/************************************************************************** * * Copyright (c) 2022-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 ModeHeatDisinfectActiveCool.h * * @author (last) Dara Navaei * @date (last) 13-Mar-2023 * * @author (original) Dara Navaei * @date (original) 18-Dec-2022 * ***************************************************************************/ #ifndef APP_MODES_MODEHEATDISINFECTACTIVECOOL_H_ #define APP_MODES_MODEHEATDISINFECTACTIVECOOL_H_ #include "DGCommon.h" #include "DGDefs.h" /** * @defgroup DGHeatDisinfectActiveCoolMode DGHeatDisinfectActiveCoolMode * @brief Heat disinfection active cool mode module. Manages the state machine for the heat disinfect active cool mode. * * @addtogroup DGHeatDisinfectActiveCoolMode * @{ */ // ********** public definitions ********** #define RSRVRS_FULL_STABLE_TIME_COUNT ( ( 4 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ///< Reservoirs 1 & 2 full stable time in counts. /// Heat disinfect active cool data publish struct typedef struct { U32 heatDisinfectActivCoolState; ///< Heat disinfect active cool state. U32 overallElapsedTime; ///< Overall elapsed time in heat disinfect active cool mode. U32 stateElapsedTime; ///< Current heat disinfect active cool elapsed time. U32 cancellationMode; ///< Heat disinfect active cool cancellation mode. } MODE_HEAT_DISINFECT_ACTIVE_COOL_DATA_T; /// Disinfect reservoir structure typedef struct { LOAD_CELL_ID_T loadCell; ///< Load cell ID. BOOL drainInit; ///< Boolean flag to indicate drain has been initialized. DG_RESERVOIR_STATUS_T rStatus; ///< Disinfect reservoir status. } DIS_MODE_RSRVR_T; /// Disinfect reservoir status structure typedef struct { DIS_MODE_RSRVR_T rsrvr[ NUM_OF_DG_RESERVOIRS ]; ///< Disinfect mode reservoir status array. U32 rsrvrFillStableTime; ///< Reservoir fill stable status time counter. U32 rsrvrFillStableTimeoutMS; ///< Reservoir fill stable time out in milliseconds. BOOL isThisInitialDrain; ///< Boolean flag to indicate whether this is the initial drain or not. } DIS_RSRVR_STATUS_T; // ********** public function prototypes ********** void initHeatDisinfectActiveCoolMode( void ); // Initialize this module U32 transitionToHeatDisinfectActiveCoolMode( void ); // Prepares for transition to heat disinfect mode U32 execHeatDisinfectActiveCoolMode( void ); // Execute the heat disinfect mode state machine (call from OperationModes) DG_HEAT_DISINFECT_ACTIVE_COOL_STATE_T getCurrentHeatDisinfectActiveCoolState( void ); // get the current state of the heat disinfect mode BOOL stopDGHeatDisinfectActiveCool( void ); // Stop DG heat disinfect // Public functions for fill and drain. These functions should be used for filling and draining in other disinfect modes in the future DG_RESERVOIR_STATUS_T getDisinfectRsrvrFillStatus( DG_RESERVOIR_ID_T rsrvrID, DIS_RSRVR_STATUS_T *rsrvrStatus, F32 targetVolML, U32 fillTimeoutMS, U32 stateTimerMS ); DG_RESERVOIR_STATUS_T getDisinfectRsrvrDrainStatus( DG_RESERVOIR_ID_T rsrvrID, DIS_RSRVR_STATUS_T *rsrvrStatus, U32 drainSteadyTimeoutMS, U32 drainStateTimeoutMS, U32 stateTimerMS ); /**@}*/ #endif