Index: build.sh =================================================================== diff -u -r01c31fe0aaab4a86cc9ffb5e0b498f76e1f62f35 -r5c4a3b41a159d0e882fd41286d63e479a5aba08c --- build.sh (.../build.sh) (revision 01c31fe0aaab4a86cc9ffb5e0b498f76e1f62f35) +++ build.sh (.../build.sh) (revision 5c4a3b41a159d0e882fd41286d63e479a5aba08c) @@ -17,11 +17,16 @@ OLD_NAME="leahi_dialin-1.0.0-py3-none-any.whl" NEW_NAME="leahi_dialin-1.0.0" -NEW_NAME+="-$1" # Append the Bamboo Build Number (Incremental version) -NEW_NAME+="+$2" # Append the Project Checkout Branch Name -NEW_NAME+=".$3" # Append the Build Commit Hash -NEW_NAME+="-py3-none-any.whl" # Append the metadata and the file extension name -NEW_NAME=$(sed -e "s/\//_/g" <<< "$NEW_NAME") # Replaces backslashes in the branch name parameter with underscore +if [ "$1" NEQ "" ]; then + NEW_NAME="leahi_dialin-1.0.0" + NEW_NAME+="-$1" # Append the Bamboo Build Number (Incremental version) + NEW_NAME+="+$2" # Append the Project Checkout Branch Name + NEW_NAME+=".$3" # Append the Build Commit Hash + NEW_NAME+="-py3-none-any.whl" # Append the metadata and the file extension name + NEW_NAME=$(sed -e "s/\//_/g" <<< "$NEW_NAME") # Replaces backslashes in the branch name parameter with underscore +else + NEW_NAME="$OLD_NAME" +fi rm -rf dist/ python3 setup.py bdist_wheel Index: leahi_dialin/common/dd_defs.py =================================================================== diff -u -r3a2a21de284ee929a53c20611bcc40d81f649733 -r5c4a3b41a159d0e882fd41286d63e479a5aba08c --- leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision 3a2a21de284ee929a53c20611bcc40d81f649733) +++ leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision 5c4a3b41a159d0e882fd41286d63e479a5aba08c) @@ -15,752 +15,863 @@ ############################################################################ from enum import unique -from aenum import extend_enum -from typing import TYPE_CHECKING -from .defs_base import Defs_Base -from .global_vars import GlobalVariables, test_config_change from ..utils.base import DialinEnum -class DD_Defs(Defs_Base): +# ================================================== Enum Creators: Operations ================================================== +@unique +class DDOpModes(DialinEnum): + MODE_FAUL = 0 # Fault mode + MODE_SERV = 1 # Service mode + MODE_INIT = 2 # Initialization & POST mode + MODE_STAN = 3 # Standby mode + MODE_PREG = 4 # Pre-generate Dialysate Mode + MODE_GEND = 5 # Generate Dialysate Mode + MODE_POSG = 6 # Post-generate Dialysate Mode + MODE_HEAT = 7 # Heat Disinfect Mode + MODE_HCOL = 8 # Cooling Mode + MODE_ROPS = 9 # RO Permeate Sample Mode + MODE_NLEG = 10 # Not legal - an illegal mode transition occurred + NUM_OF_DD_MODES = 11 # Number of Modes for the DD - # IDE autocomplete support - if TYPE_CHECKING: - DDOpModes: DialinEnum - DDFaultStates: DialinEnum - DDFaultNVDataStates: DialinEnum - DDServiceStates: DialinEnum - DDInitStates: DialinEnum - DDStandbyStates: DialinEnum - DDPreGenDialysateStates: DialinEnum - DDGenDialysateModeStates: DialinEnum - DDPostGenDialysateStates: DialinEnum - DDHeatDisinfectStates: DialinEnum - DDHeaterCoolingStates: DialinEnum - DDROPermeateStates: DialinEnum - DDNotLegalStates: DialinEnum - DDEventList: DialinEnum - DDEventDataTypes: DialinEnum +DDOpModes._str_list = { + # Official Name : Accepted strings + 'MODE_FAUL': ['fault'], + 'MODE_SERV': ['service'], + 'MODE_INIT': ['initialization'], + 'MODE_STAN': ['standby'], + 'MODE_PREG': ['pre-gen dialysate', 'pre-generate dialysate'], + 'MODE_GEND': ['generate dialysate'], + 'MODE_POSG': ['post-gen dialysate', 'post-generate dialysate'], + 'MODE_HEAT': ['heat disinfect', 'disinfect', 'heating'], + 'MODE_HCOL': ['cooling'], + 'MODE_ROPS': ['sampling', 'ro sampling', 'ro permeate sampling'], + 'MODE_NLEG': ['not legal'], + 'NUM_OF_DD_MODES': [], +} - DDConcentratePumpNames:DialinEnum - DDConductivitySensorNames:DialinEnum - DDDialysatePumpNames:DialinEnum - DDHeaterNames:DialinEnum - DDLevelSensorNames:DialinEnum - DDPistonPumpNames:DialinEnum - DDPressureSensorNames:DialinEnum - DDTemperatureSensorNames: DialinEnum - DDValveNames: DialinEnum - DDMonitoredVoltages: DialinEnum - DDBalancingChamberStates:DialinEnum - DDBalancingChamberSwitchStates:DialinEnum - DDBloodLeakStates:DialinEnum - DDConcentratePumpAttributes:DialinEnum - DDConcentratePumpStates:DialinEnum - DDDialysatePumpAttributes:DialinEnum - DDDialysatePumpsStates:DialinEnum - DDHeaterStartStop:DialinEnum - DDHeaterAttributes:DialinEnum - DDHeaterExecState:DialinEnum - DDPistonPumpAttributes:DialinEnum - DDValveStates: DialinEnum +@unique +class DDFaultStates(DialinEnum): + DD_FAULT_STATE_START = 0 # DD Fault Start State + DD_FAULT_DEENERGIZED_STATE = 1 # DD Fault De-energized State + DD_FAULT_ENERGIZED_STATE = 2 # DD Fault Energized State + NUM_OF_FP_FAULT_STATES = 3 # Number of Fault Mode State - _properties = { - # Operation / State enums - 'DDOpModes': '_create_dd_operation_modes', - 'DDFaultStates': '_create_dd_fault_states', - 'DDFaultNVDataStates': '_create_dd_fault_nvdata_states', - 'DDServiceStates': '_create_dd_service_states', - 'DDInitStates': '_create_dd_init_states', - 'DDStandbyStates': '_create_dd_standby_states', - 'DDPreGenDialysateStates': '_create_dd_pregen_states', - 'DDGenDialysateModeStates': '_create_dd_gen_states', - 'DDPostGenDialysateStates': '_create_dd_postgen_states', - 'DDHeatDisinfectStates': '_create_dd_heat_disinfect_states', - 'DDHeaterCoolingStates': '_create_dd_heater_cooling_states', - 'DDROPermeateStates': '_create_dd_ro_permeate_states', - 'DDNotLegalStates': '_create_dd_not_legal_states', +DDFaultStates._str_list = { + # Official Name : Accepted strings + 'DD_FAULT_STATE_START': ['fault start'], + 'DD_FAULT_DEENERGIZED_STATE': ['fault deenergized', 'deenergized'], + 'DD_FAULT_ENERGIZED_STATE': ['fault energized', 'energized'], + 'NUM_OF_FP_FAULT_STATES': [], +} - # Event enums - 'DDEventList': '_create_dd_event_list', - 'DDEventDataTypes': '_create_dd_event_data_types', - # Module Names enums - 'DDConcentratePumpNames': '_create_dd_concentrate_pump_names', - 'DDConductivitySensorNames': '_create_dd_conductivity_sensor_names', - 'DDDialysatePumpNames': '_create_dd_dialysate_pump_names', - 'DDHeaterNames': '_create_dd_heater_names', - 'DDLevelSensorNames': '_create_dd_level_sensor_names', - 'DDPistonPumpNames': '_create_dd_piston_pump_names', - 'DDPressureSensorNames': '_create_dd_pressure_sensor_names', - 'DDTemperatureSensorNames': '_create_dd_temperature_sensor_names', - 'DDValveNames': '_create_dd_valve_names', - 'DDMonitoredVoltages': '_create_dd_monitored_voltages', +@unique +class DDFaultNVDataStates(DialinEnum): + DD_FAULT_STATE_START = 0 # DD fault start state + DD_FAULT_STATE_RUN_NV_POSTS = 1 # DD fault run RTC and NV data management post + DD_FAULT_STATE_COMPLETE = 2 # DD fault complete + NUM_OF_DD_FAULT_NVDATA_STATES = 3 # Number of fault mode NV Data management states - # Support enums - 'DDBalancingChamberStates': '_create_dd_balancing_chamber_states', - 'DDBalancingChamberSwitchStates': '_create_dd_balancing_chamber_switch_states', - 'DDBloodLeakStates': '_create_dd_blood_leak_states', - 'DDConcentratePumpAttributes': '_create_dd_concentrate_pump_attributes', - 'DDConcentratePumpStates': '_create_dd_concentrate_pump_states', - 'DDDialysatePumpAttributes': '_create_dd_dialysate_pump_attributes', - 'DDDialysatePumpsStates': '_create_dd_dialysate_pump_states', - 'DDHeaterStartStop': '_create_dd_heater_start_stop', - 'DDHeaterAttributes': '_create_dd_heater_attributes', - 'DDHeaterExecState': '_create_dd_heater_exec_states', - 'DDPistonPumpAttributes': '_create_dd_piston_pump_attributes', - 'DDValveStates': '_create_dd_valve_states', - } +DDFaultNVDataStates._str_list = { + # Official Name : Accepted strings + 'DD_FAULT_STATE_START': ['start'], + 'DD_FAULT_STATE_RUN_NV_POSTS': ['running'], + 'DD_FAULT_STATE_COMPLETE': ['complete', 'done'], + 'NUM_OF_DD_FAULT_NVDATA_STATES': [], +} +@unique +class DDServiceStates(DialinEnum): + DD_SERVICE_STATE_START = 0 # Start service mode state + NUM_OF_DD_SERVICE_STATES = 1 # Number of service mode states - # ================================================== Enum Creators: Operations ================================================== - def _create_dd_operation_modes(self): - members = { - # Official Name : Accepted strings - 'MODE_FAUL': ['fault'], # Fault mode - 'MODE_SERV': ['service'], # Service mode - 'MODE_INIT': ['initialization'], # Initialization & POST mode - 'MODE_STAN': ['standby'], # Standby mode - 'MODE_PREG': ['pre-gen dialysate', 'pre-generate dialysate'], # Pre-generate Dialysate Mode - 'MODE_GEND': ['generate dialysate'], # Generate Dialysate Mode - 'MODE_POSG': ['post-gen dialysate', 'post-generate dialysate'], # Post-generate Dialysate Mode - 'MODE_HEAT': ['heat disinfect', 'disinfect', 'heating'], # Heat Disinfect Mode - 'MODE_HCOL': ['cooling'], # Cooling Mode - 'MODE_ROPS': ['sampling', 'ro sampling', 'ro permeate sampling'], # RO Permeate Sample Mode - 'MODE_NLEG': ['not legal'], # Not legal - an illegal mode transition occurred - 'NUM_OF_DD_MODES': [], # Number of Modes for the DD - } - created_enum = unique(DialinEnum('DDOpModes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDServiceStates._str_list = { + # Official Name : Accepted strings + 'DD_SERVICE_STATE_START': ['start', 'service start'], + 'NUM_OF_DD_SERVICE_STATES': [], +} - def _create_dd_fault_states(self): - members = { - # Official Name : Accepted strings - 'DD_FAULT_STATE_START': ['fault start'], # DD Fault Start State - 'DD_FAULT_DEENERGIZED_STATE': ['fault deenergized', 'deenergized'], # DD Fault De-energized State - 'DD_FAULT_ENERGIZED_STATE': ['fault energized', 'energized'], # DD Fault Energized State - 'NUM_OF_FP_FAULT_STATES': [], # Number of Fault Mode State - } - created_enum = unique(DialinEnum('DDFaultStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDInitStates(DialinEnum): + DD_POST_STATE_START = 0 # Post Generate Dialysate Start State + DD_POST_STATE_FW_COMPATIBILITY = 1 # Firmware Compatibility State + DD_POST_STATE_FW_INTEGRITY = 2 # Firmware Integrity State + DD_POST_STATE_FPGA = 3 # FPGA State + DD_POST_STATE_NVDATAMGMT = 4 # Non-volatile Data Management State + DD_POST_STATE_TEMPERATURE_SENSORS = 5 # Temperature Sensors State + DD_POST_STATE_PRESSURES = 6 # Pressure Sensors State + DD_POST_STATE_DIALYSATE_PUMPS = 7 # Dialysate Pumps State + DD_POST_STATE_CONCENTRATE_PUMPS = 8 # Concentrate Pumps State + DD_POST_STATE_CONDUCTIVITY_SENSORS = 9 # Conductivity Sensors State + DD_POST_STATE_WATCHDOG = 10 # Watchdog State + DD_POST_STATE_SAFETY_SHUTDOWN = 11 # Safety Shutdown State + DD_POST_STATE_COMPLETED = 12 # Post Generate Dialysate Completed State + DD_POST_STATE_FAILED = 13 # Post Generate Dialysate Fail State + NUM_OF_DD_POST_STATES = 14 # Number of Post Generate Dialysate States +DDInitStates._str_list = { + # Official Name : Accepted strings + 'DD_POST_STATE_START': ['start'], + 'DD_POST_STATE_FW_COMPATIBILITY': ['fw compatibility'], + 'DD_POST_STATE_FW_INTEGRITY': ['fw integrity'], + 'DD_POST_STATE_FPGA': ['fpga'], + 'DD_POST_STATE_NVDATAMGMT': ['nv data management', 'data management'], + 'DD_POST_STATE_TEMPERATURE_SENSORS': ['temperature sensors check'], + 'DD_POST_STATE_PRESSURES': ['pressures check'], + 'DD_POST_STATE_DIALYSATE_PUMPS': ['dialysate pumps check'], + 'DD_POST_STATE_CONCENTRATE_PUMPS': ['concentrate pumps check'], + 'DD_POST_STATE_CONDUCTIVITY_SENSORS': ['conductivity sensors check'], + 'DD_POST_STATE_WATCHDOG': ['watchdog'], + 'DD_POST_STATE_SAFETY_SHUTDOWN': ['safety shutdown'], + 'DD_POST_STATE_COMPLETED': ['completed', 'done'], + 'DD_POST_STATE_FAILED': ['failed'], + 'NUM_OF_DD_POST_STATES': [], +} - def _create_dd_fault_nvdata_states(self): - members = { - # Official Name : Accepted strings - 'DD_FAULT_STATE_START': ['start'], # DD fault start state - 'DD_FAULT_STATE_RUN_NV_POSTS': ['running'], # DD fault run RTC and NV data management post - 'DD_FAULT_STATE_COMPLETE': ['complete', 'done'], # DD fault complete - 'NUM_OF_DD_FAULT_NVDATA_STATES': [], # Number of fault mode NV Data management states - } - created_enum = unique(DialinEnum('DDFaultNVDataStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDStandbyStates(DialinEnum): + DD_STANDBY_MODE_STATE_IDLE = 0 # Idle standby mode state + DD_STANDBY_MODE_STATE_PAUSE = 1 # Pause state + NUM_OF_DD_STANDBY_MODE_STATES = 2 # Number of standby mode states +DDStandbyStates._str_list = { + # Official Name : Accepted strings + 'DD_STANDBY_MODE_STATE_IDLE': ['idle'], + 'DD_STANDBY_MODE_STATE_PAUSE': ['paused'], + 'NUM_OF_DD_STANDBY_MODE_STATES': [], +} - def _create_dd_service_states(self): - members = { - # Official Name : Accepted strings - 'DD_SERVICE_STATE_START': ['start', 'service start'], # Start service mode state - 'NUM_OF_DD_SERVICE_STATES': [], # Number of service mode states - } - created_enum = unique(DialinEnum('DDServiceStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDPreGenDialysateStates(DialinEnum): + DD_PRE_GEN_DIALYSATE_HYD_CHAMBER_FILL_CHECK = 0 # DD Pre-Gen Dialysate hyrochamber fill check + DD_PRE_GEN_WET_SELF_TEST = 1 # DD Pre-Gen Wet Self Test + DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND = 2 # DD Pre-Gen Dialysate Wait for Gen Dialysate state transition + NUM_OF_DD_PRE_GEN_DIALYSATE_STATES = 3 # Number of Pre-Gen Dialysate mode states - def _create_dd_init_states(self): - members = { - # Official Name : Accepted strings - 'DD_POST_STATE_START': ['start'], # Post Generate Dialysate Start State - 'DD_POST_STATE_FW_COMPATIBILITY': ['fw compatibility'], # Firmware Compatibility State - 'DD_POST_STATE_FW_INTEGRITY': ['fw integrity'], # Firmware Integrity State - 'DD_POST_STATE_FPGA': ['fpga'], # FPGA State - 'DD_POST_STATE_NVDATAMGMT': ['nv data management', 'data management'], # Non-volatile Data Management State - 'DD_POST_STATE_TEMPERATURE_SENSORS': ['temperature sensors check'], # Temperature Sensors State - 'DD_POST_STATE_PRESSURES': ['pressures check'], # Pressure Sensors State - 'DD_POST_STATE_DIALYSATE_PUMPS': ['dialysate pumps check'], # Dialysate Pumps State - 'DD_POST_STATE_CONCENTRATE_PUMPS': ['concentrate pumps check'], # Concentrate Pumps State - 'DD_POST_STATE_CONDUCTIVITY_SENSORS': ['conductivity sensors check'], # Conductivity Sensors State - 'DD_POST_STATE_WATCHDOG': ['watchdog'], # Watchdog State - 'DD_POST_STATE_SAFETY_SHUTDOWN': ['safety shutdown'], # Safety Shutdown State - 'DD_POST_STATE_COMPLETED': ['completed', 'done'], # Post Generate Dialysate Completed State - 'DD_POST_STATE_FAILED': ['failed'], # Post Generate Dialysate Fail State - 'NUM_OF_DD_POST_STATES': [], # Number of Post Generate Dialysate States - } - created_enum = unique(DialinEnum('DDInitStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDPreGenDialysateStates._str_list = { + # Official Name : Accepted strings + 'DD_PRE_GEN_DIALYSATE_HYD_CHAMBER_FILL_CHECK': ['fill check', 'hydro chamber fill check'], + 'DD_PRE_GEN_WET_SELF_TEST': ['self test', 'wet self test'], + 'DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND': ['wait for state transition'], + 'NUM_OF_DD_PRE_GEN_DIALYSATE_STATES': [], +} - def _create_dd_standby_states(self): - members = { - # Official Name : Accepted strings - 'DD_STANDBY_MODE_STATE_IDLE': ['idle'], # Idle standby mode state - 'DD_STANDBY_MODE_STATE_PAUSE': ['paused'], # Pause state - 'NUM_OF_DD_STANDBY_MODE_STATES': [], # Number of standby mode states - } - created_enum = unique(DialinEnum('DDStandbyStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDGenDialysateModeStates(DialinEnum): + DD_GEND_STATE_START = 0 # Gen dialysate start state + DD_GEND_DIALYSATE_BYPASS_STATE = 1 # Gen dialysate - Bypass dialysate state + DD_GEND_DIALYSATE_DELIVERY_STATE = 2 # Gen dialysate - deliver dialysate state + DD_GEND_ISOLATED_UF_STATE = 3 # Gen dialysate - Isolated ultrafiltration state + DD_GEND_SPENT_CHAMBER_FILL_STATE = 4 # Gen dialysate - spent chamber fill state + DD_GEND_BICARB_CHAMBER_FILL_STATE = 5 # Gen dialysate - bicarb chamber fill state + DD_GEND_DIALYSATE_DELIVERY_PAUSE = 6 # Gen dialysate - dialysate delivery pause state + NUM_OF_DD_GEND_MODE_STATES = 7 # Number of gen dialysate states +DDGenDialysateModeStates._str_list = { + # Official Name : Accepted strings + 'DD_GEND_STATE_START': ['start'], + 'DD_GEND_DIALYSATE_BYPASS_STATE': ['dialysate delivery bypass', 'bypass'], + 'DD_GEND_DIALYSATE_DELIVERY_STATE': ['dialysate delivery'], + 'DD_GEND_ISOLATED_UF_STATE': ['uf', 'ultrafiltration'], + 'DD_GEND_SPENT_CHAMBER_FILL_STATE': ['spent chamber fill'], + 'DD_GEND_BICARB_CHAMBER_FILL_STATE': ['bicarb chamber fill'], + 'DD_GEND_DIALYSATE_DELIVERY_PAUSE': ['dialysate delivery pause', 'pause'], + 'NUM_OF_DD_GEND_MODE_STATES': [], +} - def _create_dd_pregen_states(self): - members = { - # Official Name : Accepted strings - 'DD_PRE_GEN_DIALYSATE_HYD_CHAMBER_FILL_CHECK': ['fill check', 'hydro chamber fill check'], # DD Pre-Gen Dialysate hyrochamber fill check - 'DD_PRE_GEN_WET_SELF_TEST': ['self test', 'wet self test'], # DD Pre-Gen Wet Self Test - 'DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND': ['wait for state transition'], # DD Pre-Gen Dialysate Wait for Gen Dialysate state transition - 'NUM_OF_DD_PRE_GEN_DIALYSATE_STATES': [], # Number of Pre-Gen Dialysate mode states - } - created_enum = unique(DialinEnum('DDPreGenDialysateStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDPostGenDialysateStates(DialinEnum): + DD_POST_GEN_DIALYSATE_STATE_START = 0 # DD Post-Gen Dialysate state start + DD_POST_GEN_DIALYSATE_STATE_COMPLETE = 1 # DD Post-Gen Dialysate complete state + NUM_OF_DD_POST_GEN_DIALYSATE_STATES = 2 # Number of Post-Gen Dialysate mode states - def _create_dd_gen_states(self): - members = { - # Official Name : Accepted strings - 'DD_GEND_STATE_START': ['start'], # Gen dialysate start state - 'DD_GEND_DIALYSATE_BYPASS_STATE': ['dialysate delivery bypass', 'bypass'], # Gen dialysate - Bypass dialysate state - 'DD_GEND_DIALYSATE_DELIVERY_STATE': ['dialysate delivery'], # Gen dialysate - deliver dialysate state - 'DD_GEND_ISOLATED_UF_STATE': ['uf', 'ultrafiltration'], # Gen dialysate - Isolated ultrafiltration state - 'DD_GEND_SPENT_CHAMBER_FILL_STATE': ['spent chamber fill'], # Gen dialysate - spent chamber fill state - 'DD_GEND_BICARB_CHAMBER_FILL_STATE': ['bicarb chamber fill'], # Gen dialysate - bicarb chamber fill state - 'DD_GEND_DIALYSATE_DELIVERY_PAUSE': ['dialysate delivery pause', 'pause'], # Gen dialysate - dialysate delivery pause state - 'NUM_OF_DD_GEND_MODE_STATES': [], # Number of gen dialysate states - } - created_enum = unique(DialinEnum('DDGenDialysateModeStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDPostGenDialysateStates._str_list = { + # Official Name : Accepted strings + 'DD_POST_GEN_DIALYSATE_STATE_START': ['start'], + 'DD_POST_GEN_DIALYSATE_STATE_COMPLETE': ['complete', 'done'], + 'NUM_OF_DD_POST_GEN_DIALYSATE_STATES': [], +} - def _create_dd_postgen_states(self): - members = { - # Official Name : Accepted strings - 'DD_POST_GEN_DIALYSATE_STATE_START': ['start'], # DD Post-Gen Dialysate state start - 'DD_POST_GEN_DIALYSATE_STATE_COMPLETE': ['complete', 'done'], # DD Post-Gen Dialysate complete state - 'NUM_OF_DD_POST_GEN_DIALYSATE_STATES': [], # Number of Post-Gen Dialysate mode states - } - created_enum = unique(DialinEnum('DDPostGenDialysateStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDHeatDisinfectStates(DialinEnum): + DD_HEAT_DISINFECT_STATE_START = 0 # Heat disinfect, start mode state + DD_HEAT_DISINFECT_STATE_COMPLETE = 1 # Heat disinfect, complete state + NUM_OF_FP_SERV_STATES = 2 # Number of heat disinfect mode states +DDHeatDisinfectStates._str_list = { + # Official Name : Accepted strings + 'DD_HEAT_DISINFECT_STATE_START': ['start'], + 'DD_HEAT_DISINFECT_STATE_COMPLETE': ['done', 'complete'], + 'NUM_OF_DD_HEAT_DISINFECT_STATES': [] +} - def _create_dd_heat_disinfect_states(self): - members = { - # Official Name : Accepted strings - 'DD_HEAT_DISINFECT_STATE_START': ['start'], # Heat disinfect, start mode state - 'DD_HEAT_DISINFECT_STATE_COMPLETE': ['done', 'complete'], # Heat disinfect, complete state - 'NUM_OF_DD_HEAT_DISINFECT_STATES': [] # Number of heat disinfect mode states - } - created_enum = unique(DialinEnum('DDHeatDisinfectStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDHeaterCoolingStates(DialinEnum): + NUM_OF_DD_HEAT_COOL_STATES = 0 # Number of Heater Cooling states - def _create_dd_heater_cooling_states(self): - members = { - # Official Name : Accepted strings - 'NUM_OF_DD_HEAT_COOL_STATES': [], # Number of Heater Cooling states - } - created_enum = unique(DialinEnum('DDHeaterCoolingStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDHeaterCoolingStates._str_list = { + # Official Name : Accepted strings + 'NUM_OF_DD_HEAT_COOL_STATES': [], +} - def _create_dd_ro_permeate_states(self): - members = { - # Official Name : Accepted strings - 'NUM_OF_RO_PERMEATE_STATES': [], # Number of RO Permeate states - } - created_enum = unique(DialinEnum('DDROPermeateStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDROPermeateStates(DialinEnum): + NUM_OF_RO_PERMEATE_STATES = 0 # Number of RO Permeate states +DDROPermeateStates._str_list = { + # Official Name : Accepted strings + 'NUM_OF_RO_PERMEATE_STATES': [], +} - def _create_dd_not_legal_states(self): - members = { - # Official Name : Accepted strings - 'NUM_OF_NOT_LEGAL_STATES': [], # Number of Not Legal states - } - created_enum = unique(DialinEnum('DDNotLegalStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDNotLegalStates(DialinEnum): + NUM_OF_NOT_LEGAL_STATES = 0 # Number of Not Legal states - def _create_dd_event_list(self): - members = { - # Official Name : Accepted strings - 'DD_EVENT_STARTUP': ['startup'], # DD startup event - 'DD_EVENT_OP_MODE_CHANGE': ['op mode change', 'operation mode change'], # DD Op mode change event - 'DD_EVENT_SUB_MODE_CHANGE': ['sub mode change'], # DD Op sub-mode change event - 'DD_EVENT_OPERATION_STATUS': ['status', 'operation status'], # DD operation status event - 'DD_EVENT_D6_LEVL_CHANGE': ['d6 level change'], # DD floater level change event - 'DD_EVENT_D63_LEVL_CHANGE': ['d63 level change'], # DD bicarb level change event - 'DD_EVENT_D46_LEVL_CHANGE': ['d46 level change'], # DD spent dialysate air seperation level change event - 'DD_EVENT_TD_COMMUNICATION_LOSS': ['td communication loss'], # DD TD communication loss - 'DD_EVENT_TEMPERATURE_DRIFT': ['temperature drift'], # DD dialysate temperature drift - 'DD_EVENT_BLOOD_LEAK_ZEROING_REQUEST': ['blood leak zeroing request'], # DD blood leak zeroing request - 'DD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED': ['blood leak zeroing required'], # DD blood leak zeroing required - 'DD_EVENT_BLOOD_LEAK_NUM_OF_SET_POINT_CHECK_FAILURES': ['blood leak check failed'], # DD blood leak number of setpoint check failures - 'DD_EVENT_BLOOD_LEAK_SELF_TEST_RESULT': ['blood leak self test'], # DD blood leak self test result - 'NUM_OF_DD_EVENT_IDS': [], # Total number of DD events - } - created_enum = unique(DialinEnum('DDEventList', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDNotLegalStates._str_list = { + # Official Name : Accepted strings + 'NUM_OF_NOT_LEGAL_STATES': [], +} - def _create_dd_event_data_types(self): - members = { - # Official Name : Accepted strings - 'EVENT_DATA_TYPE_NONE': ['none'], # No Event Data Type - 'EVENT_DATA_TYPE_U32': ['u32'], # Unsigned 32bit Event Data Type - 'EVENT_DATA_TYPE_S32': ['s32'], # Signed 32bit Event Data Type - 'EVENT_DATA_TYPE_F32': ['f32'], # Float 32bit Event Data Type - 'EVENT_DATA_TYPE_BOOL': ['bool', 'boolean'], # Boolean Event Data Type - 'NUM_OF_EVENT_DATA_TYPES': [], # Number of Event Data Types - } - created_enum = unique(DialinEnum('DDEventDataTypes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +# ================================================== Enum Creators: Events ================================================== +@unique +class DDEventList(DialinEnum): + DD_EVENT_STARTUP = 0 # DD startup event + DD_EVENT_OP_MODE_CHANGE = 1 # DD Op mode change event + DD_EVENT_SUB_MODE_CHANGE = 2 # DD Op sub-mode change event + DD_EVENT_OPERATION_STATUS = 3 # DD operation status event + DD_EVENT_D6_LEVL_CHANGE = 4 # DD floater level change event + DD_EVENT_D63_LEVL_CHANGE = 5 # DD bicarb level change event + DD_EVENT_D46_LEVL_CHANGE = 6 # DD spent dialysate air seperation level change event + DD_EVENT_TD_COMMUNICATION_LOSS = 7 # DD TD communication loss + DD_EVENT_TEMPERATURE_DRIFT = 8 # DD dialysate temperature drift + DD_EVENT_BLOOD_LEAK_ZEROING_REQUEST = 9 # DD blood leak zeroing request + DD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED = 10 # DD blood leak zeroing required + DD_EVENT_BLOOD_LEAK_NUM_OF_SET_POINT_CHECK_FAILURES = 11 # DD blood leak number of setpoint check failures + DD_EVENT_BLOOD_LEAK_SELF_TEST_RESULT = 12 # DD blood leak self test result + NUM_OF_DD_EVENT_IDS = 13 # Total number of DD events +DDEventList._str_list = { + # Official Name : Accepted strings + 'DD_EVENT_STARTUP': ['startup'], + 'DD_EVENT_OP_MODE_CHANGE': ['op mode change', 'operation mode change'], + 'DD_EVENT_SUB_MODE_CHANGE': ['sub mode change'], + 'DD_EVENT_OPERATION_STATUS': ['status', 'operation status'], + 'DD_EVENT_D6_LEVL_CHANGE': ['d6 level change'], + 'DD_EVENT_D63_LEVL_CHANGE': ['d63 level change'], + 'DD_EVENT_D46_LEVL_CHANGE': ['d46 level change'], + 'DD_EVENT_TD_COMMUNICATION_LOSS': ['td communication loss'], + 'DD_EVENT_TEMPERATURE_DRIFT': ['temperature drift'], + 'DD_EVENT_BLOOD_LEAK_ZEROING_REQUEST': ['blood leak zeroing request'], + 'DD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED': ['blood leak zeroing required'], + 'DD_EVENT_BLOOD_LEAK_NUM_OF_SET_POINT_CHECK_FAILURES': ['blood leak check failed'], + 'DD_EVENT_BLOOD_LEAK_SELF_TEST_RESULT': ['blood leak self test'], + 'NUM_OF_DD_EVENT_IDS': [], +} - # ================================================== Enum Creators: Names ================================================== - def _create_dd_concentrate_pump_names(self): - members = { - # Official Name : Accepted strings - 'D11_CP1_ACID': ['d11', 'acid', 'acid pump'], # Acid Concentrate Pump - 'D10_CP2_BICARB': ['d10', 'bicarb', 'bicarb pump'], # Bicarbonate Concentrate Pump - 'D76_UF': ['d76', 'uf pump', 'ultrafiltration pump'], # Ultrafiltration Concentrate Pump - 'NUM_OF_CONCENTRATE_PUMPS': [], # Number of Concentrate Pumps - } - created_enum = unique(DialinEnum('DDConcentratePumpNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDEventDataTypes(DialinEnum): + EVENT_DATA_TYPE_NONE = 0 # No Event Data Type + EVENT_DATA_TYPE_U32 = 1 # Unsigned 32bit Event Data Type + EVENT_DATA_TYPE_S32 = 2 # Signed 32bit Event Data Type + EVENT_DATA_TYPE_F32 = 3 # Float 32bit Event Data Type + EVENT_DATA_TYPE_BOOL = 4 # Boolean Event Data Type + NUM_OF_EVENT_DATA_TYPES = 5 # Number of Event Data Types - def _create_dd_conductivity_sensor_names(self): - members = { - # Official Name : Accepted strings - 'D17_COND': ['d17'], # Closed Loop Control of Dosing for D74 Conductivity Sensor - 'D27_COND': ['d27'], # Closed Loop Control of Dosing for D29 Conductivity Sensor - 'D29_COND': ['d29'], # Water, Bicarbonate, and Acid Collective Conductivity Sensor - 'D43_COND': ['d43'], # Self Test Conductivity Sensor (not used for dialysate conductivity) - 'D74_COND': ['d74'], # Water and Bicarbonate Collective Conductivity Sensor - 'D98_COND': ['d98'], # D98 Conductivity Sensor - 'NUM_OF_CONDUCTIVITY_SENSORS': [] # Number of Conductivity Sensors - } - created_enum = unique(DialinEnum('DDConductivitySensorNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDEventDataTypes._str_list = { + # Official Name : Accepted strings + 'EVENT_DATA_TYPE_NONE': ['none'], + 'EVENT_DATA_TYPE_U32': ['u32'], + 'EVENT_DATA_TYPE_S32': ['s32'], + 'EVENT_DATA_TYPE_F32': ['f32'], + 'EVENT_DATA_TYPE_BOOL': ['bool', 'boolean'], + 'NUM_OF_EVENT_DATA_TYPES': [], +} - def _create_dd_dialysate_pump_names(self): - members = { - # Official Name : Accepted strings - 'D12_PUMP': ['d12'], # Fresh Dialysate Pump - 'D48_PUMP': ['d48'], # Spent Dialysate Pump - 'NUM_OF_DIALYSATE_PUMPS': [], # Number of Dialysate Pumps - } - created_enum = unique(DialinEnum('DDDialysatePumpNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +# ================================================== Enum Creators: Names ================================================== +@unique +class DDConcentratePumpNames(DialinEnum): + D11_CP1_ACID = 0 # Acid Concentrate Pump + D10_CP2_BICARB = 1 # Bicarbonate Concentrate Pump + D76_UF = 2 # Ultrafiltration Concentrate Pump + NUM_OF_CONCENTRATE_PUMPS = 3 # Number of Concentrate Pumps - def _create_dd_heater_names(self): - members = { - # Official Name : Accepted strings - 'D5_HEAT': ['d5'], # Primary heater - 'D45_HEAT': ['d45'], # Trimmer heater - 'NUM_OF_DD_HEATERS': [], # Number of Heaters - } - created_enum = unique(DialinEnum('DDHeaterNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDConcentratePumpNames._str_list = { + # Official Name : Accepted strings + 'D11_CP1_ACID': ['d11', 'acid', 'acid pump'], + 'D10_CP2_BICARB': ['d10', 'bicarb', 'bicarb pump'], + 'D76_UF': ['d76', 'uf pump', 'ultrafiltration pump'], + 'NUM_OF_CONCENTRATE_PUMPS': [], +} - def _create_dd_level_sensor_names(self): - members = { - # Official Name : Accepted strings - 'D6_LEVEL': ['d6'], # floater switch low, medium and high status - 'D63_LEVEL': ['d63'], # bicarb level low or high status - 'D46_LEVEL': ['d46'], # Spent dialysate air separation chamber level low or high status - 'D98_LEVEL': ['d98'], # D98 Conductivity Level Sensor - 'NUM_OF_LEVELS': [], # Number of Level Sensors - } - created_enum = unique(DialinEnum('DDLevelSensorNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDConductivitySensorNames(DialinEnum): + D17_COND = 0 # Closed Loop Control of Dosing for D74 Conductivity Sensor + D27_COND = 1 # Closed Loop Control of Dosing for D29 Conductivity Sensor + D29_COND = 2 # Water, Bicarbonate, and Acid Collective Conductivity Sensor + D43_COND = 3 # Self Test Conductivity Sensor (not used for dialysate conductivity) + D74_COND = 4 # Water and Bicarbonate Collective Conductivity Sensor + D98_COND = 5 # D98 Conductivity Sensor + NUM_OF_CONDUCTIVITY_SENSORS = 6 # Number of Conductivity Sensors +DDConductivitySensorNames._str_list = { + # Official Name : Accepted strings + 'D17_COND': ['d17'], + 'D27_COND': ['d27'], + 'D29_COND': ['d29'], + 'D43_COND': ['d43'], + 'D74_COND': ['d74'], + 'D98_COND': ['d98'], + 'NUM_OF_CONDUCTIVITY_SENSORS': [] +} - def _create_dd_piston_pump_names(self): - members = { - # Official Name : Accepted strings - 'ACID': ['d11', 'acid', 'acid pump'], # Acid piston pump - 'BICARB': ['d10', 'bicarb', 'bicarb pump'], # Bicarbonate piston pump - 'UF': ['d76', 'uf pump', 'ultrafiltration pump'], # Ultrafiltration piston pump - 'NUM_OF_PISTON_PUMPS': [], # Number of piston pumps - } - created_enum = unique(DialinEnum('DDPistonPumpNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDDialysatePumpNames(DialinEnum): + D12_PUMP = 0 # Fresh Dialysate Pump + D48_PUMP = 1 # Spent Dialysate Pump + NUM_OF_DIALYSATE_PUMPS = 2 # Number of Dialysate Pumps - def _create_dd_pressure_sensor_names(self): - members = { - # Official Name : Accepted strings - 'D9_PRES': ['d9'], # Hydraulics outlet pressure (PHo/Pn) - 'D66_PRES': ['d66'], # Dry Bicarb pressure (PDB/PCb) - 'D51_PRES': ['d51'], # Spent Dialysate pressure (PDs) - 'D18_PRES': ['d18'], # Fresh Dialysate pressure (PDf) - 'D41_PRES': ['d41'], # Transmembrane pressure (Ptm) - 'D87_PRES': ['d87'], # D87 Pressure Sensor - 'NUM_OF_PRESSURE_SENSORS': [], # Number of pressure sensors - } - created_enum = unique(DialinEnum('DDPressureSensorNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDDialysatePumpNames._str_list = { + # Official Name : Accepted strings + 'D12_PUMP': ['d12'], + 'D48_PUMP': ['d48'], + 'NUM_OF_DIALYSATE_PUMPS': [], +} - def _create_dd_temperature_sensor_names(self): - members = { - # Official Name : Accepted strings - 'D1_TEMP': ['d1'], # Heat exchanger Inlet temperature sensor - 'D78_TEMP': ['d78'], # Heat exchanger Outlet temperature sensor - 'D4_TEMP': ['d4'], # Hydraulics primary heater temperature sensor - 'D50_TEMP': ['d50'], # Trimmer heater temperature sensor - 'D99_TEMP': ['d90'], # D98(D99) Conductivity sensor temperature value - 'BRD_TEMP': ['brd', 'board'], # Barometric temperature sensor - 'D16_TEMP': ['d16'], # D16(D17) Conductivity sensor temperature value - 'D28_TEMP': ['d28'], # D28(D27) Conductivity sensor temperature value - 'D30_TEMP': ['d30'], # D30(D29) Conductivity sensor temperature value - 'D44_TEMP': ['d44'], # D44(D43) Conductivity sensor temperature value - 'D75_TEMP': ['d75'], # D75(D74) Conductivity sensor temperature value - 'D4_AVG_TEMP': ['d4 avg', 'd4 average'], # D4 Filtered value - 'D50_AVG_TEMP': ['d50 avg', 'd50 average'], # D50 Filtered value - 'D99_AVG_TEMP': ['d99 avg', 'd99 average'], # D99 Filtered value - 'D28_AVG_TEMP': ['d28 avg', 'd28 average'], # D28 Filtered value - 'D30_AVG_TEMP': ['d39 avg', 'd39 average'], # D30 Filtered value - 'D9_TEMP': ['d9'], # D9 Pressure sensor temperature value - 'D66_TEMP': ['d66'], # D66 Pressure sensor temperature value - 'D51_TEMP': ['d51'], # D51 Pressure sensor temperature value - 'D18_TEMP': ['d18'], # D18 Pressure sensor temperature value - 'D41_TEMP': ['d41'], # D41 Pressure sensor temperature value - 'D87_TEMP': ['d87'], # D87 Pressure sensor temperature value - 'NUM_OF_TEMP_SENSORS': [], # Number of Temperature Sensors - } - created_enum = unique(DialinEnum('DDTemperatureSensorNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) +@unique +class DDHeaterNames(DialinEnum): + D5_HEAT = 0 # Primary heater + D45_HEAT = 1 # Trimmer heater + NUM_OF_DD_HEATERS = 2 # Number of Heaters - # Add aliases - extend_enum(created_enum, 'FIRST_PRESSURE_SENSOR', created_enum.D9_TEMP.value) - extend_enum(created_enum, 'LAST_PRESSURE_SENSOR', created_enum.D87_TEMP.value if GlobalVariables().HW_BETA_1_9 == True else created_enum.D41_TEMP.value) - extend_enum(created_enum, 'FIRST_CONDUCTIVITY_SENSOR', created_enum.D16_TEMP.value) - extend_enum(created_enum, 'LAST_CONDUCTIVITY_SENSOR', created_enum.D75_TEMP.value) - extend_enum(created_enum, 'FIRST_AVERAGE_SENSOR', created_enum.D4_AVG_TEMP.value) - extend_enum(created_enum, 'LAST_AVERAGE_SENSOR', created_enum.D30_AVG_TEMP.value) +DDHeaterNames._str_list = { + # Official Name : Accepted strings + 'D5_HEAT': ['d5'], + 'D45_HEAT': ['d45'], + 'NUM_OF_DD_HEATERS': [], +} - # Add aliases to be searchable (listed when pressed TAB) - created_enum._member_names_.append('FIRST_PRESSURE_SENSOR') - created_enum._member_names_.append('LAST_PRESSURE_SENSOR') - created_enum._member_names_.append('FIRST_CONDUCTIVITY_SENSOR') - created_enum._member_names_.append('LAST_CONDUCTIVITY_SENSOR') - created_enum._member_names_.append('FIRST_AVERAGE_SENSOR') - created_enum._member_names_.append('FIRST_AVERAGE_SENSOR') - return created_enum +@unique +class DDLevelSensorNames(DialinEnum): + D6_LEVEL = 0 # floater switch low, medium and high status + D63_LEVEL = 1 # bicarb level low or high status + D46_LEVEL = 2 # Spent dialysate air separation chamber level low or high status + NUM_OF_FP_D98_LEVELSERV_STATES = 3 # D98 Conductivity Level Sensor + NUM_OF_LEVELS = 4 # Number of Level Sensors +DDLevelSensorNames._str_list = { + # Official Name : Accepted strings + 'D6_LEVEL': ['d6'], + 'D63_LEVEL': ['d63'], + 'D46_LEVEL': ['d46'], + 'D98_LEVEL': ['d98'], + 'NUM_OF_LEVELS': [], +} - def _create_dd_valve_names(self): - members = { - # Official Name : Accepted strings - 'D14_VALV': ['d14'], # Valve Hydraulics Outlet (D14) - 'D52_VALV': ['d52'], # Valve Thermal Disinfect (D52) - 'D8_VALV': ['d8'], # Valve Hydraulics Bypass (D8) - 'D54_VALV': ['d54'], # Valve Rinse Port (D54) - 'D53_VALV': ['d53'], # Valve Drain (D53) - 'D34_VALV': ['d34'], # Valve Dialyzer Bypass (D34) - 'D64_VALV': ['d64'], # Valve Purge 1 (D64) - 'D31_VALV': ['d31'], # Valve Pressure Test (D31) - 'D65_VALV': ['d65'], # Valve DryBcarb Inlet (D65) - 'D35_VALV': ['d35'], # Valve Dialyzer Inlet (D35) - 'D40_VALV': ['d40'], # Valve Dialyzer Outlet (D40) - 'D47_VALV': ['d47'], # Valve Dialysate Out Purge 2 (D47) - 'D3_VALV': ['d3'], # Valve Hydraulics Inlet (D3) - 'D80_VALV': ['d80'], # Valve Dry Bicarb (D80) - 'D81_VALV': ['d81'], # Valve De-scaler (D81) - 'D85_VALV': ['d85'], # Valve De-scaler (D85) - 'D23_VALV': ['d23'], # Balancing chamber Valve 1 (D23) - 'D19_VALV': ['d19'], # Balancing chamber Valve 2 (D19) - 'D25_VALV': ['d25'], # Balancing chamber Valve 3 (D25) - 'D21_VALV': ['d21'], # Balancing chamber Valve 4 (D21) - 'D24_VALV': ['d24'], # Balancing chamber Valve 5 (D24) - 'D20_VALV': ['d20'], # Balancing chamber Valve 6 (D20) - 'D26_VALV': ['d26'], # Balancing chamber Valve 7 (D26) - 'D22_VALV': ['d22'], # Balancing chamber Valve 8 (D22) - 'D79_PMP_VALV': ['d79'], # D79 pump mapped to Spare Valve 0 - 'D83_VALV': ['d83'], # D83 De-scaler Valve mapped to Spare Valve 1 - 'D91_VALV': ['d91'], # D91 De-scaler Valve mapped to Spare Valve 2 - 'SPARE3_VALV': ['spare3'], # Spare Valve 3 - 'SPARE4_VALV': ['spare4'], # Spare Valve 4 - 'SPARE5_VALV': ['spare5'], # Spare Valve 5 - 'D100_VALV': ['d100'], # D100 De-scaler Valve mapped to Spare Valve 6 - 'SPARE7_VALV': ['spare7'], # Spare Valve 7 - 'NUM_OF_DD_VALVES': [], # Number of Valves for the DD - } - created_enum = unique(DialinEnum('DDValveNames', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDPistonPumpNames(DialinEnum): + ACID = 0 # Acid piston pump + BICARB = 1 # Bicarbonate piston pump + UF = 2 # Ultrafiltration piston pump + NUM_OF_PISTON_PUMPS = 3 # Number of piston pumps - def _create_dd_monitored_voltages(self): - members = { - # Official Name : Accepted strings - 'MONITORED_LINE_1_2V': ['1.2v'], # Processor voltage (1.2V) - 'MONITORED_LINE_3_3V': ['3.3v'], # Logic voltage (3.3V) - 'MONITORED_LINE_5V_LOGIC': ['5v'], # Logic voltage (5V) - 'MONITORED_LINE_24V_1': ['24v line 1'], # Actuators voltage (24V) - 'MONITORED_LINE_24V_2': ['24v line 1'], # Actuators regen voltage (24V) - 'MONITORED_LINE_FPGA_VCC_V': ['fpga vcc'], # FPGA Vcc (3V) - 'MONITORED_LINE_FPGA_AUX_V': ['fpga aux'], # FPGA Vaux (3V) - 'MONITORED_LINE_FPGA_PVN_V': ['fpga pvn'], # FPGA Vpvn (1V) - 'NUM_OF_MONITORED_VOLTAGE_LINES': [], # Number of TD operation modes - } - created_enum = unique(DialinEnum('DDMonitoredVoltages', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDPistonPumpNames._str_list = { + # Official Name : Accepted strings + 'ACID': ['d11', 'acid pump'], + 'BICARB': ['d10', 'bicarb pump'], + 'UF': ['d76', 'uf pump', 'ultrafiltration pump'], + 'NUM_OF_PISTON_PUMPS': [], +} +@unique +class DDPressureSensorNames(DialinEnum): + D9_PRES = 0 # Hydraulics outlet pressure (PHo/Pn) + D66_PRES = 1 # Dry Bicarb pressure (PDB/PCb) + D51_PRES = 2 # Spent Dialysate pressure (PDs) + D18_PRES = 3 # Fresh Dialysate pressure (PDf) + D41_PRES = 4 # Transmembrane pressure (Ptm) + D87_PRES = 5 # D87 Pressure Sensor + NUM_OF_PRESSURE_SENSORS = 6 # Number of pressure sensors - # ================================================== Enum Creators: Support ================================================== - def _create_dd_balancing_chamber_states(self): - members = { - # Official Name : Accepted strings - 'BAL_CHAMBER_STATE_START': ['start'], # Initial state of balancing chamber - 'BAL_CHAMBER_STATE1_FILL_START': ['state 1 fill start'], # Balancing chamber state 1 fill start state - 'BAL_CHAMBER_STATE1_BICARB_ACID_DOSING_CNTRL': ['state 1 bicarb acid dosing control', 'state 1 dosing control'], # Balancing Chamber state 1 Bicarb and acid dosing control state - 'BAL_CHAMBER_STATE1_FILL_END': ['state 1 fill end'], # Balancing Chamber state 1 fill end state - 'BAL_CHAMBER_STATE2_FILL_START': ['state 2 fill start'], # Balancing chamber state 2 fill start state - 'BAL_CHAMBER_STATE2_BICARB_ACID_DOSING_CNTRL': ['state 2 bicarb acid dosing control', 'state 2 dosing control'], # Balancing Chamber state 2 Bicarb and acid dosing control state - 'BAL_CHAMBER_STATE2_FILL_END': ['state 2 fill end'], # Balancing Chamber state 2 fill end state - 'NUM_OF_BAL_CHAMBER_EXEC_STATES': [], # Number of balancing chamber states - } - created_enum = unique(DialinEnum('DDBalancingChamberStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDPressureSensorNames._str_list = { + # Official Name : Accepted strings + 'D9_PRES': ['d9'], + 'D66_PRES': ['d66'], + 'D51_PRES': ['d51'], + 'D18_PRES': ['d18'], + 'D41_PRES': ['d41'], + 'D87_PRES': ['d87'], + 'NUM_OF_PRESSURE_SENSORS': [], +} - def _create_dd_balancing_chamber_switch_states(self): - members = { - # Official Name : Accepted strings - 'BAL_CHAMBER_SW_STATE1': ['state 1'], # Balancing chamber switching state 1 (V2,V5 and V3, V8 open, rest closed) - 'BAL_CHAMBER_SW_STATE2': ['state 2'], # Balancing chamber switching state 2 ( V1,V6 and V4, V7 open, rest closed) - 'NUM_OF_BAL_CHAMBER_SW': [], # Number of balancing chamber states - } - created_enum = unique(DialinEnum('DDBalancingChamberSwitchStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +class DDTemperatureSensorNames(DialinEnum): + D1_TEMP = 0 # Heat exchanger Inlet temperature sensor + D78_TEMP = 1 # Heat exchanger Outlet temperature sensor + D4_TEMP = 2 # Hydraulics primary heater temperature sensor + D50_TEMP = 3 # Trimmer heater temperature sensor + D99_TEMP = 4 # D98(D99) Conductivity sensor temperature value + BRD_TEMP = 5 # Barometric temperature sensor + D16_TEMP = 6 # D16(D17) Conductivity sensor temperature value + D28_TEMP = 7 # D28(D27) Conductivity sensor temperature value + D30_TEMP = 8 # D30(D29) Conductivity sensor temperature value + D44_TEMP = 9 # D44(D43) Conductivity sensor temperature value + D75_TEMP = 10 # D75(D74) Conductivity sensor temperature value + D4_AVG_TEMP = 11 # D4 Filtered value + D50_AVG_TEMP = 12 # D50 Filtered value + D99_AVG_TEMP = 13 # D99 Filtered value + D28_AVG_TEMP = 14 # D28 Filtered value + D30_AVG_TEMP = 15 # D30 Filtered value + D9_TEMP = 16 # D9 Pressure sensor temperature value + D66_TEMP = 17 # D66 Pressure sensor temperature value + D51_TEMP = 18 # D51 Pressure sensor temperature value + D18_TEMP = 19 # D18 Pressure sensor temperature value + D41_TEMP = 20 # D41 Pressure sensor temperature value + D87_TEMP = 21 # D87 Pressure sensor temperature value + NUM_OF_TEMP_SENSORS = 22 # Number of Temperature Sensors + # Aliases + FIRST_PRESSURE_SENSOR = D9_TEMP + LAST_PRESSURE_SENSOR = D87_TEMP + FIRST_CONDUCTIVITY_SENSOR = D16_TEMP + LAST_CONDUCTIVITY_SENSOR = D75_TEMP + FIRST_AVERAGE_SENSOR = D4_AVG_TEMP + LAST_AVERAGE_SENSOR = D30_AVG_TEMP - def _create_dd_blood_leak_states(self): - members = { - # Official Name : Accepted strings - 'BLOOD_LEAK_WAIT_FOR_POST_STATE': ['wait for post', 'wait'], # - 'BLOOD_LEAK_CHECK_SET_POINT_STATE': ['check set point'], # - 'BLOOD_LEAK_INIT_STATE': ['init'], # - 'BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE': ['check zero and self test'], # - 'BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE': ['verify', 'verify intensity after zeroing'], # - 'BLOOD_LEAK_NORMAL_STATE': ['normal'], # - 'BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE': ['recover blood', 'recover blood detect'], # - 'NUM_OF_BLOOD_LEAK_STATES': [], # Number of blood leak states - } - created_enum = unique(DialinEnum('DDBloodLeakStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDTemperatureSensorNames._str_list = { + # Official Name : Accepted strings + 'D16_TEMP': ['d1'], + 'D78_TEMP': ['d78'], + 'D4_TEMP': ['d4'], + 'D50_TEMP': ['d50'], + 'D99_TEMP': ['d90'], + 'BRD_TEMP': ['brd', 'board'], + 'D16_TEMP': ['d16'], + 'D28_TEMP': ['d28'], + 'D30_TEMP': ['d30'], + 'D44_TEMP': ['d44'], + 'D75_TEMP': ['d75'], + 'D4_AVG_TEMP': ['d4 avg', 'd4 average'], + 'D50_AVG_TEMP': ['d50 avg', 'd50 average'], + 'D99_AVG_TEMP': ['d99 avg', 'd99 average'], + 'D28_AVG_TEMP': ['d28 avg', 'd28 average'], + 'D30_AVG_TEMP': ['d39 avg', 'd39 average'], + 'D9_TEMP': ['d9'], + 'D66_TEMP': ['d66'], + 'D51_TEMP': ['d51'], + 'D18_TEMP': ['d18'], + 'D41_TEMP': ['d41'], + 'D87_TEMP': ['d87'], + 'NUM_OF_TEMP_SENSORS': [], +} - def _create_dd_concentrate_pump_attributes(self): - members = { - # Official Name : Accepted strings - 'CURRENT_STATE': ['current state'], # Current State Concentrate Pump Attribute - 'CURRENT_SET_SPEED': ['current speed'], # Current Set Speed Concentrate Pump Attribute - 'MEASURED_SPEED': ['measured speed'], # Measured Speed Concentrate Pump Attribute - 'TARGET_SPEED': ['target speed'], # Target Speed Concentrate Pump Attribute - 'PULSE_US': ['pulse'], # Hall Sensor Pulse Width (in micro seconds) Concentrate Pump Attribute - 'TARGET_REV_COUNT': ['target revolutions count', 'target rev count'], # Target Revolutions Concentrate Pump Attribute - 'MEASURED_REV_COUNT': ['measured revolutions count', 'measured rev count'], # Measured Revolutions Concentrate Pump Attribute - 'PARKED': ['parked'], # Parked Concentrate Pump Attribute - 'PARK_FAULT': ['fault', 'park fault'], # Park Fault Concentrate Pump Attribute - 'NUM_OF_D10_D11_CONCENTRATE_PUMP_ATTRIBUTES': [], # Number of Acid (D11) and Bicarbonate (D10) Concentrate Pump Attributes - } - created_enum = unique(DialinEnum('DDConcentratePumpAttributes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDValveNames(DialinEnum): + D14_VALV = 0 # Valve Hydraulics Outlet (D14) + D52_VALV = 1 # Valve Thermal Disinfect (D52) + D8_VALV = 2 # Valve Hydraulics Bypass (D8) + D54_VALV = 3 # Valve Rinse Port (D54) + D53_VALV = 4 # Valve Drain (D53) + D34_VALV = 5 # Valve Dialyzer Bypass (D34) + D64_VALV = 6 # Valve Purge 1 (D64) + D31_VALV = 7 # Valve Pressure Test (D31) + D65_VALV = 8 # Valve DryBcarb Inlet (D65) + D35_VALV = 9 # Valve Dialyzer Inlet (D35) + D40_VALV = 10 # Valve Dialyzer Outlet (D40) + D47_VALV = 11 # Valve Dialysate Out Purge 2 (D47) + D3_VALV = 12 # Valve Hydraulics Inlet (D3) + D80_VALV = 13 # Valve Dry Bicarb (D80) + D81_VALV = 14 # Valve De-scaler (D81) + D85_VALV = 15 # Valve De-scaler (D85) + D23_VALV = 16 # Balancing chamber Valve 1 (D23) + D19_VALV = 17 # Balancing chamber Valve 2 (D19) + D25_VALV = 18 # Balancing chamber Valve 3 (D25) + D21_VALV = 19 # Balancing chamber Valve 4 (D21) + D24_VALV = 20 # Balancing chamber Valve 5 (D24) + D20_VALV = 21 # Balancing chamber Valve 6 (D20) + D26_VALV = 22 # Balancing chamber Valve 7 (D26) + D22_VALV = 23 # Balancing chamber Valve 8 (D22) + D79_PMP_VALV = 24 # D79 pump mapped to Spare Valve 0 + D83_VALV = 25 # D83 De-scaler Valve mapped to Spare Valve 1 + D91_VALV = 26 # D91 De-scaler Valve mapped to Spare Valve 2 + SPARE3_VALV = 27 # Spare Valve 3 + SPARE4_VALV = 28 # Spare Valve 4 + SPARE5_VALV = 29 # Spare Valve 5 + D100_VALV = 30 # D100 De-scaler Valve mapped to Spare Valve 6 + SPARE7_VALV = 31 # Spare Valve 7 + NUM_OF_DD_VALVES = 32 # Number of Valves for the DD +DDValveNames._str_list = { + # Official Name : Accepted strings + 'D14_VALV': ['d14'], + 'D52_VALV': ['d52'], + 'D8_VALV': ['d8'], + 'D54_VALV': ['d54'], + 'D53_VALV': ['d53'], + 'D34_VALV': ['d34'], + 'D64_VALV': ['d64'], + 'D31_VALV': ['d31'], + 'D65_VALV': ['d65'], + 'D35_VALV': ['d35'], + 'D40_VALV': ['d40'], + 'D47_VALV': ['d47'], + 'D3_VALV': ['d3'], + 'D80_VALV': ['d80'], + 'D81_VALV': ['d81'], + 'D85_VALV': ['d85'], + 'D23_VALV': ['d23'], + 'D19_VALV': ['d19'], + 'D25_VALV': ['d25'], + 'D21_VALV': ['d21'], + 'D24_VALV': ['d24'], + 'D20_VALV': ['d20'], + 'D26_VALV': ['d26'], + 'D22_VALV': ['d22'], + 'D79_PMP_VALV': ['d79'], + 'D83_VALV': ['d83'], + 'D91_VALV': ['d91'], + 'SPARE3_VALV': ['spare3'], + 'SPARE4_VALV': ['spare4'], + 'SPARE5_VALV': ['spare5'], + 'D100_VALV': ['d100'], + 'SPARE7_VALV': ['spare7'], + 'NUM_OF_DD_VALVES': [], +} - def _create_dd_concentrate_pump_states(self): - members = { - # Official Name : Accepted strings - 'CONCENTRATE_PUMP_OFF_STATE': ['off'], # Concentrate Pump Off State - 'CONCENTRATE_PUMP_RAMP_TO_TARGET_SPEED_STATE': ['ramp to target speed'], # Ramp to Target Speed Concentrate Pump State - 'CONCENTRATE_PUMP_CONTROL_TARGET_SPEED_STATE': ['control target speed'], # Control Target Speed Concentrate Pump State - 'NUM_OF_CONCENTRATE_PUMP_STATES': [], # Number of Concentrate Pump States - } - created_enum = unique(DialinEnum('DDConcentratePumpStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDMonitoredVoltages(DialinEnum): + MONITORED_LINE_1_2V = 0 # Processor voltage (1.2V) + MONITORED_LINE_3_3V = 1 # Logic voltage (3.3V) + MONITORED_LINE_5V_LOGIC = 2 # Logic voltage (5V) + MONITORED_LINE_24V_1 = 3 # Actuators voltage (24V) + MONITORED_LINE_24V_2 = 4 # Actuators regen voltage (24V) + MONITORED_LINE_FPGA_VCC_V = 5 # FPGA Vcc (3V) + MONITORED_LINE_FPGA_AUX_V = 6 # FPGA Vaux (3V) + MONITORED_LINE_FPGA_PVN_V = 7 # FPGA Vpvn (1V) + NUM_OF_MONITORED_VOLTAGE_LINES = 8 # Number of TD operation modes - def _create_dd_dialysate_pump_attributes(self): - members = { - # Official Name : Accepted strings - 'TARGET_RPM': ['target rp,'], # Target RPM Dialysate Pump Attribute - 'MEASURED_SPEED': ['measured speed'], # Measured Speed Dialysate Pump Attribute - 'CURRENT_SPEED': ['current speed'], # Current Speed Dialysate Pump Attribute - 'STATE': ['state'], # State to command Dialysate Pump Attribute - 'TARGET_PRESSURE': ['target pressure'], # Target Pressure Dialysate Pump Attribute - 'MEASURED_PRESSURE': ['measured pressure'], # Measured Pressure Dialysate Pump Attribute - 'MEASURED_CURRENT': ['measured pressure'], # Measured Current Dialysate Pump Attribute - 'CONTROL': ['control'], # Pump Run/Stop Control Pump Attribute - 'DIRECTION_ERROR_COUNT': ['direction error count', 'error count'], # Direction Error Count Dialysate Pump Attribute - 'MEASURED_DIRECTION': ['measured direction'], # Measured Direction Dialysate Pump Attribute - 'NUM_OF_DIALYSATE_PUMP_ATTRIBUTES': [], # Number of Dialysate Pump Attributes - } - created_enum = unique(DialinEnum('DDDialysatePumpAttributes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDMonitoredVoltages._str_list = { + # Official Name : Accepted strings + 'MONITORED_LINE_1_2V': ['1.2v'], + 'MONITORED_LINE_3_3V': ['3.3v'], + 'MONITORED_LINE_5V_LOGIC': ['5v'], + 'MONITORED_LINE_24V_1': ['24v line 1'], + 'MONITORED_LINE_24V_2': ['24v line 1'], + 'MONITORED_LINE_FPGA_VCC_V': ['fpga vcc'], + 'MONITORED_LINE_FPGA_AUX_V': ['fpga aux'], + 'MONITORED_LINE_FPGA_PVN_V': ['fpga pvn'], + 'NUM_OF_MONITORED_VOLTAGE_LINES': [], +} - def _create_dd_dialysate_pump_states(self): - members = { - # Official Name : Accepted strings - 'DIALYSATE_PUMP_OFF_STATE': ['off'], # Dialysate Pump Off State - 'DIALYSATE_PUMP_RAMP_UP_STATE': ['ramp up'], # Dialysate Pump Ramp Up State - 'DIALYSATE_PUMP_CONTROL_TO_TARGET_STATE': ['control to target'], # Dialysate Pump Control to Target State - 'NUM_OF_DIALYSATE_PUMP_STATES': [], # Number of Dialysate Pump States - } - created_enum = unique(DialinEnum('DDDialysatePumpsStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +# ================================================== Enum Creators: Support ================================================== +@unique +class DDBalancingChamberStates(DialinEnum): + BAL_CHAMBER_STATE_START = 0 # Initial state of balancing chamber + BAL_CHAMBER_STATE1_FILL_START = 1 # Balancing chamber state 1 fill start state + BAL_CHAMBER_STATE1_BICARB_ACID_DOSING_CNTRL = 2 # Balancing Chamber state 1 Bicarb and acid dosing control state + BAL_CHAMBER_STATE1_FILL_END = 3 # Balancing Chamber state 1 fill end state + BAL_CHAMBER_STATE2_FILL_START = 4 # Balancing chamber state 2 fill start state + BAL_CHAMBER_STATE2_BICARB_ACID_DOSING_CNTRL = 5 # Balancing Chamber state 2 Bicarb and acid dosing control state + BAL_CHAMBER_STATE2_FILL_END = 6 # Balancing Chamber state 2 fill end state + NUM_OF_BAL_CHAMBER_EXEC_STATES = 7 # Number of balancing chamber states - def _create_dd_heater_start_stop(self): - members = { - # Official Name : Accepted strings - 'STOP': ['stop'], - 'START': ['start'], - } - created_enum = unique(DialinEnum('DDHeaterStartStop', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDBalancingChamberStates._str_list = { + # Official Name : Accepted strings + 'BAL_CHAMBER_STATE_START': ['start'], + 'BAL_CHAMBER_STATE1_FILL_START': ['state 1 fill start'], + 'BAL_CHAMBER_STATE1_BICARB_ACID_DOSING_CNTRL': ['state 1 bicarb acid dosing control', 'state 1 dosing control'], + 'BAL_CHAMBER_STATE1_FILL_END': ['state 1 fill end'], + 'BAL_CHAMBER_STATE2_FILL_START': ['state 2 fill start'], + 'BAL_CHAMBER_STATE2_BICARB_ACID_DOSING_CNTRL': ['state 2 bicarb acid dosing control', 'state 2 dosing control'], + 'BAL_CHAMBER_STATE2_FILL_END': ['state 2 fill end'], + 'NUM_OF_BAL_CHAMBER_EXEC_STATES': [], +} - def _create_dd_heater_attributes(self): - members = { - # Official Name : Accepted strings - 'HEAT_DUTY_CYCLE': ['duty cycle'], # Heat Duty Cycle Attribute for Heaters - 'HEAT_TARGET_TEMP': ['target temperature', 'target temp'], # Target Temperature Attribute for Heaters - 'HEAT_STATE': ['state', 'heat state'], # State to command Attribute for Heaters - 'DUTY_CYCLE_COUNT': ['duty cycle count'], # Duty Cycle Count Attribute for Heaters - 'PWM_PERIOD': ['pwm', 'pwm period'], # Pulse Width Modulation Attribute for Heaters - 'ADJUSTED_TARGET_TEMP': ['adjusted target temperature', 'adj target temp'], # Adjusted Target Temperature Attribute for Heaters - 'TARGET_TEMP_TD': ['target temperature td', 'target temp td'], # Target Temperature Attribute for Heaters - 'NUM_OF_DD_HEATER_ATTRIBUTES': [], # Number of Heater Attributes - } - created_enum = unique(DialinEnum('DDHeaterAttributes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDBalancingChamberSwitchStates(DialinEnum): + BAL_CHAMBER_SW_STATE1 = 0 # Balancing chamber switching state 1 (V2,V5 and V3, V8 open, rest closed) + BAL_CHAMBER_SW_STATE2 = 1 # Balancing chamber switching state 2 ( V1,V6 and V4, V7 open, rest closed) + NUM_OF_BAL_CHAMBER_SW = 2 # Number of balancing chamber states +DDBalancingChamberSwitchStates._str_list = { + # Official Name : Accepted strings + 'BAL_CHAMBER_SW_STATE1': ['state 1'], + 'BAL_CHAMBER_SW_STATE2': ['state 2'], + 'NUM_OF_BAL_CHAMBER_SW': [], +} - def _create_dd_heater_exec_states(self): - members = { - # Official Name : Accepted strings - 'HEATER_EXEC_STATE_OFF': ['heater off', 'off'], # Heater Execution Off State - 'HEATER_EXEC_STATE_RAMP_TO_TARGET': ['ramp to target'], # Heater Execution Ramp to Target State - 'HEATER_EXEC_STATE_CONTROL_TO_TARGET': ['control to target'], # Heater Execution Control to Target State - 'HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET': ['control to disinfect target'], # Heater Execution Control to Disinfection State - 'NUM_OF_HEATERS_EXEC_STATE': [], # Number of Heater Execution States - } - created_enum = unique(DialinEnum('DDHeaterExecState', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDBloodLeakStates(DialinEnum): + BLOOD_LEAK_WAIT_FOR_POST_STATE = 0 # + BLOOD_LEAK_CHECK_SET_POINT_STATE = 1 # + BLOOD_LEAK_INIT_STATE = 2 # + BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE = 3 # + BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE = 4 # + BLOOD_LEAK_NORMAL_STATE = 5 # + BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE = 6 # + NUM_OF_BLOOD_LEAK_STATES = 7 # Number of blood leak states - def _create_dd_piston_pump_attributes(self): - members = { - # Official Name : Accepted strings - 'CONTROL_STATE': ['control', 'control state'], # Control State for the Piston Pumps - 'SW_COUNTER': ['sw', 'sw counter', 'software counter'], # Software counter attribute for the Piston Pumps - 'CYCLE_COUNTER': ['cycle', 'cycle counter'], # Cycle Counter for the Piston Pumps - 'NUM_OF_PISTON_PUMP_ATTRIBUTES': [], # Number of Piston Pump Attributes - } - created_enum = unique(DialinEnum('DDPistonPumpAttributes', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +DDBloodLeakStates._str_list = { + # Official Name : Accepted strings + 'BLOOD_LEAK_WAIT_FOR_POST_STATE': ['wait for post', 'wait'], + 'BLOOD_LEAK_CHECK_SET_POINT_STATE': ['check set point'], + 'BLOOD_LEAK_INIT_STATE': ['init'], + 'BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE': ['check zero and self test'], + 'BLOOD_LEAK_VERIFY_INTENSITY_AFTER_ZEROING_STATE': ['verify', 'verify intensity after zeroing'], + 'BLOOD_LEAK_NORMAL_STATE': ['normal'], + 'BLOOD_LEAK_RECOVER_BLOOD_DETECT_STATE': ['recover blood', 'recover blood detect'], + 'NUM_OF_BLOOD_LEAK_STATES': [], +} - def _create_dd_valve_states(self): - members = { - # Official Name : Accepted strings - 'VALVE_STATE_CLOSED': ['closed'], # Valve Closed State - 'VALVE_STATE_OPEN': ['open'], # Valve Open State - 'NUM_OF_VALVE_STATES': [], # Valve Open State - } - created_enum = unique(DialinEnum('DDValveStates', self.create_members(members))) - created_enum._str_list = members - created_enum.from_str = classmethod(self.from_str) - return created_enum +@unique +class DDConcentratePumpAttributes(DialinEnum): + CURRENT_STATE = 0 # Current State Concentrate Pump Attribute + CURRENT_SET_SPEED = 1 # Current Set Speed Concentrate Pump Attribute + MEASURED_SPEED = 2 # Measured Speed Concentrate Pump Attribute + TARGET_SPEED = 3 # Target Speed Concentrate Pump Attribute + PULSE_US = 4 # Hall Sensor Pulse Width (in micro seconds) Concentrate Pump Attribute + TARGET_REV_COUNT = 5 # Target Revolutions Concentrate Pump Attribute + MEASURED_REV_COUNT = 6 # Measured Revolutions Concentrate Pump Attribute + PARKED = 7 # Parked Concentrate Pump Attribute + PARK_FAULT = 8 # Park Fault Concentrate Pump Attribute + NUM_OF_D10_D11_CONCENTRATE_PUMP_ATTRIBUTES = 9 # Number of Acid (D11) and Bicarbonate (D10) Concentrate Pump Attributes +DDConcentratePumpAttributes._str_list = { + # Official Name : Accepted strings + 'CURRENT_STATE': ['current state'], + 'CURRENT_SET_SPEED': ['current speed'], + 'MEASURED_SPEED': ['measured speed'], + 'TARGET_SPEED': ['target speed'], + 'PULSE_US': ['pulse'], + 'TARGET_REV_COUNT': ['target revolutions count', 'target rev count'], + 'MEASURED_REV_COUNT': ['measured revolutions count', 'measured rev count'], + 'PARKED': ['parked'], + 'PARK_FAULT': ['fault', 'park fault'], + 'NUM_OF_D10_D11_CONCENTRATE_PUMP_ATTRIBUTES': [], +} +@unique +class DDConcentratePumpStates(DialinEnum): + CONCENTRATE_PUMP_OFF_STATE = 0 # Concentrate Pump Off State + CONCENTRATE_PUMP_RAMP_TO_TARGET_SPEED_STATE = 1 # Ramp to Target Speed Concentrate Pump State + CONCENTRATE_PUMP_CONTROL_TARGET_SPEED_STATE = 2 # Control Target Speed Concentrate Pump State + NUM_OF_CONCENTRATE_PUMP_STATES = 3 # Number of Concentrate Pump States + +DDConcentratePumpStates._str_list = { + # Official Name : Accepted strings + 'CONCENTRATE_PUMP_OFF_STATE': ['off'], + 'CONCENTRATE_PUMP_RAMP_TO_TARGET_SPEED_STATE': ['ramp to target speed'], + 'CONCENTRATE_PUMP_CONTROL_TARGET_SPEED_STATE': ['control target speed'], + 'NUM_OF_CONCENTRATE_PUMP_STATES': [], +} + + +@unique +class DDDialysatePumpAttributes(DialinEnum): + TARGET_RPM = 0 # Target RPM Dialysate Pump Attribute + MEASURED_SPEED = 1 # Measured Speed Dialysate Pump Attribute + CURRENT_SPEED = 2 # Current Speed Dialysate Pump Attribute + STATE = 3 # State to command Dialysate Pump Attribute + TARGET_PRESSURE = 4 # Target Pressure Dialysate Pump Attribute + MEASURED_PRESSURE = 5 # Measured Pressure Dialysate Pump Attribute + MEASURED_CURRENT = 6 # Measured Current Dialysate Pump Attribute + CONTROL = 7 # Pump Run/Stop Control Pump Attribute + DIRECTION_ERROR_COUNT = 8 # Direction Error Count Dialysate Pump Attribute + MEASURED_DIRECTION = 9 # Measured Direction Dialysate Pump Attribute + NUM_OF_DIALYSATE_PUMP_ATTRIBUTES = 10 # Number of Dialysate Pump Attributes + +DDDialysatePumpAttributes._str_list = { + # Official Name : Accepted strings + 'TARGET_RPM': ['target rp,'], + 'MEASURED_SPEED': ['measured speed'], + 'CURRENT_SPEED': ['current speed'], + 'STATE': ['state'], + 'TARGET_PRESSURE': ['target pressure'], + 'MEASURED_PRESSURE': ['measured pressure'], + 'MEASURED_CURRENT': ['measured pressure'], + 'CONTROL': ['control'], + 'DIRECTION_ERROR_COUNT': ['direction error count', 'error count'], + 'MEASURED_DIRECTION': ['measured direction'], + 'NUM_OF_DIALYSATE_PUMP_ATTRIBUTES': [], +} + + +@unique +class DDDialysatePumpsStates(DialinEnum): + DIALYSATE_PUMP_OFF_STATE = 0 # Dialysate Pump Off State + DIALYSATE_PUMP_RAMP_UP_STATE = 1 # Dialysate Pump Ramp Up State + DIALYSATE_PUMP_CONTROL_TO_TARGET_STATE = 2 # Dialysate Pump Control to Target State + NUM_OF_DIALYSATE_PUMP_STATES = 3 # Number of Dialysate Pump States + +DDDialysatePumpsStates._str_list = { + # Official Name : Accepted strings + 'DIALYSATE_PUMP_OFF_STATE': ['off'], + 'DIALYSATE_PUMP_RAMP_UP_STATE': ['ramp up'], + 'DIALYSATE_PUMP_CONTROL_TO_TARGET_STATE': ['control to target'], + 'NUM_OF_DIALYSATE_PUMP_STATES': [], +} + + +@unique +class DDHeaterStartStop(DialinEnum): + STOP = 0 # Stop heater + START = 1 # Start heater + NUM_OF_HEATER_STATES = 2 # Number of Heater states + +DDHeaterStartStop._str_list = { + # Official Name : Accepted strings + 'STOP': [], + 'START': [], + 'NUM_OF_HEATER_STATES': [], +} + + +@unique +class DDHeaterAttributes(DialinEnum): + HEAT_DUTY_CYCLE = 0 # Heat Duty Cycle Attribute for Heaters + HEAT_TARGET_TEMP = 1 # Target Temperature Attribute for Heaters + HEAT_STATE = 2 # State to command Attribute for Heaters + DUTY_CYCLE_COUNT = 3 # Duty Cycle Count Attribute for Heaters + PWM_PERIOD = 4 # Pulse Width Modulation Attribute for Heaters + ADJUSTED_TARGET_TEMP = 5 # Adjusted Target Temperature Attribute for Heaters + TARGET_TEMP_TD = 6 # Target Temperature Attribute for Heaters + NUM_OF_DD_HEATER_ATTRIBUTES = 7 # Number of Heater Attributes + +DDHeaterAttributes._str_list = { + # Official Name : Accepted strings + 'HEAT_DUTY_CYCLE': ['duty cycle'], + 'HEAT_TARGET_TEMP': ['target temperature', 'target temp'], + 'HEAT_STATE': ['state', 'heat state'], + 'DUTY_CYCLE_COUNT': ['duty cycle count'], + 'PWM_PERIOD': ['pwm', 'pwm period'], + 'ADJUSTED_TARGET_TEMP': ['adjusted target temperature', 'adj target temp'], + 'TARGET_TEMP_TD': ['target temperature td', 'target temp td'], + 'NUM_OF_DD_HEATER_ATTRIBUTES': [], +} + + +@unique +class DDHeaterExecState(DialinEnum): + HEATER_EXEC_STATE_OFF = 0 # Heater Execution Off State + HEATER_EXEC_STATE_RAMP_TO_TARGET = 1 # Heater Execution Ramp to Target State + HEATER_EXEC_STATE_CONTROL_TO_TARGET = 2 # Heater Execution Control to Target State + HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET = 3 # Heater Execution Control to Disinfection State + NUM_OF_HEATERS_EXEC_STATE = 4 # Number of Heater Execution States + +DDHeaterExecState._str_list = { + # Official Name : Accepted strings + 'HEATER_EXEC_STATE_OFF': ['heater off', 'off'], + 'HEATER_EXEC_STATE_RAMP_TO_TARGET': ['ramp to target'], + 'HEATER_EXEC_STATE_CONTROL_TO_TARGET': ['control to target'], + 'HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET': ['control to disinfect target'], + 'NUM_OF_HEATERS_EXEC_STATE': [], +} + + +@unique +class DDPistonPumpAttributes(DialinEnum): + CONTROL_STATE = 0 # Control State for the Piston Pumps + SW_COUNTER = 1 # Software counter attribute for the Piston Pumps + CYCLE_COUNTER = 2 # Cycle Counter for the Piston Pumps + NUM_OF_PISTON_PUMP_ATTRIBUTES = 3 # Number of Piston Pump Attributes + +DDPistonPumpAttributes._str_list = { + # Official Name : Accepted strings + 'CONTROL_STATE': ['control', 'control state'], + 'SW_COUNTER': ['sw', 'sw counter', 'software counter'], + 'CYCLE_COUNTER': ['cycle', 'cycle counter'], + 'NUM_OF_PISTON_PUMP_ATTRIBUTES': [], +} + + +@unique +class DDValveStates(DialinEnum): + VALVE_STATE_CLOSED = 0 # Valve Closed State + VALVE_STATE_OPEN = 1 # Valve Open State + NUM_OF_VALVE_STATES = 2 # Number of Valve states + +DDValveStates._str_list = { + # Official Name : Accepted strings + 'VALVE_STATE_CLOSED': ['closed'], + 'VALVE_STATE_OPEN': ['open'], + 'NUM_OF_VALVE_STATES': [], +} + + + # ================================================== Creates a singleton ================================================== -dd_enum_repository = DD_Defs() +class DD_Defs(): -# Attach listener to update function -test_config_change.add_listener(dd_enum_repository.update_enums) + DDOpModes = DDOpModes + DDFaultStates = DDFaultStates + DDFaultNVDataStates = DDFaultNVDataStates + DDServiceStates = DDServiceStates + DDInitStates = DDInitStates + DDStandbyStates = DDStandbyStates + DDPreGenDialysateStates = DDPreGenDialysateStates + DDGenDialysateModeStates = DDGenDialysateModeStates + DDPostGenDialysateStates = DDPostGenDialysateStates + DDHeatDisinfectStates = DDHeatDisinfectStates + DDHeaterCoolingStates = DDHeaterCoolingStates + DDROPermeateStates = DDROPermeateStates + DDNotLegalStates = DDNotLegalStates + + DDEventList = DDEventList + DDEventDataTypes = DDEventDataTypes + + DDConcentratePumpNames = DDConcentratePumpNames + DDConductivitySensorNames = DDConductivitySensorNames + DDDialysatePumpNames = DDDialysatePumpNames + DDHeaterNames = DDHeaterNames + DDLevelSensorNames = DDLevelSensorNames + DDPistonPumpNames = DDPistonPumpNames + DDPressureSensorNames = DDPressureSensorNames + DDTemperatureSensorNames = DDTemperatureSensorNames + DDValveNames = DDValveNames + DDMonitoredVoltages = DDMonitoredVoltages + + DDBalancingChamberStates = DDBalancingChamberStates + DDBalancingChamberSwitchStates = DDBalancingChamberSwitchStates + DDBloodLeakStates = DDBloodLeakStates + DDConcentratePumpAttributes = DDConcentratePumpAttributes + DDConcentratePumpStates = DDConcentratePumpStates + DDDialysatePumpAttributes = DDDialysatePumpAttributes + DDDialysatePumpsStates =DDDialysatePumpsStates + DDHeaterStartStop = DDHeaterStartStop + DDHeaterAttributes = DDHeaterAttributes + DDHeaterExecState = DDHeaterExecState + DDPistonPumpAttributes = DDPistonPumpAttributes + DDValveStates = DDValveStates + +dd_enum_repository = DD_Defs() Fisheye: Tag 5c4a3b41a159d0e882fd41286d63e479a5aba08c refers to a dead (removed) revision in file `leahi_dialin/common/defs_base.py'. Fisheye: No comparison available. Pass `N' to diff? Index: leahi_dialin/common/fp_defs.py =================================================================== diff -u -rdefe59974cd16b0f1c825bfc61aae7c3862f812e -r5c4a3b41a159d0e882fd41286d63e479a5aba08c --- leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision defe59974cd16b0f1c825bfc61aae7c3862f812e) +++ leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision 5c4a3b41a159d0e882fd41286d63e479a5aba08c) @@ -14,7 +14,7 @@ # ############################################################################ -from enum import unique, auto +from enum import unique from .dd_defs import dd_enum_repository from ..utils.base import DialinEnum @@ -29,16 +29,16 @@ # ================================================== Enum Creators: Operations ================================================== @unique class FPOpModes(DialinEnum): - MODE_FAUL = auto() # Fault mode - MODE_SERV = auto() # Service mode - MODE_INIT = auto() # Initialization & POST mode - MODE_STAN = auto() # Standby mode - MODE_PRE_GENP = auto() # Pre Generate Permeate mode - MODE_GENP = auto() # Generate Permeate mode - MODE_DPGP = auto() # Defeatured Pre-Generate Permeate mode - MODE_DEGP = auto() # Defeatured Generate Permeate mode - MODE_NLEG = auto() # Not legal - an illegal mode transition occurred - NUM_OF_FP_MODES = auto() # Number of TD operation modes + MODE_FAUL = 0 # Fault mode + MODE_SERV = 1 # Service mode + MODE_INIT = 2 # Initialization & POST mode + MODE_STAN = 3 # Standby mode + MODE_PRE_GENP = 4 # Pre Generate Permeate mode + MODE_GENP = 5 # Generate Permeate mode + MODE_DPGP = 6 # Defeatured Pre-Generate Permeate mode + MODE_DEGP = 7 # Defeatured Generate Permeate mode + MODE_NLEG = 8 # Not legal - an illegal mode transition occurred + NUM_OF_FP_MODES = 9 # Number of TD operation modes FPOpModes._str_list = { # Official Name : Accepted strings @@ -57,10 +57,10 @@ @unique class FPFaultStates(DialinEnum): - FP_FAULT_STATE_START = auto() # FP Fault Start State - FP_FAULT_DEENERGIZED_STATE = auto() # FP Fault De-energized State - FP_FAULT_ENERGIZED_STATE = auto() # FP Fault Energized State - NUM_OF_FP_FAULT_STATES = auto() # Number of Fault Mode State + FP_FAULT_STATE_START = 0 # FP Fault Start State + FP_FAULT_DEENERGIZED_STATE = 1 # FP Fault De-energized State + FP_FAULT_ENERGIZED_STATE = 2 # FP Fault Energized State + NUM_OF_FP_FAULT_STATES = 3 # Number of Fault Mode State FPFaultStates._str_list = { # Official Name : Accepted strings @@ -73,7 +73,7 @@ @unique class FPServiceStates(DialinEnum): - NUM_OF_FP_SERV_STATES = auto() # Number of FP service states + NUM_OF_FP_SERV_STATES = 0 # Number of FP service states FPServiceStates._str_list = { # Official Name : Accepted strings @@ -83,17 +83,17 @@ @unique class FPPostStates(DialinEnum): - FP_POST_STATE_START = auto() # Start initialize & POST mode state - FP_POST_STATE_FW_INTEGRITY = auto() # Run firmware integrity test state - FP_POST_STATE_NVDATAMGMT = auto() # Run NV Data Mgmt. test state - FP_POST_STATE_WATCHDOG = auto() # Run watchdog test state - FP_POST_STATE_SAFETY_SHUTDOWN = auto() # Run safety shutdown test state - FP_POST_STATE_TEMPERATURES = auto() # Run temperatures POST state - FP_POST_STATE_FW_COMPATIBILITY = auto() # Run firmware compatibility test state - FP_POST_STATE_FPGA = auto() # Run FPGA test state - FP_POST_STATE_COMPLETED = auto() # POST self-tests completed state - FP_POST_STATE_FAILED = auto() # POST self-tests failed state - NUM_OF_FP_POST_STATES = auto() # Number of initialize & POST mode states + FP_POST_STATE_START = 0 # Start initialize & POST mode state + FP_POST_STATE_FW_INTEGRITY = 1 # Run firmware integrity test state + FP_POST_STATE_NVDATAMGMT = 2 # Run NV Data Mgmt. test state + FP_POST_STATE_WATCHDOG = 3 # Run watchdog test state + FP_POST_STATE_SAFETY_SHUTDOWN = 4 # Run safety shutdown test state + FP_POST_STATE_TEMPERATURES = 5 # Run temperatures POST state + FP_POST_STATE_FW_COMPATIBILITY = 6 # Run firmware compatibility test state + FP_POST_STATE_FPGA = 7 # Run FPGA test state + FP_POST_STATE_COMPLETED = 8 # POST self-tests completed state + FP_POST_STATE_FAILED = 9 # POST self-tests failed state + NUM_OF_FP_POST_STATES = 10 # Number of initialize & POST mode states FPPostStates._str_list = { # Official Name : Accepted strings @@ -113,8 +113,8 @@ @unique class FPStandbyStates(DialinEnum): - FP_STANDBY_MODE_STATE_IDLE = auto() # Idle standby mode state - NUM_OF_FP_STANDBY_MODE_STATES = auto() # Number of standby mode states + FP_STANDBY_MODE_STATE_IDLE = 0 # Idle standby mode state + NUM_OF_FP_STANDBY_MODE_STATES = 1 # Number of standby mode states FPStandbyStates._str_list = { # Official Name : Accepted strings @@ -125,13 +125,13 @@ @unique class FPPreGenPermeateStates(DialinEnum): - FP_PRE_GENP_INLET_PRES_CHECK = auto() # FP Pre Gen Permeate Inlet Pressure Check State - FP_PRE_GENP_FILTER_FLUSH = auto() # FP Pre Gen Permeate Filter Flush State - FP_PRE_GENP_PERMEATE_FLUSH = auto() # FP Pre Gen Permeate Permeate Flush State - FP_PRE_GENP_CONCENTRATE_FLUSH = auto() # FP Pre Gen Permeate Concentrate Flush State - FP_PRE_GENP_VERIFY_WATER = auto() # FP Pre Gen Permeate Verify Water State - FP_PRE_GENP_PAUSED = auto() # FP Pre Gen Permeate Paused State - NUM_OF_FP_PRE_GENP_MODE_STATES = auto() # Number of Pre-Gen Permeate mode states + FP_PRE_GENP_INLET_PRES_CHECK = 0 # FP Pre Gen Permeate Inlet Pressure Check State + FP_PRE_GENP_FILTER_FLUSH = 1 # FP Pre Gen Permeate Filter Flush State + FP_PRE_GENP_PERMEATE_FLUSH = 2 # FP Pre Gen Permeate Permeate Flush State + FP_PRE_GENP_CONCENTRATE_FLUSH = 3 # FP Pre Gen Permeate Concentrate Flush State + FP_PRE_GENP_VERIFY_WATER = 4 # FP Pre Gen Permeate Verify Water State + FP_PRE_GENP_PAUSED = 5 # FP Pre Gen Permeate Paused State + NUM_OF_FP_PRE_GENP_MODE_STATES = 7 # Number of Pre-Gen Permeate mode states FPPreGenPermeateStates._str_list = { # Official Name : Accepted strings @@ -147,10 +147,10 @@ @unique class FPPreGenPDefStates(DialinEnum): - FP_PRE_GENP_DEF_FLUSH = auto() # Pre Gen Permeate Defeatured Flush state - FP_PRE_GENP_DEF_INLET_WATER_CHECK = auto() # Pre Gen Permeate Defeatured Inlet Water Check state - FP_PRE_GENP_DEF_PAUSED = auto() # Defeatured Pre Gen Permeate Paused state - NUM_OF_FP_PRE_GENP_DEF_MODE_STATES = auto() # Number of Defeatured Pre Gen Permeate states + FP_PRE_GENP_DEF_FLUSH = 0 # Pre Gen Permeate Defeatured Flush state + FP_PRE_GENP_DEF_INLET_WATER_CHECK = 1 # Pre Gen Permeate Defeatured Inlet Water Check state + FP_PRE_GENP_DEF_PAUSED = 2 # Defeatured Pre Gen Permeate Paused state + NUM_OF_FP_PRE_GENP_DEF_MODE_STATES = 3 # Number of Defeatured Pre Gen Permeate states FPPreGenPDefStates._str_list = { # Official Name : Accepted strings @@ -163,9 +163,9 @@ @unique class FPGenPermeateStates(DialinEnum): - FP_GENP_TANK_FILL_STATE = auto() # Gen Permeate Tank Fill low state - FP_GENP_TANK_FULL_STATE = auto() # Gen Permeate Tank Full state - NUM_OF_FP_GENP_MODE_STATES = auto() # Number of Gen permeate states + FP_GENP_TANK_FILL_STATE = 0 # Gen Permeate Tank Fill low state + FP_GENP_TANK_FULL_STATE = 1 # Gen Permeate Tank Full state + NUM_OF_FP_GENP_MODE_STATES = 2 # Number of Gen permeate states FPGenPermeateStates._str_list = { # Official Name : Accepted strings @@ -177,9 +177,9 @@ @unique class FPGenPermeateDefStates(DialinEnum): - FP_GENP_DEF_SUPPLY_WATER = auto() # Gen Permeate Defeatured Supply Water statee - FP_GENP_DEF_PAUSED = auto() # Gen Permeate Defeatured Paused state - NUM_OF_FP_GENP_DEF_MODE_STATES = auto() # Number of Defeatured Gen permeate states + FP_GENP_DEF_SUPPLY_WATER = 0 # Gen Permeate Defeatured Supply Water statee + FP_GENP_DEF_PAUSED = 1 # Gen Permeate Defeatured Paused state + NUM_OF_FP_GENP_DEF_MODE_STATES = 2 # Number of Defeatured Gen permeate states FPGenPermeateDefStates._str_list = { # Official Name : Accepted strings @@ -191,7 +191,7 @@ @unique class FPNotLegalStates(DialinEnum): - NUM_OF_NOT_LEGAL_STATES = auto() # Number of Not Legal states + NUM_OF_NOT_LEGAL_STATES = 0 # Number of Not Legal states FPNotLegalStates._str_list = { # Official Name : Accepted strings @@ -200,20 +200,20 @@ -# ================================================== Enum Creators: Operations ================================================== +# ================================================== Enum Creators: Events ================================================== @unique class FPEventList(DialinEnum): - FP_EVENT_STARTUP = auto() # FP startup event - FP_EVENT_OP_MODE_CHANGE = auto() # FP Op mode change event - FP_EVENT_SUB_MODE_CHANGE = auto() # FP Op sub-mode change event - FP_EVENT_PRE_GEN_RO_SET_PWM = auto() # FP gen permeate ro set pwm event - FP_EVENT_GENP_BOOST_SET_PWM = auto() # FP gen permeate boost set pwm event - FP_EVENT_GENP_CHANGE = auto() # FP gen permeate state change - FP_EVENT_PRE_GEN_CHANGE = auto() # FP pre gen state change - FP_EVENT_PRE_GEN_DEF_CHANGE = auto() # FP defeatured pre gen state change - FP_EVENT_GENP_DEF_CHANGE = auto() # FP defeatured gen permeate state change - FP_EVENT_FAULT_ALARM_TRIGGER = auto() # FP event for alarms that would trigger - NUM_OF_FP_EVENT_IDS = auto() # Number of FP events + FP_EVENT_STARTUP = 0 # FP startup event + FP_EVENT_OP_MODE_CHANGE = 1 # FP Op mode change event + FP_EVENT_SUB_MODE_CHANGE = 2 # FP Op sub-mode change event + FP_EVENT_PRE_GEN_RO_SET_PWM = 3 # FP gen permeate ro set pwm event + FP_EVENT_GENP_BOOST_SET_PWM = 4 # FP gen permeate boost set pwm event + FP_EVENT_GENP_CHANGE = 5 # FP gen permeate state change + FP_EVENT_PRE_GEN_CHANGE = 6 # FP pre gen state change + FP_EVENT_PRE_GEN_DEF_CHANGE = 7 # FP defeatured pre gen state change + FP_EVENT_GENP_DEF_CHANGE = 8 # FP defeatured gen permeate state change + FP_EVENT_FAULT_ALARM_TRIGGER = 9 # FP event for alarms that would trigger + NUM_OF_FP_EVENT_IDS = 10 # Number of FP events FPEventList._str_list = { # Official Name : Accepted strings @@ -233,12 +233,12 @@ @unique class FPEventDataTypes(DialinEnum): - EVENT_DATA_TYPE_NONE = auto() # No Event Data Type - EVENT_DATA_TYPE_U32 = auto() # Unsigned 32bit Event Data Type - EVENT_DATA_TYPE_S32 = auto() # Signed 32bit Event Data Type - EVENT_DATA_TYPE_F32 = auto() # Float 32bit Event Data Type - EVENT_DATA_TYPE_BOOL = auto() # Boolean Event Data Type - NUM_OF_EVENT_DATA_TYPES = auto() # Number of Event Data Types + EVENT_DATA_TYPE_NONE = 0 # No Event Data Type + EVENT_DATA_TYPE_U32 = 1 # Unsigned 32bit Event Data Type + EVENT_DATA_TYPE_S32 = 2 # Signed 32bit Event Data Type + EVENT_DATA_TYPE_F32 = 3 # Float 32bit Event Data Type + EVENT_DATA_TYPE_BOOL = 4 # Boolean Event Data Type + NUM_OF_EVENT_DATA_TYPES = 5 # Number of Event Data Types FPEventDataTypes._str_list = { # Official Name : Accepted strings @@ -255,8 +255,8 @@ # ================================================== Enum Creators: Names ================================================== @unique class FPBoostPumpNames(DialinEnum): - P40_PUMP = auto() # FP Boost Pump - NUM_OF_BOOST_PUMPS = auto() # Number of FP Boost Pumps + P40_PUMP = 0 # FP Boost Pump + NUM_OF_BOOST_PUMPS = 1 # Number of FP Boost Pumps FPBoostPumpNames._str_list = { # Official Name : Accepted strings @@ -267,9 +267,9 @@ @unique class FPConductivitySensorNames(DialinEnum): - P9_COND = auto() # CPi (P9) conductivity sensor value - P18_COND = auto() # CPo (P18) conductivity sensor value - NUM_OF_FP_CONDUCTIVITY_SENSRORS = auto() # Number of Conductivity sensors + P9_COND = 0 # CPi (P9) conductivity sensor value + P18_COND = 1 # CPo (P18) conductivity sensor value + NUM_OF_FP_CONDUCTIVITY_SENSRORS = 2 # Number of Conductivity sensors FPConductivitySensorNames._str_list = { # Official Name : Accepted strings @@ -281,12 +281,12 @@ @unique class FPRORejectionRatioNames(DialinEnum): - RAW_RO_REJECTION_RATIO = auto() # Raw RO Rejection Ratio value - RAW_RO_REJECTION_RATIO_TANK_FILL = auto() # Raw RO Rejection Ratio Tank Fill value - AVG_RO_REJECTION_RATIO = auto() # Average RO Rejection Ratio value - AVG_RO_REJECTION_RATIO_TANK_FILL = auto() # Average RO Rejection Ratio Tank Fill value - GEN_PERMEATE_STATE = auto() # Generate Permeate State value - NUM_OF_FP_RO_REJECTION_RATIO = auto() # Number of RO Rejection Ratio items + RAW_RO_REJECTION_RATIO = 0 # Raw RO Rejection Ratio value + RAW_RO_REJECTION_RATIO_TANK_FILL = 1 # Raw RO Rejection Ratio Tank Fill value + AVG_RO_REJECTION_RATIO = 2 # Average RO Rejection Ratio value + AVG_RO_REJECTION_RATIO_TANK_FILL = 3 # Average RO Rejection Ratio Tank Fill value + GEN_PERMEATE_STATE = 4 # Generate Permeate State value + NUM_OF_FP_RO_REJECTION_RATIO = 5 # Number of RO Rejection Ratio items FPRORejectionRatioNames._str_list = { # Official Name : Accepted strings @@ -301,9 +301,9 @@ @unique class FPFlowSensorNames(DialinEnum): - P7_FLOW = auto() # Water inlet flow sensor (FMS P7) - P16_FLOW = auto() # RO outlet flow sensor (FMP P16) - NUM_OF_FP_FLOW_SENSORS = auto() # Number of FP Flow Sensors + P7_FLOW = 0 # Water inlet flow sensor (FMS P7) + P16_FLOW = 1 # RO outlet flow sensor (FMP P16) + NUM_OF_FP_FLOW_SENSORS = 2 # Number of FP Flow Sensors FPFlowSensorNames._str_list = { # Official Name : Accepted strings @@ -315,8 +315,8 @@ @unique class FPFloaterLevelSensorNames(DialinEnum): - P25_LEVEL = auto() # P25 Level sensor - NUM_OF_FP_LEVEL_SENSORS = auto() # Number of Level Sensors + P25_LEVEL = 0 # P25 Level sensor + NUM_OF_FP_LEVEL_SENSORS = 1 # Number of Level Sensors FPFloaterLevelSensorNames._str_list = { # Official Name : Accepted strings @@ -327,12 +327,12 @@ @unique class FPPressureSensorNames(DialinEnum): - M3_PRES = auto() # Water inlet pressure before regulator - P8_PRES = auto() # Water inlet pressure after regulator - P13_PRES = auto() # Water inlet pressure before the conductivity sensor - P17_PRES = auto() # Pressure before the RO filter - P46_PRES = auto() # Pressure after the RO filter - NUM_OF_FP_PRES_SENSORS = auto() # Number of Pressure Sensors + M3_PRES = 0 # Water inlet pressure before regulator + P8_PRES = 1 # Water inlet pressure after regulator + P13_PRES = 2 # Water inlet pressure before the conductivity sensor + P17_PRES = 3 # Pressure before the RO filter + P46_PRES = 4 # Pressure after the RO filter + NUM_OF_FP_PRES_SENSORS = 5 # Number of Pressure Sensors FPPressureSensorNames._str_list = { # Official Name : Accepted strings @@ -347,8 +347,8 @@ @unique class FPROPumpNames(DialinEnum): - P12_PUMP = auto() # P12 RO Pump - NUM_OF_RO_PUMPS = auto() # Number of RO Pumps + P12_PUMP = 0 # P12 RO Pump + NUM_OF_RO_PUMPS = 1 # Number of RO Pumps FPROPumpNames._str_list = { # Official Name : Accepted strings @@ -358,18 +358,18 @@ class FPTemperatureSensorNames(DialinEnum): - M3_TEMP = auto() # Temperature after pressure regulator (M3) - P8_TEMP = auto() # Temperature before inlet conductivity sensor (P8) - P13_TEMP = auto() # Temperature before RO filter (P13) - P17_TEMP = auto() # Temperature after RO filter (P17) - P46_TEMP = auto() # Temperature after sediment filter (P46) - P10_TEMP = auto() # P10 temperature from inlet conductivity sensor. - P19_TEMP = auto() # P19 temperature from outlet conductivity sensor. - P7_TEMP = auto() # Temperature at p7 flow meter - P16_TEMP = auto() # Temperature at p16 flow meter - P7_INTERNAL_TEMP = auto() # Interal Temperature at p7 flow meter - P16_INTERNAL_TEMP = auto() # Interal Temperature at p16 flow meter - NUM_OF_TEMPERATURE_SENSORS = auto() # Number of Temperature Sensors + M3_TEMP = 0 # Temperature after pressure regulator (M3) + P8_TEMP = 1 # Temperature before inlet conductivity sensor (P8) + P13_TEMP = 2 # Temperature before RO filter (P13) + P17_TEMP = 3 # Temperature after RO filter (P17) + P46_TEMP = 4 # Temperature after sediment filter (P46) + P10_TEMP = 5 # P10 temperature from inlet conductivity sensor. + P19_TEMP = 6 # P19 temperature from outlet conductivity sensor. + P7_TEMP = 7 # Temperature at p7 flow meter + P16_TEMP = 8 # Temperature at p16 flow meter + P7_INTERNAL_TEMP = 9 # Interal Temperature at p7 flow meter + P16_INTERNAL_TEMP = 10 # Interal Temperature at p16 flow meter + NUM_OF_TEMPERATURE_SENSORS = 11 # Number of Temperature Sensors # Aliases FIRST_PRESSURE_SENSOR = M3_TEMP @@ -398,15 +398,15 @@ @unique class FPValveNames(DialinEnum): - M4_VALV = auto() # Valve (M4 VWi) - M12_VALV = auto() # Valve (M12) - P11_VALV = auto() # Valve (P11 VPi) - P33_VALV = auto() # Valve (P33 VCr) - P34_VALV = auto() # Valve (P34 VCb) - P37_VALV = auto() # Valve (P37 VCd) - P39_VALV = auto() # Valve (P39 VROd) - P6_VALV = auto() # Valve (P6 VFF) - NUM_OF_FP_VALVES = auto() # Number of valves + M4_VALV = 0 # Valve (M4 VWi) + M12_VALV = 1 # Valve (M12) + P11_VALV = 2 # Valve (P11 VPi) + P33_VALV = 3 # Valve (P33 VCr) + P34_VALV = 4 # Valve (P34 VCb) + P37_VALV = 5 # Valve (P37 VCd) + P39_VALV = 6 # Valve (P39 VROd) + P6_VALV = 7 # Valve (P6 VFF) + NUM_OF_FP_VALVES = 8 # Number of valves FPValveNames._str_list = { # Official Name : Accepted strings @@ -424,9 +424,9 @@ @unique class FPAllPumpNames(DialinEnum): - P12_PUMP_RO = auto() # P12 RO Pump - P40_PUMP_BOOSTER = auto() # P40 Boost Pump - NUM_OF_PUMPS = auto() # Number of pumps + P12_PUMP_RO = 0 # P12 RO Pump + P40_PUMP_BOOSTER = 1 # P40 Boost Pump + NUM_OF_PUMPS = 2 # Number of pumps FPAllPumpNames._str_list = { # Official Name : Accepted strings @@ -440,12 +440,12 @@ # ================================================== Enum Creators: Support ================================================== @unique class FPFloaterLevels(DialinEnum): - LEVEL_STATE_EMPTY = auto() # Empty level for the FP Floater Level Sensors - LEVEL_STATE_LOW = auto() # Low level for the FP Floater Level Sensors - LEVEL_STATE_MEDIUM = auto() # Medium level for the FP Floater Level Sensors - LEVEL_STATE_HIGH = auto() # High level for the FP Floater Level Sensors - LEVEL_STATE_ILLEGAL = auto() # Illegal level for FP Floater Level Sensor (indicates investigation) - NUM_OF_LEVEL_STATES = auto() # Number of Level States + LEVEL_STATE_EMPTY = 0 # Empty level for the FP Floater Level Sensors + LEVEL_STATE_LOW = 1 # Low level for the FP Floater Level Sensors + LEVEL_STATE_MEDIUM = 2 # Medium level for the FP Floater Level Sensors + LEVEL_STATE_HIGH = 3 # High level for the FP Floater Level Sensors + LEVEL_STATE_ILLEGAL = 4 # Illegal level for FP Floater Level Sensor (indicates investigation) + NUM_OF_LEVEL_STATES = 5 # Number of Level States FPFloaterLevels._str_list = { # Official Name : Accepted strings @@ -460,16 +460,16 @@ @unique class FPPumpAttributes(DialinEnum): - STATE = auto() # State to command attribute for Pumps - DUTY_CYCLE = auto() # Duty Cycle attribute for Pumps - FB_DUTY_CYCLE = auto() # Feedback Duty Cycle attribute for Pumps - SPEED = auto() # Current Speed attribute for pumps - TARGET_PRES = auto() # Target Pressure attribute for pumps - TARGET_FLOW = auto() # Target Flow attribute for pumps - TARGET_DUTY_CYCLE = auto() # Target Duty Cycle attribute for pumps - DUTY_CYCLE_PCT = auto() # Duty Cycle Percentage attribute for pumps - FB_DUTY_CYCLE_PCT = auto() # Feedback Duty Cycle Percentage attribute for pumps - NUM_OF_RO_PUMP_ATTRIBUTES = auto() # Number of pump attributes + STATE = 0 # State to command attribute for Pumps + DUTY_CYCLE = 1 # Duty Cycle attribute for Pumps + FB_DUTY_CYCLE = 2 # Feedback Duty Cycle attribute for Pumps + SPEED = 3 # Current Speed attribute for pumps + TARGET_PRES = 4 # Target Pressure attribute for pumps + TARGET_FLOW = 5 # Target Flow attribute for pumps + TARGET_DUTY_CYCLE = 6 # Target Duty Cycle attribute for pumps + DUTY_CYCLE_PCT = 7 # Duty Cycle Percentage attribute for pumps + FB_DUTY_CYCLE_PCT = 8 # Feedback Duty Cycle Percentage attribute for pumps + NUM_OF_RO_PUMP_ATTRIBUTES = 9 # Number of pump attributes FPPumpAttributes._str_list = { # Official Name : Accepted strings @@ -488,15 +488,15 @@ @unique class FPValveStates(DialinEnum): - VALVE_STATE_CLOSED = auto() # Valve Closed State - VALVE_STATE_OPEN = auto() # Valve Open State - NUM_OF_VALVE_STATES = auto() # Valve Open State + VALVE_STATE_CLOSED = 0 # Valve Closed State + VALVE_STATE_OPEN = 1 # Valve Open State + NUM_OF_VALVE_STATES = 2 # Valve Open State FPValveStates._str_list = { # Official Name : Accepted strings 'VALVE_STATE_CLOSED': ['closed'], - 'VALVE_STATE_OPEN': ['open'], - 'NUM_OF_VALVE_STATES': [], + 'VALVE_STATE_OPEN': ['open'], + 'NUM_OF_VALVE_STATES': [], }