Index: dialin/hd/ui_proxy.py =================================================================== diff -u -rcc42a0359151dc193b31bbd0dc5dc6f01f9eed39 -rd1534b2d731660d6b65aab5de4f4b6cfd55d2b93 --- dialin/hd/ui_proxy.py (.../ui_proxy.py) (revision cc42a0359151dc193b31bbd0dc5dc6f01f9eed39) +++ dialin/hd/ui_proxy.py (.../ui_proxy.py) (revision d1534b2d731660d6b65aab5de4f4b6cfd55d2b93) @@ -159,7 +159,10 @@ MsgIds.MSG_ID_HD_DISINFECT_STANDBY_DATA.value, self._handler_disinfects_data_publish) + self.can_interface.register_receiving_publication_function(DenaliChannels.hd_to_ui_ch_id, MsgIds.MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE.value, + self.handler_active_alarm_list_response) + self.hd_uf_settings_change_res_timestamp = 0.0 self.hd_uf_settings_change_confirm_res_timestamp = 0.0 self.hd_treatment_time_change_res_timestamp = 0.0 @@ -174,6 +177,7 @@ self.hd_recirc_res_timestamp = 0.0 self.hd_tx_end_cmd_res_timestamp = 0.0 self.hd_disinfection_standby_timestamp = 0.0 + self.hd_active_alarm_list_timestamp = 0.0 # initialize variables that will be populated by HD version response self.hd_version = None self.fpga_version = None @@ -222,6 +226,10 @@ # initialize variables that will be populated by response to treatment end command self.treatment_end_cmd_succeeded = False self.treatment_end_cmd_reject_reason = 0 + # initialize variables that will be populated by response to active alarm list cmd + self.active_alarm_list_succeeded = False + self.active_alarm_list_reject_reason = 0 + self.alarm_list_response = () self.reject_reasons = OrderedDict() for attr in RequestRejectReasons: @@ -459,6 +467,14 @@ """ return self.saline_bolus_request_bolus_volume + def get_active_alarm_list(self): + """ + Gets the HD alarm list. + + @return : the alarm list as a tuple + """ + return self.alarm_list_response + @publish([ "hd_version_res_timestamp" "hd_version", @@ -1040,6 +1056,43 @@ self.treatment_end_cmd_reject_reason = RequestRejectReasons(rea[0]) self.hd_tx_end_cmd_res_timestamp = timestamp + @publish([ + "hd_active_alarm_list_timestamp", + "active_alarm_list_succeeded", + "active_alarm_list_reject_reason", + "alarm_list_response", + ]) + def handler_active_alarm_list_response(self, message: dict, timestamp=0.0) -> None: + rsp = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] + rea = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + al1 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + al2 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + al3 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] + al4 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] + al5 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] + al6 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] + al7 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] + al8 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10]))[0] + al9 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_11:MsgFieldPositions.END_POS_FIELD_11]))[0] + al10 = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_12:MsgFieldPositions.END_POS_FIELD_12]))[0] + + self.active_alarm_list_succeeded = rsp + self.active_alarm_list_reject_reason = rea + self.alarm_list_response = (al1, al2, al3, al4, al5, al6, al7, al8, al9, al10) + self.hd_active_alarm_list_timestamp = timestamp + def cmd_ui_checkin_with_hd(self) -> None: """ Constructs and sends the ui check-in message