OWA-EPANET Toolkit 2.3
|
Functions | |
int DLLEXPORT | EN_addcurve (EN_Project ph, const char *id) |
Adds a new data curve to a project. | |
int DLLEXPORT | EN_deletecurve (EN_Project ph, int index) |
Deletes a data curve from a project. | |
int DLLEXPORT | EN_getcurveindex (EN_Project ph, const char *id, int *out_index) |
Retrieves the index of a curve given its ID name. | |
int DLLEXPORT | EN_getcurveid (EN_Project ph, int index, char *out_id) |
Retrieves the ID name of a curve given its index. | |
int DLLEXPORT | EN_setcurveid (EN_Project ph, int index, const char *id) |
Changes the ID name of a data curve given its index. | |
int DLLEXPORT | EN_getcurvelen (EN_Project ph, int index, int *out_len) |
Retrieves the number of points in a curve. | |
int DLLEXPORT | EN_getcurvetype (EN_Project ph, int index, int *out_type) |
Retrieves a curve's type. | |
int DLLEXPORT | EN_setcurvetype (EN_Project ph, int index, int type) |
Sets a curve's type. | |
int DLLEXPORT | 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. | |
int DLLEXPORT | EN_setcurvevalue (EN_Project ph, int curveIndex, int pointIndex, double x, double y) |
Sets the value of a single data point for a curve. | |
int DLLEXPORT | EN_getcurve (EN_Project ph, int index, char *out_id, int *out_nPoints, double *out_xValues, double *out_yValues) |
Retrieves all of a curve's data. | |
int DLLEXPORT | EN_setcurve (EN_Project ph, int index, double *xValues, double *yValues, int nPoints) |
assigns a set of data points to a curve. | |
These functions are used for working with data curves.
int DLLEXPORT EN_addcurve | ( | EN_Project | ph, |
const char * | id ) |
Adds a new data curve to a project.
ph | an EPANET project handle. |
id | The ID name of the curve to be added. |
The new curve contains a single data point (1.0, 1.0).
int DLLEXPORT EN_deletecurve | ( | EN_Project | ph, |
int | index ) |
Deletes a data curve from a project.
ph | an EPANET project handle. |
index | the data curve's index (starting from 1). |
int DLLEXPORT EN_getcurve | ( | EN_Project | ph, |
int | index, | ||
char * | out_id, | ||
int * | out_nPoints, | ||
double * | out_xValues, | ||
double * | out_yValues ) |
Retrieves all of a curve's data.
ph | an EPANET project handle. | |
index | a curve's index (starting from 1). | |
[out] | out_id | the curve's ID name. |
[out] | out_nPoints | the number of data points on the curve. |
[out] | out_xValues | the curve's x-values. |
[out] | out_yValues | the curve's y-values. |
The calling program is responsible for making out_xValues
and out_yValues
large enough to hold out_nPoints
number of data points and for sizing out_id
to hold at least EN_MAXID+1 characters.
int DLLEXPORT EN_getcurveid | ( | EN_Project | ph, |
int | index, | ||
char * | out_id ) |
Retrieves the ID name of a curve given its index.
ph | an EPANET project handle. | |
index | a curve's index (starting from 1). | |
[out] | out_id | the curve's ID name. |
The ID name must be sized to hold at least EN_MAXID+1 characters.
int DLLEXPORT EN_getcurveindex | ( | EN_Project | ph, |
const char * | id, | ||
int * | out_index ) |
Retrieves the index of a curve given its ID name.
ph | an EPANET project handle. | |
id | the ID name of a curve. | |
[out] | out_index | The curve's index (starting from 1). |
int DLLEXPORT EN_getcurvelen | ( | EN_Project | ph, |
int | index, | ||
int * | out_len ) |
Retrieves the number of points in a curve.
ph | an EPANET project handle. | |
index | a curve's index (starting from 1). | |
[out] | out_len | The number of data points assigned to the curve. |
int DLLEXPORT EN_getcurvetype | ( | EN_Project | ph, |
int | index, | ||
int * | out_type ) |
Retrieves a curve's type.
ph | an EPANET project handle. | |
index | a curve's index (starting from 1). | |
[out] | out_type | the curve's type (see EN_CurveType). |
int DLLEXPORT 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.
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] | out_x | the point's x-value. |
[out] | out_y | the point's y-value. |
int DLLEXPORT EN_setcurve | ( | EN_Project | ph, |
int | index, | ||
double * | xValues, | ||
double * | yValues, | ||
int | nPoints ) |
assigns a set of data points to a curve.
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. |
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.
int DLLEXPORT EN_setcurveid | ( | EN_Project | ph, |
int | index, | ||
const char * | id ) |
Changes the ID name of a data curve given its index.
ph | an EPANET project handle. |
index | a data curve index (starting from 1). |
id | the data curve's new ID name. |
The new ID name must not exceed EN_MAXID characters.
int DLLEXPORT EN_setcurvetype | ( | EN_Project | ph, |
int | index, | ||
int | type ) |
Sets a curve's type.
ph | an EPANET project handle. |
index | a curve's index (starting from 1). |
type | the curve's type (see EN_CurveType). |
int DLLEXPORT EN_setcurvevalue | ( | EN_Project | ph, |
int | curveIndex, | ||
int | pointIndex, | ||
double | x, | ||
double | y ) |
Sets the value of a single data point for a curve.
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. |