Index: dialin/common/msg_defs.py =================================================================== diff -u -rcd9d98248537d10d9cf188307ae2237c8cf8e6e4 -r70fb122058d520cbbbe922518d8d50b2dec5e2e4 --- dialin/common/msg_defs.py (.../msg_defs.py) (revision cd9d98248537d10d9cf188307ae2237c8cf8e6e4) +++ dialin/common/msg_defs.py (.../msg_defs.py) (revision 70fb122058d520cbbbe922518d8d50b2dec5e2e4) @@ -8,7 +8,7 @@ # @file msg_defs.py # # @author (last) Peter Lucia -# @date (last) 07-Aug-2020 +# @date (last) 14-Oct-2020 # @author (original) Peter Lucia # @date (original) 07-Aug-2020 # @@ -75,8 +75,9 @@ MSG_ID_DG_HEAT_DISINFECT_DATA = 0x37 # DG heat disinfection publish data MSG_ID_UI_START_TREATMENT = 0x38 # UI user request to initiate a treatment MSG_ID_HD_START_TREATMENT_RESPONSE = 0x39 # HD response to user request to initiate a treatment - MSG_ID_HD_VALVES_DATA = 0x3A # HD broadcast of valves data - MSG_ID_UI_USER_CONFIRM_TREATMENT_PARAMS = 0x3B # UI user confirmation of treatment parameters + MSG_ID_UI_ALARM_ACKNOWLEDGE = 0x3F # UI Tells HD an alarm has been acknowledged + MSG_ID_HD_VALVES_DATA = 0x3B # HD broadcast of valves data + MSG_ID_UI_USER_CONFIRM_TREATMENT_PARAMS = 0x3A # UI user confirmation of treatment parameters MSG_ID_UI_TREATMENT_END_REQUEST = 0x3C # UI user treatment end request MSG_ID_HD_TREATMENT_END_RESPONSE = 0x3D # HD response to user request to end treatment MSG_ID_HD_AIR_TRAP_DATA = 0x003E # HD broadcast of air trap data @@ -180,9 +181,9 @@ MSG_ID_HEAT_DISINFECT_RSRVR2_TO_RSRVR1_DURATION_MINS = 0xA01F # Heat disinfection reservoir 2 to reservoir 1 duration in minutes MSG_ID_HEAT_DISINFECT_NO_OF_CYCLES_TO_RUN = 0xA020 # Heat disinfection number of cycles to run MSG_ID_HEAT_DISINFECT_PUBLISH_INTERVAL_OVERRIDE = 0xA021 # Heat disinfection data publish interval override request + MSG_ID_PRIMING_STATUS = 0x0037 # The priming status MSG_ID_DG_SOFTWARE_RESET_REQUEST = 0xA022 # DG reset request MSG_ID_HD_VALVES_SET_BLOOD_TRAP_VALVE = 0x8030 # HD valves set blood trap valve state - MSG_ID_HD_DEBUG_EVENT = 0xFFF1 # HD debug event text to be logged in event log MSG_ID_DG_DEBUG_EVENT = 0xFFF2 # DG debug event text to be logged in event log Index: dialin/hd/alarms.py =================================================================== diff -u -r400926d021c357856375c533e8b0f985fa312b20 -r70fb122058d520cbbbe922518d8d50b2dec5e2e4 --- dialin/hd/alarms.py (.../alarms.py) (revision 400926d021c357856375c533e8b0f985fa312b20) +++ dialin/hd/alarms.py (.../alarms.py) (revision 70fb122058d520cbbbe922518d8d50b2dec5e2e4) @@ -17,6 +17,7 @@ DenaliChannels) from ..utils.conversions import integer_to_bytearray from ..utils.base import _AbstractSubSystem, _publish +from ..common.msg_defs import MsgIds from .constants import RESET, NO_RESET from collections import OrderedDict import struct @@ -29,14 +30,6 @@ HD interface containing alarm related commands. """ - # alarms message IDs - MSG_ID_HD_ALARMS_PUBLISHED_STATUS = 0x0002 - MSG_ID_HD_ALARM_ACTIVATE = 0x0003 - MSG_ID_HD_ALARM_CLEAR = 0x0004 - MSG_ID_HD_ALARM_LAMP_OVERRIDE = 0x8004 - MSG_ID_HD_ALARM_STATE_OVERRIDE = 0x8006 - MSG_ID_HD_ALARM_TIME_OVERRIDE = 0x8007 - # Alarm lamp patterns HD_ALARM_LAMP_PATTERN_OFF = 0 HD_ALARM_LAMP_PATTERN_OK = 1 @@ -77,16 +70,16 @@ if self.can_interface is not None: channel_id = DenaliChannels.hd_alarm_broadcast_ch_id - msg_id = self.MSG_ID_HD_ALARMS_PUBLISHED_STATUS + msg_id = MsgIds.MSG_ID_ALARM_STATUS.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_alarms_status_sync) channel_id = DenaliChannels.hd_alarm_broadcast_ch_id - msg_id = self.MSG_ID_HD_ALARM_ACTIVATE + msg_id = MsgIds.MSG_ID_ALARM_TRIGGERED.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_alarm_activate) channel_id = DenaliChannels.hd_alarm_broadcast_ch_id - msg_id = self.MSG_ID_HD_ALARM_CLEAR + msg_id = MsgIds.MSG_ID_ALARM_CLEARED.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_alarm_clear) @@ -101,10 +94,10 @@ self.alarm_states = [False] * 500 self.ids = OrderedDict() - for attr in dir(AlarmList): - if not callable(getattr(AlarmList, attr)) and attr.startswith("ALARM_ID"): - self.ids[attr] = getattr(AlarmList, attr) - self.ids = OrderedDict(sorted(self.ids.items(), key=lambda key: key[1].value)) +# for attr in dir(AlarmList): +# if not callable(getattr(AlarmList, attr)) and attr.startswith("ALARM_ID"): +# self.ids[attr] = getattr(AlarmList, attr) +# self.ids = OrderedDict(sorted(self.ids.items(), key=lambda key: key[1].value)) def get_alarm_states(self): """ @@ -245,7 +238,7 @@ payload = rst + sta + alm message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, - message_id=self.MSG_ID_HD_ALARM_STATE_OVERRIDE, + message_id=MsgIds.MSG_ID_HD_ALARM_STATE_OVERRIDE.value, payload=payload) # Send message @@ -281,7 +274,7 @@ payload = rst + ms + alm message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, - message_id=self.MSG_ID_HD_ALARM_TIME_OVERRIDE, + message_id=MsgIds.MSG_ID_HD_ALARM_TIME_OVERRIDE.value, payload=payload) self.logger.debug("override alarm time since activated") @@ -329,7 +322,7 @@ payload = rst + pat message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, - message_id=self.MSG_ID_HD_ALARM_LAMP_OVERRIDE, + message_id=MsgIds.MSG_ID_HD_ALARM_LAMP_OVERRIDE.value, payload=payload) self.logger.debug("Override Alarm Lamp Pattern") Index: dialin/hd/blood_flow.py =================================================================== diff -u -rcd9d98248537d10d9cf188307ae2237c8cf8e6e4 -r70fb122058d520cbbbe922518d8d50b2dec5e2e4 --- dialin/hd/blood_flow.py (.../blood_flow.py) (revision cd9d98248537d10d9cf188307ae2237c8cf8e6e4) +++ dialin/hd/blood_flow.py (.../blood_flow.py) (revision 70fb122058d520cbbbe922518d8d50b2dec5e2e4) @@ -87,15 +87,15 @@ """ return self.measured_blood_pump_speed - def get_measured_blood_pump_mc_speed(self): + def get_measured_blood_pump_motor_controller_speed(self): """ Gets the measured blood pump motor controller speed @return: The measured blood pump motor controller speed """ return self.measured_blood_pump_mc_speed - def get_measured_blood_pump_mc_current(self): + def get_measured_blood_pump_motor_controller_current(self): """ Gets the measured blood pump motor controller current @@ -243,7 +243,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_blood_pump_mc_measured_speed_override(self, speed, reset=NO_RESET): + def cmd_blood_pump_measured_motor_controller_speed_override(self, speed, reset=NO_RESET): """ Constructs and sends the measured blood pump motor controller speed \n override command. @@ -283,7 +283,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_measured_blood_pump_mc_current_override(self, curr, reset=NO_RESET): + def cmd_blood_pump_measured_motor_controller_current_override(self, curr, reset=NO_RESET): """ Constructs and sends the measured blood pump motor controller current override command Constraints: @@ -322,7 +322,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_blood_pump_measured_speed_override(self, speed, reset=NO_RESET): + def cmd_blood_pump_measured_motor_speed_override(self, speed, reset=NO_RESET): """ Constructs and sends the measured blood pump motor speed override \n command. Index: dialin/hd/hemodialysis_device.py =================================================================== diff -u -r527decd42c3e6730a33ff6b7635787d13f9400e5 -r70fb122058d520cbbbe922518d8d50b2dec5e2e4 --- dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 527decd42c3e6730a33ff6b7635787d13f9400e5) +++ dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 70fb122058d520cbbbe922518d8d50b2dec5e2e4) @@ -38,8 +38,8 @@ class HD(_AbstractSubSystem): """ - Hemodialysis Device (HD) Dialin object API. It provides the basic interface to communicate with - the HD firmware. + Hemodialysis Device (HD) Dialin object API. + It provides the basic interface to communicate with the HD firmware. """ # HD login password