Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -ra7e73b2d25806ea5742372124a7ae308753c7bfb -r94752123638e25dd446cc94728947c40cd0309a1 --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision a7e73b2d25806ea5742372124a7ae308753c7bfb) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 94752123638e25dd446cc94728947c40cd0309a1) @@ -164,6 +164,9 @@ MSG_ID_TD_RINSEBACK_PROGRESS = 0x8F MSG_ID_UI_RINSEBACK_CMD_REQUEST = 0x90 MSG_ID_TD_RINSEBACK_CMD_RESPONSE = 0x91 + MSG_ID_TD_BLOOD_PRIME_PROGRESS_DATA = 0x97 + MSG_ID_UI_BLOOD_PRIME_CMD_REQUEST = 0x98 + MSG_ID_TD_BLOOD_PRIME_CMD_RESPONSE = 0x99 MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r629840541ae05dc625a930120454d463a2fb3d51 -r94752123638e25dd446cc94728947c40cd0309a1 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 629840541ae05dc625a930120454d463a2fb3d51) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 94752123638e25dd446cc94728947c40cd0309a1) @@ -504,7 +504,7 @@ payload=payload) self.can_interface.send(message, 0) - + def td_treatment_time( self, tx_duration_s : int , tx_elapsed_s : int , @@ -595,6 +595,49 @@ self.can_interface.send(message, 0) + + def td_blood_prime_progress(self, + target_volume : float , + delivered_volume : float ): + """ + Broadcasts blood prime data (Msg ID: 0x97, 151) + Args: + @param target_volume (float) : Target Volume + @param delivered_volume (float) : Delivered Volume + @return: None + """ + + if not self.can_enabled: + raise ValueError("CAN Interface is not enabled") + + payload = conversions.float_to_bytearray (target_volume ) + payload += conversions.float_to_bytearray (delivered_volume ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_BLOOD_PRIME_PROGRESS_DATA.value, + payload=payload) + + self.can_interface.send(message, 0) + + + def td_blood_prime_cmd_response(self, vRejectionReason: int): + """ + rinseback command response message (Msg ID: 0x99, 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_BLOOD_PRIME_CMD_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_versions(self, major: int, minor: int, micro: int, build: int, fpga_id: int, fpga_major: int, fpga_minor: int, fpga_lab: int, compatibility_rev: int):