Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r6e481cfc0fe27ec23377c9c0bbebafee2df774db -rb4d3a3f424d8038c4970c3c904ebc0c546ea6de8 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 6e481cfc0fe27ec23377c9c0bbebafee2df774db) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision b4d3a3f424d8038c4970c3c904ebc0c546ea6de8) @@ -37,7 +37,6 @@ Args: op_mode (int ): operation mode sub_mode (int, optional ): operation sub-mode. Defaults to 0. - """ if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -97,7 +96,6 @@ @param H6_rot_hall_state : Rotor hall state (1=home, 0=not home) @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -139,7 +137,6 @@ @param controlling : air control @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -319,7 +316,6 @@ @param fpga_vpvn (float): FPGA pvn voltage (1V) @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -372,7 +368,6 @@ @param tmp_max (float) : TMP maximum @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -409,7 +404,6 @@ @param time_remaining (int) : Heparin time remaining @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -437,7 +431,6 @@ @param heartRate (int ) : heart rate @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -466,7 +459,6 @@ @param state (int ) : Saline bolus state @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -497,7 +489,6 @@ @param state (int ) : UF state @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -557,7 +548,6 @@ @param tx_remaining_s (int) : Treatment time remaining (s) @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -591,7 +581,6 @@ @param max_dial_rate_mLH : Maximum dial rate in mL/H. @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -622,7 +611,6 @@ @param dialysate_temp (float) : Target Dialysate Temperature @return: None """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled") @@ -1023,7 +1011,7 @@ vRincebackFlowRateDefReason (int, optional): None zero value of rejection reason. Defaults to 0. vSubVolumeMinReason (int, optional): None zero value of rejection reason. Defaults to 0. vSubVolumeMaxReason (int, optional): None zero value of rejection reason. Defaults to 0. - vSubVolumeDefReason (int, optional): None zero value of rejection reason. Defaults to 0. + vSubVolumeDefReason (int, optional): None zero value of rejection reason. Defaults to 0. """ payload = conversions.integer_to_bytearray(vAccepted ) payload += conversions.integer_to_bytearray(vBloodFlowMinReason ) @@ -1198,7 +1186,7 @@ vChlorineWaterSampleCheckMinRejectionReason (int, optional): None zero value of rejection reason. Defaults to 0. vChlorineWaterSampleCheckMaxRejectionReason (int, optional): None zero value of rejection reason. Defaults to 0. vChlorineWaterSampleCheckDefRejectionReason (int, optional): None zero value of rejection reason. Defaults to 0. - vWaterSampleTestResultRequiredDefRejectionReason (int, optional): None zero value of rejection reason. Defaults to 0. + vWaterSampleTestResultRequiredDefRejectionReason (int, optional): None zero value of rejection reason. Defaults to 0. """ payload = conversions.integer_to_bytearray(vAccepted ) payload += conversions.integer_to_bytearray(vMinRORejectionRatioAlarmMaxRejectionReason ) @@ -1255,6 +1243,50 @@ self.can_interface.send(message, 0) + def td_rinseback_progress(self, vTargetVolume: float, vDeliveredVolume: float, vFlowRate: int, vTimeout: int, + vCountdown: int, vIsCompleted: int): + """ + rinseback progress message (Msg ID: 0x8F, 143) + Args: + @param vTargetVolume : (float) target volume (mL) + @param vDeliveredVolume : (float) delivered volume (mL) + @param vFlowRate : (int) flow rate (mL/min) + @param vTimeout : (int) timeout (s) + @param vCountdown : (int) countdown time (s) + @param vIsCompleted : (int) completed flag + @return: None + """ + payload = conversions.float_to_bytearray (vTargetVolume ) + payload += conversions.float_to_bytearray (vDeliveredVolume ) + payload += conversions.unsigned_integer_to_bytearray (vFlowRate ) + payload += conversions.unsigned_integer_to_bytearray (vTimeout ) + payload += conversions.unsigned_integer_to_bytearray (vCountdown ) + payload += conversions.integer_to_bytearray (vIsCompleted ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_RINSEBACK_PROGRESS.value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_rinseback_cmd_response(self, vRejectionReason: int): + """ + rinseback command response message (Msg ID: 0x91, 145) + Args: + @param vRejectionReason : (int) rejection reason + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_RINSEBACK_CMD_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_isolated_uf_duration_change_response(self, vRejectionReason: int, vVolumeGoalMax: int): """ the isolated uf duration change response message (msg id: 0x9C, 156) @@ -1278,7 +1310,7 @@ def td_isolated_uf_volume_goal_change_response(self, vRejectionReason: int, vVolumeGoal: int, vDuration: int, vRate: int): """ - the isolated uf volume goal change response message (msg id: 0x9E, 156) + the isolated uf volume goal change response message (msg id: 0x9E, 158) args: @param vRejectionReason (int) : response rejection reason, if rejection reason is 0, then accepted (0) will be sent, @@ -1303,7 +1335,7 @@ def td_isolated_uf_confirm_response(self, vRejectionReason: int): """ - the isolated uf confirm response message (msg id: 0x9E, 156) + the isolated uf confirm response message (msg id: 0xA0, 160) args: @param vRejectionReason (int) : response rejection reason, if rejection reason is 0, then accepted (0) will be sent, @@ -1320,6 +1352,38 @@ self.can_interface.send(message, 0) + def td_blood_set_auto_load_response(self,vRejectionReason: int): + """ + the blood set auto eject response message method(Msg ID: 0xXX, XXX) + Args: + None + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_DISPOSABLES_CONFIRM_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_blood_set_auto_eject_response(self,vRejectionReason: int): + """ + the heparin adjustment response message method(Msg ID: 0xXX, XXX) + Args: + None + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + def td_Treatment_Parameters_CreateRx(self, vRejectionReason: int): """ TD response to in initiate Treatment and enter Create Rx (Msg ID: 0x46, 70) @@ -1385,7 +1449,6 @@ vHeparinDispensingRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. vHeparinBolusVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. """ - if not self.can_enabled: raise ValueError("CAN Interface is not enabled")