Index: HemodialysisDevice.py =================================================================== diff -u -r18637d43f1065ccc49a4cc67cfcf440874794cee -r3b321f8ad2966cce65d6234ea44d3a2d4d79d133 --- HemodialysisDevice.py (.../HemodialysisDevice.py) (revision 18637d43f1065ccc49a4cc67cfcf440874794cee) +++ HemodialysisDevice.py (.../HemodialysisDevice.py) (revision 3b321f8ad2966cce65d6234ea44d3a2d4d79d133) @@ -270,6 +270,8 @@ # HD response to UF change request message field positions START_POS_UF_CHG_RSP_RESP = DenaliMessage.PAYLOAD_START_INDEX END_POS_UF_CHG_RSP_RESP = START_POS_UF_CHG_RSP_RESP + 4 + START_POS_UF_CHG_RSP_REJECT_REASON = END_POS_UF_CHG_RSP_RESP + END_POS_UF_CHG_RSP_REJECT_REASON = START_POS_UF_CHG_RSP_REJECT_REASON + 4 START_POS_UF_CHG_RSP_VOL = END_POS_UF_CHG_RSP_RESP END_POS_UF_CHG_RSP_VOL = START_POS_UF_CHG_RSP_VOL + 4 START_POS_UF_CHG_RSP_TIME = END_POS_UF_CHG_RSP_VOL @@ -312,26 +314,27 @@ # initialize variables that will be populated by response from HD to UF change request self.UFChangeSucceeded = False + self.UFChangeRejectReason = 0 self.UFChangeVolumeMl = 0 self.UFChangeTimeMin = 0 self.UFChangeRateMlMin = 0.0 self.UFChangeTimeDiff = 0 self.UFChangeRateDiff = 0.0 # initialize variables that will be populated by response from HD to blood & dialysate flow rate change request - self.TargetBloodFlowRate = 0 - self.TargetDialysateFlowRate = 0 self.BloodAndDialysateFlowRateChangeSucceeded = False self.BloodAndDialysateFlowRateChangeRejectReason = 0 + self.TargetBloodFlowRate = 0 + self.TargetDialysateFlowRate = 0 def handlerBloodAndDialysateChangeResponseFunction(self, message): """ Handler for response from HD regarding blood & dialysate flow rate change request. \param message: response message from HD regarding requested blood & dialysate flow rate settings change.\n BOOL Accepted \n - U32 UF Volume (mL) - converted to Liters \n - U32 Treatment Time (min) \n - U32 UF Rate (mL/min) \n + U32 Reject reason (if not accepted) \n + U32 Blood flow rate (mL/min) \n + U32 Dialysate flow rate (mL/min) \n \returns none """ @@ -359,6 +362,7 @@ \param message: response message from HD regarding requested ultrafiltration settings change.\n BOOL Accepted \n + U32 RejectReason (if not accepted) F32 UF Volume (mL) - converted to Liters \n U32 Treatment Time (min) \n F32 UF Rate (mL/min) \n @@ -369,6 +373,8 @@ """ rsp = struct.unpack('i',bytearray( message['message'][self.START_POS_UF_CHG_RSP_RESP:self.END_POS_UF_CHG_RSP_RESP])) + rea = struct.unpack('i',bytearray( + message['message'][self.START_POS_UF_CHG_RSP_REJECT_REASON:self.END_POS_UF_CHG_RSP_REJECT_REASON])) vol = struct.unpack('f',bytearray( message['message'][self.START_POS_UF_CHG_RSP_VOL:self.END_POS_UF_CHG_RSP_VOL])) tim = struct.unpack('i',bytearray( @@ -385,6 +391,7 @@ else: resp = True self.UFChangeSucceeded = resp + self.UFChangeRejectReason = rea[0] self.UFChangeVolumeL = vol[0] / self.LITER_TO_ML_CONVERSION_FACTOR self.UFChangeTimeMin = tim[0] self.UFChangeRateMlMin = rat[0]