adds an API function to get information about upcoming events

This commit is contained in:
Sam Hatchett
2022-07-27 14:18:50 -04:00
parent 44ad2488e4
commit 5f8ee49fd6
5 changed files with 109 additions and 48 deletions

View File

@@ -638,6 +638,16 @@ typedef struct Project *EN_Project;
*/
int DLLEXPORT EN_getstatistic(EN_Project ph, int type, double* out_value);
/**
@brief Get information about upcoming time step events, and what causes them.
@param ph an EPANET project handle.
@param[out] eventType the type of event that will occur.
@param[out] duration the amount of time in the future this event will occur
@param[out] elementIndex the index of the element causing the event.
**/
int DLLEXPORT EN_timeToNextEvent(EN_Project ph, EN_TimestepEvent *eventType, long *duration, int *elementIndex);
/**
@brief Retrieves the order in which a node or link appears in an @ref OutFile "output file".
@param ph an EPANET project handle.

View File

@@ -125,6 +125,18 @@ typedef enum {
EN_NEXTEVENTTANK = 15 //!< Index of tank with shortest time to become empty or full (read only)
} EN_TimeParameter;
/**
These are the types of events that can cause a timestep to end.
**/
typedef enum {
EN_STEP_REPORT = 0,
EN_STEP_HYD = 1,
EN_STEP_WQ = 2,
EN_STEP_TANKEVENT = 3,
EN_STEP_CONTROLEVENT = 4
} EN_TimestepEvent;
/// Analysis convergence statistics
/**
These statistics report the convergence criteria for the most current hydraulic analysis