Index: dialin/ui/hd_simulator.py =================================================================== diff -u -r3765a2a0a45ddf65c99604f12ac635884ff8dc09 -ra480932829373ec2106eeece3eab672303590bb3 --- dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision 3765a2a0a45ddf65c99604f12ac635884ff8dc09) +++ dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision a480932829373ec2106eeece3eab672303590bb3) @@ -229,7 +229,7 @@ self.logger.error("Not all rejections are enums.") return False - payload = bytearray() + payload = integer_to_bytearray(0) for rejection in rejections: payload += integer_to_bytearray(rejection.value) @@ -1027,8 +1027,10 @@ def cmd_set_pressure_occlusion_data(self, arterial_prs: float, venous_prs: float, blood_pump_occlusion: int, pressure_state: int, art_min_limit: int, art_max_limit: int, - ven_min_limit: int, ven_max_limit: int, filtered_arterial_prs: float, - filtered_venous_prs : float) -> None: + ven_min_limit: int, ven_max_limit: int + , filtered_arterial_prs: float, + filtered_venous_prs : float + ) -> None: """ the Pressure/Occlusion Data messages setter/sender method @@ -1044,8 +1046,8 @@ @param art_max_limit: (int) arterial maximum limit @param ven_min_limit: (int) venous minimum limit @param ven_max_limit: (int) venous maximum limit - @param filtered_arterial_prs: (float) filtered arterial pressure - @param filtered_venous_prs: (float) filtered venous pressure + # @param filtered_arterial_prs: (float) filtered arterial pressure + # @param filtered_venous_prs: (float) filtered venous pressure @return: none """ @@ -2009,6 +2011,38 @@ self.can_interface.send(message, 0) + def cmd_send_confirm_post_tx_next(self, accepted: int, reason: int): + """ + the HD response to the request from UI to continue after a post treatment review + @param accepted: boolean accepted or rejected + @param reason: the rejection reason + @return: None + """ + payload = integer_to_bytearray(accepted) + payload += integer_to_bytearray(reason) + + message = DenaliMessage.build_message(channel_id=DenaliChannels.hd_to_ui_ch_id, + message_id=MsgIds.MSG_ID_HD_POST_TX_NEXT_CMD_RESPONSE.value, + payload=payload) + + self.can_interface.send(message, 0) + + def cmd_send_heparin_response(self, syringePumpVolumeDelivered: float, syringePumpVolumeRequired: float): + """ + the HD response to the request from UI to continue after a post treatment review + @param accepted: boolean accepted or rejected + @param reason: the rejection reason + @return: None + """ + payload = float_to_bytearray(syringePumpVolumeDelivered) + payload += float_to_bytearray(syringePumpVolumeRequired) + + message = DenaliMessage.build_message(channel_id=DenaliChannels.hd_to_ui_ch_id, + message_id=MsgIds.MSG_ID_HD_HEPARIN_DATA.value, + payload=payload) + + self.can_interface.send(message, 0) + # ------------------------------------------------ GENERAL MESSAGES ------------------------------------------------ def cmd_send_hd_general_response(self, message_id: int, accepted: int, reason: int,