Windows and Dialogs
Bases: QMainWindow
Main GUI window for interactive, automated plotting of experimental data.
Responsibilities
- Load the main QtDesigner-generated UI file and dynamically attach device-
specific option panels to the central
QStackedWidget. - Manage the currently loaded
DataSet:- Creating, loading, saving, and autosaving datasets.
- Displaying raw JSON content and console history in helper dialogs.
- Updating header fields (set name, device type) when datasets change.
- Integrate logging with a QTextEdit-based console for time-stamped messages.
- Provide a thin controller layer for:
- Launching the plotting pipeline via
plot_manager. - Handling progress updates and console appends.
- Adding notes and console history back into the dataset.
- Launching the plotting pipeline via
On construction, the window:
- Discovers available devices from implementations.devices.
- Loads and registers per-device widgets and their plot functions.
- Wires menu actions and buttons to dataset, plotting, and utility actions.
- Optionally auto-opens a demo dataset if a file name is supplied.
The class is intended to be the central hub of the GUI application, with device-specific logic pushed into worker classes and implementations.
Source code in gui\windows\MainWindow.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
navigate_to_docs()
Opens the default web browser and navigates to the documentation URL.
Source code in gui\windows\MainWindow.py
315 316 317 318 319 320 | |
not_implemented()
Shows the user a message that the current feature is planned but not yet implemented.
Source code in gui\windows\MainWindow.py
322 323 324 325 326 | |
show_about()
Shows a simple window with licence, authorship and build information
Source code in gui\windows\MainWindow.py
302 303 304 305 306 307 308 309 310 311 312 313 | |
Bases: QDialog
Dialog for interactively creating new DataSet instances.
Overview
This window guides the user through constructing a dataset by: - Selecting a device type from a combobox. - Adding individual files with custom labels, or - Auto-generating filepaths from a directory according to a chosen structure. - Setting the experiment name and experiment date/time.
Behaviour
- Maintains an internal
DataSetobject that is updated as the user adds files or generates sets from directories. - Displays the current file mapping as formatted JSON in a plain-text widget.
- Validates that both a name and at least one file are present before enabling the “Done” button.
- On completion (
finish), writes name, device type, and experiment datetime into the dataset and closes with an accepted result.
Parameters
devices : list[str], optional
List of available device names to present in the device selection combo
box. Defaults to a single "N/A" entry when not specified.
Source code in gui\windows\DataSetCreatorWindow.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
add_file_to_set()
Gets the path and label and adds it to the current DataSet instance while updating GUI
Source code in gui\windows\DataSetCreatorWindow.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
browse_dir()
Open directory selection dialog to get a path and update gui when confirmed
Source code in gui\windows\DataSetCreatorWindow.py
84 85 86 87 88 89 | |
browse_files()
Open file selection dialog to get a file path and update gui when confirmed
Source code in gui\windows\DataSetCreatorWindow.py
77 78 79 80 81 82 | |
finish()
Add name, device type, and date and time dataset before exiting
Source code in gui\windows\DataSetCreatorWindow.py
196 197 198 199 200 201 202 203 | |
finish_button_state()
Only enable closing when some data was included
Source code in gui\windows\DataSetCreatorWindow.py
170 171 172 173 174 175 176 177 178 | |
generate_set()
Automatically generate a set of filepaths based on a directory path. Will create nested structure if desired
Source code in gui\windows\DataSetCreatorWindow.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
label_button_state()
Only enable the add button once a label and a path were selected
Source code in gui\windows\DataSetCreatorWindow.py
158 159 160 161 162 163 164 165 166 167 | |
reset()
Completely reset this UI by clearing all elements
Source code in gui\windows\DataSetCreatorWindow.py
187 188 189 190 191 192 193 194 | |
Bases: Handler, QTextEdit
QTextEdit-based logging console widget for the GUI.
This class bridges the logging module with a Qt text widget by:
- Subclassing both logging.Handler and QTextEdit.
- Emitting formatted log messages through a dedicated Qt signal
(appendTextEdit), which is connected to the widget's append slot.
- Keeping the text area read-only so it behaves like a console.
Typical usage
- Create an instance and add it as a handler to a
logging.Logger. - Configure a formatter for the handler.
- Logged messages will appear in the GUI with the configured format.
Parameters
parent : QWidget Parent widget that will own this console.
Source code in gui\windows\qtexteditconsole.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
Display text content inside a modal dialog with optional saving.
The dialog contains:
- A read-only text editor showing contents.
- “OK” to close the dialog.
- “SAVE” to delegate saving via window.save_to_file.
Parameters
window : QMainWindow Parent window providing the save callback. title : str Dialog title bar text. contents : str Text content to display.
Source code in gui\windows\dialogs\dialog_print.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
Build and return an 'About' information dialog containing a logo and text.
Features: - Displays an application logo loaded via QPixmap. - Shows about text with HTML formatting support. - Uses a fixed-size vertical layout.
Parameters
about_contents : str HTML/markdown-like text describing the application. centralwidget : QWidget Parent widget for modal behavior. logo_path : str Directory path to the logo image file.
Returns
QDialog Configured dialog ready to be shown.
Source code in gui\windows\dialogs\generate_about_dialog.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |