Merging dev into dev-swig-redux

This commit is contained in:
Michael Tryby
2019-01-28 11:23:25 -05:00
parent 30c9843965
commit b339ff22ca
4 changed files with 1633 additions and 21 deletions

1613
include/epanet2_2.h.orig Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -191,7 +191,7 @@ typedef enum {
EN_PUMP_CLOSED = 2, //!< Pump closed EN_PUMP_CLOSED = 2, //!< Pump closed
EN_PUMP_OPEN = 3, //!< Pump open EN_PUMP_OPEN = 3, //!< Pump open
EN_PUMP_XFLOW = 5 //!< Pump open - cannot supply flow EN_PUMP_XFLOW = 5 //!< Pump open - cannot supply flow
} EN_PumpStateType; } EN_PumpStateType;
/// Types of water quality analyses /// Types of water quality analyses
/** /**
@@ -249,7 +249,7 @@ typedef enum {
EN_LPM = 6, //!< Liters per minute EN_LPM = 6, //!< Liters per minute
EN_MLD = 7, //!< Million liters per day EN_MLD = 7, //!< Million liters per day
EN_CMH = 8, //!< Cubic meters per hour EN_CMH = 8, //!< Cubic meters per hour
EN_CMD = 9 //!< Cubic meters per day EN_CMD = 9 //!< Cubic meters per day
} EN_FlowUnits; } EN_FlowUnits;
/// Types of demand models /// Types of demand models
@@ -261,7 +261,7 @@ A demand driven analysis requires that a junction's full demand be supplied
in each time period independent of how much pressure is available. A pressure in each time period independent of how much pressure is available. A pressure
driven analysis makes demand be a power function of pressure, up to the point driven analysis makes demand be a power function of pressure, up to the point
where the full demand is met. where the full demand is met.
*/ */
typedef enum { typedef enum {
EN_DDA = 0, //!< Demand driven analysis EN_DDA = 0, //!< Demand driven analysis
EN_PDA = 1 //!< Pressure driven analysis EN_PDA = 1 //!< Pressure driven analysis
@@ -272,7 +272,7 @@ typedef enum {
These options specify hydraulic convergence criteria, choice of head loss formula, and These options specify hydraulic convergence criteria, choice of head loss formula, and
several other parameters applied on a network-wide basis. They are accessed using the several other parameters applied on a network-wide basis. They are accessed using the
@ref EN_getoption and @ref EN_setoption functions. @ref EN_getoption and @ref EN_setoption functions.
*/ */
typedef enum { typedef enum {
EN_TRIALS = 0, //!< Maximum hydraulic trials allowed EN_TRIALS = 0, //!< Maximum hydraulic trials allowed
EN_ACCURACY = 1, //!< Maximum total relative flow change for hydraulic convergence EN_ACCURACY = 1, //!< Maximum total relative flow change for hydraulic convergence
@@ -308,7 +308,7 @@ These options determine what kind of statistical post-processing should be done
the time series of simulation results generated before they are reported using the time series of simulation results generated before they are reported using
@ref EN_report. An option can be chosen by using `STATISTIC option` as the argument @ref EN_report. An option can be chosen by using `STATISTIC option` as the argument
to @ref EN_setreport. to @ref EN_setreport.
*/ */
typedef enum { typedef enum {
EN_SERIES = 0, //!< Report all time series points EN_SERIES = 0, //!< Report all time series points
EN_AVERAGE = 1, //!< Report average value over simulation period EN_AVERAGE = 1, //!< Report average value over simulation period
@@ -408,7 +408,7 @@ typedef enum {
EN_R_TIME = 9, //!< Elapsed simulation time EN_R_TIME = 9, //!< Elapsed simulation time
EN_R_CLOCKTIME = 10, //!< Time of day EN_R_CLOCKTIME = 10, //!< Time of day
EN_R_FILLTIME = 11, //!< Time to fill a tank EN_R_FILLTIME = 11, //!< Time to fill a tank
EN_R_DRAINTIME = 12 //!< Time to drain a tank EN_R_DRAINTIME = 12 //!< Time to drain a tank
} EN_RuleVariable; } EN_RuleVariable;
/// Comparison operators used in rule-based controls /// Comparison operators used in rule-based controls
@@ -422,7 +422,7 @@ typedef enum {
EN_R_IS = 6, //!< Is equal to EN_R_IS = 6, //!< Is equal to
EN_R_NOT = 7, //!< Is not equal to EN_R_NOT = 7, //!< Is not equal to
EN_R_BELOW = 8, //!< Is below EN_R_BELOW = 8, //!< Is below
EN_R_ABOVE = 9 //!< Is above EN_R_ABOVE = 9 //!< Is above
} EN_RuleOperator; } EN_RuleOperator;
/// Link status codes used in rule-based controls /// Link status codes used in rule-based controls

View File

@@ -17,7 +17,7 @@
#ifndef EN_API_FLOAT_TYPE #ifndef EN_API_FLOAT_TYPE
#define EN_API_FLOAT_TYPE float #define EN_API_FLOAT_TYPE double
#endif #endif
// Opaque pointer to project // Opaque pointer to project
@@ -46,7 +46,7 @@ int DLLEXPORT proj_close(Handle ph);
int DLLEXPORT hydr_solve(Handle ph); int DLLEXPORT hydr_solve(Handle ph);
int DLLEXPORT hydr_save(Handle ph); int DLLEXPORT hydr_save(Handle ph);
int DLLEXPORT hydr_open(Handle ph); int DLLEXPORT hydr_open(Handle ph);
int DLLEXPORT hydr_init(Handle ph, EN_SaveOption saveFlag); int DLLEXPORT hydr_init(Handle ph, EN_InitHydOption saveFlag);
int DLLEXPORT hydr_run(Handle ph, long *currentTime); int DLLEXPORT hydr_run(Handle ph, long *currentTime);
int DLLEXPORT hydr_next(Handle ph, long *tStep); int DLLEXPORT hydr_next(Handle ph, long *tStep);
int DLLEXPORT hydr_close(Handle ph); int DLLEXPORT hydr_close(Handle ph);
@@ -56,7 +56,7 @@ int DLLEXPORT hydr_usefile(Handle ph, char *filename);
int DLLEXPORT qual_solve(Handle ph); int DLLEXPORT qual_solve(Handle ph);
int DLLEXPORT qual_open(Handle ph); int DLLEXPORT qual_open(Handle ph);
int DLLEXPORT qual_init(Handle ph, EN_SaveOption saveFlag); int DLLEXPORT qual_init(Handle ph, EN_InitHydOption saveFlag);
int DLLEXPORT qual_run(Handle ph, long *currentTime); int DLLEXPORT qual_run(Handle ph, long *currentTime);
int DLLEXPORT qual_next(Handle ph, long *tStep); int DLLEXPORT qual_next(Handle ph, long *tStep);
int DLLEXPORT qual_step(Handle ph, long *timeLeft); int DLLEXPORT qual_step(Handle ph, long *timeLeft);
@@ -76,8 +76,8 @@ int DLLEXPORT anlys_getoption(Handle ph, EN_Option opt, EN_API_FLOAT_TYPE *value
int DLLEXPORT anlys_setoption(Handle ph, int code, EN_API_FLOAT_TYPE value); int DLLEXPORT anlys_setoption(Handle ph, int code, EN_API_FLOAT_TYPE value);
int DLLEXPORT anlys_getflowunits(Handle ph, int *code); int DLLEXPORT anlys_getflowunits(Handle ph, int *code);
int DLLEXPORT anlys_setflowunits(Handle ph, EN_FlowUnits code); int DLLEXPORT anlys_setflowunits(Handle ph, EN_FlowUnits code);
int DLLEXPORT anlys_gettimeparam(Handle ph, EN_TimeProperty code, long *value); int DLLEXPORT anlys_gettimeparam(Handle ph, EN_TimeParameter code, long *value);
int DLLEXPORT anlys_settimeparam(Handle ph, EN_TimeProperty code, long value); int DLLEXPORT anlys_settimeparam(Handle ph, EN_TimeParameter code, long value);
int DLLEXPORT anlys_getqualinfo(Handle ph, int *qualcode, char *chemname, char *chemunits, int *tracenode); int DLLEXPORT anlys_getqualinfo(Handle ph, int *qualcode, char *chemname, char *chemunits, int *tracenode);
int DLLEXPORT anlys_getqualtype(Handle ph, int *qualcode, int *tracenode); int DLLEXPORT anlys_getqualtype(Handle ph, int *qualcode, int *tracenode);
int DLLEXPORT anlys_setqualtype(Handle ph, EN_QualityType qualcode, char *chemname, char *chemunits, char *tracenode); int DLLEXPORT anlys_setqualtype(Handle ph, EN_QualityType qualcode, char *chemname, char *chemunits, char *tracenode);
@@ -144,8 +144,7 @@ int DLLEXPORT curv_setvalue(Handle ph, int curveIndex, int pointIndex, EN_API_FL
int DLLEXPORT curv_get(Handle ph, int curveIndex, char* id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues); int DLLEXPORT curv_get(Handle ph, int curveIndex, char* id, int *nValues, EN_API_FLOAT_TYPE **xValues, EN_API_FLOAT_TYPE **yValues);
int DLLEXPORT curv_set(Handle ph, int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y, int len); int DLLEXPORT curv_set(Handle ph, int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y, int len);
int DLLEXPORT scntl_add(Handle ph, int type, int linkIndex, double setting, int nodeIndex, double level, int *index);
int DLLEXPORT scntl_add(Handle ph, int *cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
int DLLEXPORT scntl_delete(Handle ph, int index); int DLLEXPORT scntl_delete(Handle ph, int index);
int DLLEXPORT scntl_get(Handle ph, int controlIndex, int *controlType, int *linkIndex, EN_API_FLOAT_TYPE *setting, int *nodeIndex, EN_API_FLOAT_TYPE *level); int DLLEXPORT scntl_get(Handle ph, int controlIndex, int *controlType, int *linkIndex, EN_API_FLOAT_TYPE *setting, int *nodeIndex, EN_API_FLOAT_TYPE *level);
int DLLEXPORT scntl_set(Handle ph, int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level); int DLLEXPORT scntl_set(Handle ph, int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);

View File

@@ -117,7 +117,7 @@ int DLLEXPORT hydr_open(Handle ph)
return error_set(pr->error, EN_openH(pr->project)); return error_set(pr->error, EN_openH(pr->project));
} }
int DLLEXPORT hydr_init(Handle ph, EN_SaveOption saveFlag) int DLLEXPORT hydr_init(Handle ph, EN_InitHydOption saveFlag)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_initH(pr->project, saveFlag)); return error_set(pr->error, EN_initH(pr->project, saveFlag));
@@ -168,7 +168,7 @@ int DLLEXPORT qual_open(Handle ph)
return error_set(pr->error, EN_openQ(pr->project)); return error_set(pr->error, EN_openQ(pr->project));
} }
int DLLEXPORT qual_init(Handle ph, EN_SaveOption saveFlag) int DLLEXPORT qual_init(Handle ph, EN_InitHydOption saveFlag)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_initQ(pr->project, saveFlag)); return error_set(pr->error, EN_initQ(pr->project, saveFlag));
@@ -270,13 +270,13 @@ int DLLEXPORT anlys_setflowunits(Handle ph, EN_FlowUnits code)
return error_set(pr->error, EN_setflowunits(pr->project, code)); return error_set(pr->error, EN_setflowunits(pr->project, code));
} }
int DLLEXPORT anlys_gettimeparam(Handle ph, EN_TimeProperty code, long *value) int DLLEXPORT anlys_gettimeparam(Handle ph, EN_TimeParameter code, long *value)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_gettimeparam(pr->project, code, value)); return error_set(pr->error, EN_gettimeparam(pr->project, code, value));
} }
int DLLEXPORT anlys_settimeparam(Handle ph, EN_TimeProperty code, long value) int DLLEXPORT anlys_settimeparam(Handle ph, EN_TimeParameter code, long value)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_settimeparam(pr->project, code, value)); return error_set(pr->error, EN_settimeparam(pr->project, code, value));
@@ -456,7 +456,7 @@ int DLLEXPORT link_setid(Handle ph, int index, char *newid)
int DLLEXPORT link_gettype(Handle ph, int index, int *code) int DLLEXPORT link_gettype(Handle ph, int index, int *code)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_getlinktype(pr->project, index, (EN_LinkType *)code)); return error_set(pr->error, EN_getlinktype(pr->project, index, code));
} }
int DLLEXPORT link_settype(Handle ph, int *index, EN_LinkType type, int actionCode) int DLLEXPORT link_settype(Handle ph, int *index, EN_LinkType type, int actionCode)
@@ -621,10 +621,10 @@ int DLLEXPORT curv_set(Handle ph, int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_
int DLLEXPORT scntl_add(Handle ph, int *cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level) int DLLEXPORT scntl_add(Handle ph, int type, int linkIndex, double setting, int nodeIndex, double level, int *index)
{ {
handle_t *pr = (handle_t *)ph; handle_t *pr = (handle_t *)ph;
return error_set(pr->error, EN_addcontrol(pr->project, cindex, ctype, lindex, setting, nindex, level)); return error_set(pr->error, EN_addcontrol(pr->project, type, linkIndex, setting, nodeIndex, level, index));
} }
int DLLEXPORT scntl_delete(Handle ph, int index) int DLLEXPORT scntl_delete(Handle ph, int index)