########################################################################### # # 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 fp_defs.py # # @author (last) Dara Navaei # @date (last) 08-Feb-2024 # @author (original) Peter Lucia # @date (original) 22-Jun-2021 # ############################################################################ from enum import unique from ..utils.base import DialinEnum @unique class FPOpModes(DialinEnum): 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_NLEG = 6 # Not legal - an illegal mode transition occurred NUM_OF_FP_MODES = 7 # Number of TD operation modes @unique class FPPostStates(DialinEnum): 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 @unique class FPEventList(DialinEnum): 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 NUM_OF_FP_EVENT_IDS = 3 # Total number of FP events @unique class FPEventDataType(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 @unique class FPBoostPumpNames(DialinEnum): P40_PUMP = 0 # FP Boost Pump NUM_OF_BOOST_PUMPS = 1 # Number of FP Boost Pumps @unique class FPConductivitySensorsEnum(DialinEnum): P9_COND = 0 # CPi (P9) conductivity sensor value P18_COND = 1 # CPo (P18) conductivity sensor value NUM_OF_FP_CONDUCTIVITY = 2 # Number of Conductivity sensors @unique class FPFlowSensorNames(DialinEnum): 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 @unique class FPFlowSensorAttributesEnum(DialinEnum): FLOW = 0 # Flow attribute for FP Flow Sensors TEMP = 1 # Temperature attribute for FP Flow Sensors NUM_OF_FP_FLOW_ATTRIBUTES = 2 # Number of FP Flow Sensor attributes @unique class FPFloaterLevels(DialinEnum): LEVEL_STATE_LOW = 0 # Low level for the FP Floater Level Sensors LEVEL_STATE_MEDIUM = 1 # Medium level for the FP Floater Level Sensors LEVEL_STATE_HIGH = 2 # High level for the FP Floater Level Sensors LEVEL_STATE_ILLEGAL = 3 # Illegal level for FP Floater Level Sensor (indicates investigation) NUM_OF_LEVEL_STATES = 4 # Number of Level States @unique class FPFloaterLevelSensorNames(DialinEnum): P25_LEVEL = 0 # P25 Level sensor NUM_OF_FP_LEVEL_SENSORS = 1 # Number of FP Level Sensors @unique class FPPressureSensorNames(DialinEnum): M1_PRES = 0 # Water inlet pressure before regulator M3_PRES = 1 # Water inlet pressure after regulator P8_PRES = 2 # Water inlet pressure before the conductivity sensor P13_PRES = 3 # Pressure before the RO filter P17_PRES = 4 # Pressure after the RO filter X1_PRES = 5 # Pressure before RO pump X2_PRES = 6 # Pressure of RO Concentrate X3_PRES = 7 # Pressure after P32, concentrate drop X4_PRES = 8 # Pressure Drain Drop NUM_OF_FP_PRES_SENSORS = 9 # Number of Pressure Sensors @unique class ROPumpNames(DialinEnum): P12_PUMP = 0 # P12 RO Pump NUM_OF_RO_PUMPS = 1 # Number of RO Pumps @unique class FPPumpAttributes(DialinEnum): 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 @unique class FPTemperaturesNames(DialinEnum): P10_TEMP = 0 # P10 temperature from inlet conductivity sensor. P19_TEMP = 1 # P19 temperature from outlet conductivity sensor. M1_TEMP = 2 # Temperature before pressure regulator (M1) M3_TEMP = 3 # Temperature after pressure regulator (M3) P8_TEMP = 4 # Temperature before inlet conductivity sensor (P8) P13_TEMP = 5 # Temperature before RO filter (P13) P17_TEMP = 6 # Temperature after RO filter (P17) X1_TEMP = 7 # Temperature before RO pump (X1) X2_TEMP = 8 # Temperature RO Concentrate X3_TEMP = 9 # Temperature RO Concentrate drop X4_TEMP = 10 # Temperature drain drop P7_TEMP = 11 # Temperature at p7 flow meter P16_TEMP = 12 # Temperature at p16 flow meter NUM_OF_TEMPERATURE_SENSORS = 13 # Number of Temperature Sensors @unique class FPValveStates(DialinEnum): VALVE_STATE_CLOSED = 0 # Valve Closed State VALVE_STATE_OPEN = 1 # Valve Open State @unique class FPValveNames(DialinEnum): M4_VALV = 0 # Valve (M4 VWi) P39_VALV = 1 # Valve (P39 VROd) P6_VALV = 2 # Valve (P6 VFF) P11_VALV = 3 # Valve (P11 VPi) P33_VALV = 4 # Valve (P33 VCr) P34_VALV = 5 # Valve (P34 VCb) P37_VALV = 6 # Valve (P37 VCd) M7_VALV = 7 # Valve (M7) P20_VALV = 8 # Valve (P20) P43_VALV = 9 # Valve (P43) NUM_OF_VALVES = 10 # Number of valves @unique class FPPumpNames(DialinEnum): P12_PUMP_RO = 0 # RO Pump P40_PUMP_BOOSTER = 1 # Booster Pump