def init(self): """Set the connection with the device Musn't be initialized already. """ assert not self._initialized, "Cannot init initialized multimeter" checkserial=serialCheck.serialcheck() #make sure to use pyserial # Open a serial port self._serial=serial.Serial(self._device,self._baud,xonxoff=True,timeout=2) self.configMultimeter() self._measureThread=measureThread(self) self._initialized=True
def init(self): """Connection with the chopper and set the device access Musn't be initialized already. """ assert not self._initialized, "Cannot init initialized chopper" checkserial = serialCheck.serialcheck() #make sure to use pyserial self._serial = serial.Serial(self._device, 115200, timeout=2) # get greetings greetings = self._ask('G') self._initialized = True return greetings
def init(self,position): """Set the connection to the device Musn't be initialized already """ assert not self._initialized, "Cannot init initialized wobbler" serialCheck.serialcheck() #make sure to use pyserial # Open a serial port self._serial=serial.Serial(self._device,self._baud,timeout=2) # Set the command to Go to Initialization + position self._send("GI+") # No position is set so wait for a constant time... self._wait_until_motionless(2) # Finally, move to indicated position self._move(position) self._wait() self._dt = 0.0014511945645014446 self._initialized=True
def init(self): """Set the connection to the device Musn't be initialized already. """ assert not self._initialized, "Cannot init initialized sensors" checkserial = serialCheck.serialcheck() #make sure to use pyserial self._serial = serial.Serial(self._device, 115200, timeout=2) self._sensors = ['Temp0', 'Temp1', 'Temp2', 'Humidity'] # get greetings greetings = self._ask('GS') self._initialized = True return greetings
def init(self, position): """Set the connection to the device Musn't be initialized already """ assert not self._initialized, "Cannot init initialized wobbler" checkserial = serialCheck.serialcheck() #make sure to use pyserial # Open a serial port self._serial = serial.Serial(self._device, self._baud, timeout=2) # Set the command to Go to Initialization + position self._send("GI+") # No position is set so wait for a constant time... self._wait_until_motionless(2) # Finally, move to indicated position self._move(position) self._wait() if position - self._maxpos // 2 > 0: dpos = -3000 else: dpos = 3000 t = time() self._move(position + dpos) self._wait() dt = time() - t t = time() self._move(position) self._wait() # at least the time required for 1 step self._dt = time() - t self._dt += dt self._dt /= 6000. self._initialized = True