Exemple #1
0
 def unregisterEvent(self, event):
     super().unregisterEvent(event)
     reply = self.execCommand(Command.disspont)
     if reply.error:
         raise CommandError(reply.value)
     reply = self.execCommand(Command.enspont, flags=self._events)
     if reply.error:
         raise CommandError(reply.value)
Exemple #2
0
 def setRate(self, newrate):
     brate = str(newrate).encode('ASCII')
     fields = [brate, b'ml/h']
     reply = self.execCommand(Command.rate, fields)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
Exemple #3
0
 def securitycode(self):
     if self.__seccode is None:
         reply = self.execCommand(Command.getserialno)
         if reply.error:
             raise CommandError(reply.value)
         self.__seccode = genCheckSum(reply.value)
     return self.__seccode
Exemple #4
0
 def listModules(self):
     reply = self.execCommand(Command.readvar, flags=[VarId.modules])
     if reply.error:
         raise CommandError(reply.value)
     results = parseVars(reply.value)
     binmods = int(results[VarId.modules], 16)
     return [i + 1 for i in range(5) if (1 << i) & binmods]
Exemple #5
0
 def readVolume(self):
     reply = self.execCommand(Command.queryvolume)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
Exemple #6
0
 def readRate(self):
     reply = self.execCommand(Command.rate)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
Exemple #7
0
 def stopInfusion(self):
     reply = self.execCommand(Command.setpause)
     if reply.error:
         raise CommandError(reply.value)
Exemple #8
0
 def remoteControl(self, doctrl):
     #1 : manual, 2 : PC control
     newmode = b'2' if doctrl else b'1'
     reply = self.execCommand(Command.mode, args=[newmode])
     if reply.error:
         raise CommandError(reply.value)
Exemple #9
0
 def resetVolume(self):
     reply = self.execCommand(Command.resetvolume)
     if reply.error:
         raise CommandError(reply.value)
Exemple #10
0
 def readDrug(self):
     reply = self.execCommand(Command.readdrug)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
Exemple #11
0
 def readVolume(self):
     reply = self.execCommand(Command.readvar, flags=[VarId.volume])
     if reply.error:
         raise CommandError(reply.value)
     return extractVolume(reply.value)
Exemple #12
0
 def clearEvents(self):
     super().clearEvents()
     reply = self.execCommand(Command.disspont)
     if reply.error:
         raise CommandError(reply.value)
Exemple #13
0
 def readDeviceType(self):
     reply = self.execCommand(Command.readfixed, flags=[FixedVarId.devicetype])
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
Exemple #14
0
 def connect(self):
     reply = self.execCommand(Command.connect)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value