Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -ra102c40e71891cb6d3918229f934b18e01d5b964 -r0077b2a87fc60618207360e1a2104f78cf4d311a --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision a102c40e71891cb6d3918229f934b18e01d5b964) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 0077b2a87fc60618207360e1a2104f78cf4d311a) @@ -125,6 +125,8 @@ 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_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 MSG_ID_TD_TESTER_LOGIN_REQUEST = 0x8000 @@ -336,4 +338,4 @@ MSG_ID_FP_DEBUG_EVENT = 0xFFF3 - MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK = 0xFFFF \ No newline at end of file + MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK = 0xFFFF Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -reb3e8ec85b8c2cfd7215d762117c617b8084be45 -r0077b2a87fc60618207360e1a2104f78cf4d311a --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision eb3e8ec85b8c2cfd7215d762117c617b8084be45) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 0077b2a87fc60618207360e1a2104f78cf4d311a) @@ -803,7 +803,48 @@ payload=payload) self.can_interface.send(message, 0) - + + + def td_treatment_log_alarm(self, alarm_id: int, parameter1: float, parameter2: float) -> None: + """ + send the treatment log data + @param alarm_id: (U32) alarm ID + @param parameter1: (F32) paramter 1 (it's not clear yet how many paramters with what type is required and this is only plceholder) + @param parameter2: (F32) paramter 2 (it's not clear yet how many paramters with what type is required and this is only plceholder) + @return: None + """ + payload = conversions.integer_to_bytearray(alarm_id) + payload += conversions.float_to_bytearray(parameter1) + payload += conversions.float_to_bytearray(parameter2) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_LOG_ALARM_EVENT.value, + payload=payload) + + self.can_interface.send(message, 0) + + + def td_treatment_log_event(self, event_id: int, old_value: float, new_value: float) -> None: + """ + send the treatment log data + @param event_id: (U32) alarm ID + @param old_value: (F32) the old value + @param new_value: (F32) the new value + @return: none + """ + payload = conversions.integer_to_bytearray(event_id) + payload += conversions.float_to_bytearray(old_value) + payload += conversions.float_to_bytearray(new_value) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_LOG_EVENT.value, + payload=payload) + + self.can_interface.send(message, 0) + + def cmd_send_general_response(self, message_id: int, accepted: int, reason: int, is_pure_data: bool = False, has_parameters: bool = False,