OWA-EPANET Toolkit 2.3
|
Functions | |
int DLLEXPORT | EN_addnode (EN_Project ph, const char *id, int nodeType, int *out_index) |
Adds a new node to a project. | |
int DLLEXPORT | EN_deletenode (EN_Project ph, int index, int actionCode) |
Deletes a node from a project. | |
int DLLEXPORT | EN_getnodeindex (EN_Project ph, const char *id, int *out_index) |
Gets the index of a node given its ID name. | |
int DLLEXPORT | EN_getnodeid (EN_Project ph, int index, char *out_id) |
Gets the ID name of a node given its index. | |
int DLLEXPORT | EN_setnodeid (EN_Project ph, int index, const char *newid) |
Changes the ID name of a node. | |
int DLLEXPORT | EN_getnodetype (EN_Project ph, int index, int *out_nodeType) |
Retrieves a node's type given its index. | |
int DLLEXPORT | EN_getnodevalue (EN_Project ph, int index, int property, double *out_value) |
Retrieves a property value for a node. | |
int DLLEXPORT | EN_getnodevalues (EN_Project ph, int property, double *out_values) |
Retrieves an array of property values for all nodes. | |
int DLLEXPORT | EN_setnodevalue (EN_Project ph, int index, int property, double value) |
Sets a property value for a node. | |
int DLLEXPORT | EN_setjuncdata (EN_Project ph, int index, double elev, double dmnd, const char *dmndpat) |
Sets a group of properties for a junction node. | |
int DLLEXPORT | EN_settankdata (EN_Project ph, int index, double elev, double initlvl, double minlvl, double maxlvl, double diam, double minvol, const char *volcurve) |
Sets a group of properties for a tank node. | |
int DLLEXPORT | EN_getcoord (EN_Project ph, int index, double *out_x, double *out_y) |
Gets the (x,y) coordinates of a node. | |
int DLLEXPORT | EN_setcoord (EN_Project ph, int index, double x, double y) |
Sets the (x,y) coordinates of a node. | |
These functions are used for working with network nodes.
int DLLEXPORT EN_addnode | ( | EN_Project | ph, |
const char * | id, | ||
int | nodeType, | ||
int * | out_index ) |
Adds a new node to a project.
ph | an EPANET project handle. | |
id | the ID name of the node to be added. | |
nodeType | the type of node being added (see EN_NodeType) | |
[out] | out_index | the index of the newly added node |
When a new node is created all of its properties (see EN_NodeProperty) are set to 0.
int DLLEXPORT EN_deletenode | ( | EN_Project | ph, |
int | index, | ||
int | actionCode ) |
Deletes a node from a project.
ph | an EPANET project handle. |
index | the index of the node to be deleted. |
actionCode | the action taken if any control contains the node and its links. |
If actionCode
is EN_UNCONDITIONAL
then the node, its incident links and all simple and rule-based controls that contain them are deleted. If set to EN_CONDITIONAL
then the node is not deleted if it or its incident links appear in any controls and error code 261 is returned.
int DLLEXPORT EN_getcoord | ( | EN_Project | ph, |
int | index, | ||
double * | out_x, | ||
double * | out_y ) |
Gets the (x,y) coordinates of a node.
ph | an EPANET project handle. | |
index | a node index (starting from 1). | |
[out] | out_x | the node's X-coordinate value. |
[out] | out_y | the node's Y-coordinate value. |
int DLLEXPORT EN_getnodeid | ( | EN_Project | ph, |
int | index, | ||
char * | out_id ) |
Gets the ID name of a node given its index.
ph | an EPANET project handle. | |
index | a node's index (starting from 1). | |
[out] | out_id | the node's ID name. |
The ID name must be sized to hold at least EN_MAXID+1 characters.
int DLLEXPORT EN_getnodeindex | ( | EN_Project | ph, |
const char * | id, | ||
int * | out_index ) |
Gets the index of a node given its ID name.
ph | an EPANET project handle. | |
id | a node ID name. | |
[out] | out_index | the node's index (starting from 1). |
int DLLEXPORT EN_getnodetype | ( | EN_Project | ph, |
int | index, | ||
int * | out_nodeType ) |
Retrieves a node's type given its index.
ph | an EPANET project handle. | |
index | a node's index (starting from 1). | |
[out] | out_nodeType | the node's type (see EN_NodeType). |
int DLLEXPORT EN_getnodevalue | ( | EN_Project | ph, |
int | index, | ||
int | property, | ||
double * | out_value ) |
Retrieves a property value for a node.
ph | an EPANET project handle. | |
index | a node's index. | |
property | the property to retrieve (see EN_NodeProperty). | |
[out] | out_value | the current value of the property. |
Values are returned in units that depend on the units used for flow rate (see Measurement Units).
int DLLEXPORT EN_getnodevalues | ( | EN_Project | ph, |
int | property, | ||
double * | out_values ) |
Retrieves an array of property values for all nodes.
ph | an EPANET project handle. | |
property | the property to retrieve (see EN_NodeProperty). | |
[out] | out_values | an array of values for all nodes. |
Values are returned in units that depend on the units used for flow rate (see Measurement Units).
int DLLEXPORT EN_setcoord | ( | EN_Project | ph, |
int | index, | ||
double | x, | ||
double | y ) |
Sets the (x,y) coordinates of a node.
ph | an EPANET project handle. |
index | a node index (starting from 1). |
x | the node's X-coordinate value. |
y | the node's Y-coordinate value. |
int DLLEXPORT EN_setjuncdata | ( | EN_Project | ph, |
int | index, | ||
double | elev, | ||
double | dmnd, | ||
const char * | dmndpat ) |
Sets a group of properties for a junction node.
ph | an EPANET project handle. |
index | a junction node's index (starting from 1). |
elev | the value of the junction's elevation. |
dmnd | the value of the junction's primary base demand. |
dmndpat | the ID name of the demand's time pattern ("" for no pattern) |
These properties have units that depend on the units used for flow rate (see Measurement Units).
int DLLEXPORT EN_setnodeid | ( | EN_Project | ph, |
int | index, | ||
const char * | newid ) |
Changes the ID name of a node.
ph | an EPANET project handle. |
index | a node's index (starting from 1). |
newid | the new ID name for the node. |
The ID name must not be longer than EN_MAXID characters.
int DLLEXPORT EN_setnodevalue | ( | EN_Project | ph, |
int | index, | ||
int | property, | ||
double | value ) |
Sets a property value for a node.
ph | an EPANET project handle. |
index | a node's index (starting from 1). |
property | the property to set (see EN_NodeProperty). |
value | the new value for the property. |
Values are in units that depend on the units used for flow rate (see Measurement Units).
int DLLEXPORT EN_settankdata | ( | EN_Project | ph, |
int | index, | ||
double | elev, | ||
double | initlvl, | ||
double | minlvl, | ||
double | maxlvl, | ||
double | diam, | ||
double | minvol, | ||
const char * | volcurve ) |
Sets a group of properties for a tank node.
ph | an EPANET project handle. |
index | a tank node's index (starting from 1). |
elev | the tank's bottom elevation. |
initlvl | the initial water level in the tank. |
minlvl | the minimum water level for the tank. |
maxlvl | the maximum water level for the tank. |
diam | the tank's diameter (0 if a volume curve is supplied). |
minvol | the volume of the tank at its minimum water level. |
volcurve | the name of the tank's volume curve ("" for no curve) |
These properties have units that depend on the units used for flow rate (see Measurement Units).