Beispiel #1
0
    def __init__(self, tab_panel, tab_data):
        super(StreakCamAlignSettingsController, self).__init__(tab_data)
        self.panel = tab_panel
        main_data = tab_data.main
        self.streak_ccd = main_data.streak_ccd
        self.streak_delay = main_data.streak_delay
        self.streak_unit = main_data.streak_unit
        self.streak_lens = main_data.streak_lens

        self._calib_path = get_picture_folder()  # path to the trigger delay calibration folder

        self.panel_streak = SettingsPanel(self.panel.pnl_streak)
        self.panel_streak.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.panel.pnl_streak.GetSizer().Add(self.panel_streak, 1, border=5,
                                             flag=wx.BOTTOM | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL)

        entry_timeRange = create_setting_entry(self.panel_streak, "Time range",
                                               self.streak_unit.timeRange,
                                               self.streak_unit,
                                               conf={"control_type": odemis.gui.CONTROL_COMBO,
                                                     "label": "Time range",
                                                     "tooltip": "Time needed by the streak unit for one sweep "
                                                                "from top to bottom of the readout camera chip."}
                                               )
        entry_timeRange.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.ctrl_timeRange = entry_timeRange.value_ctrl

        entry_triggerDelay = create_setting_entry(self.panel_streak, "Trigger delay",
                                                  self.streak_delay.triggerDelay,
                                                  self.streak_delay,
                                                  conf={"control_type": odemis.gui.CONTROL_FLT,
                                                        "label": "Trigger delay",
                                                        "tooltip": "Change the trigger delay value to "
                                                                   "center the image."},
                                                  change_callback=self._onUpdateTriggerDelayMD)

        entry_triggerDelay.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.ctrl_triggerDelay = entry_triggerDelay.value_ctrl

        entry_magnification = create_setting_entry(self.panel_streak, "Magnification",
                                                   self.streak_lens.magnification,
                                                   self.streak_lens,
                                                   conf={"control_type": odemis.gui.CONTROL_COMBO,
                                                         "label": "Magnification",
                                                         "tooltip": "Change the magnification of the input"
                                                                    "optics for the streak camera system. \n"
                                                                    "Values < 1: De-magnifying \n"
                                                                    "Values > 1: Magnifying"})

        entry_magnification.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.combo_magnification = entry_magnification.value_ctrl

        # remove border
        self.panel_streak.GetSizer().GetItem(0).SetBorder(0)
        self.panel_streak.Layout()

        self.panel.btn_open_streak_calib_file.Bind(wx.EVT_BUTTON, self._onOpenCalibFile)
        self.panel.btn_save_streak_calib_file.Bind(wx.EVT_BUTTON, self._onSaveCalibFile)
Beispiel #2
0
    def __init__(self, tab_panel, tab_data):
        super(StreakCamAlignSettingsController, self).__init__(tab_data)
        self.panel = tab_panel
        main_data = tab_data.main
        self.streak_ccd = main_data.streak_ccd
        self.streak_delay = main_data.streak_delay
        self.streak_unit = main_data.streak_unit
        self.streak_lens = main_data.streak_lens

        self._calib_path = get_picture_folder()  # path to the trigger delay calibration folder

        self.panel_streak = SettingsPanel(self.panel.pnl_streak)
        self.panel_streak.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.panel.pnl_streak.GetSizer().Add(self.panel_streak, 1, border=5,
                                             flag=wx.BOTTOM | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL)

        entry_timeRange = create_setting_entry(self.panel_streak, "Time range",
                                               self.streak_unit.timeRange,
                                               self.streak_unit,
                                               conf={"control_type": odemis.gui.CONTROL_COMBO,
                                                     "label": "Time range",
                                                     "tooltip": "Time needed by the streak unit for one sweep "
                                                                "from top to bottom of the readout camera chip."}
                                               )
        entry_timeRange.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.ctrl_timeRange = entry_timeRange.value_ctrl

        entry_triggerDelay = create_setting_entry(self.panel_streak, "Trigger delay",
                                                  self.streak_delay.triggerDelay,
                                                  self.streak_delay,
                                                  conf={"control_type": odemis.gui.CONTROL_FLT,
                                                        "label": "Trigger delay",
                                                        "tooltip": "Change the trigger delay value to "
                                                                   "center the image."},
                                                  change_callback=self._onUpdateTriggerDelayMD)

        entry_triggerDelay.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.ctrl_triggerDelay = entry_triggerDelay.value_ctrl

        entry_magnification = create_setting_entry(self.panel_streak, "Magnification",
                                                   self.streak_lens.magnification,
                                                   self.streak_lens,
                                                   conf={"control_type": odemis.gui.CONTROL_COMBO,
                                                         "label": "Magnification",
                                                         "tooltip": "Change the magnification of the input"
                                                                    "optics for the streak camera system. \n"
                                                                    "Values < 1: De-magnifying \n"
                                                                    "Values > 1: Magnifying"})

        entry_magnification.value_ctrl.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.combo_magnification = entry_magnification.value_ctrl

        # remove border
        self.panel_streak.GetSizer().GetItem(0).SetBorder(0)
        self.panel_streak.Layout()

        self.panel.btn_open_streak_calib_file.Bind(wx.EVT_BUTTON, self._onOpenCalibFile)
        self.panel.btn_save_streak_calib_file.Bind(wx.EVT_BUTTON, self._onSaveCalibFile)
