Index: leahi_dialin/common/fp_defs.py =================================================================== diff -u -r7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d -r914620537399ff9ecc4925fc56f8b8be567d184e --- leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision 7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d) +++ leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision 914620537399ff9ecc4925fc56f8b8be567d184e) @@ -8,14 +8,18 @@ # @file fp_defs.py # # @author (last) Zoltan Miskolci -# @date (last) 04-Dec-2025 +# @date (last) 09-Jan-2026 # @author (original) Peter Lucia # @date (original) 22-Jun-2021 # ############################################################################ + from enum import unique + +from .dd_defs import DDConductivitySensorNames, DDPressureNames, DDValveNames from ..utils.base import DialinEnum + @unique class FPOpModes(DialinEnum): MODE_FAUL = 0 # Fault mode @@ -121,7 +125,7 @@ NUM_OF_BOOST_PUMPS = 1 # Number of FP Boost Pumps @unique -class FPConductivitySensorsEnum(DialinEnum): +class FPConductivitySensorNames(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 @@ -143,25 +147,27 @@ @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 + 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 @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): 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 + FIRST_FP_SENSOR = P8_PRES # First FP Sensor + LAST_FP_SENSOR = P46_PRES # Last FP Sensor @unique class ROPumpNames(DialinEnum): @@ -181,31 +187,29 @@ FB_DUTY_CYCLE_PCT = 8 # Feedback Duty Cycle Percentage attribute for pumps NUM_OF_RO_PUMP_ATTRIBUTES = 9 # Number of pump attributes -BETA_CONDUCTIVITY_SENSOR_OFFSET = 3 # Offset to translate Dialin FPTemperaturesNames to DD firmware ConductivitySensors enum -BETA_FLOW_SENSOR_OFFSET = 7 # Offset to translate Dialin FPTemperaturesNames to DD firmware FlowSensors enum -BETA_IO_PRES_SENSOR_OFFSET = 5 # Offset to translate Dialin FPTemperaturesNames to DD firmware PressureSensors enum -BETA_FP_PRES_SENSOR_OFFSET = 3 # Offset to translate Dialin FPTemperaturesNames to DD firmware PressureSensors enum - -@unique class FPTemperaturesNames(DialinEnum): M3_TEMP = 0 # Temperature after pressure regulator (M3) - P10_TEMP = 1 # P10 temperature from inlet conductivity sensor. - P19_TEMP = 2 # P19 temperature from outlet conductivity sensor. - P8_TEMP = 3 # Temperature before inlet conductivity sensor (P8) - P13_TEMP = 4 # Temperature before RO filter (P13) - P17_TEMP = 5 # Temperature after RO filter (P17) - P7_TEMP = 6 # Temperature at p7 flow meter - P16_TEMP = 7 # Temperature at p16 flow meter - P46_TEMP = 8 # Temperature after sediment filter (P46) + 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 NUM_OF_TEMPERATURE_SENSORS = 9 # Number of Temperature Sensors + FIRST_PRESSURE_SENSOR = M3_TEMP # First Pressure Sensor + LAST_PRESSURE_SENSOR = P46_TEMP # Last Pressure Sensor + FIRST_CONDUCTIVITY_SENSOR = P10_TEMP # First Conductivity Sensor + LAST_CONDUCTIVITY_SENSOR = P19_TEMP # Last Conductivity Sensor + FIRST_FLOW_SENSOR = P7_TEMP # First FLow Sensor + LAST_FLOW_SENSOR = P16_TEMP # Last Flow Sensor @unique class FPValveStates(DialinEnum): VALVE_STATE_CLOSED = 0 # Valve Closed State VALVE_STATE_OPEN = 1 # Valve Open State -BETA_IOFP_VALVE_OFFSET = 32 # Offset to translate Dialin FPValveNames to DD firmware DD_Valves - @unique class FPValveNames(DialinEnum): M4_VALV = 0 # Valve (M4 VWi) @@ -221,4 +225,10 @@ @unique class FPPumpNames(DialinEnum): P12_PUMP_RO = 0 # RO Pump - P40_PUMP_BOOSTER = 1 # Booster Pump \ No newline at end of file + P40_PUMP_BOOSTER = 1 # Booster Pump + + +# To offset the FP enums with the DD values, as they lsited after the DD in the FW +BETA_IOFP_COND_SENSOR_OFFSET = DDConductivitySensorNames.NUM_OF_CONDUCTIVITY_SENSORS.value # Offset to translate Dialin FPTemperaturesNames to DD firmware PressureSensors enum +BETA_IOFP_PRES_SENSOR_OFFSET = DDPressureNames.NUM_OF_PRESSURE_SENSORS.value # Offset to translate Dialin FPTemperaturesNames to DD firmware PressureSensors enum +BETA_IOFP_VALVE_OFFSET = DDValveNames.NUM_OF_DD_VALVES.value # Offset to translate Dialin FPValveNames to DD firmware DD_Valves