Index: leahi_dialin/dd/modules/gen_dialysate.py =================================================================== diff -u -rf0566e1e902b870166c829ec82cd2605efac62b0 -r39190f5b592ef515e19ae1b5455a32b84f853cf5 --- leahi_dialin/dd/modules/gen_dialysate.py (.../gen_dialysate.py) (revision f0566e1e902b870166c829ec82cd2605efac62b0) +++ leahi_dialin/dd/modules/gen_dialysate.py (.../gen_dialysate.py) (revision 39190f5b592ef515e19ae1b5455a32b84f853cf5) @@ -66,14 +66,26 @@ @param message: published gen dialysate data message @return: None """ - self.execution_state = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.dialysate_delivery_in_progress = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] - self.dialysate_good_to_deliver = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] - self.target_qd = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + sensor_list =[] + sensor_list.append(['self.execution_state', 'I']) + sensor_list.append(['self.dialysate_delivery_in_progress', 'I']) + # sensor_list.append(['self.d6_level', 'I']) + # sensor_list.append(['self.d63_level', 'f']) + # sensor_list.append(['self.d46_level', 'I']) + # sensor_list.append(['self.d9_pressure', 'f']) + # sensor_list.append(['self.d18_pressure', 'f']) + # sensor_list.append(['self.d51_pressure', 'f']) + sensor_list.append(['self.dialysate_good_to_deliver', 'I']) + sensor_list.append(['self.target_qd', 'f']) + + i = 1 + for sensor in sensor_list: + start_pos = eval(f'MsgFieldPositions.START_POS_FIELD_{i}') + end_pos = eval(f'MsgFieldPositions.END_POS_FIELD_{i}') + value = struct.unpack(sensor[1],bytearray(message['message'][start_pos:end_pos]))[0] + exec(f'{sensor[0]} = {value}') + i += 1 + self.dd_gen_dialysate_timestamp = timestamp Index: leahi_dialin/fp/filtration_purification.py =================================================================== diff -u -rfd6f015b1ff68a2ee15187722ec21b8898fce10c -r39190f5b592ef515e19ae1b5455a32b84f853cf5 --- leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision fd6f015b1ff68a2ee15187722ec21b8898fce10c) +++ leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision 39190f5b592ef515e19ae1b5455a32b84f853cf5) @@ -94,9 +94,9 @@ self.can_interface.register_receiving_publication_function(channel_id, MsgIds.MSG_ID_FP_DEF_STATUS_RESPONSE.value, self._handler_fp_defeatured_response) - self.can_interface.register_receiving_publication_function(channel_id, - MsgIds.MSG_ID_FP_DEF_STATUS_RESPONSE.value, - self._handler_fp_boost_pump_installed_response) + # self.can_interface.register_receiving_publication_function(channel_id, + # MsgIds.MSG_ID_FP_DEF_STATUS_RESPONSE.value, + # self._handler_fp_boost_pump_installed_response) # Dialin will send a login message during construction. This is for the leahi subsystems to start # publishing CAN data when there is no UI connected as the UI typically does this job. self.cmd_log_in_to_fp() @@ -260,23 +260,16 @@ @return: 1 if successful, zero otherwise """ + return cmd_generic_override( + payload = None, + reset = NO_RESET, + channel_id = DenaliChannels.dialin_to_fp_ch_id, + msg_id = MsgIds.MSG_ID_FP_DEF_STATUS_REQUEST, + entity_name = 'FP Defeatured Status', + override_text = '', + logger = self.logger, + can_interface = self.can_interface) - message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_fp_ch_id, - message_id=MsgIds.MSG_ID_FP_DEF_STATUS_REQUEST.value) - - self.logger.debug('Getting FP defeatured status') - received_message = self.can_interface.send(message) - - # If there is content... - if received_message is not None: - self.logger.debug("Received FW ACK after requesting FP defeatured configuration record.") - # response payload is OK or not OK - return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] - else: - self.logger.debug("Timeout!!!!") - return False - - def cmd_request_boost_pump_install_status(self) -> int: """ Constructs and sends the FP defeatured status request