Improved error handling if simulation failed.

This commit is contained in:
jupfi 2024-06-18 16:26:07 +02:00
parent 566375a9c1
commit e78319393c

View file

@ -27,11 +27,17 @@ class DuckSimulatorController(BaseSpectrometerController):
measurement_data = simulator.run_sequence(sequence) measurement_data = simulator.run_sequence(sequence)
if measurement_data:
# Emit the data to the nqrduck core # Emit the data to the nqrduck core
logger.debug("Emitting measurement data") logger.debug("Emitting measurement data")
self.module.nqrduck_signal.emit("statusbar_message", "Finished Simulation") self.module.nqrduck_signal.emit("statusbar_message", "Finished Simulation")
self.module.nqrduck_signal.emit("measurement_data", measurement_data) self.module.nqrduck_signal.emit("measurement_data", measurement_data)
else:
logger.warning("No measurement data was returned from the simulator")
self.module.nqrduck_signal.emit(
"measurement_error", "No measurement data was returned from the simulator. Did you set a TX pulse?"
)
def set_frequency(self, value: str) -> None: def set_frequency(self, value: str) -> None: