Changed to access via properties.

This commit is contained in:
jupfi 2023-07-08 10:44:10 +02:00
parent 0049bebc43
commit 3dd7768553
2 changed files with 12 additions and 12 deletions

View file

@ -17,20 +17,20 @@ class BroadbandController(ModuleController):
def change_start_frequency(self, value): def change_start_frequency(self, value):
value = float(value) value = float(value)
if value > self.MIN_FREQUENCY: if value > self.MIN_FREQUENCY:
self._module._model.start_frequency = value self.module._model.start_frequency = value
else: else:
self._module._model.start_frequency = self.MIN_FREQUENCY self.module._model.start_frequency = self.MIN_FREQUENCY
@pyqtSlot(str) @pyqtSlot(str)
def change_stop_frequency(self, value): def change_stop_frequency(self, value):
value = float(value) value = float(value)
if value < self.MAX_FREQUENCY: if value < self.MAX_FREQUENCY:
self._module._model.stop_frequency = value self.module._model.stop_frequency = value
else: else:
self._module._model.stop_frequency = self.MAX_FREQUENCY self.module._model.stop_frequency = self.MAX_FREQUENCY
@pyqtSlot() @pyqtSlot()
def start_measurement_clicked(self): def start_measurement(self):
logger.debug("Start measurement clicked") logger.debug("Start measurement clicked")
self._module.nqrduck_signal.emit("start_measurement", "") self._module.nqrduck_signal.emit("start_measurement", "")

View file

@ -26,23 +26,23 @@ class BroadbandView(ModuleView):
def _connect_signals(self) -> None: def _connect_signals(self) -> None:
self._ui_form.start_frequencyField.editingFinished.connect( self._ui_form.start_frequencyField.editingFinished.connect(
lambda: self._module._controller.change_start_frequency( lambda: self.module._controller.change_start_frequency(
self._ui_form.start_frequencyField.text() self._ui_form.start_frequencyField.text()
) )
) )
self._ui_form.stop_frequencyField.editingFinished.connect( self._ui_form.stop_frequencyField.editingFinished.connect(
lambda: self._module._controller.change_stop_frequency( lambda: self.module._controller.change_stop_frequency(
self._ui_form.stop_frequencyField.text() self._ui_form.stop_frequencyField.text()
) )
) )
self._module._model.start_frequency_changed.connect(self.on_start_frequency_change) self.module._model.start_frequency_changed.connect(self.on_start_frequency_change)
self._module._model.stop_frequency_changed.connect(self.on_stop_frequency_change) self.module._model.stop_frequency_changed.connect(self.on_stop_frequency_change)
self._ui_form.start_measurementButton.clicked.connect(lambda: self.start_measurement_clicked()) self._ui_form.start_measurementButton.clicked.connect(lambda: self._start_measurement_clicked())
self.start_measurement.connect(lambda: self._module._controller.start_measurement_clicked()) self.start_measurement.connect(lambda: self.module._controller.start_measurement())
def start_measurement_clicked(self): def _start_measurement_clicked(self):
# Create a QMessageBox object # Create a QMessageBox object
msg_box = QMessageBox() msg_box = QMessageBox()
msg_box.setText("Start the measurement?") msg_box.setText("Start the measurement?")