コード例 #1
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 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)
コード例 #2
0
ファイル: alaris.py プロジェクト: jaj42/infupy
 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
コード例 #3
0
ファイル: alaris.py プロジェクト: jaj42/infupy
 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
コード例 #4
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 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]
コード例 #5
0
ファイル: alaris.py プロジェクト: jaj42/infupy
 def readVolume(self):
     reply = self.execCommand(Command.queryvolume)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
コード例 #6
0
ファイル: alaris.py プロジェクト: jaj42/infupy
 def readRate(self):
     reply = self.execCommand(Command.rate)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
コード例 #7
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def stopInfusion(self):
     reply = self.execCommand(Command.setpause)
     if reply.error:
         raise CommandError(reply.value)
コード例 #8
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 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)
コード例 #9
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def resetVolume(self):
     reply = self.execCommand(Command.resetvolume)
     if reply.error:
         raise CommandError(reply.value)
コード例 #10
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def readDrug(self):
     reply = self.execCommand(Command.readdrug)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
コード例 #11
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def readVolume(self):
     reply = self.execCommand(Command.readvar, flags=[VarId.volume])
     if reply.error:
         raise CommandError(reply.value)
     return extractVolume(reply.value)
コード例 #12
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def clearEvents(self):
     super().clearEvents()
     reply = self.execCommand(Command.disspont)
     if reply.error:
         raise CommandError(reply.value)
コード例 #13
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def readDeviceType(self):
     reply = self.execCommand(Command.readfixed, flags=[FixedVarId.devicetype])
     if reply.error:
         raise CommandError(reply.value)
     return reply.value
コード例 #14
0
ファイル: fresenius.py プロジェクト: jaj42/infupy
 def connect(self):
     reply = self.execCommand(Command.connect)
     if reply.error:
         raise CommandError(reply.value)
     return reply.value