Fixed bug with frequency setting.

This commit is contained in:
jupfi 2024-03-14 16:58:11 +01:00
parent 18f0da7067
commit 38c68831c7

View file

@ -34,7 +34,7 @@ class MeasurementController(ModuleController):
# Use validator
if self.module.model.validator_measurement_frequency.validate(value, 0) == QValidator.State.Acceptable:
self.module.model.measurement_frequency = float(value)
self.module.model.measurement_frequency = float(value) * 1e6
self.module.nqrduck_signal.emit("set_frequency", str(self.module.model.measurement_frequency))
self.toggle_start_button()
@ -70,6 +70,11 @@ class MeasurementController(ModuleController):
logger.debug("Start measurement clicked")
self.module.view.measurement_dialog.show()
# Set the measurement parameters again in case the user switches spectrometer
self.module.nqrduck_signal.emit("set_frequency", str(self.module.model.measurement_frequency))
self.module.nqrduck_signal.emit("set_averages", str(self.module.model.averages))
QApplication.processEvents()
self.module.nqrduck_signal.emit("start_measurement", None)
def toggle_start_button(self) -> None: