mirror of
https://github.com/nqrduck/nqrduck-spectrometer-limenqr.git
synced 2024-11-05 01:00:03 +00:00
Improved Error handling.
This commit is contained in:
parent
737441551b
commit
3587cb7b93
1 changed files with 5 additions and 3 deletions
|
@ -31,9 +31,11 @@ class DuckLimeNQRController(BaseSpectrometerController):
|
||||||
measurement_data = limenqr.run_sequence(sequence)
|
measurement_data = limenqr.run_sequence(sequence)
|
||||||
|
|
||||||
# Emit the data to the nqrduck core
|
# Emit the data to the nqrduck core
|
||||||
self.emit_status_message("Finished Measurement")
|
if measurement_data:
|
||||||
self.emit_measurement_data(measurement_data)
|
self.emit_status_message("Finished Measurement")
|
||||||
|
self.emit_measurement_data(measurement_data)
|
||||||
|
else:
|
||||||
|
self.emit_measurement_error("Measurement failed - no data could be retrieved. Did you connect the spectrometer?")
|
||||||
|
|
||||||
def emit_measurement_data(self, measurement_data: Measurement) -> None:
|
def emit_measurement_data(self, measurement_data: Measurement) -> None:
|
||||||
"""Emits the measurement data to the GUI.
|
"""Emits the measurement data to the GUI.
|
||||||
|
|
Loading…
Reference in a new issue