def __init__(self, session): """ Initialization """ self.session = session tkutil.Dialog.__init__(self, session.tk, "Open & Reload Multiple Spectra") proj = session.project mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory) mfs.frame.pack(side="top", anchor="nw", fill="both", expand=1) self.files = mfs r = Tkinter.Label(self.top, justify="left") r.pack(side="top", anchor="nw") self.result = r br = tkutil.button_row( self.top, ("Open", self.open_cb), ("Reload", self.reload_spectra), ("Cancel", self.close_cb), ("Help", sputil.help_cb(session, "OpenAutoreloadSpectra")), ) br.frame.pack(side="top", anchor="nw") self.paths = [] # list of spectrum files to open self.spectra = [] # spectra already opened # if there are opened windows, get the paths for v in proj.view_list(): self.paths.append(v.spectrum.save_path) self.spectra.append(v.spectrum)
def __init__(self, session): """ Initialization """ self.session = session tkutil.Dialog.__init__(self, session.tk, 'Open & Autoreload Multiple Spectra') proj = session.project mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory) mfs.frame.pack(side = 'top', anchor = 'nw', fill = 'both', expand = 1) self.files = mfs r = Tkinter.Label(self.top, justify = 'left') r.pack(side = 'top', anchor = 'nw') self.result = r br = tkutil.button_row(self.top, ('Open', self.open_cb), ('Set Timer', self.set_timer), ('Toggle Autoreload', self.toggle_autoreload), ('Cancel', self.close_cb), ('Help', sputil.help_cb(session, 'OpenAutoreloadSpectra')), ) br.frame.pack(side = 'top', anchor = 'nw') self.autoreload = True # if the spectrum files should be autoreloaded self.paths = None # list of spectrum files to open self.tslist = None # list of timestamps for the spectrum files self.tth = None # threading.Timer instance self.q = Queue.Queue(1)
def __init__(self, session): self.session = session tkutil.Dialog.__init__(self, session.tk, 'Open Multiple Spectra') proj = session.project mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory) mfs.frame.pack(side = 'top', anchor = 'nw', fill = 'both', expand = 1) self.files = mfs r = Tkinter.Label(self.top, justify = 'left') r.pack(side = 'top', anchor = 'nw') self.result = r br = tkutil.button_row(self.top, ('Open', self.open_cb), ('Cancel', self.close_cb), ('Help', sputil.help_cb(session, 'OpenSpectra')), ) br.frame.pack(side = 'top', anchor = 'nw')
def __init__(self, session): self.session = session tkutil.Dialog.__init__(self, session.tk, 'Open Multiple Spectra') proj = session.project mfs = tkutil.multiple_file_selection(self.top, proj.sparky_directory) mfs.frame.pack(side='top', anchor='nw', fill='both', expand=1) self.files = mfs r = Tkinter.Label(self.top, justify='left') r.pack(side='top', anchor='nw') self.result = r br = tkutil.button_row( self.top, ('Open', self.open_cb), ('Cancel', self.close_cb), ('Help', sputil.help_cb(session, 'OpenSpectra')), ) br.frame.pack(side='top', anchor='nw')