Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r9094b10daec7a21c915c37cf3755cbfeb95f5f9e -r082676758cf5454d87bb95c80c59d89e47c54e90 --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 9094b10daec7a21c915c37cf3755cbfeb95f5f9e) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 082676758cf5454d87bb95c80c59d89e47c54e90) @@ -125,7 +125,13 @@ MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE = 0x67 MSG_ID_DD_VOLTAGES_DATA = 0x68 MSG_ID_DD_RINSE_PUMP_DATA = 0x69 - + MSG_ID_TD_TREATMENT_LOG_ALARM_EVENT = 0x6A + MSG_ID_TD_TREATMENT_LOG_EVENT = 0x6B + MSG_ID_TD_DATE_AND_TIME_REQUEST = 0x6C + MSG_ID_TD_DATE_AND_TIME_RESPONSE = 0x6D + MSG_ID_DD_DATE_AND_TIME_REQUEST = 0x6E + MSG_ID_DD_DATE_AND_TIME_RESPONSE = 0x6F + MSG_ID_FP_RO_REJECTION_RATIO_DATA = 0x71 MSG_ID_TD_INSTITUTIONAL_RECORD_REQUEST = 0x82 MSG_ID_TD_INSTITUTIONAL_RECORD_RESPONSE = 0x83 MSG_ID_TD_ADJUST_INSTITUTIONAL_RECORD_REQUEST = 0x84 @@ -134,6 +140,11 @@ MSG_ID_TD_ADVANCED_INSTITUTIONAL_RECORD_RESPONSE = 0x87 MSG_ID_TD_ADVANCED_ADJUST_INSTITUTIONAL_RECORD_REQUEST = 0x88 MSG_ID_TD_ADVANCED_ADJUST_INSTITUTIONAL_RECORD_RESPONSE = 0x89 + MSG_ID_TD_HEPARIN_REQUEST = 0x8A + MSG_ID_TD_HEPARIN_RESPONSE = 0x8B + MSG_ID_TD_HEPARIN_DATA = 0x8C + MSG_ID_TD_END_TREATMENT_REQUEST = 0x8D + MSG_ID_TD_END_TREATMENT_RESPONSE = 0x8E MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 @@ -205,6 +216,7 @@ MSG_ID_TD_BARO_PRESSURE_OVERRIDE = 0x8041 MSG_ID_TD_TEMPERATURE_OVERRIDE = 0x8042 MSG_ID_TD_TEMPERATURE_PUBLISH_INTERVAL_OVERRIDE_REQUEST = 0x8043 + MSG_ID_TD_EJECTOR_OPT_SENSOR_OVERRIDE_REQUEST = 0x8044 MSG_ID_TD_TRAINING_TEST_OVERRIDE_REQUEST = 0x8999 @@ -344,6 +356,13 @@ MSG_ID_FP_SET_TEST_CONFIGURATION = 0xB02D MSG_ID_FP_GET_TEST_CONFIGURATION = 0XB02E MSG_ID_FP_RESET_ALL_TEST_CONFIGURATIONS = 0XB02F + MSG_ID_FP_INLET_PRES_PUBLISH_INTERVAL_OVERRIDE_REQUEST = 0xB030 + MSG_ID_FP_INLET_PRES_CHECK_TIME_OVERRIDE_REQUEST = 0xB031 + MSG_ID_FP_FILTERED_COND_SENSOR_READINGS_OVERRIDE_REQUEST = 0xB032 + # MSG_ID_FP_FILTERED_COND_SENSOR_TEMPERATURE_OVERRIDE_REQUEST = 0xB032 + 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_TD_DEBUG_EVENT = 0xFFF1 MSG_ID_DD_DEBUG_EVENT = 0xFFF2 Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r17e292e04b073cf0d6de5919842be7f3302287c8 -r082676758cf5454d87bb95c80c59d89e47c54e90 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 17e292e04b073cf0d6de5919842be7f3302287c8) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 082676758cf5454d87bb95c80c59d89e47c54e90) @@ -397,38 +397,34 @@ self.can_interface.send(message, 0) - def td_saline( self, - target_volume : int , - cumulative_volume : float , - bolus_volume : float , - state : int ): + def td_heparin( self, + target : float , + cumulative : float , + time_remaining : int ): """ - Broadcasts the current TD Saline data (Msg ID: 0x3D, 61) + Broadcasts the current TD Heparin data (Msg ID: 0xXX, XX) Args: - @param target_volume (int ) : Saline target volume - @param cumulative_volume (float) : Saline cumulative volume - @param bolus_volume (float) : Saline bolus set volume - @param state (int ) : Saline bolus state + @param target (float) : Heparin target volume + @param cumulative (float) : Heparin cumulative volume + @param time_remaining (int) : Heparin time remaining @return: None """ if not self.can_enabled: raise ValueError("CAN Interface is not enabled") - payload = conversions.unsigned_integer_to_bytearray(target_volume ) - payload += conversions.float_to_bytearray (cumulative_volume ) - payload += conversions.float_to_bytearray (bolus_volume ) - payload += conversions.unsigned_integer_to_bytearray(state ) + payload = conversions.float_to_bytearray (target ) + payload += conversions.float_to_bytearray (cumulative ) + payload += conversions.unsigned_integer_to_bytearray(time_remaining ) message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_SALINE_BOLUS_DATA.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_HEPARIN_DATA.value, payload=payload) self.can_interface.send(message, 0) - def td_vitals( self, systolic : int , diastolic : int , @@ -456,6 +452,37 @@ payload=payload) self.can_interface.send(message, 0) + def td_saline( self, + target_volume : int , + cumulative_volume : float , + bolus_volume : float , + state : int ): + """ + Broadcasts the current TD Saline data (Msg ID: 0x3D, 61) + Args: + @param target_volume (int ) : Saline target volume + @param cumulative_volume (float) : Saline cumulative volume + @param bolus_volume (float) : Saline bolus set volume + @param state (int ) : Saline bolus state + @return: None + """ + + if not self.can_enabled: + raise ValueError("CAN Interface is not enabled") + + + payload = conversions.unsigned_integer_to_bytearray(target_volume ) + payload += conversions.float_to_bytearray (cumulative_volume ) + payload += conversions.float_to_bytearray (bolus_volume ) + payload += conversions.unsigned_integer_to_bytearray(state ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_SALINE_BOLUS_DATA.value, + payload=payload) + + self.can_interface.send(message, 0) + def td_ultrafiltration( self, set_volume : float , target_rate : float , @@ -663,6 +690,55 @@ payload=payload) self.can_interface.send(message, 0) + + def td_date_time_response(self,vRejectionReason: int): + """ + the TD Date/ Time response message method(Msg ID: 0x6D, 100) + 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_DATE_AND_TIME_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_heparin_adjustment_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_HEPARIN_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_end_tx_response(self,vRejectionReason: int): + """ + the end treatment 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_END_TREATMENT_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + def td_institutional_response(self, vRejectionReason : int, vBloodFlowMin : int, vBloodFlowMax : int,