Commit 69680571 authored by Cyril Guilloud's avatar Cyril Guilloud
Browse files

add test if user canceled selection.

parent 4ca98f93
...@@ -550,26 +550,36 @@ class BaseXIA(BaseMCA): ...@@ -550,26 +550,36 @@ class BaseXIA(BaseMCA):
# Dialogs to configure XIA device # Dialogs to configure XIA device
def select_config(self): def select_config(self):
""" User dialog to select a configuration file.
"""
config_list = self.available_configurations config_list = self.available_configurations
dlg_list = list(zip(config_list, config_list)) dlg_list = list(zip(config_list, config_list))
dlg = UserChoice(label="Configuration File", values=dlg_list) dlg = UserChoice(label="Configuration File", values=dlg_list)
self.load_configuration(display(dlg)) ans = display(dlg)
if ans is not None:
self.load_configuration(ans)
def select_trig(self): def select_trig(self):
""" User dialog to select a trigger mode.
"""
triggers_list = [ttt.name for ttt in TriggerMode] triggers_list = [ttt.name for ttt in TriggerMode]
dlg_list = list(zip(triggers_list, ["1 - SOFTWARE", "2 - SYNC", "3 - GATE"])) dlg_list = list(zip(triggers_list, ["1 - SOFTWARE", "2 - SYNC", "3 - GATE"]))
dlg = UserChoice(label="Trigger Mode", values=dlg_list) dlg = UserChoice(label="Trigger Mode", values=dlg_list)
ans = display(dlg) ans = display(dlg)
print(f"user choose '{ans}'") if ans is not None:
self.trigger_mode = ans print(f"user choose '{ans}'")
self.trigger_mode = ans
def select_preset_mode(self): def select_preset_mode(self):
""" User dialog to select a preset mode.
"""
preset_list = [ppp.name for ppp in self.supported_preset_modes] preset_list = [ppp.name for ppp in self.supported_preset_modes]
dlg_list = list(zip(preset_list, preset_list)) dlg_list = list(zip(preset_list, preset_list))
dlg = UserChoice(label="Preset Mode", values=dlg_list) dlg = UserChoice(label="Preset Mode", values=dlg_list)
ans = display(dlg) ans = display(dlg)
print(f"user choose '{ans}'") if ans is not None:
self.preset_mode = ans print(f"user choose '{ans}'")
self.preset_mode = ans
# Specific XIA classes # Specific XIA classes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment