def __init__(self, tab_panel, tab_data): super(SparcAlignSettingsController, self).__init__(tab_data) main_data = tab_data.main self.hw_settings_config = get_hw_settings_config(main_data.role) self._ar_setting_cont = AngularSettingsController(tab_panel.fp_ma_settings_ar, "No angle-resolved camera found") self._spect_setting_cont = SpectrumSettingsController(tab_panel.fp_ma_settings_spectrum, "No spectrometer found") if main_data.ccd: self.add_hw_component(main_data.ccd, self._ar_setting_cont) if main_data.spectrometer: self.add_hw_component(main_data.spectrometer, self._spect_setting_cont) # increase a bit the font size for easy reading from far self.add_spec_chronograph(self._spect_setting_cont, 12) if main_data.spectrograph: comp = main_data.spectrograph for a in ("wavelength", "grating", "slit-in"): if a not in comp.axes: logging.debug("Skipping non existent axis %s on component %s", a, comp.name) continue conf = self.hw_settings_config[comp.role].get(a) self._spect_setting_cont.add_axis(a, comp, conf)
def __init__(self, tab_data): self._tab_data_model = tab_data self.setting_controllers = [] # TODO: see if we need to listen to main.is_acquiring, and automatically # pause + enable. For now, it's done by the acquisition controllers, # and it avoids pausing the settings controllers from other tabs. # build the default config value based on the global one + the role self._va_config = get_hw_settings_config(tab_data.main.role) # disable settings while there is a preparation process running self._tab_data_model.main.is_preparing.subscribe(self.on_preparation)