Ejemplo n.º 1
0
Archivo: mpc200.py Proyecto: ablot/acq4
 def getDevice(cls, port):
     """
     Return a SutterMPC200 instance for the specified serial port. Only one instance will 
     be created for each port.
     """
     port = SerialDevice.normalizePortName(port)
     if port not in cls.DEVICES:
         cls.DEVICES[port] = SutterMPC200(port=port)
     return cls.DEVICES[port]
Ejemplo n.º 2
0
 def __init__(self, port):
     port = SerialDevice.normalizePortName(port)
     if port in SutterMPC200.DEVICES:
         raise Exception("The port %s is already accessed by another instance of this class. Use getDevice(port) instead.")
     SutterMPC200.DEVICES[port] = self
     self.lock = RLock()
     self.port = port
     SerialDevice.__init__(self, port=self.port, baudrate=128000)
     self.scale = [0.0625e-6]*3  # default is 16 usteps per micron
     self._moving = False
Ejemplo n.º 3
0
    def getDevice(cls, port):
        """
        Return a SutterMPC200 instance for the specified serial port. Only one instance will 
        be created for each port.

        *port* must be a serial COM port (eg. COM3 or /dev/ttyACM0)        
        """
        port = SerialDevice.normalizePortName(port)
        if port in cls.DEVICES:
            return cls.DEVICES[port]
        else:
            return SutterMPC200(port=port)