def __init__(self, parent): tk.Frame.__init__(self, parent) self.config_reader = ConfigReader(os.getcwd() + '/configs/rootConfig') self.development_mode = self.config_reader.is_development_mode() self.master.wm_title("Cold Control Heavy") self.addMenu() self.title = tk.Label(self, text="Cold Control Heavy", font=("Helvetica", 24)) '''Load DAQ channels and cards from the config file. Set up the DAQ_controller with these.''' self.daq_config_fname = self.config_reader.get_daq_config_fname() self.daq_UI = DAQ_UI(self, self.daq_config_fname, development_mode=self.development_mode) '''Load a sequence and start the sequence UI (though it is hidden by default)''' self.sequence_fname = self.config_reader.get_sequence_fname() self.sequence_ui = Sequence_UI(self, self.sequence_fname, self.daq_UI.daq_controller.getChannelNumberNameDict(onlyVisable=False), self.daq_UI.daq_controller.getChannelCalibrationDict(), hidden=True) '''Start up the camera UI.''' self.camera_UI = Camera_UI(self, ic_imaging_control = None) '''Set up the experimental UI with pre-configured defaults from the appropriate config files.''' self.absorbtion_imaging_config_fname = self.config_reader.get_absorbtion_imaging_config_fname() self.photon_production_config_fname = self.config_reader.get_photon_production_config_fname() self.experimental_UI = Experimental_UI(self, self.daq_UI, self.sequence_ui, self.photon_production_config_fname, self.absorbtion_imaging_config_fname, ic_imaging_control=self.camera_UI.ic_ic) '''Initialise the labook UI''' self.labbook_UI = Labbook_UI(self) '''Configure the interface and place the displays for each UI appropriately.''' self.grid_columnconfigure(0, weight=1, pad=3, uniform='cols') self.grid_columnconfigure(1, weight=1, pad=3, uniform='cols') self.grid_columnconfigure(2, weight=1, pad=3, uniform='cols') self.grid_columnconfigure(3, weight=1, pad=3, uniform='cols') gridOpts = {'padx': 10, 'pady':10} self.title.grid(row=0,column=0,columnspan=3, **gridOpts) self.daq_UI.grid(row=1,column=1,columnspan=2, sticky=tk.N+tk.E+tk.W, **gridOpts) self.experimental_UI.grid(row=2,column=1,columnspan=2, sticky=tk.N) self.camera_UI.grid(row=1,column=0, sticky=tk.N+tk.E+tk.W) self.labbook_UI.grid(row=1, column=3, sticky=tk.N+tk.E+tk.W) '''Bind closing the app to a clean up method.''' root.protocol( "WM_DELETE_WINDOW", self.onExit)
def __init__(self): '''Initialises and sets sel attributes from configreader values in 'const' section''' CR = ConfigReader() for key in CR.configSectionMap('const'): val = CR.configSectionMap('const')[key] setattr(self, key.upper(), val)
def __init__(self): self.config = ConfigReader()