epyt-flow 0.14.1__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. epyt_flow/VERSION +1 -1
  2. epyt_flow/__init__.py +0 -37
  3. epyt_flow/data/benchmarks/battledim.py +2 -2
  4. epyt_flow/data/benchmarks/leakdb.py +12 -9
  5. epyt_flow/gym/scenario_control_env.py +32 -33
  6. epyt_flow/simulation/events/actuator_events.py +24 -18
  7. epyt_flow/simulation/events/leakages.py +59 -57
  8. epyt_flow/simulation/events/quality_events.py +21 -30
  9. epyt_flow/simulation/events/system_event.py +3 -3
  10. epyt_flow/simulation/scada/complex_control.py +14 -12
  11. epyt_flow/simulation/scada/custom_control.py +22 -21
  12. epyt_flow/simulation/scada/scada_data.py +108 -105
  13. epyt_flow/simulation/scada/simple_control.py +38 -31
  14. epyt_flow/simulation/scenario_simulator.py +368 -395
  15. epyt_flow/simulation/sensor_config.py +31 -32
  16. epyt_flow/topology.py +11 -10
  17. epyt_flow/uncertainty/model_uncertainty.py +146 -122
  18. epyt_flow/utils.py +66 -0
  19. epyt_flow/visualization/visualization_utils.py +4 -2
  20. {epyt_flow-0.14.1.dist-info → epyt_flow-0.15.0.dist-info}/METADATA +14 -19
  21. epyt_flow-0.15.0.dist-info/RECORD +65 -0
  22. epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -60
  23. epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -21
  24. epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -151
  25. epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -5930
  26. epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -961
  27. epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -79
  28. epyt_flow/EPANET/EPANET/SRC_engines/flowbalance.c +0 -186
  29. epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -219
  30. epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -1000
  31. epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -177
  32. epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -28
  33. epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -1303
  34. epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -1172
  35. epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -781
  36. epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -442
  37. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -464
  38. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -1960
  39. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -518
  40. epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -884
  41. epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -672
  42. epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -735
  43. epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -2265
  44. epyt_flow/EPANET/EPANET/SRC_engines/leakage.c +0 -527
  45. epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -146
  46. epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -24
  47. epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -853
  48. epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -1691
  49. epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -695
  50. epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -800
  51. epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -696
  52. epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -1557
  53. epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -1500
  54. epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -871
  55. epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -508
  56. epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -928
  57. epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.c +0 -59
  58. epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.h +0 -38
  59. epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.c +0 -92
  60. epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.h +0 -39
  61. epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.c +0 -212
  62. epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.h +0 -81
  63. epyt_flow/EPANET/EPANET/SRC_engines/validate.c +0 -408
  64. epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -53
  65. epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -27
  66. epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -107
  67. epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -28
  68. epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -102
  69. epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -42
  70. epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -937
  71. epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -39
  72. epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -204
  73. epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -24
  74. epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -1285
  75. epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -368
  76. epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -42
  77. epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -586
  78. epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -116
  79. epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -260
  80. epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -175
  81. epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -35
  82. epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -1504
  83. epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -401
  84. epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -791
  85. epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -2010
  86. epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -400
  87. epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -422
  88. epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -1164
  89. epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -551
  90. epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -524
  91. epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -56
  92. epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -158
  93. epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -34
  94. epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -287
  95. epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -39
  96. epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -293
  97. epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -35
  98. epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -816
  99. epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -29
  100. epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -14
  101. epyt_flow/EPANET/compile_linux.sh +0 -4
  102. epyt_flow/EPANET/compile_macos.sh +0 -4
  103. epyt_flow/simulation/backend/__init__.py +0 -1
  104. epyt_flow/simulation/backend/my_epyt.py +0 -1101
  105. epyt_flow-0.14.1.dist-info/RECORD +0 -148
  106. {epyt_flow-0.14.1.dist-info → epyt_flow-0.15.0.dist-info}/WHEEL +0 -0
  107. {epyt_flow-0.14.1.dist-info → epyt_flow-0.15.0.dist-info}/licenses/LICENSE +0 -0
  108. {epyt_flow-0.14.1.dist-info → epyt_flow-0.15.0.dist-info}/top_level.txt +0 -0
