Change ENgetheadcurve to ENgetheadcurveindex

Closes #31
This commit is contained in:
Elad Salomons
2015-11-28 00:21:36 +02:00
parent 8ef2f7e3e3
commit 096167af8b
5 changed files with 8 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ EXPORTS
ENgetqualinfo = _ENgetqualinfo@16
ENsetbasedemand = _ENsetbasedemand@12
ENgetaveragepatternvalue = _ENgetaveragepatternvalue@8
ENgetheadcurve = _ENgetheadcurve@8
ENgetheadcurveindex = _ENgetheadcurveindex@8
ENgetpumptype = _ENgetpumptype@8
ENgetcurveindex = _ENgetcurveindex@8
ENgetcurveid = _ENgetcurveid@8

View File

@@ -206,7 +206,7 @@ Global Const EN_CUSTOM = 2 ' user-defined custom curve
Declare Function ENgetlinkvalue Lib "epanet2.dll" (ByVal Index As Long, ByVal Code As Long, Value As Single) As Long
Declare Function ENgetcurve Lib "epanet2.dll" (ByVal CurveIndex As Long, ByVal CurveID As String, nValues As Long, xValues As Any, yValues As Any) As Long
Declare Function ENgetheadcurve Lib "epanet2.dll" (ByVal Index As Long, ByVal ID As String) As Long
Declare Function ENgetheadcurveindex Lib "epanet2.dll" (ByVal PumpIndex As Long, ByVal CurveIndex As Long) As Long
Declare Function ENgetpumptype Lib "epanet2.dll" (ByVal Index As Long, PumpType As Long) As Long
Declare Function ENgetversion Lib "epanet2.dll" (Value As Long) As Long

View File

@@ -258,7 +258,7 @@ extern "C" {
int DLLEXPORT ENgetlinkvalue(int index, int code, EN_API_FLOAT_TYPE *value);
int DLLEXPORT ENgetcurve(int curveIndex, char* id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues);
int DLLEXPORT ENgetheadcurve(int index, char *id);
int DLLEXPORT ENgetheadcurveindex(int index, int *curveindex);
int DLLEXPORT ENgetpumptype(int index, int *type);
int DLLEXPORT ENgetversion(int *version);

View File

@@ -200,7 +200,7 @@ Public Const EN_CUSTOM = 2 ' user-defined custom curve
Declare Function ENgetlinkvalue Lib "epanet2.dll" (ByVal Index As Int32, ByVal Code As Int32, ByRef Value As Single) As Int32
Declare Function ENgetcurve Lib "epanet2.dll" (ByVal CurveIndex As Int32, ByRef nValues As Int32, ByRef xValues As Single, ByRef yValues As Single) As Int32 'ES
Declare Function ENgetheadcurve Lib "epanet2.dll" (ByVal Index As Int32, ByVal ID As StringBuilder) As Int32 'ES
Declare Function ENgetheadcurveindex Lib "epanet2.dll" (ByVal Index As Int32, ByVal CurveIndex As int32) As Int32 'ES
Declare Function ENgetpumptype Lib "epanet2.dll" (ByVal Index As Int32, ByRef PumpType As Int32) As Int32 'ES
Declare Function ENgetversion Lib "epanet2.dll" (ByRef Value As Int32) As Int32

View File

@@ -2764,21 +2764,19 @@ int DLLEXPORT ENsetqualtype(int qualcode, char *chemname,
return(0);
}
int DLLEXPORT ENgetheadcurve(int index, char *id)
int DLLEXPORT ENgetheadcurveindex(int index, int *curveindex)
/*----------------------------------------------------------------
** Input: index = index of pump in list of links
** Output: id = head curve ID
** Output: curveindex = head curve index
** Returns: error code
** Purpose: retrieves ID of a head curve for specific link index
** Purpose: retrieves index of a head curve for specific link index
**
** NOTE: 'id' must be able to hold MAXID characters
**----------------------------------------------------------------
*/
{
strcpy(id,"");
if (!Openflag) return(102);
if (index < 1 || index > Nlinks || PUMP != Link[index].Type) return(204);
strcpy(id,Curve[Pump[PUMPINDEX(index)].Hcurve].ID);
*curveindex = Pump[PUMPINDEX(index)].Hcurve;
return(0);
}