Skip to content
Snippets Groups Projects
Commit d9aaca3e authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

replace values['_DEVICE_'] with device after selection

parent 82ae38ea
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ def defineGUI(): ...@@ -90,7 +90,7 @@ def defineGUI():
tooltip='Choose one or more files')], tooltip='Choose one or more files')],
[sg.Combo(list(ti.keys()), enable_events = True, size=(8, 1), # row 2 [sg.Combo(list(ti.keys()), enable_events = True, size=(8, 1), # row 2
default_value = instrument_default_value, default_value = instrument_default_value,
key='_COMBO_', tooltip='Select the instrument')], key='_DEVICE_', tooltip='Select the instrument')],
[sg.Frame(d, frameLayout[d], key='_FRAME_{:s}'.format(d) , visible=True) # row 3 [sg.Frame(d, frameLayout[d], key='_FRAME_{:s}'.format(d) , visible=True) # row 3
for d in devices], for d in devices],
[sg.OK(), sg.CloseButton('Cancel')]]) # row 4 [sg.OK(), sg.CloseButton('Cancel')]]) # row 4
...@@ -185,7 +185,7 @@ if __name__ == "__main__": ...@@ -185,7 +185,7 @@ if __name__ == "__main__":
# setup the GUI windows Layout # setup the GUI windows Layout
window = defineGUI() window = defineGUI()
device = window.FindElement('_COMBO_').DefaultValue device = window.FindElement('_DEVICE_').DefaultValue
keys = cfg['split'][device.lower()].keys() keys = cfg['split'][device.lower()].keys()
# can't update combo with FindElement('_HIDDEN_').Update(), we use this function # can't update combo with FindElement('_HIDDEN_').Update(), we use this function
...@@ -224,11 +224,12 @@ if __name__ == "__main__": ...@@ -224,11 +224,12 @@ if __name__ == "__main__":
continue continue
break break
if event == '_COMBO_': if event == '_DEVICE_':
# you have to go into the bowels of the pygi code, to get the instance of the Combo # you have to go into the bowels of the pygi code, to get the instance of the Combo
# by the line and column number of the window to update its "fileType" property. # by the line and column number of the window to update its "fileType" property.
device = values['_DEVICE_']
updateFilesBrowseCombo( updateFilesBrowseCombo(
ti[values['_COMBO_']], filesBrowsePosition_column, filesBrowsePosition_row) ti[device], filesBrowsePosition_column, filesBrowsePosition_row)
# update the Multilines instance from FilesBrowse return # update the Multilines instance from FilesBrowse return
if event == '_HIDDEN_': if event == '_HIDDEN_':
...@@ -246,14 +247,14 @@ if __name__ == "__main__": ...@@ -246,14 +247,14 @@ if __name__ == "__main__":
for k in values.keys(): for k in values.keys():
if k[0] == '_' or values[k] == False: if k[0] == '_' or values[k] == False:
continue continue
# check if values['_COMBO_'] == device # check if device == device
if not values['_COMBO_'] in k: if not device in k:
continue continue
else: else:
args.keys.append(re.sub('_\w+$', '', k)) args.keys.append(re.sub('_\w+$', '', k))
# process of files start here # process of files start here
fe = process(args, cfg, values['_COMBO_']) fe = process(args, cfg, device)
# display result in popup GUI # display result in popup GUI
dims = "Dimensions: {} x {}".format(fe.n, fe.m) dims = "Dimensions: {} x {}".format(fe.n, fe.m)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment