Index: leahi_dialin/common/__init__.py =================================================================== diff -u -rcdc6acfe393fcc90595116cf478725e16eba7f28 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/common/__init__.py (.../__init__.py) (revision cdc6acfe393fcc90595116cf478725e16eba7f28) +++ leahi_dialin/common/__init__.py (.../__init__.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -1,10 +1,6 @@ import os import json -# mandatory import -from .msg_defs import * -from .msg_ids import * - file_name = "config.json" sw_key = "SW" config = {} @@ -25,5 +21,7 @@ from .dd_defs_proxy import dd_enum_repository from .disp_defs_proxy import disp_enum_repository from .fp_defs_proxy import fp_enum_repository + from .msg_defs import * + from .msg_ids import * from .td_defs_proxy import td_enum_repository from .ui_defs import * Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -re9dfb2412b14f3d28824cb3e37c364b8194bb24e -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision e9dfb2412b14f3d28824cb3e37c364b8194bb24e) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -210,14 +210,26 @@ MSG_ID_UI_VITALS_ADJUSTMENT_REQUEST = 0xB8 # UI vitals adjustment request MSG_ID_TD_VITALS_ADJUSTMENT_RESPONSE = 0xB9 # TD vitals adjustment response + MSG_ID_TD_PRIME_PROGRESS_DATA = 0xC7 + MSG_ID_UI_SETUP_TUBING_SET_CONNECTIONS_CONFIRM_REQUEST = 0xD6 # UI setup connection confirmation request MSG_ID_TD_SETUP_TUBING_SET_CONNECTIONS_CONFIRM_RESPONSE = 0xD7 # TD setup connection confirmation response - + MSG_ID_TD_POST_FINAL_TEST_RESULT = 0xD8 + MSG_ID_TD_POST_SINGLE_TEST_RESULT = 0xD9 + MSG_ID_TD_UI_CANCEL_REQUEST = 0xDA MSG_ID_DD_SUBSTITUTION_PUMP_DATA = 0xDB # DD substitution pump broadcast data. MSG_ID_DD_CONDUCTIVITY_SENSOR_RESISTANCE_DATA = 0xDC # DD conductivity resistance data broadcast. MSG_ID_FP_FILTER_FLUSH_DATA = 0xDD # FP Filter Flush broadcast data MSG_ID_FP_PERMEATE_FLUSH_DATA = 0xDE # FP Permeate Flush broadcast data + MSG_ID_UI_RO_WATER_MODE_REQUEST = 0xEB + MSG_ID_DD_RO_WATER_MODE_RESPONSE = 0xEC + MSG_ID_UI_ADJUST_RO_WATER_MODE_REQUEST = 0xED + MSG_ID_DD_ADJUST_RO_WATER_MODE_RESPONSE = 0xEE + TBD_EF = 0xEF + MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 + + MSG_ID_UI_DD_NVM_GET_SYSTEM_RECORD_REQUEST = 0x100 # DD NVM Get System Record Request MSG_ID_DD_UI_NVM_GET_SYSTEM_RECORD_RESPONSE = 0x101 # DD NVM Get System Record Response MSG_ID_UI_DD_NVM_SET_SYSTEM_RECORD_REQUEST = 0x102 # DD NVM Set System Record Request Index: leahi_dialin/common/td_defs_proxy.py =================================================================== diff -u -rbe799e12803dba3054ff893b68f8b79a9dde440b -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/common/td_defs_proxy.py (.../td_defs_proxy.py) (revision be799e12803dba3054ff893b68f8b79a9dde440b) +++ leahi_dialin/common/td_defs_proxy.py (.../td_defs_proxy.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -116,5 +116,4 @@ # Record support - td_enum_repository = TD_Defs() Index: leahi_dialin/common/test_config_defs.py =================================================================== diff -u -r2755d8bacf159cf1aefb2d8377ec1475f544bbe9 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/common/test_config_defs.py (.../test_config_defs.py) (revision 2755d8bacf159cf1aefb2d8377ec1475f544bbe9) +++ leahi_dialin/common/test_config_defs.py (.../test_config_defs.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -14,10 +14,13 @@ # ############################################################################ +# Module import from enum import unique -from ..utils.enums import DialinEnum +# Project import +from leahi_dialin.utils.enums import DialinEnum + @unique class DDFPTestConfigOptions(DialinEnum): TEST_CONFIG_DD_FP_ENABLE_BETA_1_HW = 0 # (DD & FP) Test configuration using Beta 1.0 Hardware Index: leahi_dialin/dd/modules/blood_leak.py =================================================================== diff -u -r436742844a3fbbb6a3b0bc81dc87bc6385c3e368 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/dd/modules/blood_leak.py (.../blood_leak.py) (revision 436742844a3fbbb6a3b0bc81dc87bc6385c3e368) +++ leahi_dialin/dd/modules/blood_leak.py (.../blood_leak.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -17,6 +17,7 @@ # Module imports from logging import Logger from enum import unique +import time from typing import Union # Project imports @@ -90,18 +91,20 @@ # Initialize all the embedded mode commands self.blood_leak_emb_mode_cmds[cmd] = '' + self.handler_execution_times = [] + # ============================================================ Properties ============================================================ @property - def blood_leak_detected(self) -> bool: + def blood_leak_status(self) -> bool: """ The Blood Leak Detected Status """ return self._blood_leak_detected - @blood_leak_detected.setter - def blood_leak_detected(self, value: bool): + @blood_leak_status.setter + def blood_leak_status(self, value: bool): self._blood_leak_detected = value @@ -244,6 +247,7 @@ @param message: published blood leak status message @return: None """ + start = time.perf_counter() msg_list =[] msg_list.append((type(self).blood_leak_status, DataTypes.BOOL)) msg_list.append((type(self).blood_leak_state, DataTypes.U32)) @@ -258,6 +262,7 @@ self.process_into_vars(decoder_list = msg_list, message = message) self.dd_blood_leak_status_timestamp = timestamp + self.handler_execution_times.append((timestamp, message, time.perf_counter() - start)) @publish(['msg_id_dd_send_blood_leak_emb_mode_response', 'blood_leak_emb_mode_cmd_response', Index: leahi_dialin/dd/modules/ultrafiltration.py =================================================================== diff -u -r81e359d6c7ced081bd4580ec3e6cc38939781c6a -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/dd/modules/ultrafiltration.py (.../ultrafiltration.py) (revision 81e359d6c7ced081bd4580ec3e6cc38939781c6a) +++ leahi_dialin/dd/modules/ultrafiltration.py (.../ultrafiltration.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -16,6 +16,7 @@ # Module imports from logging import Logger +import time from typing import Union # Project imports @@ -55,6 +56,7 @@ self.uf_rate = 0.0 self.compensated_uf_rate = 0.0 self.is_uf_requested = False + self.handler_execution_times = [] @@ -122,6 +124,7 @@ @param message: published ultrafiltration data message @return: None """ + start = time.perf_counter() msg_list =[] # msg_list.append((type(self).uf_exec_state, DataTypes.U32)) msg_list.append((type(self).uf_rate, DataTypes.F32)) @@ -130,6 +133,7 @@ self.process_into_vars(decoder_list = msg_list, message = message) self.uf_timestamp = timestamp + self.handler_execution_times.append((timestamp, message, time.perf_counter() - start)) Index: leahi_dialin/fp/filtration_purification.py =================================================================== diff -u -rb7d86216a91c9fbf74af7c6233ed0b6eaf74cd75 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision b7d86216a91c9fbf74af7c6233ed0b6eaf74cd75) +++ leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -342,22 +342,17 @@ @return: 1 if successful, zero otherwise """ - message = CanMessage.build_message(channel_id=CanChannels.dialin_to_fp_ch_id, - message_id=MsgIds.MSG_ID_FP_DEF_STATUS_REQUEST.value) + return cmd_generic_override( + payload = None, + reset = NO_RESET, + channel_id = CanChannels.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) - 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'][CanMessage.PAYLOAD_START_INDEX] - else: - self.logger.debug("Timeout!!!!") - return False - - def cmd_request_boost_pump_install_status(self) -> int: """ Constructs and sends the FP Boost Pump Installed status request @@ -366,24 +361,17 @@ @return: 1 if successful, zero otherwise """ - # ToDo: Update the msg id when FW part of LDT-3779 is implemented - message = CanMessage.build_message(channel_id=CanChannels.dialin_to_fp_ch_id, - message_id=MsgIds.MSG_ID_FP_BOOST_PUMP_INSTALL_STATUS_REQUEST.value) + return cmd_generic_override( + payload = None, + reset = NO_RESET, + channel_id = CanChannels.dialin_to_fp_ch_id, + msg_id = MsgIds.MSG_ID_FP_BOOST_PUMP_INSTALL_STATUS_REQUEST, + entity_name = 'FP P40 Boost Pump installed status', + override_text = '', + logger = self.logger, + can_interface = self.can_interface) - self.logger.debug('Getting FP P40 Boost Pump installed 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 P40 Boost Pump installed configuration record.") - # response payload is OK or not OK - return received_message['message'][CanMessage.PAYLOAD_START_INDEX] - else: - self.logger.debug("Timeout!!!!") - return False - - - def cmd_op_mode_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the measured op mode broadcast interval override command Index: leahi_dialin/td/modules/alarms.py =================================================================== diff -u -r6caa49d072aceb2655d605de5d2eea52ab1a8911 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/td/modules/alarms.py (.../alarms.py) (revision 6caa49d072aceb2655d605de5d2eea52ab1a8911) +++ leahi_dialin/td/modules/alarms.py (.../alarms.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -566,8 +566,8 @@ @return: none """ - for x in range(self.alarm_states): - self.alarm_states[x] = False + for i in range(0, len(self.alarm_states)): + self.alarm_states[i] = False def get_dialin_alarms(self) -> dict: Index: leahi_dialin/td/modules/blood_pressure.py =================================================================== diff -u -r489ce5ef49041b863501b7fecd6e4716e7dcaa9f -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/td/modules/blood_pressure.py (.../blood_pressure.py) (revision 489ce5ef49041b863501b7fecd6e4716e7dcaa9f) +++ leahi_dialin/td/modules/blood_pressure.py (.../blood_pressure.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -16,6 +16,7 @@ # Module imports from logging import Logger +import time from typing import Union # Project imports @@ -135,13 +136,15 @@ @param message: published data message @return: none """ + start = time.perf_counter() msg_list =[] msg_list.append((type(self).systolic, DataTypes.U32)) msg_list.append((type(self).diastolic, DataTypes.U32)) msg_list.append((type(self).heart_rate, DataTypes.U32)) self.process_into_vars(decoder_list = msg_list, message = message) self.blood_pressure_timestamp = timestamp + self.handler_bp_time.append((timestamp, message, time.perf_counter() - start)) @publish(["MSG_ID_TD_BLOOD_PRESSURE_READING", "ack", "reject_reason", "rr_timestamp"]) @@ -152,12 +155,14 @@ @param message: published data message @return: none """ + start = time.perf_counter() msg_list =[] msg_list.append((type(self).ack, DataTypes.BOOL)) msg_list.append((type(self).reject_reason, DataTypes.U32)) self.process_into_vars(decoder_list = msg_list, message = message) self.rr_timestamp = timestamp + self.handler_bp_rr_time.append((timestamp, message, time.perf_counter() - start)) Index: leahi_dialin/td/modules/syringe_pump.py =================================================================== diff -u -r6caa49d072aceb2655d605de5d2eea52ab1a8911 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/td/modules/syringe_pump.py (.../syringe_pump.py) (revision 6caa49d072aceb2655d605de5d2eea52ab1a8911) +++ leahi_dialin/td/modules/syringe_pump.py (.../syringe_pump.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -73,7 +73,7 @@ @property def syringe_pump_state(self) -> TDTreaSyringePumpStates: """ - The Srynge Pump State + The Syringe Pump State """ return self._syringe_pump_state Index: leahi_dialin/td/modules/treatment.py =================================================================== diff -u -r489ce5ef49041b863501b7fecd6e4716e7dcaa9f -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/td/modules/treatment.py (.../treatment.py) (revision 489ce5ef49041b863501b7fecd6e4716e7dcaa9f) +++ leahi_dialin/td/modules/treatment.py (.../treatment.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -16,11 +16,13 @@ # Module imports from logging import Logger +import time # Project imports from leahi_dialin.common.constants import NO_RESET from leahi_dialin.common.generic_defs import DataTypes from leahi_dialin.common.msg_ids import MsgIds +from leahi_dialin.common.msg_ids import MsgIds from leahi_dialin.common.override_templates import cmd_generic_override from leahi_dialin.common import td_enum_repository from leahi_dialin.protocols.CAN import CanMessenger, CanChannels @@ -119,6 +121,7 @@ # Treatment Parameters Data. Most recent response. self.tx_param_req_timestamp = 0 #: The timestamp of the latest Treatment Parameters Request message + self.handler_execution_times = [] self.treatment_paramters = { 'blood_flow_rate': 0, # The Blood flow rate 'dialysate_flow_rate': 0, # The Dialysate flow rate @@ -228,6 +231,7 @@ @param message: published treatment parameter range data message @return: none """ + start = time.perf_counter() msg_list = [] msg_list.append((self.treatment_param_ranges, 'min_tx_time', DataTypes.U32)) msg_list.append((self.treatment_param_ranges, 'max_tx_time', DataTypes.U32)) @@ -238,6 +242,7 @@ self.process_into_vars(decoder_list = msg_list, message = message) self.tx_params_timestamp = timestamp + self.handler_execution_times.append((timestamp, message, time.perf_counter() - start)) @publish(["MSG_ID_TD_FLUID_BOLUS_DATA", "tgt_saline_volume","cum_saline_volume","bol_saline_volume", Index: leahi_dialin/td/proxies/ui_proxy.py =================================================================== diff -u -r63dcccf308248c312b5f82b65f46605e6d90402d -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/td/proxies/ui_proxy.py (.../ui_proxy.py) (revision 63dcccf308248c312b5f82b65f46605e6d90402d) +++ leahi_dialin/td/proxies/ui_proxy.py (.../ui_proxy.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -21,8 +21,8 @@ # Project imports from leahi_dialin.common.constants import ACCEPTED from leahi_dialin.common.generic_defs import DataTypes -from leahi_dialin.common.msg_ids import MsgIds from leahi_dialin.common.msg_defs import RequestRejectReasons +from leahi_dialin.common.msg_ids import MsgIds from leahi_dialin.common.override_templates import cmd_generic_override from leahi_dialin.protocols.CAN import CanMessenger, CanChannels from leahi_dialin.utils.abstract_classes import AbstractSubSystem Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -re1ae66e77d235a2726783b4e9560320da4c1a172 -r0762e3a03157e5f3428387a6914a13ed38d3ddca --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision e1ae66e77d235a2726783b4e9560320da4c1a172) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 0762e3a03157e5f3428387a6914a13ed38d3ddca) @@ -575,7 +575,7 @@ message = CAN.CanMessage.build_message( channel_id=CAN.CanChannels.td_sync_broadcast_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_SALINE_BOLUS_DATA.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_FLUID_BOLUS_DATA.value, payload=payload) self.can_interface.send(message, 0) @@ -1015,7 +1015,7 @@ message = CAN.CanMessage.build_message( channel_id=CAN.CanChannels.td_to_ui_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_BLOOD_PRESSURE_RESPONSE.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_BLOOD_PRESSURE_READING.value, payload=payload) self.can_interface.send(message, 0) @@ -1643,7 +1643,7 @@ message = CAN.CanMessage.build_message( channel_id=CAN.CanChannels.td_to_ui_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_UI_CONFIRMATION_REQUEST.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_UI_GENERIC_CONFIRMATION_REQUEST.value, payload=payload) self.can_interface.send(message, 0) @@ -1761,7 +1761,7 @@ message = CAN.CanMessage.build_message( channel_id=CAN.CanChannels.td_to_ui_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_SETUP_CONNECTION_CONFIRM_RESPONSE.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_SETUP_TUBING_SET_CONNECTIONS_CONFIRM_RESPONSE.value, payload=payload) self.can_interface.send(message, 0) @@ -1882,7 +1882,7 @@ message = CAN.CanMessage.build_message( channel_id=CAN.CanChannels.td_to_ui_ch_id, - message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_PATIENT_DISCONNECT_CONFIRM_RESPONSE.value, + message_id=msg_ids.MsgIds.MSG_ID_TD_PATIENT_DISCONNECT_CONFIRM_RESPONSE.value, payload=payload) self.can_interface.send(message, 0)