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

@@ -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)