Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r0ceb8d71e2c853991e79dc436a74fe96d33ea6a7 -r6364355a60f818cb66570b78b4c69e00a0d5865d --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 0ceb8d71e2c853991e79dc436a74fe96d33ea6a7) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 6364355a60f818cb66570b78b4c69e00a0d5865d) @@ -133,6 +133,10 @@ MSG_ID_DD_DATE_AND_TIME_RESPONSE = 0x6F MSG_ID_FP_RO_REJECTION_RATIO_DATA = 0x71 MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 + MSG_ID_TD_HEPARIN_REQUEST = 0x8A + MSG_ID_TD_HEPARIN_RESPONSE = 0x8B + MSG_ID_TD_HEPARIN_DATA = 0x8C + MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 MSG_ID_TD_TESTER_LOGIN_REQUEST = 0x8000 MSG_ID_TD_SOFTWARE_RESET_REQUEST = 0x8001 Index: leahi_dialin/fp/modules/valves.py =================================================================== diff -u -r9eeeeb3a8bc94c59e506254b088493fd69c3b1e1 -r6364355a60f818cb66570b78b4c69e00a0d5865d --- leahi_dialin/fp/modules/valves.py (.../valves.py) (revision 9eeeeb3a8bc94c59e506254b088493fd69c3b1e1) +++ leahi_dialin/fp/modules/valves.py (.../valves.py) (revision 6364355a60f818cb66570b78b4c69e00a0d5865d) @@ -7,8 +7,8 @@ # # @file valves.py # -# @author (last) Micahel Garthwaite -# @date (last) 17-Aug-2023 +# @author (last) Zoltan Miskolci +# @date (last) 08-Dec-2025 # @author (original) Peman Montazemi # @date (original) 19-May-2020 # @@ -39,8 +39,10 @@ """ # Valves states publish message field positions - START_POS_VALVES_STATES = DenaliMessage.PAYLOAD_START_INDEX - END_POS_VALVES_STATES = START_POS_VALVES_STATES + 2 # Valves States come in as a U16 value (2 bytes) + START_IO_VALVES_STATES = DenaliMessage.PAYLOAD_START_INDEX + END_IO_VALVES_STATES = START_IO_VALVES_STATES + 1 # IO Valves States come in as a U08 value (1 byte) + START_FP_VALVES_STATES = END_IO_VALVES_STATES + END_FP_VALVES_STATES = START_FP_VALVES_STATES + 1 # FP Valves States come in as a U08 value (1 byte) def __init__(self, can_interface, logger: Logger): """ Index: leahi_dialin/ui/dd_messaging.py =================================================================== diff -u -r82673b44f61604336cf70c0e72db0e332325c8af -r6364355a60f818cb66570b78b4c69e00a0d5865d --- leahi_dialin/ui/dd_messaging.py (.../dd_messaging.py) (revision 82673b44f61604336cf70c0e72db0e332325c8af) +++ leahi_dialin/ui/dd_messaging.py (.../dd_messaging.py) (revision 6364355a60f818cb66570b78b4c69e00a0d5865d) @@ -530,6 +530,22 @@ self.can_interface.send(message, 0) + def dd_date_time_response(self,vRejectionReason: int): + """ + the DD 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.dd_sync_broadcast_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_DD_DATE_AND_TIME_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + def dd_valves(self, D14_VALV : bool, D52_VALV : bool, D8_VALV : bool, Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -reb3e8ec85b8c2cfd7215d762117c617b8084be45 -r6364355a60f818cb66570b78b4c69e00a0d5865d --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision eb3e8ec85b8c2cfd7215d762117c617b8084be45) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 6364355a60f818cb66570b78b4c69e00a0d5865d) @@ -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,39 @@ 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_Treatment_Parameters_CreateRx(self, vRejectionReason: int): """ TD response to in initiate Treatment and enter Create Rx (Msg ID: 0x46, 70)