Ejemplo n.º 1
0
 def __init__(self):
     """The Constructor Method for the Stepper Class
     
     Exceptions:
         RuntimeError - If current platform is not supported/phidget c dll cannot be found
     """
     Phidget.__init__(self)
     
     self.__inputChange = None
     self.__velocityChange = None
     self.__positionChange = None
     self.__currentChange = None
     
     self.__onInputChange = None
     self.__onVelocityChange = None
     self.__onPositionChange = None
     self.__onCurrentChange = None
     
     try:
         PhidgetLibrary.getDll().CPhidgetStepper_create(byref(self.handle))
     except RuntimeError:
         raise
     
     if sys.platform == 'win32':
         self.__INPUTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
         self.__VELOCITYCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
         self.__POSITIONCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_longlong)
         self.__CURRENTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
     elif sys.platform == 'darwin' or sys.platform == 'linux2':
         self.__INPUTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_int)
         self.__VELOCITYCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
         self.__POSITIONCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_longlong)
         self.__CURRENTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p, c_int, c_double)
Ejemplo n.º 2
0
    def __init__(self):
        """The Constructor Method for the Stepper Class
        
        Exceptions:
            RuntimeError - If current platform is not supported/phidget c dll cannot be found
        """
        Phidget.__init__(self)

        self.__inputChange = None
        self.__velocityChange = None
        self.__positionChange = None
        self.__currentChange = None

        self.__onInputChange = None
        self.__onVelocityChange = None
        self.__onPositionChange = None
        self.__onCurrentChange = None

        try:
            PhidgetLibrary.getDll().CPhidgetStepper_create(byref(self.handle))
        except RuntimeError:
            raise

        if sys.platform == 'win32':
            self.__INPUTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p, c_void_p,
                                                    c_int, c_int)
            self.__VELOCITYCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p,
                                                       c_void_p, c_int,
                                                       c_double)
            self.__POSITIONCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p,
                                                       c_void_p, c_int,
                                                       c_longlong)
            self.__CURRENTCHANGEHANDLER = WINFUNCTYPE(c_int, c_void_p,
                                                      c_void_p, c_int,
                                                      c_double)
        elif sys.platform == 'darwin' or sys.platform == 'linux2':
            self.__INPUTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p,
                                                  c_int, c_int)
            self.__VELOCITYCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p,
                                                     c_int, c_double)
            self.__POSITIONCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p,
                                                     c_int, c_longlong)
            self.__CURRENTCHANGEHANDLER = CFUNCTYPE(c_int, c_void_p, c_void_p,
                                                    c_int, c_double)
Ejemplo n.º 3
0
 def __del__(self):
     """The Destructor Method for the Stepper Class
     """
     Phidget.dispose(self)
Ejemplo n.º 4
0
 def __del__(self):
     """The Destructor Method for the Stepper Class
     """
     Phidget.dispose(self)