/************************************************************************** * * Copyright (c) 2019-2025 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) 29-Feb-2024 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 * ***************************************************************************/ #ifndef __MODE_FILL_H__ #define __MODE_FILL_H__ #include "DGCommon.h" #include "DGDefs.h" /** * @defgroup DGFillMode DGFillMode * @brief Fill mode module. Manages fill mode functions via a state machine. * * @addtogroup DGFillMode * @{ */ // ********** 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 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 U32 transitionToFillMode( void ); // prepares for transition to fill mode U32 execFillMode( void ); // execute the fill mode state machine (call from OperationModes) 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 ); void setROMode( BOOL enableROOnlyMode ); BOOL isROOnlyModeEnabled( void ); void setAcidAndBicarbType( U32 acid, U32 bicarb ); void setMinRORejectionRatioPCT( U32 roRejectionRatio ); BOOL testSetFillModeDataPublishIntervalOverride( U32 value ); BOOL testResetFillModeDataPublishIntervalOverride( void ); BOOL testSetIntegratedVolumeOverride( F32 value ); BOOL testResetIntegratedVolumeOverride( void ); BOOL testSetEnableTestChemsCondValuesStatus( void ); BOOL testSetModeFillForCal( U32 calForCheck ); /**@}*/ #endif