Exemplo n.º 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)
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.direction = None
        self.socket = None
        self.enabled = False

        atexit.register(self.close)
Exemplo n.º 3
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name=name)

        self.det_width = None
        self.det_height = None
        self._hwr_detector = None
        self._hwr_energy = None
        self.det_beam = {}
Exemplo n.º 4
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.direction = None
        self.socket = None
        self.enabled = False

        atexit.register(self.close)
Exemplo n.º 5
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     Device.__init__(self, name)
     self.predefined_positions = {}
     self.motor = None
     self.delta = 0.001
     self.positions = {}
     self._last_position_name = None
Exemplo n.º 6
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)
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     Device.__init__(self, name)
     self.predefined_positions = {}
     self.motor = None
     self.delta = 0.001
     self.positions = {}
     self._last_position_name = None
Exemplo n.º 8
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.username = None
     self._motor_pos_suffix = None
     self._motor_state_suffix = None
     self._exporter = None
     self._exporter_address = None
     self.motor_position = None
     self.motor_state = None
Exemplo n.º 9
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.chan_position = None
        self.chan_state = None
        self.chan_limits = None
        self.cmd_set_position = None
        self.cmd_stop_axis = None
        self.cmd_set_online = None

        self.step_limits = None
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.interlock_set = None
        self.limits = None

        self.chan_position = None
        self.chan_state = None
        self.chan_min_value = None
        self.chan_max_value = None
        self.chan_interlock_state = None
        self.cmd_stop = None
Exemplo n.º 11
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.motor_pos_attr_suffix = "Position"
     self.motor_state_attr_suffix = "State"
     self.translate_state = {
         MicrodiffMotor.NOTINITIALIZED: self.motor_states.NOTINITIALIZED,
         MicrodiffMotor.UNUSABLE: self.motor_states.BUSY,
         MicrodiffMotor.READY: self.motor_states.READY,
         MicrodiffMotor.MOVESTARTED: self.motor_states.MOVESTARTED,
         MicrodiffMotor.MOVING: self.motor_states.MOVING,
         MicrodiffMotor.ONLIMIT: self.motor_states.HIGHLIMIT,
     }
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.motor_pos_attr_suffix = "Position"
     self.motor_state_attr_suffix = "State"
     self.translate_state = {
         MicrodiffMotor.NOTINITIALIZED: self.motor_states.NOTINITIALIZED,
         MicrodiffMotor.UNUSABLE: self.motor_states.BUSY,
         MicrodiffMotor.READY: self.motor_states.READY,
         MicrodiffMotor.MOVESTARTED: self.motor_states.MOVESTARTED,
         MicrodiffMotor.MOVING: self.motor_states.MOVING,
         MicrodiffMotor.ONLIMIT: self.motor_states.HIGHLIMIT,
     }
Exemplo n.º 13
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.stop_command = None
     self.position_channel = None
     self.state_channel = None
     self.taurusname = None
     self.motor_position = 0.0
     self.threshold_default = 0.0018
     self.move_threshold_default = 0.0
     self.polling_default = "events"
     self.limit_upper = None
     self.limit_lower = None
     self.static_limits = (-1e4, 1e4)
     self.limits = (None, None)
     self.motor_state = MotorStates.NOTINITIALIZED
Exemplo n.º 14
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.stop_command = None
     self.position_channel = None
     self.state_channel = None
     self.taurusname = None
     self.motor_position = 0.0
     self.threshold_default = 0.0018
     self.move_threshold_default = 0.0
     self.polling_default = "events"
     self.limit_upper = None
     self.limit_lower = None
     self.static_limits = (-1e4, 1e4)
     self.limits = (None, None)
     self.motor_state = MotorStates.NOTINITIALIZED
Exemplo n.º 15
0
    def __init__(self, name):
        """
        init
        :param name:
        """
        AbstractMotor.__init__(self, name)

        self.previous_position = None

        self.chan_position = None
        self.chan_state = None
        self.chan_limits = None
        self.cmd_set_position = None
        self.cmd_stop_axis = None
        self.cmd_set_online = None

        self.epsilon = None
        self.username = None
        self.step_limits = None
Exemplo n.º 16
0
    def update_state(self, state=None):
        """Check if the state has changed. Emits signal stateChanged.
        Args:
            state (enum 'HardwareObjectState'): state
        """
        if isinstance(state, bool):
            # It seems like the current version of BLISS gives us a boolean
            # at first and last event, True for ready and False for moving
            state = "READY" if state else "MOVING"
        else:
            try:
                state = state.current_states_names[0]
            except (AttributeError, KeyError):
                state = "UNKNOWN"

        try:
            self._specific_state = BlissMotorStates.__members__[state]
        except:
            self._specific_state = BlissMotorStates.__members__["UNKNOWN"]

        AbstractMotor.update_state(
            self, self.SPECIFIC_TO_HWR_STATE.get(state, HardwareObjectState.UNKNOWN)
        )
Exemplo n.º 17
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)
Exemplo n.º 18
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()
Exemplo n.º 19
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.motor_pos_attr_suffix = "Position"
Exemplo n.º 20
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self.motor_obj = None
Exemplo n.º 21
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.motor_pos_attr_suffix = "Position"
Exemplo n.º 22
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     self._wrap_range = None
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
Exemplo n.º 24
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.motor_name = None
        self.motor_resolution = None
        self.motor_pos_attr_suffix = None
Exemplo n.º 25
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.__move_task = None
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.motor_name = None
        self.motor_resolution = None
        self.motor_pos_attr_suffix = None
Exemplo n.º 27
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
     Device.__init__(self, name)
     self.camera = None
Exemplo n.º 28
0
    def __init__(self, *args, **kwargs):
        AbstractMotor.__init__(self, name="Resolution")

        # self.get_value = self.getPosition
        self.valid = True
Exemplo n.º 29
0
 def __init__(self, name):
     AbstractMotor.__init__(self, name)
Exemplo n.º 30
0
    def __init__(self, name):
        AbstractMotor.__init__(self, name)

        self.__move_task = None