Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r01af2d84b2cb4aa87c58f10eb8af669820e71f49 -r198ab82e946fcb7824100b7a352a317b53063678 --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 01af2d84b2cb4aa87c58f10eb8af669820e71f49) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 198ab82e946fcb7824100b7a352a317b53063678) @@ -216,9 +216,9 @@ MSG_ID_DD_NVM_USAGE_INFO_RECORD_RESPONSE = 0xC1 MSG_ID_UI_DD_NVM_SET_USAGE_INFO_RECORD_REQUEST = 0xC2 MSG_ID_DD_NVM_CAL_PRESSURE_SENSOR_RESPONSE = 0xC3 - MSG_ID_UI_DD_NVM_SET_CAL_PRESSURE_SENSOR_REQUEST = 0xC4 - MSG_ID_DD_NVM_CAL_TEMP_SENSOR_RESPONSE = 0xC5 - MSG_ID_UI_DD_NVM_SET_CAL_TEMP_SENSOR_REQUEST = 0xC6 + MSG_ID_TD_DRY_BICARD_DISCONNECT_DATA = 0xC4 + MSG_ID_UI_DRY_BICARD_DISCONNECT_REQUEST = 0xC5 + MSG_ID_TD_DRY_BICARD_DISCONNECT_RESPONSE = 0xC6 MSG_ID_DD_NVM_CAL_CONC_PUMP_RESPONSE = 0xC7 MSG_ID_UI_DD_NVM_SET_CAL_CONC_PUMP_REQUEST = 0xC8 MSG_ID_DD_NVM_CAL_D12_PUMP_RESPONSE = 0xC9 Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -rb37f6de135a6bedb66753f17d7623af59b15145a -r198ab82e946fcb7824100b7a352a317b53063678 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision b37f6de135a6bedb66753f17d7623af59b15145a) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 198ab82e946fcb7824100b7a352a317b53063678) @@ -326,6 +326,51 @@ self.can_interface.send(message, 0) + + def td_syringePump(self, PumpState : int , + DeliveryState : int , + SetRate : float, + MeasRate : float, + Position : int , + VolumeDelivered : float, + Home : float, + Force : float, + SafetyVolume : float, + Status : int ): + """ + Broadcasts the current TD voltage data (Msg ID: 0x1D, 29) + Args: + @param line_1_2v (float): Processor 1.2V + @param line_3_3v (float): Logic voltage (3.3V) + @param line_logic_5v (float): Logic voltage (5V) + @param line_24v_1 (float): Actuators voltage (24V) + @param line_24v_2 (float): Actuators voltage (24V) + @param fpga_vcc (float): FPGA input voltage (3V) + @param fpga_vaux (float): FPGA aux. voltage (3V) + @param fpga_vpvn (float): FPGA pvn voltage (1V) + @return: None + """ + if not self.can_enabled: + raise ValueError("CAN Interface is not enabled") + + payload = conversions.unsigned_integer_to_bytearray(PumpState ) + payload += conversions.unsigned_integer_to_bytearray(DeliveryState ) + payload += conversions.float_to_bytearray (SetRate ) + payload += conversions.float_to_bytearray (MeasRate ) + payload += conversions.unsigned_integer_to_bytearray(Position ) + payload += conversions.float_to_bytearray (VolumeDelivered ) + payload += conversions.float_to_bytearray (Home ) + payload += conversions.float_to_bytearray (Force ) + payload += conversions.float_to_bytearray (SafetyVolume ) + payload += conversions.unsigned_integer_to_bytearray(Status ) + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.td_sync_broadcast_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_SYRINGE_PUMP_DATA.value, + payload=payload) + + self.can_interface.send(message, 0) + + def td_voltage(self, line_1_2v : float, line_3_3v : float, line_logic_5v : float, @@ -367,6 +412,7 @@ self.can_interface.send(message, 0) + def td_pressure(self, H2_arterial_pressure : float , H14_venous_pressure : float , @@ -749,6 +795,31 @@ self.can_interface.send(message, 0) + def td_dry_bicart_disconnect_data(self, vShowDialog : int, + vTotal : int, + vProgress : int, + vDrainInProgress : int, + vDepressurizeInProgress : int): + """ + rinseback progress message (Msg ID: 0x8F, 143) + Args: + @param vTimeout : (int) Total Timeout of Recirculate delivery + @param vCountdown : (int) Current Timeout count down of Recirculate delivery + @return: None + """ + payload = conversions.integer_to_bytearray ( vShowDialog ) + payload += conversions.integer_to_bytearray ( vTotal ) + payload += conversions.integer_to_bytearray ( vProgress ) + payload += conversions.integer_to_bytearray ( vDrainInProgress ) + payload += conversions.integer_to_bytearray ( vDepressurizeInProgress ) + + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_DRY_BICARD_DISCONNECT_DATA.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_recirculate_progress(self, vTimeout: int, vCountdown: int): """ @@ -768,6 +839,25 @@ self.can_interface.send(message, 0) + def td_dry_bicart_cmd_response(self, vAccepted: int, vRejectionReason: int): + """ + rinseback command response message (Msg ID: 0xC6, 145) + Args: + @param vRejectionReason : (int) rejection reason + @return: None + """ + payload = conversions.integer_to_bytearray(vAccepted) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_DRY_BICARD_DISCONNECT_RESPONSE.value, + payload=payload) + + self.can_interface.send(message, 0) + + + def td_recirculate_cmd_response(self, vAccepted: int, vRejectionReason: int): """ rinseback command response message (Msg ID: 0x99, 145) @@ -2114,8 +2204,8 @@ payload += conversions.float_to_bytearray(tmpPressure ) payload += conversions.float_to_bytearray(dialysate_temp ) - message = CAN.DenaliMessage.build_message( - channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message = CAN.CanMessage.build_message( + channel_id=CAN.CanChannels.td_to_ui_ch_id, message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_LOG_AVERAGE_DATA.value, payload=payload)