Index: dialin/common/alarm_defs.py =================================================================== diff -u -r19d246d9c099e1a15570767f82ca79502aff2776 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/common/alarm_defs.py (.../alarm_defs.py) (revision 19d246d9c099e1a15570767f82ca79502aff2776) +++ dialin/common/alarm_defs.py (.../alarm_defs.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -267,7 +267,7 @@ ALARM_ID_DG_TEMP_SENSORS_DIFF_OUT_OF_RANGE = 244 ALARM_ID_DG_HEAT_DISINFECT_TARGET_TEMP_TIMEOUT = 245 ALARM_ID_DG_HEAT_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT = 246 - ALARM_ID_DG_HEAT_DISINFECT_INLET_COND_AND_TEMP_OUT = 247 + ALARM_ID_DG_HEAT_DISINFECT_ACTIVE_COOL_TIME_OUT = 247 ALARM_ID_DG_CHEM_DISINFECT_TARGET_TEMP_TIMEOUT = 248 ALARM_ID_DG_CHEM_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT = 249 ALARM_ID_DG_CHEM_DISINFECT_INLET_COND_AND_TEMP_OUT = 250 Index: dialin/common/dg_defs.py =================================================================== diff -u -rf0cb1f298e3960769e0133172769deb9afe5a393 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/common/dg_defs.py (.../dg_defs.py) (revision f0cb1f298e3960769e0133172769deb9afe5a393) +++ dialin/common/dg_defs.py (.../dg_defs.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -30,8 +30,10 @@ DG_MODE_FLUS = 8 # Flush mode DG_MODE_HEAT = 9 # Heat Disinfect mode DG_MODE_CHEM = 10 # Chemical Disinfect mode - DG_MODE_NLEG = 11 # Not legal - an illegal mode transition occurred - NUM_OF_DG_MODES = 12 # Number of DG operation modes + DG_MODE_CHFL = 11 # Chemical Disinfect Flush mode + DG_MODE_HCOL = 12 # Heat Disinfect Active Cool mode + DG_MODE_NLEG = 13 # Not legal - an illegal mode transition occurred + NUM_OF_DG_MODES = 1 # Number of DG operation modes @unique @@ -201,6 +203,15 @@ @unique +class DGHeatDisinfectActiveCoolStates(DialinEnum): + DG_HEAT_DISINFECT_ACTIVE_COOL_STATE_START = 0 + DG_HEAT_DISINFECT_ACTIVE_COOL_STATE_COOL_DOWN_RO_FILTER = 1 + DG_HEAT_DISINFECT_ACTIVE_COOL_STATE_CANCEL_BASIC_PATH = 2 + DG_HEAT_DISINFECT_ACTIVE_COOL_STATE_COMPLETE = 3 + NUM_OF_DG_HEAT_DISINFECT_ACTIVE_COOL_STATES = 4 + + +@unique class DGChemicalDisinfectStates(DialinEnum): DG_CHEM_DISINFECT_STATE_START = 0 DG_CHEM_DISINFECT_STATE_DRAIN_R1 = 1 Index: dialin/common/msg_ids.py =================================================================== diff -u -r683488dfe7660d2021b2887afe955f409f7de2aa -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/common/msg_ids.py (.../msg_ids.py) (revision 683488dfe7660d2021b2887afe955f409f7de2aa) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -204,6 +204,16 @@ MSG_ID_HD_REQUEST_DG_ALARMS = 0xB5 MSG_ID_HD_REQUEST_DG_SERVICE_MODE = 0xB6 MSG_ID_DG_RTC_EPOCH = 0xB7 + MSG_ID_HD_REQUEST_DG_USAGE_INFO = 0xB8 + MSG_ID_HD_REQUEST_DG_SERVICE_RECORD = 0xB9 + MSG_ID_HD_REQUEST_UI_CONFIRMATION = 0xBA + MSG_ID_UI_CONFIRMATION_RESULT = 0xBB + MSG_ID_REQUEST_CPLD_STATUS = 0xBC + MSG_ID_DG_CPLD_STATUS = 0xBD + MSG_ID_HD_BATTERY_MANAGEMENT_DATA = 0xBE + MSG_ID_HD_BATTERY_STATUS_DATA = 0xBF + MSG_ID_DG_HEAT_DISINFECT_ACTIVE_COOL_DATA = 0xC0 + MSG_ID_DG_START_STOP_HEAT_DISINFECT_ACTIVE_COOL = 0xC1 MSG_ID_CAN_ERROR_COUNT = 0x999 Index: dialin/dg/calibration_record.py =================================================================== diff -u -rf0cb1f298e3960769e0133172769deb9afe5a393 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/calibration_record.py (.../calibration_record.py) (revision f0cb1f298e3960769e0133172769deb9afe5a393) +++ dialin/dg/calibration_record.py (.../calibration_record.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -13,18 +13,16 @@ # @date (original) 12-Feb-2021 # ############################################################################ -import os.path import struct -import sys import time from collections import OrderedDict from logging import Logger from time import sleep - from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import DenaliMessage, DenaliChannels from ..utils.base import AbstractSubSystem, publish -from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver +from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver, NVRecords +from ..utils.conversions import integer_to_bytearray class DGCalibrationNVRecord(AbstractSubSystem): @@ -157,6 +155,29 @@ self.logger.warning("Request cancelled: an existing request is in progress.") return False + def cmd_dg_calibration_record_crc_override(self, crc: int) -> bool: + + crc_value = integer_to_bytearray(crc) + dg_record = integer_to_bytearray(NVRecords.NVDATAMGMT_CALIBRATION_RECORD.value) + payload = crc_value + dg_record + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_NV_RECORD_CRC_OVERRIDE.value, + payload=payload) + + self.logger.debug("Overriding DG calibration record CRC to: " + str(crc)) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.error("Timeout!!!!") + return False + def _handler_dg_calibration_sync(self, message): """ Handles published DG calibration_record record messages. DG calibration records are captured for Index: dialin/dg/dialysate_generator.py =================================================================== diff -u -rbff28676dd855ea33707bbb26a624abc94aebdf0 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision bff28676dd855ea33707bbb26a624abc94aebdf0) +++ dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -32,6 +32,7 @@ from .gen_idle import GenIdle from .hd_proxy import DGHDProxy from .heat_disinfect import HeatDisinfect +from .heat_disinfect_active_cool import HeatDisinfectActiveCool from .heaters import Heaters from .load_cells import DGLoadCells from .pressures import DGPressures @@ -173,6 +174,7 @@ self.gen_idle = GenIdle(self.can_interface, self.logger) self.hd_proxy = DGHDProxy(self.can_interface, self.logger) self.heat_disinfect = HeatDisinfect(self.can_interface, self.logger) + self.heat_disinfect_active_cool = HeatDisinfectActiveCool(self.can_interface, self.logger) self.heaters = Heaters(self.can_interface, self.logger) self.load_cells = DGLoadCells(self.can_interface, self.logger) self.pressures = DGPressures(self.can_interface, self.logger) Index: dialin/dg/hd_proxy.py =================================================================== diff -u -r5eb006b08eb1d7b641b22fff20072ab7b685cfec -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision 5eb006b08eb1d7b641b22fff20072ab7b685cfec) +++ dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -273,6 +273,37 @@ self.logger.debug("Timeout!!!!") return False + def cmd_start_stop_dg_heat_disinfect_active_cool(self, start: bool = True) -> int: + """ + Constructs and sends the start/stop DG heat disinfect active cool command + + @param start: (bool) True = start heat disinfect active cool, False = stop heat disinfect active cool. + @return: non-zero integer if successful, False otherwise + """ + # 1 is to start + if start: + cmd = 1 + cmd_str = "Starting" + else: + cmd = 0 + cmd_str = "Stopping" + payload = integer_to_bytearray(cmd) + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_START_STOP_HEAT_DISINFECT_ACTIVE_COOL.value, + payload=payload) + + self.logger.debug(cmd_str + " DG heat disinfect active cool") + + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.debug("Timeout!!!!") + return False + def cmd_start_stop_dg_flush(self, start: bool = True) -> int: """ Constructs and sends the start/stop DG flush command Index: dialin/dg/heat_disinfect.py =================================================================== diff -u -rfe051f80c87d4d43ff6c8c1a598eacd62f61c5f8 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/heat_disinfect.py (.../heat_disinfect.py) (revision fe051f80c87d4d43ff6c8c1a598eacd62f61c5f8) +++ dialin/dg/heat_disinfect.py (.../heat_disinfect.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -38,15 +38,14 @@ DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER = 11 DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 = 12 DG_HEAT_DISINFECT_STATE_COOL_DOWN_HEATERS = 13 - DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER = 14 - DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1 = 15 - DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R2 = 16 - DG_HEAT_DISINFECT_STATE_RINSE_R1_TO_R2 = 17 - DG_HEAT_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1 = 18 - DG_HEAT_DISINFECT_STATE_RINSE_CIRCULATION = 19 - DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH = 20 - DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH = 21 - DG_HEAT_DISINFECT_STATE_COMPLETE = 22 + DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1 = 14 + DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R2 = 15 + DG_HEAT_DISINFECT_STATE_RINSE_R1_TO_R2 = 16 + DG_HEAT_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1 = 17 + DG_HEAT_DISINFECT_STATE_RINSE_CIRCULATION = 18 + DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH = 19 + DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH = 20 + DG_HEAT_DISINFECT_STATE_COMPLETE = 21 @unique Index: dialin/dg/heat_disinfect_active_cool.py =================================================================== diff -u --- dialin/dg/heat_disinfect_active_cool.py (revision 0) +++ dialin/dg/heat_disinfect_active_cool.py (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -0,0 +1,74 @@ +########################################################################### +# +# Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. +# +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# @file heat_disinfect.py +# +# @author (last) Micahel Garthwaite +# @date (last) 19-Jul-2022 +# @author (original) Dara Navaei +# @date (original) 27-Feb-2021 +# +############################################################################ +import struct +from logging import Logger +from ..common.msg_defs import MsgIds, MsgFieldPositions +from ..protocols.CAN import DenaliChannels +from ..utils.base import AbstractSubSystem, publish + + +class HeatDisinfectActiveCool(AbstractSubSystem): + """ + Heat Disinfect Active Cool class with APIs to set the timing of each of the stages. + """ + + def __init__(self, can_interface, logger: Logger): + super().__init__() + + self.can_interface = can_interface + self.logger = logger + + self.heat_disinfect_active_cool_state = 0 + self.overall_elapsed_time = 0 + self.state_elapsed_time = 0 + + if self.can_interface is not None: + channel_id = DenaliChannels.dg_sync_broadcast_ch_id + msg_id = MsgIds.MSG_ID_DG_HEAT_DISINFECT_ACTIVE_COOL_DATA.value + self.can_interface.register_receiving_publication_function(channel_id, msg_id, + self._handler_heat_disinfect_active_cool_sync) + + def clear_heat_disinfect_active_cool_info(self) -> None: + """ + Clears public class properties that are updated by the handler. + Specifically properties updated by the DG broadcast message + MSG_ID_DG_HEAT_DISINFECT_ACTIVE_COOL_DATA. + + @returns none + """ + + self.heat_disinfect_active_cool_state = 0 + self.overall_elapsed_time = 0 + self.state_elapsed_time = 0 + + @publish(["heat_disinfect_active_cool_state", "overall_elapsed_time", "state_elapsed_time"]) + def _handler_heat_disinfect_active_cool_sync(self, message): + """ + Handles published heat disinfect active cool message + + @param message: published heat disinfect active cool data message + @returns none + """ + state = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] + elapsed_time = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + state_elapsed_time = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + + self.heat_disinfect_active_cool_state = state + self.overall_elapsed_time = int(elapsed_time / 1000) + self.state_elapsed_time = int(state_elapsed_time / 1000) Index: dialin/dg/service_record.py =================================================================== diff -u -r165a814489f7d0e91655b8861d4a4acac3d57f51 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/service_record.py (.../service_record.py) (revision 165a814489f7d0e91655b8861d4a4acac3d57f51) +++ dialin/dg/service_record.py (.../service_record.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -23,7 +23,8 @@ from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import DenaliMessage, DenaliChannels from ..utils.base import AbstractSubSystem, DialinEnum, publish -from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver +from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver, NVRecords +from ..utils.conversions import integer_to_bytearray @unique @@ -117,6 +118,29 @@ self.logger.debug("Request cancelled: an existing request is in progress.") return False + def cmd_dg_service_record_crc_override(self, crc: int) -> bool: + + crc_value = integer_to_bytearray(crc) + dg_record = integer_to_bytearray(NVRecords.NVDATAMGMT_SERVICE_RECORD.value) + payload = crc_value + dg_record + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_NV_RECORD_CRC_OVERRIDE.value, + payload=payload) + + self.logger.debug("Overriding DG service record CRC to: " + str(crc)) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.error("Timeout!!!!") + return False + def _handler_dg_service_sync(self, message): """ Handles published DG service record messages. DG service records are captured for Index: dialin/dg/sw_configs.py =================================================================== diff -u -rf0cb1f298e3960769e0133172769deb9afe5a393 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/sw_configs.py (.../sw_configs.py) (revision f0cb1f298e3960769e0133172769deb9afe5a393) +++ dialin/dg/sw_configs.py (.../sw_configs.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -55,6 +55,8 @@ SW_CONFIG_DISABLE_CONC_PUMPS_SPEED_ALARM = 20 SW_CONFIG_DISABLE_MIXING_IN_FILL = 21 SW_CONFIG_DISABLE_TEMPERATURE_SENSORS_ALARM = 22 + SW_CONFIG_DISABLE_CONCENTRATE_PUMPS_PARK = 23 + SW_CONFIG_ENABLE_USING_TPO_FOR_PRIMARY_HEATER_CONTROL = 24 class DGSoftwareConfigs(AbstractSubSystem): Index: dialin/dg/system_record.py =================================================================== diff -u -rf0cb1f298e3960769e0133172769deb9afe5a393 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/system_record.py (.../system_record.py) (revision f0cb1f298e3960769e0133172769deb9afe5a393) +++ dialin/dg/system_record.py (.../system_record.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -19,11 +19,11 @@ from enum import unique from logging import Logger from time import sleep - from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import DenaliMessage, DenaliChannels from ..utils.base import AbstractSubSystem, DialinEnum, publish -from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver +from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver, NVRecords +from ..utils.conversions import integer_to_bytearray @unique @@ -155,6 +155,29 @@ self.logger.debug("Request cancelled: an existing request is in progress.") return False + def cmd_dg_system_record_crc_override(self, crc: int) -> bool: + + crc_value = integer_to_bytearray(crc) + dg_record = integer_to_bytearray(NVRecords.NVDATAMGMT_SYSTEM_RECORD.value) + payload = crc_value + dg_record + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_NV_RECORD_CRC_OVERRIDE.value, + payload=payload) + + self.logger.debug("Overriding DG system record CRC to: " + str(crc)) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.error("Timeout!!!!") + return False + def _handler_dg_system_sync(self, message): """ Handles published DG system record messages. HD system records are captured for Index: dialin/dg/usage_info_record.py =================================================================== diff -u -r165a814489f7d0e91655b8861d4a4acac3d57f51 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/dg/usage_info_record.py (.../usage_info_record.py) (revision 165a814489f7d0e91655b8861d4a4acac3d57f51) +++ dialin/dg/usage_info_record.py (.../usage_info_record.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -19,11 +19,12 @@ from collections import OrderedDict from logging import Logger from time import sleep - +from enum import unique from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import DenaliMessage, DenaliChannels from ..utils.base import AbstractSubSystem, publish -from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver +from ..utils.nv_ops_utils import NVOpsUtils, NVUtilsObserver, NVRecords +from ..utils.conversions import integer_to_bytearray class DGUsageNVRecord(AbstractSubSystem): @@ -95,6 +96,29 @@ self.logger.debug("Request cancelled: an existing request is in progress.") return False + def cmd_dg_usage_info_crc_override(self, crc: int) -> bool: + + crc_value = integer_to_bytearray(crc) + dg_record = integer_to_bytearray(NVRecords.NVDATAMGMT_USAGE_INFO_RECORD.value) + payload = crc_value + dg_record + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_NV_RECORD_CRC_OVERRIDE.value, + payload=payload) + + self.logger.debug("Overriding DG usage info CRC to: " + str(crc)) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.error("Timeout!!!!") + return False + def _handler_dg_usage_info_sync(self, message): """ Handles published DG usage information record messages. Index: dialin/utils/nv_ops_utils.py =================================================================== diff -u -rcd79d9df6686d5aa1f71ad4789a7c372ddcff370 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- dialin/utils/nv_ops_utils.py (.../nv_ops_utils.py) (revision cd79d9df6686d5aa1f71ad4789a7c372ddcff370) +++ dialin/utils/nv_ops_utils.py (.../nv_ops_utils.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -16,13 +16,23 @@ import os.path import struct import time +from enum import unique from logging import Logger from typing import List from collections import OrderedDict from .excel_ops import * -from dialin.utils.base import AbstractObserver +from dialin.utils.base import AbstractObserver, DialinEnum +@unique +class NVRecords(DialinEnum): + NVDATAMGMT_CALIBRATION_RECORD = 0 + NVDATAMGMT_SYSTEM_RECORD = 1 + NVDATAMGMT_SERVICE_RECORD = 2 + NVDATAMGMT_USAGE_INFO_RECORD = 3 + NUM_OF_NVDATMGMT_RECORDS_JOBS = 4 + + class NVUtilsObserver(AbstractObserver): """ Index: tests/dg_tests.py =================================================================== diff -u -r5ea9bb5784c334aef0e9baea8e37c476dcf79e35 -rca3dffa6d804bbaeff6eb1009edf88835107dc44 --- tests/dg_tests.py (.../dg_tests.py) (revision 5ea9bb5784c334aef0e9baea8e37c476dcf79e35) +++ tests/dg_tests.py (.../dg_tests.py) (revision ca3dffa6d804bbaeff6eb1009edf88835107dc44) @@ -46,7 +46,7 @@ from dialin.hd.valves import HDValves from dialin.hd.voltages import HDMonitoredVoltages from dialin.hd.pretreatment import PreTreatmentRsrvrState -from dialin.common.dg_defs import DGFlushStates +from dialin.common.dg_defs import DGFlushStates, DGHeatDisinfectActiveCoolStates from time import sleep from datetime import datetime import sys @@ -70,10 +70,21 @@ def get_heat_disinfect_mode_info(): + state = 0 + state_elapsed_time = 0 + overall_elapsed_time = 0 + if dg.dg_operation_mode == 9: + state = DGHeatDisinfectStates(dg.heat_disinfect.heat_disinfect_state).name + overall_elapsed_time = dg.heat_disinfect.overall_elapsed_time + state_elapsed_time = dg.heat_disinfect.state_elapsed_time + elif dg.dg_operation_mode == 12: + state = DGHeatDisinfectActiveCoolStates(dg.heat_disinfect_active_cool.heat_disinfect_active_cool_state).name + state_elapsed_time = dg.heat_disinfect_active_cool.state_elapsed_time + overall_elapsed_time = dg.heat_disinfect_active_cool.overall_elapsed_time + info = ('State, {}, Overall_elapsed_time, {}, State_elapsed_time, {}, Disinfect_elapsed_time, {}, ' 'R1_level, {:5.3f}, R2_level, {:5.3f}, Top_alarm, {}, UI_state, {}, ' - .format(DGHeatDisinfectStates(dg.heat_disinfect.heat_disinfect_state).name, - dg.heat_disinfect.overall_elapsed_time, dg.heat_disinfect.state_elapsed_time, + .format(state, overall_elapsed_time, state_elapsed_time, dg.heat_disinfect.heat_disinfect_count_down_time, dg.heat_disinfect.r1_level, dg.heat_disinfect.r2_level, hd.alarms.alarm_top, DGHeatDisinfectUIStates(dg.chemical_disinfect.chemical_disinfect_ui_state).name))