Index: NVDataMgmtDGRecords.h =================================================================== diff -u -r1797ae184a55396ff3464cead47f16bac9dda84c -r592773fa1fc0df8a99bb202505dac31a55261f4c --- NVDataMgmtDGRecords.h (.../NVDataMgmtDGRecords.h) (revision 1797ae184a55396ff3464cead47f16bac9dda84c) +++ NVDataMgmtDGRecords.h (.../NVDataMgmtDGRecords.h) (revision 592773fa1fc0df8a99bb202505dac31a55261f4c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file NVDataMgmtDGRecords.h * * @author (last) Dara Navaei -* @date (last) 04-Jan-2022 +* @date (last) 01-Jul-2022 * * @author (original) Dara Navaei * @date (original) 12-Feb-2021 @@ -31,9 +31,47 @@ // ********** public definitions ********** -#define MAX_TOP_LEVEL_PN_CHARS 10U ///< Max number of characters for top level part number. -#define MAX_TOP_LEVEL_SN_CHARS 15U ///< Max number of characters for top level serial number. +#define MAX_TOP_LEVEL_PN_CHARS 10U ///< Max number of characters for top level part number. +#define MAX_TOP_LEVEL_SN_CHARS 15U ///< Max number of characters for top level serial number. +#define PRES_SENSORS_RESERVED_SPACE_COUNT 5 ///< Pressure sensors reserved space count. +#define FLOW_SENSROS_RESERVED_SPACE_COUNT 2 ///< Flow sensors reserved space count. +#define TEMP_SENSORS_RESERVED_SPACE_COUNT 2 ///< Temperature sensors reserved space count. +#define COND_SENSORS_RESERVED_SPACE_COUNT 2 ///< Conductivity sensors reserved space count. +#define GENERIC_VOL_RESERVED_SPACE_COUNT 4 ///< Generic volumes reserved space count. +#ifndef _RELEASE_ +/// Software configuration enums +typedef enum software_configurations +{ + SW_CONFIG_DISABLE_TRIMMER_HEATER = 0, ///< Software configuration disable trimmer heater. + SW_CONFIG_DISABLE_ACCELS, ///< Software configuration disable accelerometers. + SW_CONFIG_DISABLE_CAL_CHECK, ///< Software configuration disable calibration check. + SW_CONFIG_DISABLE_HEATERS_MONITOR, ///< Software configuration disable heaters monitor. + SW_CONFIG_DISABLE_DRAIN_PUMP_MONITOR, ///< Software configuration disable drain pump monitor. + SW_CONFIG_DISABLE_RO_PUMP_MONITOR, ///< Software configuration disable RO pump monitor. + SW_CONFIG_DISABLE_RO_RATIO_CHECK, ///< Software configuration disable RO ratio check + SW_CONFIG_DISABLE_COND_SENSOR_CHECK, ///< Software configuration disable conductivity sensor check. + SW_CONFIG_DISABLE_WATER_QUALITY_CHECK, ///< Software configuration disable water quality check. + SW_CONFIG_DISABLE_FLOW_VS_LOAD_CELL_CHECK_IN_FILL, ///< Software configuration disable flow vs. load cell check in fill. + SW_CONFIG_DISABLE_HEATERS_EFFICIENCY, ///< Software configuration disable heaters efficiency. + SW_CONFIG_DISABLE_DISINFECT_CONDUCTIVITY_CHECK, ///< Software configuration disable disinfect conductivity check. + SW_CONFIG_DISABLE_CONC_PUMPS, ///< Software configuration disable concentrate pumps. + SW_CONFIG_DISABLE_CAPS_MONITOR, ///< Software configuration disable cap monitor. + SW_CONFIG_DISABLE_UV_REACTORS, ///< Software configuration disable UV reactors. + SW_CONFIG_DISABLE_ACID_ALARMS, ///< Software configuration disable acid alarms. + SW_CONFIG_DISABLE_BICARB_ALARMS, ///< Software configuration disable bicarb alarms. + SW_CONFIG_DISABLE_EMPTY_BOTTLES_ALARM, ///< Software configuration disable empty bottle alarms. + SW_CONFIG_DISABLE_BICARB_CONDUCTIVITY_TEST, ///< Software configuration disable bicarb conductivity test. + SW_CONFIG_DISABLE_ACID_CONDUCTIVITY_TEST, ///< Software configuration disable acid conductivity test. + SW_CONFIG_DISABLE_CONC_PUMPS_SPEED_ALARM, ///< Software configuration disable concentrate pumps speed alarm. + SW_CONFIG_DISABLE_MIXING_IN_FILL, ///< Software configuration disable mixing in fill. + SW_CONFIG_DISABLE_TEMPERATURE_SENSORS_ALARM, ///< Software configuration disable temperature sensors alarm. + SW_CONFIG_ENABLE_V3_SYSTEM, ///< Software configuration enable V3 system. + SW_CONFIG_DISABLE_SERVICE_AND_DISINFECT_CHECK, ///< Software configuration disable service and disinfect checks. + NUM_OF_SW_CONFIGS ///< Number of software configurations. +} SOFTWARE_CONFIG_T; +#endif + /// DG available NV data to get typedef enum dg_nv_commands { @@ -42,11 +80,23 @@ GET_CAL_FLOW_SENSORS, ///< Get flow sensors calibration data. GET_CAL_ACID_CONCENTREATES, ///< Get acid concentrates calibration data. GET_CAL_BICARB_CONCENTRATES, ///< Get bicarb concentrates calibration data. + GET_CAL_ACCEL_SENSORS, ///< Get accelerometers calibration data. + GET_CAL_CONDUCTIVITY_SENSORS, ///< Get conductivity sensors calibration data. + GET_CAL_TEMP_SENSORS, ///< Get temperature sensors calibration data. + GET_CAL_RSRVRS_VOL_RECORD, ///< Get reservoirs volume record. + GET_CAL_HEATING_RECORD, ///< Get heating calibration record. + GET_CAL_DRAIN_LINE_VOLUME_RECORD, ///< Get drain line volume record. + GET_CAL_RO_PUMP_RECORD, ///< Get RO pump calibration record. + GET_CAL_CONCENTRATE_PUMPS_RECORD, ///< Get concentrate pumps calibration record. + GET_CAL_DRAIN_PUMP_RECORD, ///< Get drain pump calibration record. + GET_CAL_FANS_RECORD, ///< Get fans calibration record. + GET_CAL_PRE_RO_PURGE_VOLUME_RECORD, ///< Get pre RO purge volume record. + GET_CAL_FILTERS_RECORD, ///< Get filters record. GET_INF_HEATERS_RECORD, ///< Get heaters information form the the last run. - GET_MFG_RECORD, ///< Get manufacturing record. GET_SYS_RECORD, ///< Get system record. GET_SRV_RECORD, ///< Get service record. GET_SRR_RECORD, ///< Get scheduled runs record. + GET_USAGE_RECORD, ///< Get usage record. NUM_OF_NV_DG_DATA ///< Number of non-volatile data. } NV_DATA_T; @@ -57,6 +107,7 @@ CAL_DATA_RO_PUMP_OUTLET_PRES_SENSOR, ///< DG calibration data RO pump outlet pressure sensor. CAL_DATA_DRAIN_PUMP_INLET_PRES_SENSOR, ///< DG calibration data drain pump inlet pressure sensor. CAL_DATA_DRAIN_PUMP_OUTLET_PRES_SENSOR, ///< DG calibration data drain pump outlet pressure sensor. + CAL_DATA_BAROMETRIC_PRES_SENSOR, ///< DG calibration data barometric pressure sensor. NUM_OF_CAL_DATA_PRES_SENSORS, ///< Number of calibration data pressure sensors. } CAL_DATA_DG_PRES_SENSORS_T; @@ -96,6 +147,9 @@ CAL_DATA_OUTLET_PRIMARY_HEATER_TEMP, ///< Outlet primary heater temperature sensor. CAL_DATA_COND_SENSOR_1_TEMP, ///< Conductivity sensor 1 temperature sensor. CAL_DATA_COND_SENSOR_2_TEMP, ///< Conductivity sensor 2 temperature sensor. + CAL_DATA_HEAT_DISINFECT_TEMP, ///< Heat disinfect temperature sensor. + CAL_DATA_INTERNAL_THD_TEMP, ///< Heat disinfect internal ADC temperature sensor. + CAL_DATA_BARMOTERIC_TEMP, ///< Barometric temperature sensor. NUM_OF_CAL_DATA_TEMP_SENSORS, ///< Number of temperature sensors. } CAL_DATA_DG_TEMP_SENSORS_T; @@ -147,15 +201,35 @@ NUM_OF_CAL_DATA_BICARB_CONCENTRATES ///< Number of bicarb concentrates. } CAL_DATA_DG_BICARB_CONCENTRATES_T; +/// DG fans enumeration. +typedef enum dg_fans +{ + CAL_DATA_INLET_FAN_1 = 0, ///< Inlet fan 1. + CAL_DATA_INLET_FAN_2, ///< Inlet fan 2. + CAL_DATA_INLET_FAN_3, ///< Inlet fan 3. + CAL_DATA_OUTLET_FAN_1, ///< Outlet fan 1. + CAL_DATA_OUTLET_FAN_2, ///< Outlet fan 2. + CAL_DATA_OUTLET_FAN_3, ///< Outlet fan 3. + NUM_OF_CAL_DATA_FANS ///< Number of fans. +} CAL_DATA_DG_FANS_T; + /// DG scheduled runs enumeration. typedef enum dg_scheduled_runs { - FLUSH = 0, ///< Flush run. - HEAT_DISINFECT, ///< Heat disinfect run. - CHEMICAL_DISINFECT, ///< Chemical disinfect run. + RUN_FLUSH = 0, ///< Flush run. + RUN_HEAT_DISINFECT, ///< Heat disinfect run. + RUN_CHEMICAL_DISINFECT, ///< Chemical disinfect run. NUM_OF_DG_SCHEDULED_RUNS ///< Number of DG scheduled runs. } SCHEDULED_DG_RUNS_T; +/// Disinfect types +typedef enum dg_disinfects +{ + USAGE_INFO_HEAT_DISINFECT = 0, ///< Heat disinfect. + USAGE_INFO_CHEMICAL_DISINFECT, ///< Chemical disinfect. + NUM_OF_DISINFECTS ///< Number of disinfects. +} DG_DISINFECT_T; + #pragma pack(push, 1) /// Polynomial calibration structure typedef struct @@ -206,18 +280,14 @@ typedef struct { POLYNOMIAL_CAL_PAYLOAD_T pressureSensors[ NUM_OF_CAL_DATA_PRES_SENSORS ]; ///< Pressure sensors to calibrate. - // NOTE: The reserved space is for 6 sensors. This portion of the struct should be eventually be - // reduced, so #define was not used for the size of the array - POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ 6 ]; ///< Reserved space for future pressure sensors. + POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ PRES_SENSORS_RESERVED_SPACE_COUNT ]; ///< Reserved space for future pressure sensors. } DG_PRES_SENSORS_CAL_RECORD_T; /// Flow sensors calibration structure typedef struct { POLYNOMIAL_CAL_PAYLOAD_T flowSensors[ NUM_OF_CAL_DATA_FLOW_SENSORS ]; ///< Flow sensors to calibrate. - // NOTE: The reserved space is for 6 sensors. This portion of the struct should be eventually be - // reduced, so #define was not used for the size of the array - POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ 2 ]; ///< Reserved space for future flow sensors. + POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ FLOW_SENSROS_RESERVED_SPACE_COUNT ]; ///< Reserved space for future flow sensors. } DG_FLOW_SENSORS_CAL_RECORD_T; /// Load cells calibration structure @@ -230,18 +300,14 @@ typedef struct { POLYNOMIAL_CAL_PAYLOAD_T tempSensors[ NUM_OF_CAL_DATA_TEMP_SENSORS ]; ///< Temperature sensors to calibrate. - // NOTE: The reserved space is for 6 sensors. This portion of the struct should be eventually be - // reduced, so #define was not used for the size of the array - POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ 5 ]; ///< Reserved space for future temperature sensors. + POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ TEMP_SENSORS_RESERVED_SPACE_COUNT ]; ///< Reserved space for future temperature sensors. } DG_TEMP_SENSORS_CAL_RECORD_T; /// Conductivity sensors calibration structure typedef struct { POLYNOMIAL_CAL_PAYLOAD_T condSensors[ NUM_OF_CAL_DATA_COND_SENSORS ]; ///< Conductivity sensors to calibrate. - // NOTE: The reserved space is for 6 sensors. This portion of the struct should be eventually be - // reduced, so #define was not used for the size of the array - POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ 2 ]; ///< Reserved space for future conductivity sensors. + POLYNOMIAL_CAL_PAYLOAD_T reservedSpace[ COND_SENSORS_RESERVED_SPACE_COUNT ]; ///< Reserved space for future conductivity sensors. } DG_COND_SENSORS_CAL_RECORD_T; /// Drain line volume calibration structure @@ -289,15 +355,16 @@ /// DG generic volume record typedef struct { - DG_GENERIC_VOLUME_DATA_T genericVolume[ 4 ]; ///< DG generic volume record. + DG_GENERIC_VOLUME_DATA_T genericVolume[ GENERIC_VOL_RESERVED_SPACE_COUNT ]; ///< DG generic volume record. }DG_GENERIC_VOLUME_RECORD_T; /// DG acid concentrate typedef struct { F32 acidConcMixRatio; ///< Acid concentrate mix ratio. - F32 startVolume; ///< Start volume. - F32 reserverdSpace; ///< Reserved space. + F32 acidFullBottleVolumeML; ///< Acid full bottle volume in milliliters. + F32 acidConductivityUSPerCM; ///< Acid conductivity in uS/cm. + F32 acidBottleTemperature; ///< Acid bottle temperature in C. U32 calibrationTime; ///< Calibration time. U16 crc; ///< CRC. } DG_ACID_CONCENTRATE_T; @@ -306,8 +373,9 @@ typedef struct { F32 bicarbConcMixRatio; ///< Bicarb concentrate mix ratio. - F32 startVolume; ///< Start volume. - F32 reservedSpace; ///< Reserved space. + F32 bicarbStartVolumeML; ///< Bicarb start volume. + F32 bicarbConductivityUSPerCM; ///< Bicarb conductivity in uS/cm. + F32 bicarbBottleTemperature; ///< Bicarb bottle temperature in C. U32 calibrationTime; ///< Calibration time. U16 crc; ///< CRC. } DG_BICARB_CONCENTRATE_T; @@ -356,8 +424,7 @@ /// DG fans calibration data structure typedef struct { - DG_FAN_CAL_RECORD_T fan1; ///< Fan 1. - DG_FAN_CAL_RECORD_T fan2; ///< Fan 2. + DG_FAN_CAL_RECORD_T fans[ NUM_OF_CAL_DATA_FANS ]; ///< Fans calibration record. } DG_FANS_CAL_RECORD_T; /// HD accelerometer sensor calibration record @@ -370,6 +437,16 @@ U16 crc; ///< CRC for the DG accelerometer sensor. } DG_ACCEL_SENSOR_CAL_RECORD_T; +/// DG heating calibration record +typedef struct +{ + F32 reservoirTempTauCPerMin; ///< Reservoir temperature Tau C/min. + F32 ultrafilterTempTauCPerMin; ///< Ultrafilter temperature Tau C/min. + U32 ultrafilterVolmL; ///< Ultrafilter volume in mL. + U32 calibrationTime; ///< Calibration time. + U16 crc; ///< CRC for the reservoirs and UF record. +} DG_HEATING_CAL_RECORD_T; + /// DG systems record structure typedef struct { @@ -386,6 +463,7 @@ U08 serviceLoc; ///< DG service location. U32 lastServiceEpochDate; ///< DG last service date in epoch. U32 serviceIntervalSeconds; ///< DG service interval in seconds. + //U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. U16 crc; ///< CRC for the DG service record structure. } DG_SERVICE_RECORD_T; @@ -405,7 +483,12 @@ /// DG usage info structure. typedef struct { - U32 waterConsumption; ///< Water consumption. + F32 roWaterGenTotalL; ///< Total RO water generated in liters. (Cannot be reset) + F32 roWaterGenSinceLastServiceL; ///< RO water generated since last treatment in liters. + U32 lastHeatDisDateEpoch; ///< Last heat disinfect date in epoch. + U32 lastChemicalDisDateEpoch; ///< Last chemical disinfect date in epoch. + BOOL isDisinfected; ///< Disinfect status boolean flag. + U32 lastResetTimeEpoch; ///< Last time the record was reset in epoch. U16 crc; ///< CRC for the DG usage info structure. } DG_USAGE_INFO_RECORD_T; @@ -414,6 +497,15 @@ { F32 averageFillFlow; ///< Average fill flow rate. } DG_HEATERS_RECORD_T; + +#ifndef _RELEASE_ +/// DG software configurations +typedef struct +{ + U08 swConfigs[ NUM_OF_SW_CONFIGS ]; ///< Software configurations. +} DG_SW_CONFIG_RECORD_T; +#endif + #pragma pack(pop) /**@}*/