These functions are used for working with network nodes. More...
Functions | |
int | EN_addnode (EN_Project ph, char *id, int nodeType, int *out_index) |
Adds a new node to a project. More... | |
int | EN_deletenode (EN_Project ph, int index, int actionCode) |
Deletes a node from a project. More... | |
int | EN_getnodeindex (EN_Project ph, char *id, int *out_index) |
Gets the index of a node given its ID name. More... | |
int | EN_getnodeid (EN_Project ph, int index, char *out_id) |
Gets the ID name of a node given its index. More... | |
int | EN_setnodeid (EN_Project ph, int index, char *newid) |
Changes the ID name of a node. More... | |
int | EN_getnodetype (EN_Project ph, int index, int *out_nodeType) |
Retrieves a node's type given its index. More... | |
int | EN_getnodevalue (EN_Project ph, int index, int property, double *out_value) |
Retrieves a property value for a node. More... | |
int | EN_setnodevalue (EN_Project ph, int index, int property, double value) |
Sets a property value for a node. More... | |
int | EN_setjuncdata (EN_Project ph, int index, double elev, double dmnd, char *dmndpat) |
Sets a group of properties for a junction node. More... | |
int | EN_settankdata (EN_Project ph, int index, double elev, double initlvl, double minlvl, double maxlvl, double diam, double minvol, char *volcurve) |
Sets a group of properties for a tank node. More... | |
int | EN_getcoord (EN_Project ph, int index, double *out_x, double *out_y) |
Gets the (x,y) coordinates of a node. More... | |
int | EN_setcoord (EN_Project ph, int index, double x, double y) |
Sets the (x,y) coordinates of a node. More... | |
These functions are used for working with network nodes.
int EN_addnode | ( | EN_Project | ph, |
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] | 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 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 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] | x | the node's X-coordinate value. |
[out] | y | the node's Y-coordinate value. |
int 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 characters.
int EN_getnodeindex | ( | EN_Project | ph, |
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] | index | the node's index (starting from 1). |
int 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] | nodeType | the node's type (see EN_NodeType). |
int 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] | 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 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 EN_setjuncdata | ( | EN_Project | ph, |
int | index, | ||
double | elev, | ||
double | dmnd, | ||
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 EN_setnodeid | ( | EN_Project | ph, |
int | index, | ||
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 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 EN_settankdata | ( | EN_Project | ph, |
int | index, | ||
double | elev, | ||
double | initlvl, | ||
double | minlvl, | ||
double | maxlvl, | ||
double | diam, | ||
double | minvol, | ||
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).