Merge branch 'dev-2.1' into doxy-trial

# Conflicts fixed:
#	include/epanet2.h
#	src/epanet.c
This commit is contained in:
sam hatchett
2015-11-28 13:22:45 -05:00
11 changed files with 274 additions and 90 deletions

View File

@@ -140,6 +140,10 @@ Global Const EN_SAVE = 1
Global Const EN_INITFLOW = 10 ' Re-initialize flow flag
Global Const EN_CONST_HP = 0 ' constant horsepower
Global Const EN_POWER_FUNC = 1 ' power function
Global Const EN_CUSTOM = 2 ' user-defined custom curve
'These are the external functions that comprise the DLL
Declare Function ENepanet Lib "epanet2.dll" (ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As Any) As Long
@@ -202,7 +206,7 @@ Global Const EN_INITFLOW = 10 ' Re-initialize flow flag
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

@@ -60,6 +60,7 @@
#endif
#endif
// --- Define the EPANET toolkit constants
/// Node property codes
@@ -159,26 +160,33 @@ typedef enum {
} EN_LinkType;
#define EN_NONE 0 /* Quality analysis types. */
#define EN_CHEM 1 /* See QualType in TYPES.H */
#define EN_AGE 2
#define EN_TRACE 3
typedef enum {
EN_NONE = 0, /* Quality analysis types. */
EN_CHEM = 1, /* See QualType in TYPES.H */
EN_AGE = 2,
EN_TRACE = 3
} EN_QualityType;
#define EN_CONCEN 0 /* Source quality types. */
#define EN_MASS 1 /* See SourceType in TYPES.H. */
#define EN_SETPOINT 2
#define EN_FLOWPACED 3
typedef enum {
EN_CONCEN = 0, /* Source quality types. */
EN_MASS = 1, /* See SourceType in TYPES.H. */
EN_SETPOINT = 2,
EN_FLOWPACED = 3
} EN_SourceType;
typedef enum {
EN_CFS = 0, /* Flow units types. */
EN_GPM = 1, /* See FlowUnitsType */
EN_MGD = 2, /* in TYPES.H. */
EN_IMGD = 3,
EN_AFD = 4,
EN_LPS = 5,
EN_LPM = 6,
EN_MLD = 7,
EN_CMH = 8,
EN_CMD = 9
} EN_FlowUnits;
#define EN_CFS 0 /* Flow units types. */
#define EN_GPM 1 /* See FlowUnitsType */
#define EN_MGD 2 /* in TYPES.H. */
#define EN_IMGD 3
#define EN_AFD 4
#define EN_LPS 5
#define EN_LPM 6
#define EN_MLD 7
#define EN_CMH 8
#define EN_CMD 9
/// Simulation Option codes
typedef enum {
@@ -189,26 +197,47 @@ typedef enum {
EN_DEMANDMULT = 4
} EN_Option;
typedef enum {
EN_LOWLEVEL = 0, /* Control types. */
EN_HILEVEL = 1, /* See ControlType */
EN_TIMER = 2, /* in TYPES.H. */
EN_TIMEOFDAY = 3
} EN_ControlType;
#define EN_LOWLEVEL 0 /* Control types. */
#define EN_HILEVEL 1 /* See ControlType */
#define EN_TIMER 2 /* in TYPES.H. */
#define EN_TIMEOFDAY 3
#define EN_AVERAGE 1 /* Time statistic types. */
#define EN_MINIMUM 2 /* See TstatType in TYPES.H */
#define EN_MAXIMUM 3
#define EN_RANGE 4
#define EN_MIX1 0 /* Tank mixing models */
#define EN_MIX2 1
#define EN_FIFO 2
#define EN_LIFO 3
typedef enum {
EN_AVERAGE = 1, /* Time statistic types. */
EN_MINIMUM = 2, /* See TstatType in TYPES.H */
EN_MAXIMUM = 3,
EN_RANGE = 4
} EN_StatisticType;
#define EN_NOSAVE 0 /* Save-results-to-file flag */
#define EN_SAVE 1
#define EN_INITFLOW 10 /* Re-initialize flows flag */
typedef enum {
EN_MIX1 = 0, /* Tank mixing models */
EN_MIX2 = 1,
EN_FIFO = 2,
EN_LIFO = 3
} EN_MixingModel;
typedef enum {
EN_NOSAVE = 0,
EN_SAVE = 1,
EN_INITFLOW = 10,
EN_SAVE_AND_INIT = 11
} EN_SaveOption;
typedef enum {
EN_CONST_HP = 0, /* constant horsepower */
EN_POWER_FUNC = 1, /* power function */
EN_CUSTOM = 2 /* user-defined custom curve */
} EN_CurveType;
@@ -656,6 +685,8 @@ extern "C" {
@return Error code.
*/
int DLLEXPORT ENgetcurve(int curveIndex, char* id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues);
int DLLEXPORT ENgetheadcurveindex(int index, int *curveindex);
int DLLEXPORT ENgetpumptype(int index, int *type);
/**
@brief Get the string ID of the head curve assigned to a pump.

View File

@@ -55,7 +55,7 @@ Public Const EN_STATUS = 11
Public Const EN_SETTING = 12
Public Const EN_ENERGY = 13
Public Const EN_LINKQUAL = 14 'ES
Public Const EN_LINKPATTERN 15
Public Const EN_LINKPATTERN = 15
Public Const EN_DURATION = 0 ' Time parameters
Public Const EN_HYDSTEP = 1
@@ -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