EPANET  2.1
Curves

Functions

int ENgetcurve (int curveIndex, char *id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues)
 Get a curve's properties. More...
 
int ENgetheadcurveindex (int pumpIndex, int *curveIndex)
 Retrieves the curve index for a specified pump index. More...
 
int ENgetpumptype (int linkIndex, int *outType)
 Get the type of pump. More...
 
int ENgetcurveindex (char *id, int *index)
 Retrieves index of curve with specific ID. More...
 
int ENgetcurveid (int index, char *id)
 Retrieves ID of a curve with specific index. More...
 
int ENgetcurvelen (int index, int *len)
 Retrieves number of points in a curve. More...
 
int ENgetcurvevalue (int curveIndex, int pointIndex, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y)
 retrieves x,y point for a specific point number and curve More...
 
int ENsetcurvevalue (int curveIndex, int pointIndex, EN_API_FLOAT_TYPE x, EN_API_FLOAT_TYPE y)
 Sets x,y point for a specific point and curve. More...
 
int ENsetcurve (int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y, int len)
 Sets x,y values for a specified curve. More...
 
int ENaddcurve (char *id)
 Adds a new curve appended to the end of the existing curves. More...
 

Detailed Description

Function Documentation

int ENaddcurve ( char *  id)

Adds a new curve appended to the end of the existing curves.

Parameters
idThe name of the curve to be added.
Returns
Error code.
See also
ENgetcurveindex ENsetcurve
int ENgetcurve ( int  curveIndex,
char *  id,
int *  nValues,
EN_API_FLOAT_TYPE **  xValues,
EN_API_FLOAT_TYPE **  yValues 
)

Get a curve's properties.

Parameters
curveIndexThe index of a curve (first curve is index 1).
[out]idThe curve's string ID. Client code must preallocate at least MAXID characters.
[out]nValuesThe number of values in the curve's (x,y) list.
[out]xValuesThe curve's x-values. Must be freed by client.
[out]yValuesThe curve's y-values. Must be freed by client.
Returns
Error code.
int ENgetcurveid ( int  index,
char *  id 
)

Retrieves ID of a curve with specific index.

Parameters
indexThe index of a curve.
[out]idThe ID of the curve specified.
Returns
Error code.
See also
ENsetcurveindex

NOTE: 'id' must be able to hold MAXID characters

int ENgetcurveindex ( char *  id,
int *  index 
)

Retrieves index of curve with specific ID.

Parameters
idThe ID of a curve.
[out]indexThe index of the named curve
Returns
Error code.
See also
ENgetcurveid
int ENgetcurvelen ( int  index,
int *  len 
)

Retrieves number of points in a curve.

Parameters
indexThe index of a curve.
[out]lenThe length of the curve coordinate list
Returns
Error code.
See also
ENgetcurvevalue
int ENgetcurvevalue ( int  curveIndex,
int  pointIndex,
EN_API_FLOAT_TYPE *  x,
EN_API_FLOAT_TYPE *  y 
)

retrieves x,y point for a specific point number and curve

Parameters
curveIndexThe index of a curve
pointIndexThe index of a point in the curve
[out]xThe x-value of the specified point.
[out]yThe y-value of the specified point.
Returns
Error code.
See also
ENgetcurvelen ENsetcurvevalue
int ENgetheadcurveindex ( int  pumpIndex,
int *  curveIndex 
)

Retrieves the curve index for a specified pump index.

Parameters
pumpIndexThe index of a pump
[out]curveIndexThe index of the curve used by the pump.
Returns
Error code.
int ENgetpumptype ( int  linkIndex,
int *  outType 
)

Get the type of pump.

Parameters
linkIndexThe index of the pump element
[out]outTypeThe integer-typed pump curve type signifier (output parameter)
Returns
Error code
See also
EN_CurveType
int ENsetcurve ( int  index,
EN_API_FLOAT_TYPE *  x,
EN_API_FLOAT_TYPE *  y,
int  len 
)

Sets x,y values for a specified curve.

Parameters
indexThe index of a curve.
xAn array of x-values for the curve.
yAn array of y-values for the curve.
lenThe length of the arrays x and y.
Returns
Error code.
int ENsetcurvevalue ( int  curveIndex,
int  pointIndex,
EN_API_FLOAT_TYPE  x,
EN_API_FLOAT_TYPE  y 
)

Sets x,y point for a specific point and curve.

Parameters
curveIndexThe index of a curve.
pointIndexThe index of a point in the curve.
xThe x-value of the point.
yThe y-value of the point.
Returns
Error code.