Beispiel #3
0
    def __init__(self, tab_panel, tab_data):
        super(MirrorSettingsController, self).__init__(tab_data)
        self.panel = tab_panel
        mirror_lens = tab_data.main.lens

        self.panel_center = SettingsPanel(self.panel.pnl_mode_btns)
        self.panel_center.SetBackgroundColour(odemis.gui.BG_COLOUR_PANEL)
        self.panel.pnl_mode_btns.GetSizer().Add(
            self.panel_center,
            1,
            border=5,
            flag=wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL)

        entry_mirrorPosition = create_setting_entry(
            self.panel_center,
            "Mirror type",
            mirror_lens.configuration,
            mirror_lens,
            conf={
                "control_type": odemis.gui.CONTROL_COMBO,
                "label": "Mirror type",
                "tooltip": "Change the type of the mirror"
            })

        entry_mirrorPosition.value_ctrl.SetBackgroundColour(
            odemis.gui.BG_COLOUR_PANEL)
        # remove border
        self.panel_center.GetSizer().GetItem(0).SetBorder(0)
        self.panel_center.Layout()
Beispiel #4
0
    def add_setting_entry(self, name, va, hw_comp, conf=None):
        """ Add a name/value pair to the settings panel.

        :param name: (string): name of the value
        :param va: (VigilantAttribute)
        :param hw_comp: (Component): the component that contains this VigilantAttribute
        :param conf: ({}): Configuration items that may override default settings
        :return SettingEntry or None: the entry created, or None, if no entry was
          created (eg, because the conf indicates CONTROL_NONE).
        """

        assert isinstance(va, VigilantAttributeBase)

        # Remove any 'empty panel' warning
        self.panel.clear_default_message()

        ne = create_setting_entry(self.panel, name, va, hw_comp, conf,
                                  self.on_setting_changed)
        if ne is None:
            return None

        self.entries.append(ne)

        if self.highlight_change:
            bind_setting_context_menu(ne)

        self.panel.Parent.Parent.Layout()

        return ne
Beispiel #5
0
    def add_setting_entry(self, name, va, hw_comp, conf=None):
        """ Add a name/value pair to the settings panel.

        :param name: (string): name of the value
        :param va: (VigilantAttribute)
        :param hw_comp: (Component): the component that contains this VigilantAttribute
        :param conf: ({}): Configuration items that may override default settings

        """

        assert isinstance(va, VigilantAttributeBase)

        # Remove any 'empty panel' warning
        self.panel.clear_default_message()

        ne = create_setting_entry(self.panel, name, va, hw_comp, conf, self.on_setting_changed)
        self.entries.append(ne)

        if self.highlight_change:
            bind_setting_context_menu(ne)

        self.panel.Parent.Parent.Layout()

        return ne