@@ -1,260 +0,0 @@
1
- /*******************************************************************************
2
- ** MODULE: MSXFILE.C
3
- ** PROJECT: EPANET-MSX
4
- ** DESCRIPTION: writes MSX project data to a MSX input file.
5
- ** AUTHORS: see AUTHORS
6
- ** Copyright: see AUTHORS
7
- ** License: see LICENSE
8
- ** VERSION: 2.0.00
9
- ** LAST UPDATE: 04/14/2021
10
- *******************************************************************************/
11
-
12
- #include <stdio.h>
13
- #include <string.h>
14
-
15
- #include "msxtypes.h"
16
- #include "msxutils.h"
17
- #include "msxdict.h"
18
- #include "epanet2.h"
19
-
20
- // External variables
21
- //--------------------
22
- extern MSXproject MSX; // MSX project data
23
-
24
- // Exported functions
25
- //--------------------
26
- int MSXfile_save(FILE *f);
27
-
28
- // Local functions
29
- //-----------------
30
- static void saveSpecies(FILE *f);
31
- static void saveCoeffs(FILE *f);
32
- static int saveInpSections(FILE *f);
33
- static void saveParams(FILE *f);
34
- static void saveQuality(FILE *f);
35
- static void saveSources(FILE *f);
36
- static void savePatterns(FILE *f);
37
-
38
- //=============================================================================
39
-
40
- int MSXfile_save(FILE *f)
41
- /*
42
- ** Purpose:
43
- ** saves current MSX project data to file.
44
- **
45
- ** Input:
46
- ** f = pointer to MSX file where data are saved.
47
- */
48
- {
49
- int errcode;
50
- fprintf(f, "[TITLE]");
51
- fprintf(f, "\n%s\n", MSX.Title);
52
- saveSpecies(f);
53
- saveCoeffs(f);
54
- errcode = saveInpSections(f);
55
- saveParams(f);
56
- saveQuality(f);
57
- saveSources(f);
58
- savePatterns(f);
59
- return errcode;
60
- }
61
-
62
- //=============================================================================
63
-
64
- void saveSpecies(FILE *f)
65
- {
66
- int i, n;
67
- fprintf(f, "\n[SPECIES]");
68
- n = MSX.Nobjects[SPECIES];
69
- for (i=1; i<=n; i++)
70
- {
71
- if ( MSX.Species[i].type == BULK ) fprintf(f, "\nBULK ");
72
- else fprintf(f, "\nWALL ");
73
- fprintf(f, "%-32s %-15s %e %e",
74
- MSX.Species[i].id, MSX.Species[i].units,
75
- MSX.Species[i].aTol, MSX.Species[i].rTol);
76
- }
77
- }
78
-
79
- //=============================================================================
80
-
81
- void saveCoeffs(FILE *f)
82
- {
83
- int i, n;
84
- fprintf(f, "\n\n[COEFFICIENTS]");
85
- n = MSX.Nobjects[CONSTANT];
86
- for (i=1; i<=n; i++)
87
- {
88
- fprintf(f, "\nCONSTANT %-32s %e",
89
- MSX.Const[i].id, MSX.Const[i].value);
90
- }
91
- n = MSX.Nobjects[PARAMETER];
92
- for (i=1; i<=n; i++)
93
- {
94
- fprintf(f, "\nPARAMETER %-32s %e",
95
- MSX.Param[i].id, MSX.Param[i].value);
96
- }
97
- }
98
-
99
- //=============================================================================
100
-
101
- int saveInpSections(FILE *f)
102
- {
103
- char line[MAXLINE+1];
104
- char writeLine;
105
- int newsect;
106
-
107
- if ((MSX.MsxFile.file = fopen(MSX.MsxFile.name,"rt")) == NULL) return ERR_OPEN_MSX_FILE;
108
- rewind(MSX.MsxFile.file);
109
-
110
- fprintf(f,"\n\n");
111
- writeLine = FALSE;
112
- while ( fgets(line, MAXLINE, MSX.MsxFile.file) != NULL )
113
- {
114
- if (*line == '[' )
115
- {
116
- writeLine = TRUE;
117
- newsect = MSXutils_findmatch(line, MsxSectWords);
118
- if ( newsect >= 0 ) switch(newsect)
119
- {
120
- case s_OPTION:
121
- case s_TERM:
122
- case s_PIPE:
123
- case s_TANK:
124
- case s_REPORT:
125
- break;
126
- default:
127
- writeLine = FALSE;
128
- }
129
- }
130
- if ( writeLine) fprintf(f, "%s", line);
131
- }
132
- if ( MSX.MsxFile.file ) fclose(MSX.MsxFile.file);
133
- MSX.MsxFile.file = NULL;
134
- return 0;
135
- }
136
-
137
- //=============================================================================
138
-
139
- void saveParams(FILE *f)
140
- {
141
- int i, j, k;
142
- double x;
143
- char id[MAXLINE+1];
144
-
145
- if ( MSX.Nobjects[PARAMETER] > 0 )
146
- {
147
- fprintf(f, "\n\n[PARAMETERS]");
148
- for (j=1; j<=MSX.Nobjects[PARAMETER]; j++)
149
- {
150
- x = MSX.Param[j].value;
151
- for (i=1; i<=MSX.Nobjects[LINK]; i++)
152
- {
153
- if ( MSX.Link[i].param[j] != x )
154
- {
155
- ENgetlinkid(i, id);
156
- fprintf(f, "\nPIPE %-32s %-32s %e",
157
- id, MSX.Param[j].id, MSX.Link[i].param[j]);
158
- }
159
- }
160
- for (i=1; i<=MSX.Nobjects[TANK]; i++)
161
- {
162
- if ( MSX.Tank[i].param[j] != x )
163
- {
164
- k = MSX.Tank[i].node;
165
- ENgetnodeid(k, id);
166
- fprintf(f, "\nTANK %-32s %-32s %e",
167
- id, MSX.Param[j].id, MSX.Tank[i].param[j]);
168
- }
169
- }
170
- }
171
- }
172
- }
173
-
174
- //=============================================================================
175
-
176
- void saveQuality(FILE *f)
177
- {
178
- int i, j;
179
- char id[MAXLINE+1];
180
-
181
- fprintf(f, "\n\n[QUALITY]");
182
- for (j=1; j<=MSX.Nobjects[SPECIES]; j++)
183
- {
184
- if (MSX.C0[j] > 0.0)
185
- fprintf(f, "\nGLOBAL %-32s %e",
186
- MSX.Species[j].id, MSX.C0[j]);
187
-
188
- for (i=1; i<=MSX.Nobjects[NODE]; i++)
189
- {
190
- if ( MSX.Node[i].c0[j] > 0.0 && MSX.Node[i].c0[j] != MSX.C0[j])
191
- {
192
- ENgetnodeid(i, id);
193
- fprintf(f, "\nNODE %-32s %-32s %e",
194
- id, MSX.Species[j].id, MSX.Node[i].c0[j]);
195
- }
196
- }
197
- for (i=1; i<=MSX.Nobjects[LINK]; i++)
198
- {
199
- if ( MSX.Link[i].c0[j] > 0.0 && MSX.Link[i].c0[j] != MSX.C0[j])
200
- {
201
- ENgetlinkid(i, id);
202
- fprintf(f, "\nLINK %-32s %-32s %e",
203
- id, MSX.Species[j].id, MSX.Link[i].c0[j]);
204
- }
205
- }
206
- }
207
- }
208
-
209
- //=============================================================================
210
-
211
- void saveSources(FILE *f)
212
- {
213
- int i;
214
- Psource source;
215
- char id[MAXLINE+1];
216
-
217
- fprintf(f, "\n\n[SOURCES]");
218
- for (i=1; i<=MSX.Nobjects[NODE]; i++)
219
- {
220
- source = MSX.Node[i].sources;
221
- while ( source )
222
- {
223
- if ( source->c0 > 0.0 && source->type > -1) //Feng Shang 09/23/2008
224
- {
225
- ENgetnodeid(i, id);
226
- fprintf(f, "\n%-10s %-32s %-32s %e",
227
- SourceTypeWords[source->type], id,
228
- MSX.Species[source->species].id, source->c0);
229
- if ( source->pat > 0 )
230
- fprintf(f, " %-32s", MSX.Pattern[source->pat].id);
231
- }
232
- source = source->next;
233
- }
234
- }
235
- }
236
-
237
- //=============================================================================
238
-
239
- void savePatterns(FILE *f)
240
- {
241
- int i, count;
242
- SnumList *listItem;
243
-
244
- if ( MSX.Nobjects[PATTERN] > 0 ) fprintf(f, "\n\n[PATTERNS]");
245
- for (i=1; i<=MSX.Nobjects[PATTERN]; i++)
246
- {
247
- count = 0;
248
- listItem = MSX.Pattern[i].first;
249
- while (listItem)
250
- {
251
- if ( count % 6 == 0 )
252
- {
253
- fprintf(f, "\n%-32s", MSX.Pattern[i].id);
254
- }
255
- fprintf(f, " %e", listItem->value);
256
- count++;
257
- listItem = listItem->next;
258
- }
259
- }
260
- }
@@ -1,175 +0,0 @@
1
- /*******************************************************************************
2
- ** MODULE: MSXFUNCS.C
3
- ** PROJECT: EPANET-MSX
4
- ** DESCRIPTION: compiles chemistry functions to a shared dynamic library.
5
- ** COPYRIGHT: Copyright (C) 2007 Feng Shang, Lewis Rossman, and James Uber.
6
- ** All Rights Reserved. See license information in LICENSE.TXT.
7
- ** AUTHORS: see AUTHORS
8
- ** VERSION: 2.0.00
9
- ** LAST UPDATE: 04/14/2014
10
- *******************************************************************************/
11
-
12
- #include <stdio.h>
13
-
14
- // --- define WINDOWS
15
-
16
- #undef WINDOWS
17
- #ifdef _WIN32
18
- #define WINDOWS
19
- #endif
20
- #ifdef __WIN32__
21
- #define WINDOWS
22
- #endif
23
- #ifdef WIN32
24
- #define WINDOWS
25
- #endif
26
-
27
- #ifdef WINDOWS
28
- #include <windows.h>
29
- HMODULE hDLL;
30
- #else
31
- #include <dlfcn.h>
32
- void *hDLL;
33
- #endif
34
-
35
- #include "msxfuncs.h"
36
-
37
-
38
- MSXGETRATES MSXgetPipeRates = NULL;
39
- MSXGETRATES MSXgetTankRates = NULL;
40
- MSXGETEQUIL MSXgetPipeEquil = NULL;
41
- MSXGETEQUIL MSXgetTankEquil = NULL;
42
- MSXGETFORMULAS MSXgetPipeFormulas = NULL;
43
- MSXGETFORMULAS MSXgetTankFormulas = NULL;
44
-
45
-
46
-
47
- //=============================================================================
48
-
49
- int MSXfuncs_load(char * libName)
50
- /*
51
- ** Purpose:
52
- ** loads compiled chemistry functions from a named library
53
- **
54
- ** Input:
55
- ** libName = path to shared library
56
- **
57
- ** Returns:
58
- ** an error code (0 if no error).
59
- */
60
- {
61
-
62
- #ifdef WINDOWS
63
- hDLL = LoadLibraryA(libName);
64
- if (hDLL == NULL) return 1;
65
-
66
- MSXgetPipeRates = (MSXGETRATES) GetProcAddress(hDLL, "MSXgetPipeRates");
67
- MSXgetTankRates = (MSXGETRATES) GetProcAddress(hDLL, "MSXgetTankRates");
68
- MSXgetPipeEquil = (MSXGETEQUIL) GetProcAddress(hDLL, "MSXgetPipeEquil");
69
- MSXgetTankEquil = (MSXGETEQUIL) GetProcAddress(hDLL, "MSXgetTankEquil");
70
- MSXgetPipeFormulas = (MSXGETFORMULAS) GetProcAddress(hDLL, "MSXgetPipeFormulas");
71
- MSXgetTankFormulas = (MSXGETFORMULAS) GetProcAddress(hDLL, "MSXgetTankFormulas");
72
-
73
- #else
74
- hDLL = dlopen(libName, RTLD_LAZY);
75
- if (hDLL == NULL) return 1;
76
-
77
- MSXgetPipeRates = (MSXGETRATES) dlsym(hDLL, "MSXgetPipeRates");
78
- MSXgetTankRates = (MSXGETRATES) dlsym(hDLL, "MSXgetTankRates");
79
- MSXgetPipeEquil = (MSXGETEQUIL) dlsym(hDLL, "MSXgetPipeEquil");
80
- MSXgetTankEquil = (MSXGETEQUIL) dlsym(hDLL, "MSXgetTankEquil");
81
- MSXgetPipeFormulas = (MSXGETFORMULAS) dlsym(hDLL, "MSXgetPipeFormulas");
82
- MSXgetTankFormulas = (MSXGETFORMULAS) dlsym(hDLL, "MSXgetTankFormulas");
83
- #endif
84
-
85
- if (MSXgetPipeRates == NULL || MSXgetTankRates == NULL ||
86
- MSXgetPipeEquil == NULL || MSXgetTankEquil == NULL ||
87
- MSXgetPipeFormulas == NULL || MSXgetTankFormulas == NULL)
88
- {
89
- MSXfuncs_free();
90
- hDLL = NULL;
91
- return 2;
92
- }
93
- return 0;
94
- }
95
-
96
- //=============================================================================
97
-
98
- void MSXfuncs_free()
99
- /*
100
- ** Purpose:
101
- ** frees the handle to the shared function library
102
- **
103
- ** Input:
104
- ** none
105
- **
106
- ** Returns:
107
- ** none
108
- */
109
- {
110
- #ifdef WINDOWS
111
- if (hDLL) FreeLibrary(hDLL);
112
- #else
113
- if (hDLL) dlclose(hDLL);
114
- #endif
115
- }
116
-
117
- //=============================================================================
118
-
119
- int MSXfuncs_run(char* cmdLine)
120
- /*
121
- ** Purpose:
122
- ** executes a program and waits for it to end
123
- **
124
- ** Input:
125
- ** cmdLine = command line string that executes the program
126
- **
127
- ** Returns:
128
- ** the program's exit code (or -1 if the program was not run)
129
- */
130
- {
131
- #ifdef WINDOWS
132
-
133
- unsigned long exitCode;
134
- STARTUPINFOA si;
135
- PROCESS_INFORMATION pi;
136
-
137
- // --- initialize data structures
138
-
139
- memset(&si, 0, sizeof(si));
140
- memset(&pi, 0, sizeof(pi));
141
- si.cb = sizeof(si);
142
-
143
- // --- hide the window that the program runs in
144
-
145
- si.dwFlags = STARTF_USESHOWWINDOW;
146
- si.wShowWindow = SW_HIDE;
147
-
148
- // --- execute the command line in a new console window
149
- exitCode = CreateProcess(NULL, cmdLine, NULL, NULL, 0,
150
- CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
151
- if (exitCode == 0)
152
- {
153
- exitCode = GetLastError();
154
- return exitCode;
155
- }
156
-
157
- // --- wait for program to end
158
-
159
- exitCode = WaitForSingleObject(pi.hProcess, INFINITE);
160
-
161
- // --- retrieve the error code produced by the program
162
-
163
- BOOL rt = GetExitCodeProcess(pi.hProcess, &exitCode);
164
-
165
- // --- release handles
166
-
167
- CloseHandle(pi.hProcess);
168
- CloseHandle(pi.hThread);
169
- return exitCode;
170
-
171
- #else
172
- return -1;
173
- #endif
174
- }
175
-
@@ -1,35 +0,0 @@
1
- /************************************************************************
2
- ** MODULE: MSXFUNCS.H
3
- ** PROJECT: EPANET-MSX
4
- ** DESCRIPTION: Definitions of functions loaded from compiled chemistry file.
5
- ** COPYRIGHT: Copyright (C) 2007 Feng Shang, Lewis Rossman, and James Uber.
6
- ** All Rights Reserved. See license information in LICENSE.TXT.
7
- ** AUTHORS: See Authors
8
- ** VERSION: 2.0.00
9
- ** LAST UPDATE: 04/14/2021
10
- ***********************************************************************/
11
-
12
- #ifndef MSXFUNCS_H
13
- #define MSXFUNCS_H
14
-
15
- // Define pointers for each group of chemistry functions
16
- typedef void (*MSXGETRATES)(double *, double *, double * , double *, double *);
17
- typedef void (*MSXGETEQUIL)(double *, double *, double * , double *, double *);
18
- typedef void (*MSXGETFORMULAS)(double *, double *, double *, double *);
19
-
20
- // Declare each chemistry function
21
- extern MSXGETRATES MSXgetPipeRates;
22
- extern MSXGETRATES MSXgetTankRates;
23
- extern MSXGETEQUIL MSXgetPipeEquil;
24
- extern MSXGETEQUIL MSXgetTankEquil;
25
- extern MSXGETFORMULAS MSXgetPipeFormulas;
26
- extern MSXGETFORMULAS MSXgetTankFormulas;
27
-
28
- // Functions that load and free the chemistry functions
29
- int MSXfuncs_load(char *);
30
- void MSXfuncs_free(void);
31
-
32
- // Function that executes a command line program
33
- int MSXfuncs_run(char * );
34
-
35
- #endif