예제 #1
0
 def __check_mot(self, mot):
     # Old way doesn't handle subclasses:
     """
 if (type(mot) is motor.Motor): m = mot
 elif (type(mot) is virtualmotor.VirtualMotor): m = mot
 elif (type(mot) is motor_PV.motorPV): m = mot
 """
     # New way, which handles subclasses:
     if isinstance(mot, motor.Motor) \
            or isinstance(mot, virtualmotor.VirtualMotor) \
            or isinstance(mot, motor_PV.motorPV):
         m = mot
     else:
         m = motor_PV.motorPV(mot, mot)
     return m
예제 #2
0
파일: daq.py 프로젝트: teddyrendahl/HXRSnD
 def __check_mot(self,mot):
   if (type(mot) is motor.Motor): m = mot
   elif (type(mot) is virtualmotor.VirtualMotor): m = mot
   elif (type(mot) is motor_PV.motorPV): m = mot
   else: m=motor_PV.motorPV(mot,mot)
   return m