These functions are used for working with data curves.
More...
|
int | EN_addcurve (EN_Project ph, char *id) |
| Adds a new data curve to a project. More...
|
|
int | EN_deletecurve (EN_Project ph, int index) |
| Deletes a data curve from a project. More...
|
|
int | EN_getcurveindex (EN_Project ph, char *id, int *out_index) |
| Retrieves the index of a curve given its ID name. More...
|
|
int | EN_getcurveid (EN_Project ph, int index, char *out_id) |
| Retrieves the ID name of a curve given its index. More...
|
|
int | EN_setcurveid (EN_Project ph, int index, char *id) |
| Changes the ID name of a data curve given its index. More...
|
|
int | EN_getcurvelen (EN_Project ph, int index, int *out_len) |
| Retrieves the number of points in a curve. More...
|
|
int | EN_getcurvetype (EN_Project ph, int index, int *out_type) |
| Retrieves a curve's type. More...
|
|
int | EN_setcurvetype (EN_Project ph, int index, int type) |
| Sets a curve's type. More...
|
|
int | EN_getcurvevalue (EN_Project ph, int curveIndex, int pointIndex, double *out_x, double *out_y) |
| Retrieves the value of a single data point for a curve. More...
|
|
int | EN_setcurvevalue (EN_Project ph, int curveIndex, int pointIndex, double x, double y) |
| Sets the value of a single data point for a curve. More...
|
|
int | EN_setcurve (EN_Project ph, int index, double *xValues, double *yValues, int nPoints) |
| assigns a set of data points to a curve. More...
|
|
These functions are used for working with data curves.
◆ EN_addcurve()
Adds a new data curve to a project.
- Parameters
-
ph | an EPANET project handle. |
id | The ID name of the curve to be added. |
- Returns
- an error code.
The new curve contains a single data point (1.0, 1.0).
◆ EN_deletecurve()
Deletes a data curve from a project.
- Parameters
-
ph | an EPANET project handle. |
index | the data curve's index (starting from 1). |
- Returns
- an error code.
◆ EN_getcurveid()
int EN_getcurveid |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
char * |
out_id |
|
) |
| |
Retrieves the ID name of a curve given its index.
- Parameters
-
| ph | an EPANET project handle. |
| index | a curve's index (starting from 1). |
[out] | out_id | the curve's ID name. |
- Returns
- an error code.
The ID name must be sized to hold at least EN_MAXID characters.
◆ EN_getcurveindex()
int EN_getcurveindex |
( |
EN_Project |
ph, |
|
|
char * |
id, |
|
|
int * |
out_index |
|
) |
| |
Retrieves the index of a curve given its ID name.
- Parameters
-
| ph | an EPANET project handle. |
| id | the ID name of a curve. |
[out] | index | The curve's index (starting from 1). |
- Returns
- an error code.
◆ EN_getcurvelen()
int EN_getcurvelen |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
int * |
out_len |
|
) |
| |
Retrieves the number of points in a curve.
- Parameters
-
| ph | an EPANET project handle. |
| index | a curve's index (starting from 1). |
[out] | len | The number of data points assigned to the curve. |
- Returns
- an error code.
◆ EN_getcurvetype()
int EN_getcurvetype |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
int * |
out_type |
|
) |
| |
Retrieves a curve's type.
- Parameters
-
| ph | an EPANET project handle. |
| index | a curve's index (starting from 1). |
[out] | type | the curve's type (see EN_CurveType). |
- Returns
- an error code.
◆ EN_getcurvevalue()
int EN_getcurvevalue |
( |
EN_Project |
ph, |
|
|
int |
curveIndex, |
|
|
int |
pointIndex, |
|
|
double * |
out_x, |
|
|
double * |
out_y |
|
) |
| |
Retrieves the value of a single data point for a curve.
- Parameters
-
| ph | an EPANET project handle. |
| curveIndex | a curve's index (starting from 1). |
| pointIndex | the index of a point on the curve (starting from 1). |
[out] | x | the point's x-value. |
[out] | y | the point's y-value. |
- Returns
- an error code.
◆ EN_setcurve()
int EN_setcurve |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
double * |
xValues, |
|
|
double * |
yValues, |
|
|
int |
nPoints |
|
) |
| |
assigns a set of data points to a curve.
- Parameters
-
ph | an EPANET project handle. |
index | a curve's index (starting from 1). |
xValues | an array of new x-values for the curve. |
yValues | an array of new y-values for the curve. |
nPoints | the new number of data points for the curve. |
- Returns
- an error code.
xValues and yValues are zero-based arrays that contains nPoints elements.
Use this function to redefine (and resize) a curve all at once; use EN_setcurvevalue to revise a curve's data points one at a time.
◆ EN_setcurveid()
int EN_setcurveid |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
char * |
id |
|
) |
| |
Changes the ID name of a data curve given its index.
- Parameters
-
ph | an EPANET project handle. |
index | a data curve index (starting from 1). |
id | the data curve's new ID name. |
- Returns
- an error code.
The new ID name must not exceed EN_MAXID characters.
◆ EN_setcurvetype()
int EN_setcurvetype |
( |
EN_Project |
ph, |
|
|
int |
index, |
|
|
int |
type |
|
) |
| |
Sets a curve's type.
- Parameters
-
ph | an EPANET project handle. |
index | a curve's index (starting from 1). |
type | the curve's type (see EN_CurveType). |
- Returns
- an error code.
◆ EN_setcurvevalue()
int EN_setcurvevalue |
( |
EN_Project |
ph, |
|
|
int |
curveIndex, |
|
|
int |
pointIndex, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
Sets the value of a single data point for a curve.
- Parameters
-
ph | an EPANET project handle. |
curveIndex | a curve's index (starting from 1). |
pointIndex | the index of a point on the curve (starting from 1). |
x | the point's new x-value. |
y | the point's new y-value. |
- Returns
- an error code.