EPANET  2.1
Managing Controls

Enumerations

enum  EN_ControlType { EN_LOWLEVEL = 0, EN_HILEVEL = 1, EN_TIMER = 2, EN_TIMEOFDAY = 3 }
 

Functions

int ENgetcontrol (int controlIndex, int *controlType, int *linkIndex, EN_API_FLOAT_TYPE *setting, int *nodeIndex, EN_API_FLOAT_TYPE *level)
 Retrieves parameters that define a simple control. More...
 
int ENsetcontrol (int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level)
 Specify parameters to define a simple control. More...
 

Detailed Description

Function Documentation

int ENgetcontrol ( int  controlIndex,
int *  controlType,
int *  linkIndex,
EN_API_FLOAT_TYPE *  setting,
int *  nodeIndex,
EN_API_FLOAT_TYPE *  level 
)

Retrieves parameters that define a simple control.

Parameters
controlIndexControl index (position of control statement in the input file, starting from 1)
[out]controlTypeControl type code (see EPANET2.H)
[out]linkIndexIndex of controlled link
[out]settingControl setting on link
[out]nodeIndexIndex of controlling node (0 for TIMER or TIMEOFDAY control)
[out]levelControl level (tank level, junction pressure, or time (seconds))
Returns
Error code
int ENsetcontrol ( int  cindex,
int  ctype,
int  lindex,
EN_API_FLOAT_TYPE  setting,
int  nindex,
EN_API_FLOAT_TYPE  level 
)

Specify parameters to define a simple control.

Parameters
cindexThe index of the control to edit. First control is index 1.
ctypeThe type code to set for this control.
lindexThe index of a link to control.
settingThe control setting applied to the link.
nindexThe index of a node used to control the link, or 0 for TIMER / TIMEOFDAY control.
levelcontrol point (tank level, junction pressure, or time in seconds).
Returns
Error code.