Skip to content

Commit

Permalink
allow changing readout on empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Aug 29, 2024
1 parent 41060c6 commit cf67764
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions viewer/feminos-viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ def __init__(self, _root):
self.selected_readout = tk.StringVar()

self.readout_menu = tk.OptionMenu(self.top_menu, self.selected_readout, *self.readout_options,
command=self.on_select_readout)
command=self.on_readout_select)
self.readout_menu.pack(side=tk.LEFT, padx=20, pady=5)
self.selected_readout.set("IAXO-D1")
assert self.selected_readout.get() in readouts, f"Invalid readout {self.selected_readout.get()}. Available readouts are {readouts.keys()}"
Expand Down Expand Up @@ -1858,11 +1858,13 @@ def on_motion(event):
def readout(self):
return self.selected_readout.get()

def on_select_readout(self, _):
def on_readout_select(self, _):
self.readout_signal_ids = set(readouts[self.readout]["mapping"].keys())
self.reset_event_and_observable_data()
self.load_file()
self.plot_graph()

if self.check_file(silent=True):
self.load_file()
self.plot_graph()

def on_reload(self):
self.load_file()
Expand Down

0 comments on commit cf67764

Please sign in to comment.