mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-13 22:21:53 +00:00
Linting.
This commit is contained in:
parent
2637db3320
commit
fc017eb943
2 changed files with 29 additions and 12 deletions
|
@ -38,7 +38,11 @@ class BaseSpectrometerModel(ModuleModel):
|
||||||
self.quackseq_model = None
|
self.quackseq_model = None
|
||||||
self.quackseq_visuals = dict()
|
self.quackseq_visuals = dict()
|
||||||
|
|
||||||
def visualize_settings(self):
|
def visualize_settings(self) -> None:
|
||||||
|
"""Visualizes the settings of the spectrometer.
|
||||||
|
|
||||||
|
This method creates a dictionary of visual settings from the settings of the spectrometer.
|
||||||
|
"""
|
||||||
settings = self.quackseq_model.settings
|
settings = self.quackseq_model.settings
|
||||||
|
|
||||||
for name, setting in settings.items():
|
for name, setting in settings.items():
|
||||||
|
|
|
@ -30,11 +30,12 @@ class VisualSetting(QObject):
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
setting (Setting): The setting that is used to create the visual setting.
|
setting (Setting): The setting that is used to create the visual setting.
|
||||||
|
args: Additional arguments.
|
||||||
|
kwargs: Additional keyword arguments.
|
||||||
"""
|
"""
|
||||||
self.widget = None
|
self.widget = None
|
||||||
self.setting = setting
|
self.setting = setting
|
||||||
super().__init__()
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VisualFloatSetting(VisualSetting):
|
class VisualFloatSetting(VisualSetting):
|
||||||
|
@ -67,7 +68,11 @@ class VisualFloatSetting(VisualSetting):
|
||||||
self.widget.spin_box.setValue(setting.default)
|
self.widget.spin_box.setValue(setting.default)
|
||||||
self.spin_box = True
|
self.spin_box = True
|
||||||
else:
|
else:
|
||||||
self.widget = DuckSpinBox(min_value=setting.min_value, max_value=setting.max_value, double_box=True)
|
self.widget = DuckSpinBox(
|
||||||
|
min_value=setting.min_value,
|
||||||
|
max_value=setting.max_value,
|
||||||
|
double_box=True,
|
||||||
|
)
|
||||||
self.widget.set_value(setting.default)
|
self.widget.set_value(setting.default)
|
||||||
|
|
||||||
self.widget.state_updated.connect(self.on_state_updated)
|
self.widget.state_updated.connect(self.on_state_updated)
|
||||||
|
@ -187,9 +192,7 @@ class VisualBooleanSetting(VisualSetting):
|
||||||
|
|
||||||
def __init__(self, setting: BooleanSetting) -> None:
|
def __init__(self, setting: BooleanSetting) -> None:
|
||||||
"""Create a new boolean setting."""
|
"""Create a new boolean setting."""
|
||||||
super().__init__(
|
super().__init__(setting)
|
||||||
setting
|
|
||||||
)
|
|
||||||
|
|
||||||
# Overrides the default widget
|
# Overrides the default widget
|
||||||
self.widget = self.get_widget()
|
self.widget = self.get_widget()
|
||||||
|
@ -345,3 +348,13 @@ class VisualStringSetting(VisualSetting):
|
||||||
"""
|
"""
|
||||||
self.value = value
|
self.value = value
|
||||||
self.settings_changed.emit()
|
self.settings_changed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
class VisualTableSetting:
|
||||||
|
"""A setting that is a table.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
setting (TableSetting) : The setting that is used to create the visual setting.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in a new issue