OWA-EPANET Toolkit  2.2
Simple Control Functions

These functions are used for working with simple conditional controls. More...

Functions

int EN_addcontrol (EN_Project ph, int type, int linkIndex, double setting, int nodeIndex, double level, int *index)
 Adds a new simple control to a project. More...
 
int EN_deletecontrol (EN_Project ph, int index)
 Deletes an existing simple control. More...
 
int EN_getcontrol (EN_Project ph, int index, int *type, int *linkIndex, double *setting, int *nodeIndex, double *level)
 Retrieves the properties of a simple control. More...
 
int EN_setcontrol (EN_Project ph, int index, int type, int linkIndex, double setting, int nodeIndex, double level)
 Sets the properties of an existing simple control. More...
 

Overview

These functions are used for working with simple conditional controls.

Function Documentation

◆ EN_addcontrol()

int EN_addcontrol ( EN_Project  ph,
int  type,
int  linkIndex,
double  setting,
int  nodeIndex,
double  level,
int *  index 
)

Adds a new simple control to a project.

Parameters
phan EPANET project handle.
typethe type of control to add (see EN_ControlType).
linkIndexthe index of a link to control (starting from 1).
settingcontrol setting applied to the link.
nodeIndexindex of the node used to control the link (0 for EN_TIMER and EN_TIMEOFDAY controls).
levelaction level (tank level, junction pressure, or time in seconds) that triggers the control.
[out]indexindex of the new control.
Returns
an error code.

◆ EN_deletecontrol()

int EN_deletecontrol ( EN_Project  ph,
int  index 
)

Deletes an existing simple control.

Parameters
phan EPANET project handle.
indexthe index of the control to delete (starting from 1).
Returns
an error code.

◆ EN_getcontrol()

int EN_getcontrol ( EN_Project  ph,
int  index,
int *  type,
int *  linkIndex,
double *  setting,
int *  nodeIndex,
double *  level 
)

Retrieves the properties of a simple control.

Parameters
phan EPANET project handle.
indexthe control's index (starting from 1).
[out]typethe type of control (see EN_ControlType).
[out]linkIndexthe index of the link being controlled.
[out]settingthe control setting applied to the link.
[out]nodeIndexthe index of the node used to trigger the control (0 for EN_TIMER and EN_TIMEOFDAY controls).
[out]levelthe action level (tank level, junction pressure, or time in seconds) that triggers the control.
Returns
an error code.

◆ EN_setcontrol()

int EN_setcontrol ( EN_Project  ph,
int  index,
int  type,
int  linkIndex,
double  setting,
int  nodeIndex,
double  level 
)

Sets the properties of an existing simple control.

Parameters
phan EPANET project handle.
indexthe control's index (starting from 1).
typethe type of control (see EN_ControlType).
linkIndexthe index of the link being controlled.
settingthe control setting applied to the link.
nodeIndexthe index of the node used to trigger the control (0 for EN_TIMER and EN_TIMEOFDAY controls).
levelthe action level (tank level, junction pressure, or time in seconds) that triggers the control.
Returns
an error code.