Index: leahi_dialin/dd/modules/records.py =================================================================== diff -u -rf65ed90f5f8af7672ae59bc5450d1a4f8935d041 -rf6b74a922cea4bd0cc195719e808028e50a5af8c --- leahi_dialin/dd/modules/records.py (.../records.py) (revision f65ed90f5f8af7672ae59bc5450d1a4f8935d041) +++ leahi_dialin/dd/modules/records.py (.../records.py) (revision f6b74a922cea4bd0cc195719e808028e50a5af8c) @@ -47,83 +47,83 @@ if self.can_interface is not None: # Data Request Response messages self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SYSTEM_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_system_record_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SERVICE_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_service_record_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_PRESSURE_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_pres_sensor_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_TEMP_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_temp_sensor_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_CONC_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_conc_pump_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_D12_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_dial_pump_d12_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_D48_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_dial_pump_d48_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_ACID_CONCENTRATE_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_acid_conc_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_BICARB_CONCENTRATE_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_bicarb_conc_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_ACCEL_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_accelerometer_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_CAL_BLOOD_LEAK_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_calibration_record_blood_leak_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_INSTITUTIONAL_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_institutional_record_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_USAGE_INFO_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_usage_info_record_sync) # Set Data Response messages self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_SYSTEM_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_system_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_SERVICE_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_service_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_PRESSURE_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_pressure_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_TEMP_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_temp_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_CONC_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_conc_pump_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_D12_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_d12_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_D48_PUMP_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_d48_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_ACID_CONCENTRATE_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_acid_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_BICARB_CONCENTRATE_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_bicarb_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_ACCEL_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_accel_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_CAL_BLOOD_LEAK_SENSOR_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_cal_blood_leak_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_INSTITUTIONAL_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_institutional_rr_sync) self.can_interface.register_receiving_publication_function(channel_id = CanChannels.dd_sync_broadcast_ch_id, - message_id = MsgIds.MSG_ID_DD_NVM_SET_USAGE_INFO_RECORD_RESPONSE.value, + message_id = MsgIds.MSG_ID_UNUSED.value, function = self._handler_usage_info_rr_sync) @@ -847,7 +847,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_DD_SET_OPERATION_MODE_OVERRIDE_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = 'DD Operation Mode', override_text = f'set to {service_mode.name}', logger = self.logger, @@ -871,7 +871,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_GET_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD System Record request', override_text = '', logger = self.logger, @@ -893,7 +893,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_GET_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD Service Record request', override_text = '', logger = self.logger, @@ -915,7 +915,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_GET_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD Calibration Record request', override_text = '', logger = self.logger, @@ -937,7 +937,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_GET_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD Institutional Record request', override_text = '', logger = self.logger, @@ -959,7 +959,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_GET_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD Usage Information Record request', override_text = '', logger = self.logger, @@ -1000,7 +1000,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_SET_SYSTEM_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'New DD System Record', override_text = 'being set', logger = self.logger, @@ -1034,7 +1034,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_SET_SERVICE_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'New DD Service Record', override_text = 'being set', logger = self.logger, @@ -1052,14 +1052,14 @@ @return: 1 if successful, zero otherwise """ msg_id_pairing = { - 'PRES': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_PRESSURE_SENSOR_REQUEST, - 'TEMP': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_TEMP_SENSOR_REQUEST, - 'CONC': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_CONC_PUMP_REQUEST, - 'DIAL': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D48_PUMP_REQUEST, - 'ACID': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_ACID_CONCENTRATE_REQUEST, - 'BICARB': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_BICARB_CONCENTRATE_REQUEST, - 'ACCEL': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_ACCEL_SENSOR_REQUEST, - 'BLOOD_LEAK': MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_BLOOD_LEAK_SENSOR_REQUEST, + 'PRES': MsgIds.MSG_ID_UNUSED, + 'TEMP': MsgIds.MSG_ID_UNUSED, + 'CONC': MsgIds.MSG_ID_UNUSED, + 'DIAL': MsgIds.MSG_ID_UNUSED, + 'ACID': MsgIds.MSG_ID_UNUSED, + 'BICARB': MsgIds.MSG_ID_UNUSED, + 'ACCEL': MsgIds.MSG_ID_UNUSED, + 'BLOOD_LEAK': MsgIds.MSG_ID_UNUSED, } # Make a dictionary to store all the send functions for later send send_data = [] @@ -1102,7 +1102,7 @@ kwargs['sensor_enum'] = sensor if sensor == dd_enum_repository.DDDialysatePumpNames.D12_PUMP: - kwargs['msg_id'] = MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D12_PUMP_REQUEST + kwargs['msg_id'] = MsgIds.MSG_ID_UNUSED else: kwargs['msg_id'] = msg_id_pairing[group] @@ -1289,7 +1289,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_SET_INSTITUTIONAL_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'DD Institutional Record', override_text = 'being set', logger = self.logger, @@ -1339,7 +1339,7 @@ payload = payload, reset = None, channel_id = CanChannels.dialin_to_dd_ch_id, - msg_id = MsgIds.MSG_ID_UI_DD_NVM_SET_USAGE_INFO_RECORD_REQUEST, + msg_id = MsgIds.MSG_ID_UNUSED, entity_name = f'New DD Usage Information Record', override_text = 'being set', logger = self.logger, @@ -1363,7 +1363,7 @@ else: payload_sensor = byte_to_bytearray(sensor_enum.value) payload_content = b'' - if msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D12_PUMP_REQUEST: + if msg_id == MsgIds.MSG_ID_UNUSED: payload_content += float_to_bytearray(dialysate_pump_target_speed) else: payload_content += float_to_bytearray(fourth_order_coeff) @@ -1373,19 +1373,19 @@ payload_content += float_to_bytearray(offset) payload_content += integer_to_bytearray(calibration_time) payload_content += unsigned_short_to_bytearray(self.crc16(payload_content)) - if msg_id in [MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D12_PUMP_REQUEST, MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D48_PUMP_REQUEST]: + if msg_id in [MsgIds.MSG_ID_UNUSED, MsgIds.MSG_ID_UNUSED]: payload = payload_content else: payload = payload_sensor + payload_content sensor_type = '' - if msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_PRESSURE_SENSOR_REQUEST: + if msg_id == MsgIds.MSG_ID_UNUSED: sensor_type = 'Pressure Sensor' - elif msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_TEMP_SENSOR_REQUEST: + elif msg_id == MsgIds.MSG_ID_UNUSED: sensor_type = 'Temperature Sensor' - elif msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_CONC_PUMP_REQUEST: + elif msg_id == MsgIds.MSG_ID_UNUSED: sensor_type = 'Concentrate Pump' - elif msg_id in [MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D12_PUMP_REQUEST, MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_D48_PUMP_REQUEST]: + elif msg_id in [MsgIds.MSG_ID_UNUSED, MsgIds.MSG_ID_UNUSED]: sensor_type = 'Dialysate Pump' return cmd_generic_override(payload = payload, @@ -1417,9 +1417,9 @@ payload = payload_sensor + payload_content conc_type = '' - if msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_ACID_CONCENTRATE_REQUEST: + if msg_id == MsgIds.MSG_ID_UNUSED: conc_type = 'Acid' - elif msg_id == MsgIds.MSG_ID_UI_DD_NVM_SET_CAL_BICARB_CONCENTRATE_REQUEST: + elif msg_id == MsgIds.MSG_ID_UNUSED: conc_type = 'Bicarb' return cmd_generic_override(payload = payload,