Added EN_setnodeid and EN_setlinkid (Issue #306)

This commit is contained in:
Lew Rossman
2018-10-17 09:05:16 -04:00
parent 1fce14efb8
commit 76419e0b4c
4 changed files with 86 additions and 0 deletions

View File

@@ -250,7 +250,9 @@ Public Const EN_G_CURVE = 4 ' General\default curve
Declare Function ENsetflowunits Lib "epanet2.dll" (ByVal code As Long) As Long
Declare Function ENaddcontrol Lib "epanet2.dll" (Cindex As Long, ByVal Ctype As Long, ByVal Lindex As Long, ByVal setting As Single, ByVal Nindex As Long, ByVal Level As Single) As Long
Declare Function ENsetcontrol Lib "epanet2.dll" (ByVal Cindex As Long, ByVal Ctype As Long, ByVal Lindex As Long, ByVal setting As Single, ByVal Nindex As Long, ByVal Level As Single) As Long
Declare Function ENsetnodeid Lib "epanet2.dll" (ByVal index As Long, ByVal newid As String) As Long
Declare Function ENsetnodevalue Lib "epanet2.dll" (ByVal index As Long, ByVal code As Long, ByVal value As Single) As Long
Declare Function ENsetlinkid Lib "epanet2.dll" (ByVal index As Long, ByVal newid As String) As Long
Declare Function ENsetlinkvalue Lib "epanet2.dll" (ByVal index As Long, ByVal code As Long, ByVal value As Single) As Long
Declare Function ENaddpattern Lib "epanet2.dll" (ByVal id As String) As Long
Declare Function ENsetpattern Lib "epanet2.dll" (ByVal index As Long, F As Any, ByVal N As Long) As Long

View File

@@ -842,6 +842,14 @@ extern "C" {
@return Error code.
*/
int DLLEXPORT ENsetcontrol(int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
/**
@brief Change the ID name for a node.
@param index The index of a node. First node is index 1.
@param newid A string containing the node's new ID name.
@return Error code.
*/
int DLLEXPORT ENsetnodeid(int index, char *newid);
/**
@brief Set a property value for a node.
@@ -852,6 +860,14 @@ extern "C" {
@see EN_NodeProperty
*/
int DLLEXPORT ENsetnodevalue(int index, int code, EN_API_FLOAT_TYPE v);
/**
@brief Change the ID name for a link.
@param index The index of a link. First link is index 1.
@param newid A string containing the link's new ID name.
@return Error code.
*/
int DLLEXPORT ENsetlinkid(int index, char *newid);
/**
@brief Set a property value for a link.
@@ -1297,7 +1313,9 @@ extern "C" {
int DLLEXPORT EN_addcontrol(EN_ProjectHandle ph, int *cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
int DLLEXPORT EN_setcontrol(EN_ProjectHandle ph, int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
int DLLEXPORT EN_setnodeid(EN_ProjectHandle ph, int index, char *newid);
int DLLEXPORT EN_setnodevalue(EN_ProjectHandle ph, int index, int code, EN_API_FLOAT_TYPE v);
int DLLEXPORT EN_setlinkid(EN_ProjectHandle ph, int index, char *newid);
int DLLEXPORT EN_setlinkvalue(EN_ProjectHandle ph, int index, int code, EN_API_FLOAT_TYPE v);
int DLLEXPORT EN_addpattern(EN_ProjectHandle ph, char *id);
int DLLEXPORT EN_setpattern(EN_ProjectHandle ph, int index, EN_API_FLOAT_TYPE *f, int len);

View File

@@ -227,7 +227,9 @@ Public Const EN_CUSTOM = 2 ' user-defined custom curve
Declare Function ENgetversion Lib "epanet2.dll" (ByRef Value As Int32) As Int32
Declare Function ENsetcontrol Lib "epanet2.dll" (ByVal Cindex As Int32, ByVal CtlType As Int32, ByVal Lindex As Int32, ByVal Setting As Single, ByVal Nindex As Int32, ByVal Level As Single) As Int32
Declare Function ENsetnodeid Lib "epanet2.dll" (ByVal index As Int32, ByVal newid As String) As Int32
Declare Function ENsetnodevalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByVal Value As Single) As Int32
Declare Function ENsetlinkid Lib "epanet2.dll" (ByVal index As Int32, ByVal newid As String) As Int32
Declare Function ENsetlinkvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByVal Value As Single) As Int32
Declare Function ENsetpattern Lib "epanet2.dll" (ByVal Index as Int32, ByRef F as Single, ByVal N as Int32) as Int32
Declare Function ENsetpatternvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Period As Int32, ByVal Value As Single) As Int32