EPANET
Functions
Simple Control Functions

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

Functions

int DLLEXPORT EN_addcontrol (EN_Project ph, int type, int linkIndex, double setting, int nodeIndex, double level, int *out_index)
 Adds a new simple control to a project. More...
 
int DLLEXPORT EN_deletecontrol (EN_Project ph, int index)
 Deletes an existing simple control. More...
 
int DLLEXPORT EN_getcontrol (EN_Project ph, int index, int *out_type, int *out_linkIndex, double *out_setting, int *out_nodeIndex, double *out_level)
 Retrieves the properties of a simple control. More...
 
int DLLEXPORT 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...
 
int DLLEXPORT EN_getcontrolenabled (EN_Project ph, int index, int *out_enabled)
 Gets the enabled status of a simple control. More...
 
int DLLEXPORT EN_setcontrolenabled (EN_Project ph, int index, int enabled)
 Sets the enabled status of a simple control. More...
 

Detailed Description

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 *  out_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]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 *  out_type,
int *  out_linkIndex,
double *  out_setting,
int *  out_nodeIndex,
double *  out_level 
)

Retrieves the properties of a simple control.

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

◆ EN_getcontrolenabled()

int EN_getcontrolenabled ( EN_Project  ph,
int  index,
int *  out_enabled 
)

Gets the enabled status of a simple control.

Parameters
phan EPANET project handle.
indexthe control's index (starting from 1).
out_enabledEN_TRUE (= 1) if the control is enabled or EN_FALSE (= 0) if it is disabled.
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.

◆ EN_setcontrolenabled()

int EN_setcontrolenabled ( EN_Project  ph,
int  index,
int  enabled 
)

Sets the enabled status of a simple control.

Parameters
phan EPANET project handle.
indexthe control's index (starting from 1).
enabledEN_TRUE (= 1) sets the control to enabled, EN_FALSE (= 0) sets it to disabled.
Returns
an error code.