########################################################################### # # Copyright (c) 2021-2024 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 dd_defs.py # # @author (last) Zoltan Miskolci # @date (last) 28-Jan-2026 # @author (original) Peter Lucia # @date (original) 22-Jun-2021 # ############################################################################ from enum import unique from ..utils.base import DialinEnum # ================================================== 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 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': [], } @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 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': [], } @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 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 DDServiceStates._str_list = { # Official Name : Accepted strings 'DD_SERVICE_STATE_START': ['start', 'service start'], 'NUM_OF_DD_SERVICE_STATES': [], } @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': [], } @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': [], } @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 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': [], } @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': [], } @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 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': [], } @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': [] } @unique class DDHeaterCoolingStates(DialinEnum): NUM_OF_DD_HEAT_COOL_STATES = 0 # Number of Heater Cooling states DDHeaterCoolingStates._str_list = { # Official Name : Accepted strings 'NUM_OF_DD_HEAT_COOL_STATES': [], } @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': [], } @unique class DDNotLegalStates(DialinEnum): NUM_OF_NOT_LEGAL_STATES = 0 # Number of Not Legal states DDNotLegalStates._str_list = { # Official Name : Accepted strings 'NUM_OF_NOT_LEGAL_STATES': [], } # ================================================== 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': [], } @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 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': [], } # ================================================== 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 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': [], } @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': [] } @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 DDDialysatePumpNames._str_list = { # Official Name : Accepted strings 'D12_PUMP': ['d12'], 'D48_PUMP': ['d48'], 'NUM_OF_DIALYSATE_PUMPS': [], } @unique class DDHeaterNames(DialinEnum): D5_HEAT = 0 # Primary heater D45_HEAT = 1 # Trimmer heater NUM_OF_DD_HEATERS = 2 # Number of Heaters DDHeaterNames._str_list = { # Official Name : Accepted strings 'D5_HEAT': ['d5'], 'D45_HEAT': ['d45'], 'NUM_OF_DD_HEATERS': [], } @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 D98_LEVEL = 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': [], } @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 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 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': [], } 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 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': [], } @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': [], } @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 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': [], } # ================================================== 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 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': [], } @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': [], } @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 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': [], } @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 ================================================== class DD_Defs(): 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()