def get_custom_config(self):
        """
        Gets a pyforms BaseWidget to complete configuration for LinearAxis
        """

        if self._widget is None:
            widget = BaseWidget("Linear Axis Config")

            widget.device_list = ControlCombo(label="Device")

            widget.device_list += ('None', None)

            for device in DEVICES:
                widget.device_list += device

            if self._linear_stage is not None:
                widget.value = self._linear_stage.serial_number

                print("Stage:", self._linear_stage.serial_number)
                print("Widget:", widget.value)

            widget.device_list.current_index_changed_event = self._update_stage

            widget.formset = ['device_list', '']

            self._widget = widget

            self._update_stage(0)

        if self._linear_stage is not None:
            self._linear_stage.identify()

        return self._widget
Beispiel #2
0
def laser_custom_config():
    """
    Get the GUI config to configure the laser
    The GUI is the same for each laser axis and for the laser lightsource
    """
    global WIDGET

    if WIDGET is None:
        widget = BaseWidget("Laser Config")

        widget.power_supply = ControlCombo(label="Power Supply")

        widget.power_supply += ('None', None)

        for power in DEVICES['Power Supply']:
            widget.power_supply += power

        widget.power_supply.current_index_changed_event = update_laser

        widget.power_channel = ControlNumber(label="Power Supply Channel",
                                             default=1,
                                             minimum=1,
                                             maximum=4)

        widget.signal_generator = ControlCombo(label="Signal Generator")

        widget.signal_generator += ('None', None)

        for signal in DEVICES['Signal Generator']:
            widget.signal_generator += signal

        widget.signal_generator.current_index_changed_event = update_laser

        widget.formset = [
            "h5:Laser Using", 'power_supply', 'power_channel',
            'signal_generator', "(All laser axis use the same laser)"
        ]

        WIDGET = widget

    return WIDGET
    def get_custom_config(self):
        """
        Gets a pyforms BaseWidget to complete configuration for RotationAxis
        """

        if self._widget is None:
            widget = BaseWidget("Rotate Axis Config")

            widget.device_list = ControlCombo(label="Device")

            widget.device_list += ('None', None)

            for device in DEVICES:
                widget.device_list += device

            if self._rotation_stage is not None:
                widget.value = self._rotation_stage.serial_number

            widget.device_list.current_index_changed_event = self._update_stage

            widget.distance_field = ControlNumber(
                label="Distance to Surface",
                default=self._distance_to_surface,
                minimum=0,
                maximum=float('inf'),
                decimals=5)

            widget.distance_field.key_pressed_event = self._update_distance_to_surface

            widget.formset = ['device_list', 'distance_field', '']

            self._widget = widget

            self._update_stage(0)

        if self._rotation_stage is not None:
            self._rotation_stage.identify()

        return self._widget