(self)
| 84 | gpc.param_model.parameters_changed() |
| 85 | |
| 86 | def initialize(self): |
| 87 | self.resize(_main_window_geometry["initial_width"], _main_window_geometry["initial_height"]) |
| 88 | |
| 89 | self.setMinimumWidth(_main_window_geometry["min_width"]) |
| 90 | self.setMinimumHeight(_main_window_geometry["min_height"]) |
| 91 | |
| 92 | self.setWindowTitle(self.gpc.get_window_title()) |
| 93 | |
| 94 | self.central_widget = TwoPanelWidget(gpc=self.gpc, gui_vars=self.gui_vars) |
| 95 | self.setCentralWidget(self.central_widget) |
| 96 | |
| 97 | # Status bar |
| 98 | self.statusLabel = QLabel() |
| 99 | self.statusBar().addWidget(self.statusLabel) |
| 100 | self.statusProgressBar = QProgressBar() |
| 101 | self.statusProgressBar.setFixedWidth(200) |
| 102 | self.statusBar().addPermanentWidget(self.statusProgressBar) |
| 103 | |
| 104 | self.statusLabelDefaultText = "No data is loaded" |
| 105 | self.statusLabel.setText(self.statusLabelDefaultText) |
| 106 | |
| 107 | # 'Scan Data' menu item |
| 108 | self.action_read_file = QAction("&Read File...", self) |
| 109 | self.action_read_file.setStatusTip("Load data from HDF5 file") |
| 110 | self.action_read_file.triggered.connect(self.central_widget.left_panel.load_data_widget.pb_file.clicked) |
| 111 | |
| 112 | self.action_load_run = QAction("&Load Run...", self) |
| 113 | self.action_load_run.setEnabled(self.gui_vars["gui_state"]["databroker_available"]) |
| 114 | self.action_load_run.setStatusTip("Load data from database (Databroker)") |
| 115 | self.action_load_run.triggered.connect(self.central_widget.left_panel.load_data_widget.pb_dbase.clicked) |
| 116 | |
| 117 | self.action_view_metadata = QAction("View Metadata...", self) |
| 118 | self.action_view_metadata.setEnabled(self.gpc.is_scan_metadata_available()) |
| 119 | self.action_view_metadata.setStatusTip("View metadata for loaded run") |
| 120 | self.action_view_metadata.triggered.connect( |
| 121 | self.central_widget.left_panel.load_data_widget.pb_view_metadata.clicked |
| 122 | ) |
| 123 | |
| 124 | # Main menu |
| 125 | menubar = self.menuBar() |
| 126 | # Disable native menu bar (it doesn't work on MacOS 10.15 with PyQt<=5.11) |
| 127 | # It may work with later versions of PyQt when they become available. |
| 128 | menubar.setNativeMenuBar(False) |
| 129 | loadData = menubar.addMenu("Scan &Data") |
| 130 | loadData.addAction(self.action_read_file) |
| 131 | loadData.addAction(self.action_load_run) |
| 132 | loadData.addSeparator() |
| 133 | loadData.addAction(self.action_view_metadata) |
| 134 | |
| 135 | # 'Fitting Model' menu item |
| 136 | self.action_lines_find_automatically = QAction("Find &Automatically...", self) |
| 137 | self.action_lines_find_automatically.setStatusTip("Automatically find emission lines in total spectrum") |
| 138 | self.action_lines_find_automatically.triggered.connect( |
| 139 | self.central_widget.left_panel.model_widget.pb_find_elines.clicked |
| 140 | ) |
| 141 | |
| 142 | self.action_lines_load_from_file = QAction("Load From &File...", self) |
| 143 | self.action_lines_load_from_file.setStatusTip( |
no test coverage detected