mirror of
https://github.com/nqrduck/nqrduck-spectrometer-simulator.git
synced 2024-11-09 11:10:04 +00:00
Improved Error handling when the pulse sequence is invalid.
This commit is contained in:
parent
e717cb2a24
commit
0a2838dbb9
1 changed files with 9 additions and 2 deletions
|
@ -26,9 +26,16 @@ class SimulatorController(BaseSpectrometerController):
|
|||
dwell_time = self.calculate_dwelltime()
|
||||
logger.debug("Dwell time: %s", dwell_time)
|
||||
|
||||
pulse_array = self.translate_pulse_sequence(dwell_time)
|
||||
try:
|
||||
pulse_array = self.translate_pulse_sequence(dwell_time)
|
||||
except ValueError:
|
||||
logger.warning("Could not translate pulse sequence")
|
||||
self.module.nqrduck_signal.emit(
|
||||
"measurement_error", "Could not translate pulse sequence. Did you configure one?"
|
||||
)
|
||||
return
|
||||
|
||||
simulation = self.get_simulation(sample, pulse_array)
|
||||
simulation = self.get_simulation(sample, pulse_array)
|
||||
|
||||
result = simulation.simulate()
|
||||
|
||||
|
|
Loading…
Reference in a new issue