Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r5b8701e66a79f25df2f14677ac2a58bff7409f0b -rb4d3a3f424d8038c4970c3c904ebc0c546ea6de8 --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 5b8701e66a79f25df2f14677ac2a58bff7409f0b) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision b4d3a3f424d8038c4970c3c904ebc0c546ea6de8) @@ -161,6 +161,9 @@ MSG_ID_TD_HEPARIN_DATA = 0x8C MSG_ID_TD_END_TREATMENT_REQUEST = 0x8D MSG_ID_TD_END_TREATMENT_RESPONSE = 0x8E + MSG_ID_TD_RINSEBACK_PROGRESS = 0x8F + MSG_ID_UI_RINSEBACK_CMD_REQUEST = 0x90 + MSG_ID_TD_RINSEBACK_CMD_RESPONSE = 0x91 MSG_ID_TD_ISOLATED_UF_DATA = 0x9A MSG_ID_UI_ISOLATED_UF_DURATION_CHANGE_REQUEST = 0x9B MSG_ID_TD_ISOLATED_UF_DURATION_CHANGE_RESPONSE = 0x9C @@ -171,6 +174,11 @@ MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 + MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST = 0X92 + MSG_ID_TD_ADJUST_DISPOSABLES_CONFIRM_RESPONSE = 0X93 + MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST = 0X94 + MSG_ID_TD_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_RESPONSE = 0X95 + MSG_ID_TD_TESTER_LOGIN_REQUEST = 0x8000 MSG_ID_TD_SOFTWARE_RESET_REQUEST = 0x8001 MSG_ID_TD_SEND_TEST_CONFIGURATION = 0x8002 @@ -326,6 +334,9 @@ MSG_ID_DD_VOLTAGE_DATA_PUBLISH_INTERVAL_OVERRIDE_REQUEST = 0xA051 MSG_ID_DD_MONITORED_VOLTAGE_OVERRIDE_REQUEST = 0xA052 MSG_ID_DD_RINSE_PUMP_DATA_PUBLISH_INTERVAL_OVERRIDE_REQUEST = 0xA053 + MSG_ID_DD_RINSE_PUMP_PWM_PERCENT_OVERRIDE_REQUEST = 0xA054 + MSG_ID_DD_RINSE_PUMP_TURN_ON_OFF_REQUEST = 0xA055 + MSG_ID_DD_SET_CONDUCTIVITY_MODEL_REQUEST = 0xA056 # Placeholder messages MSG_ID_DD_ALARM_STATE_OVERRIDE_REQUEST = 0xAF03 @@ -386,6 +397,8 @@ MSG_ID_FP_SET_START_STOP_OVERRIDE_REQUEST = 0xB033 MSG_ID_FP_RO_REJECTION_RATIO_PUBLISH_INTERVAL_OVERRIDE_REQUEST = 0xB034 MSG_ID_FP_RO_FILTERED_REJECTION_RATIO_OVERRIDE_REQUEST = 0xB035 + MSG_ID_FP_DEF_STATUS_REQUEST = 0xB049 + MSG_ID_FP_DEF_STATUS_RESPONSE = 0xB04A MSG_ID_TD_DEBUG_EVENT = 0xFFF1 MSG_ID_DD_DEBUG_EVENT = 0xFFF2 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")