OWA-EPANET Toolkit  2.2
Analysis Options Functions

These functions are used to get and set analysis options. More...

Functions

int EN_getoption (EN_Project ph, int option, double *value)
 Retrieves the value of an analysis option. More...
 
int EN_setoption (EN_Project ph, int option, double value)
 Sets the value for an anlysis option. More...
 
int EN_getflowunits (EN_Project ph, int *units)
 Retrieves a project's flow units. More...
 
int EN_setflowunits (EN_Project ph, int units)
 Sets a project's flow units. More...
 
int EN_gettimeparam (EN_Project ph, int param, long *value)
 Retrieves the value of a time parameter. More...
 
int EN_settimeparam (EN_Project ph, int param, long value)
 Sets the value of a time parameter. More...
 
int EN_getqualinfo (EN_Project ph, int *qualType, char *out_chemName, char *out_chemUnits, int *traceNode)
 Gets information about the type of water quality analysis requested. More...
 
int EN_getqualtype (EN_Project ph, int *qualType, int *traceNode)
 Retrieves the type of water quality analysis to be run. More...
 
int EN_setqualtype (EN_Project ph, int qualType, char *chemName, char *chemUnits, char *traceNode)
 Sets the type of water quality analysis to run. More...
 

Overview

These functions are used to get and set analysis options.

Function Documentation

◆ EN_getflowunits()

int EN_getflowunits ( EN_Project  ph,
int *  units 
)

Retrieves a project's flow units.

Parameters
phan EPANET project handle.
[out]unitsa flow units code (see EN_FlowUnits)
Returns
an error code.

Flow units in liters or cubic meters implies that SI metric units are used for all other quantities in addition to flow. Otherwise US Customary units are employed.

◆ EN_getoption()

int EN_getoption ( EN_Project  ph,
int  option,
double *  value 
)

Retrieves the value of an analysis option.

Parameters
phan EPANET project handle.
optiona type of analysis option (see EN_Option).
[out]valuethe current value of the option.
Returns
an error code

◆ EN_getqualinfo()

int EN_getqualinfo ( EN_Project  ph,
int *  qualType,
char *  out_chemName,
char *  out_chemUnits,
int *  traceNode 
)

Gets information about the type of water quality analysis requested.

Parameters
phan EPANET project handle.
[out]qualTypetype of analysis to run (see EN_QualityType).
[out]out_chemNamename of chemical constituent.
[out]out_chemUnitsconcentration units of the constituent.
[out]traceNodeindex of the node being traced (if applicable).
Returns
an error code.

◆ EN_getqualtype()

int EN_getqualtype ( EN_Project  ph,
int *  qualType,
int *  traceNode 
)

Retrieves the type of water quality analysis to be run.

Parameters
phan EPANET project handle.
[out]qualTypethe type of analysis to run (see EN_QualityType).
[out]traceNodethe index of node being traced, if qualType = EN_TRACE.
Returns
an error code.

◆ EN_gettimeparam()

int EN_gettimeparam ( EN_Project  ph,
int  param,
long *  value 
)

Retrieves the value of a time parameter.

Parameters
phan EPANET project handle.
parama time parameter code (see EN_TimeParameter).
[out]valuethe current value of the time parameter (in seconds).
Returns
an error code.

◆ EN_setflowunits()

int EN_setflowunits ( EN_Project  ph,
int  units 
)

Sets a project's flow units.

Parameters
phan EPANET project handle.
unitsa flow units code (see EN_FlowUnits)
Returns
an error code.

Flow units in liters or cubic meters implies that SI metric units are used for all other quantities in addition to flow. Otherwise US Customary units are employed.

◆ EN_setoption()

int EN_setoption ( EN_Project  ph,
int  option,
double  value 
)

Sets the value for an anlysis option.

Parameters
phan EPANET project handle.
optiona type of analysis option (see EN_Option).
valuethe new value assigned to the option.
Returns
an error code.
See also
EN_Option

◆ EN_setqualtype()

int EN_setqualtype ( EN_Project  ph,
int  qualType,
char *  chemName,
char *  chemUnits,
char *  traceNode 
)

Sets the type of water quality analysis to run.

Parameters
phan EPANET project handle.
qualTypethe type of analysis to run (see EN_QualityType).
chemNamethe name of the quality constituent.
chemUnitsthe concentration units of the constituent.
traceNodethe ID name of the node being traced if qualType = EN_TRACE.
Returns
an error code.

Chemical name and units can be an empty string if the analysis is not for a chemical. The same holds for the trace node if the analysis is not for source tracing.

Note that the trace node is specified by ID name and not by index.

◆ EN_settimeparam()

int EN_settimeparam ( EN_Project  ph,
int  param,
long  value 
)

Sets the value of a time parameter.

Parameters
phan EPANET project handle.
parama time parameter code (see EN_TimeParameter).
valuethe new value of the time parameter (in seconds)
Returns
an error code.