diff --git a/reflectivity_ui/interfaces/main_window.py b/reflectivity_ui/interfaces/main_window.py index c06e639..971fc78 100644 --- a/reflectivity_ui/interfaces/main_window.py +++ b/reflectivity_ui/interfaces/main_window.py @@ -515,7 +515,7 @@ def open_polarization_window(self): def open_rawdata_dialog(self): return NotImplemented - + def open_deadtime_settings(self): r"""Show the dialog for dead-time options. Update attribue deadtime options upon closing the dialog.""" view = DeadTimeSettingsView(parent=self) diff --git a/reflectivity_ui/ui/deadtime_entry.py b/reflectivity_ui/ui/deadtime_entry.py index 6408706..b8ebb8c 100644 --- a/reflectivity_ui/ui/deadtime_entry.py +++ b/reflectivity_ui/ui/deadtime_entry.py @@ -3,7 +3,7 @@ class DeadTimeEntryPoint(QGroupBox): - def __init__(self, title='Dead Time Correction'): + def __init__(self, title="Dead Time Correction"): super().__init__(title) self.initUI() @@ -22,9 +22,9 @@ def initUI(self): "}" ) - self.applyCheckBox = QCheckBox('Apply', self) + self.applyCheckBox = QCheckBox("Apply", self) self.applyCheckBox.stateChanged.connect(self.toggleSettingsButton) - self.settingsButton = QPushButton('Settings', self) + self.settingsButton = QPushButton("Settings", self) self.settingsButton.setEnabled(self.applyCheckBox.isChecked()) # enabled if we use the correction # Create a horizontal layout for the checkbox and settings button diff --git a/reflectivity_ui/ui/deadtime_settings.py b/reflectivity_ui/ui/deadtime_settings.py index 1c7620c..9f34920 100644 --- a/reflectivity_ui/ui/deadtime_settings.py +++ b/reflectivity_ui/ui/deadtime_settings.py @@ -7,7 +7,7 @@ from qtpy.uic import loadUi -class DeadTimeSettingsModel(): +class DeadTimeSettingsModel: """Stores all options for the dead time correction. These are global options""" apply_deadtime: bool = False @@ -15,6 +15,7 @@ class DeadTimeSettingsModel(): dead_time: float = 4.2 tof_step: float = 100.0 + class DeadTimeSettingsView(QDialog): """ Dialog to choose the dead time correction options. @@ -47,9 +48,9 @@ def get_state_from_form(self) -> dict: Dictionary whose keys must match fields of class `DeadTimeSettingsModel` """ return { - 'paralyzable': self.ui.use_paralyzable.isChecked(), - 'dead_time': self.ui.dead_time_value.value(), - 'tof_step': self.ui.dead_time_tof.value(), + "paralyzable": self.ui.use_paralyzable.isChecked(), + "dead_time": self.ui.dead_time_value.value(), + "tof_step": self.ui.dead_time_tof.value(), } def accept(self):