コード例 #1
0
 def init(self):
     """ Initialization method """
     AbstractMotor.init(self)
     EPICSActuator.init(self)
     self.get_limits()
     self.get_velocity()
     self.update_state(self.STATES.READY)
コード例 #2
0
 def init(self):
     """Initialise the motor"""
     AbstractMotor.init(self)
     cfg = static.get_config()
     self.motor_obj = cfg.get(self.actuator_name)
     self.connect(self.motor_obj, "position", self.update_value)
     self.connect(self.motor_obj, "state", self.update_state)
     self.connect(self.motor_obj, "move_done", self.update_state)
コード例 #3
0
    def init(self):
        """Initialise the motor"""
        AbstractMotor.init(self)
        self._hwr_detector = HWR.beamline.detector
        self._hwr_energy = HWR.beamline.energy

        if self._hwr_detector:
            self.det_width = float(self._hwr_detector.getProperty("width"))
            self.det_height = float(self._hwr_detector.getProperty("height"))
            try:
                self.det_beam = self._hwr_detector["beam"].getProperties()
            except KeyError:
                pass
        else:
            logging.getLogger().exception("Cannot get detector properties")
            raise AttributeError("Cannot get detector properties")

        self.connect(self._hwr_detector.distance, "stateChanged",
                     self.update_state)
        self.connect(self._hwr_detector.distance, "valueChanged",
                     self.update_distance)
        self.connect(self._hwr_energy, "valueChanged", self.update_energy)
        self.connect(self._hwr_energy, "stateChanged", self.update_state)
コード例 #4
0
    def init(self):
        """Initialise the motor"""
        AbstractMotor.init(self)

        self._motor_pos_suffix = self.getProperty("position_suffix",
                                                  "Position")
        self._motor_state_suffix = self.getProperty("state_suffix", "State")

        self._exporter_address = self.getProperty("exporter_address")
        _host, _port = self._exporter_address.split(":")
        self._exporter = Exporter(_host, int(_port))

        self.motor_position = self.add_channel(
            {
                "type": "exporter",
                "exporter_address": self._exporter_address,
                "name": "position",
            },
            self.actuator_name + self._motor_pos_suffix,
        )
        if self.motor_position:
            self.get_value()
            self.motor_position.connectSignal("update", self.update_value)

        self.motor_state = self.add_channel(
            {
                "type": "exporter",
                "exporter_address": self._exporter_address,
                "name": "motor_state",
            },
            self.actuator_name + self._motor_state_suffix,
        )

        if self.motor_state:
            self.motor_state.connectSignal("update", self._update_state)

        self.update_state()