Utils
Clear
Fully reset the GUI state and remove all in-memory data.
This helper:
- Clears the active DataSet and GUI fields via clear_data.
- Empties the console widget.
- Writes a confirmation message to the GUI console.
Parameters
window : QMainWindow Main application window whose state should be cleared.
Source code in gui\utils\clear\clear_all.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Clear the currently loaded dataset and reset all GUI widgets tied to it.
Resets:
- Stored DataSet object and its disk location.
- Set name, device name, notes, and list widgets.
- Plot type combobox and stacked widget view.
A console message is printed to confirm completion.
Parameters
window : QMainWindow Main GUI instance that holds dataset-related widgets.
Source code in gui\utils\clear\clear_data.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 | |
DataSet Tools
Launch the DataSet creation dialog and construct a new dataset from user input.
Workflow: - Opens the DataSet creator window populated with available devices. - On confirmation: * Clears existing state. * Stores the newly created dataset. * Loads it into the GUI and updates the header. * Immediately saves it to disk. - If cancelled, informs the user that no dataset was created.
Parameters
window : QMainWindow Main application window controlling dataset creation.
Source code in gui\utils\dataset_tools\create_dataset.py
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 | |
Populate the GUI with data from the currently loaded dataset.
Actions: - Adds all dataset labels to the file selection list. - Selects all items by default. - Populates the plot-type combobox with device-appropriate plotting functions.
Raises
IncompatibleDeviceTypeFound If the dataset’s device type does not match available plot handlers.
Parameters
window : QMainWindow GUI instance holding a loaded dataset.
Source code in gui\utils\dataset_tools\load_dataset.py
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 | |
Save the currently loaded dataset to disk using a file dialog.
Behaviour:
- Ensures a dataset is loaded before saving.
- Opens a save-file dialog and writes the dataset via DataSetJSONEncoder.
- Auto-appends a valid extension if necessary.
- Updates the stored dataset location and logs status messages.
Parameters
window : QMainWindow GUI window containing the active dataset.
Source code in gui\utils\dataset_tools\save_dataset.py
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 | |
Other
Extract the current value from common Qt widget types.
Supported widgets:
- QDoubleSpinBox / QSpinBox → numeric value
- QCheckBox → boolean isChecked
- QLineEdit / QComboBox → text, with "None"/"none" mapped to None
Raises NotImplementedError if the widget type is unsupported.
Parameters
widget : QWidget The widget whose value should be extracted.
Returns
Any The widget's value in a Python-friendly type.
Source code in gui\utils\get_qwidget_value.py
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 | |
Find and return the checked QRadioButton within a dialog.
Scans all child radio buttons and returns the first active one.
Parameters
dialog : QDialog Container widget containing radio buttons.
Returns
QRadioButton or None
The checked radio button, or None if no selection exists.
Source code in gui\utils\search_for_first_active_radio_button.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Split a CamelCase string into its component words.
Examples
"MyPlotType" → ["My", "Plot", "Type"]
Parameters
camel_case : str Input CamelCase string.
Returns
list[str] List of lowercase/uppercase-correct word segments.
Source code in gui\utils\split_camelCase.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |