Index: firmware/App/Modes/ModeFill.h =================================================================== diff -u -r38974e7129adace42bc44cacbf384a0b1442046c -re3839e10decfadf12a8fb2b9f8c049d8a30e945b --- firmware/App/Modes/ModeFill.h (.../ModeFill.h) (revision 38974e7129adace42bc44cacbf384a0b1442046c) +++ firmware/App/Modes/ModeFill.h (.../ModeFill.h) (revision e3839e10decfadf12a8fb2b9f8c049d8a30e945b) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-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 ModeFill.h * * @author (last) Dara Navaei -* @date (last) 03-Nov-2021 +* @date (last) 29-Feb-2024 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 @@ -31,6 +31,29 @@ // ********** public definitions ********** +/// Chemical bottles +typedef enum +{ + ACID = 0, ///< Acid. + BICARB, ///< Bicarb. + NUM_OF_CHEMICALS, ///< Number of chemicals. +} CHEMICAL_BOTTLES_T; + +/// DG broadcast dialysate fill data structure. +typedef struct +{ + F32 averageBicarbConductivity; ///< The average bicarb conductivity calculated in one fill. + F32 averageAcidConductivity; ///< The average acid conductivity calculated in one fill. + U32 isThisTheFirstFill; ///< Indicate if this is the first fill. + F32 pctDiffInConductivity; ///< The percent difference between CD1 and CD2. + F32 usedAcidVolumeML; ///< The used acid volume in ML. + F32 usedBicarbVolumeML; ///< The used bicarb volume in ML. + F32 integratedVolumeML; ///< Integrated volume in milliliters. + U32 roOnlyModeStatus; ///< RO only mode status. + U32 badFillSignal; ///< bad fill signal. + U32 badFillState; ///< bad fill substate. +} DG_FILL_MODE_DATA_T; + // ********** public function prototypes ********** void initFillMode( void ); // initialize this module @@ -39,16 +62,37 @@ U32 execFillMode( void ); // execute the fill mode state machine (call from OperationModes) -F32 getAvgFillFlowRate( void ); - +F32 getAvgFillFlowRateLPM( void ); F32 getAvgFillTemperature( void ); - F32 getLastFillTemperature( void ); +void setThisFirstFillFlag( BOOL flag ); // indicates bottles need prime when set to TRUE void resetFillStatusParameters( void ); BOOL isThisTheFirstFill( void ); +F32 getChemicalUsedVolumeML( CHEMICAL_BOTTLES_T bottle ); +void resetChemicalUsedVolumeML( CHEMICAL_BOTTLES_T bottle ); + +void setROMode( BOOL enableROOnlyMode ); +BOOL isROOnlyModeEnabled( void ); + +void setAcidAndBicarbType( U32 acid, U32 bicarb ); + +BOOL testSetUsedAcidVolumeMLOverride( F32 value ); +BOOL testResetUsedAcidVolumeMLOverride( void ); + +BOOL testSetUsedBicarbVolumeMLOverride( F32 value ); +BOOL testResetUsedBicarbVolumeMLOverride( void ); + +BOOL testSetFillModeDataPublishIntervalOverride( U32 value ); +BOOL testResetFillModeDataPublishIntervalOverride( void ); + +BOOL testSetIntegratedVolumeOverride( F32 value ); +BOOL testResetIntegratedVolumeOverride( void ); + +BOOL testSetModeFillForCal( U32 calForCheck ); + /**@}*/ #endif