def __init__(self, inst, props, *args, **kwargs): try: MotorController.__init__(self, inst, props, *args, **kwargs) self.device = PyTango.DeviceProxy(self.DeviceName) self.startMultiple = {} self.positionMultiple = {} self.attributes = {} except Exception as e: self._log.error('Error when init: %s' % e) raise
def __init__(self, inst, props, *args, **kwargs): self._target_temp = None self._current_temp = None try: MotorController.__init__(self, inst, props, *args, **kwargs) self.device = PyTango.DeviceProxy(self.DeviceName) self.attributes = {} except Exception as e: self._log.error('Error when init: %s' % e) raise
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) print("Epics Motor Prefix: ", self.PV) self.epicsmotorHW = EpicsMotorHW(self.PV) #super_class = super(CopleyController, self) #super_class.__init__(inst, props, *args, **kwargs) ### Epics PV initialization process epicsmotorHW = self.epicsmotorHW # if axis 1 exists, then use this method to check the epics PV #print("Check Epics Motor: {} OK ".format(epicsmotorHW.connectMotor(self.PV, 1))) epicsmotorHW.checkEpicsMotorNr(self.PV)
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) self.axisAttributes = {} self.interlockProxy = None try: print self.MotorName, self.InterlockDevice self.motorProxy = DeviceProxy(self.MotorName) if self.InterlockDevice != "": self.interlockProxy = DeviceProxy(self.InterlockDevice) except DevFailed, df: de = df[0] self._log.error("__init__ DevFailed: (%s) %s" % (de.reason, de.desc)) self._log.error("__init__ DevFailed: %s" % str(df))
def AddDevice(self, axis): MotorController.AddDevice(self, axis) idx = axis - 1 if len(self.m) < axis: raise Exception("Invalid axis %d" % axis) if self.m[idx] is None: m = BaseMotion() m.curr_pos = 0 self.m[idx] = m
def AddDevice(self, axis): MotorController.AddDevice(self, axis) idx = axis - 1 if len(self.m) < axis: raise Exception("Invalid axis %d" % axis) if self.m[idx] is None: m = Motion() m.setMinVelocity(0) m.setMaxVelocity(100) m.setAccelerationTime(2) m.setDecelerationTime(2) m.setCurrentPosition(0) self.m[idx] = m
def __init__(self, inst, props, *args, **kwargs): """ Do the default init plus the icepap connection @param inst instance name of the controller @param properties of the controller """ MotorController.__init__(self, inst, props, *args, **kwargs) self.ipap = IcePAPController(self.Host, self.Port, self.Timeout, auto_axes=True) self.attributes = {} self.state_multiple = [] self.position_multiple = [] self.move_multiple_grouped = [] self.move_multiple_not_grouped = [] self.stop_multiple = [] self.abort_multiple = [] # Set IcePAP library logging level import logging logger = logging.getLogger('icepap') logger.setLevel(self.IcepapLogLevel) self._log.debug('Icepap logging level set to %s' % self.IcepapLogLevel)
def GetAxisPar(self, axis, name): """ Get the standard pool motor parameters. @param axis to get the parameter @param name of the parameter to get the value @return the value of the parameter """ par_name = name.lower() if par_name == 'step_per_unit': value = self.attributes[axis]['step_per_unit'] elif par_name == 'velocity': spu = self.attributes[axis]['step_per_unit'] value = self.ipap[axis].velocity / spu elif par_name == 'base_rate': value = 0 elif par_name in ['acceleration', 'deceleration']: value = self.ipap[axis].acctime else: value = MotorController.GetAxisPar(self, axis, name) return value
def SetAxisPar(self, axis, name, value): """ Set the standard pool motor parameters. @param axis to set the parameter @param name of the parameter @param value to be set """ par_name = name.lower() if par_name == 'step_per_unit': self.attributes[axis]['step_per_unit_set'] = True spu = float(value) self.attributes[axis]['step_per_unit'] = spu velocity = self.attributes[axis]['velocity'] if velocity is not None: self._SetVelocity(axis, velocity * spu) elif par_name == 'velocity': self.attributes[axis]['velocity'] = value spu = self.attributes[axis]['step_per_unit'] if not self.attributes[axis]['step_per_unit_set']: # if step_per_unit has not been set yet we still try to # set velocity because the motor may simply use the default # step per unit of 1. If it fails we ignore the error. The # velocity will be set when the step per unit is configured try: self._SetVelocity(axis, value * spu) except: pass else: self._SetVelocity(axis, value * spu) elif par_name == 'base_rate': pass elif par_name == 'acceleration': self.ipap[axis].acctime = value elif par_name == 'deceleration': pass else: MotorController.SetAxisPar(self, axis, name, value)
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) self.m = self.MaxDevice*[None,]
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) self.axisAttributes = {}
def DeleteDevice(self, axis): MotorController.DeleteDevice(self, axis) idx = axis - 1 if len(self.m) < axis or not self.m[idx]: self._log.error("Invalid axis %d" % axis)
def GetAxisAttributes(self, axis): axis_attrs = MotorController.GetAxisAttributes(self, axis) new_axis_attrs = {} for attr in ('Position', 'Limit_switches'): new_axis_attrs[attr] = axis_attrs[attr] return new_axis_attrs
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) self.m = self.MaxDevice * [ None, ]
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self,inst, props, *args, **kwargs) self.blender_blades = blenderBlades.BlenderBlades('127.0.0.1', 9999)
def GetAxisAttributes(self, axis): axis_attrs = MotorController.GetAxisAttributes(self, axis) new_axis_attrs = dict(Position=axis_attrs['Position']) new_axis_attrs['Position'][Type] = int return new_axis_attrs
def GetAxisAttributes(self, axis): return MotorController.GetAxisAttributes(self, axis)
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self, inst, props, *args, **kwargs) self.xyz_stage = XYZStage(self.Host, self.Port) self._states = {} self._raw_states = [None] * 3
def __init__(self, inst, props, *args, **kwargs): MotorController.__init__(self,inst, props, *args, **kwargs) #super_class = super(CopleyController, self) #super_class.__init__(inst, props, *args, **kwargs) self.copleyController = EpicsObject()