epanet-plus 0.0.1__cp311-cp311-macosx_10_9_x86_64.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.

Potentially problematic release.


This version of epanet-plus might be problematic. Click here for more details.

Files changed (105) hide show
  1. docs/conf.py +67 -0
  2. epanet-msx-src/dispersion.h +27 -0
  3. epanet-msx-src/hash.c +107 -0
  4. epanet-msx-src/hash.h +28 -0
  5. epanet-msx-src/include/epanetmsx.h +104 -0
  6. epanet-msx-src/include/epanetmsx_export.h +42 -0
  7. epanet-msx-src/mathexpr.c +937 -0
  8. epanet-msx-src/mathexpr.h +39 -0
  9. epanet-msx-src/mempool.c +204 -0
  10. epanet-msx-src/mempool.h +24 -0
  11. epanet-msx-src/msxchem.c +1285 -0
  12. epanet-msx-src/msxcompiler.c +368 -0
  13. epanet-msx-src/msxdict.h +42 -0
  14. epanet-msx-src/msxdispersion.c +586 -0
  15. epanet-msx-src/msxerr.c +116 -0
  16. epanet-msx-src/msxfile.c +260 -0
  17. epanet-msx-src/msxfuncs.c +175 -0
  18. epanet-msx-src/msxfuncs.h +35 -0
  19. epanet-msx-src/msxinp.c +1504 -0
  20. epanet-msx-src/msxout.c +398 -0
  21. epanet-msx-src/msxproj.c +791 -0
  22. epanet-msx-src/msxqual.c +2011 -0
  23. epanet-msx-src/msxrpt.c +400 -0
  24. epanet-msx-src/msxtank.c +422 -0
  25. epanet-msx-src/msxtoolkit.c +1164 -0
  26. epanet-msx-src/msxtypes.h +551 -0
  27. epanet-msx-src/msxutils.c +524 -0
  28. epanet-msx-src/msxutils.h +56 -0
  29. epanet-msx-src/newton.c +158 -0
  30. epanet-msx-src/newton.h +34 -0
  31. epanet-msx-src/rk5.c +287 -0
  32. epanet-msx-src/rk5.h +39 -0
  33. epanet-msx-src/ros2.c +293 -0
  34. epanet-msx-src/ros2.h +35 -0
  35. epanet-msx-src/smatrix.c +816 -0
  36. epanet-msx-src/smatrix.h +29 -0
  37. epanet-src/AUTHORS +60 -0
  38. epanet-src/LICENSE +21 -0
  39. epanet-src/enumstxt.h +151 -0
  40. epanet-src/epanet.c +5937 -0
  41. epanet-src/epanet2.c +961 -0
  42. epanet-src/epanet2.def +131 -0
  43. epanet-src/errors.dat +79 -0
  44. epanet-src/flowbalance.c +186 -0
  45. epanet-src/funcs.h +219 -0
  46. epanet-src/genmmd.c +1000 -0
  47. epanet-src/hash.c +177 -0
  48. epanet-src/hash.h +28 -0
  49. epanet-src/hydcoeffs.c +1303 -0
  50. epanet-src/hydraul.c +1164 -0
  51. epanet-src/hydsolver.c +781 -0
  52. epanet-src/hydstatus.c +442 -0
  53. epanet-src/include/epanet2.h +466 -0
  54. epanet-src/include/epanet2_2.h +1962 -0
  55. epanet-src/include/epanet2_enums.h +518 -0
  56. epanet-src/inpfile.c +884 -0
  57. epanet-src/input1.c +672 -0
  58. epanet-src/input2.c +970 -0
  59. epanet-src/input3.c +2265 -0
  60. epanet-src/leakage.c +527 -0
  61. epanet-src/mempool.c +146 -0
  62. epanet-src/mempool.h +24 -0
  63. epanet-src/output.c +853 -0
  64. epanet-src/project.c +1691 -0
  65. epanet-src/quality.c +695 -0
  66. epanet-src/qualreact.c +800 -0
  67. epanet-src/qualroute.c +696 -0
  68. epanet-src/report.c +1559 -0
  69. epanet-src/rules.c +1500 -0
  70. epanet-src/smatrix.c +871 -0
  71. epanet-src/text.h +508 -0
  72. epanet-src/types.h +928 -0
  73. epanet-src/util/cstr_helper.c +59 -0
  74. epanet-src/util/cstr_helper.h +38 -0
  75. epanet-src/util/errormanager.c +92 -0
  76. epanet-src/util/errormanager.h +39 -0
  77. epanet-src/util/filemanager.c +212 -0
  78. epanet-src/util/filemanager.h +81 -0
  79. epanet-src/validate.c +408 -0
  80. epanet.cpython-311-darwin.so +0 -0
  81. epanet_plus/VERSION +1 -0
  82. epanet_plus/__init__.py +8 -0
  83. epanet_plus/epanet_plus.c +118 -0
  84. epanet_plus/epanet_toolkit.py +2730 -0
  85. epanet_plus/epanet_wrapper.py +2414 -0
  86. epanet_plus/include/epanet_plus.h +9 -0
  87. epanet_plus-0.0.1.dist-info/METADATA +152 -0
  88. epanet_plus-0.0.1.dist-info/RECORD +105 -0
  89. epanet_plus-0.0.1.dist-info/WHEEL +6 -0
  90. epanet_plus-0.0.1.dist-info/licenses/LICENSE +21 -0
  91. epanet_plus-0.0.1.dist-info/top_level.txt +11 -0
  92. examples/basic_usage.py +35 -0
  93. python-extension/ext.c +344 -0
  94. python-extension/pyepanet.c +2133 -0
  95. python-extension/pyepanet.h +143 -0
  96. python-extension/pyepanet2.c +1823 -0
  97. python-extension/pyepanet2.h +141 -0
  98. python-extension/pyepanet_plus.c +37 -0
  99. python-extension/pyepanet_plus.h +4 -0
  100. python-extension/pyepanetmsx.c +388 -0
  101. python-extension/pyepanetmsx.h +35 -0
  102. tests/test_epanet.py +16 -0
  103. tests/test_epanetmsx.py +36 -0
  104. tests/test_epyt.py +114 -0
  105. tests/test_load_inp_from_buffer.py +18 -0
@@ -0,0 +1,1823 @@
1
+ #include <Python.h>
2
+ #include "epanet2.h"
3
+ #include "types.h"
4
+
5
+
6
+ PyObject* method_ENopen(PyObject* self, PyObject* args)
7
+ {
8
+ char *inpFile, *rptFile, *outFile = NULL;
9
+
10
+ if(!PyArg_ParseTuple(args, "sss", &inpFile, &rptFile, &outFile)) {
11
+ return NULL;
12
+ }
13
+
14
+ int err = ENopen(inpFile, rptFile, outFile);
15
+
16
+ return PyTuple_Pack(1, PyLong_FromLong(err));
17
+ }
18
+
19
+
20
+ PyObject* method_ENclose(PyObject* self, PyObject* Py_UNUSED(args))
21
+ {
22
+ int err = ENclose();
23
+
24
+ return PyTuple_Pack(1, PyLong_FromLong(err));
25
+ }
26
+
27
+ PyObject* method_ENaddcontrol(PyObject* self, PyObject* args)
28
+ {
29
+ int type;
30
+ int linkIndex;
31
+ float setting;
32
+ int nodeIndex;
33
+ float level;
34
+ int index;
35
+
36
+ if(!PyArg_ParseTuple(args, "iifif", &type, &linkIndex, &setting, &nodeIndex, &level)) {
37
+ return NULL;
38
+ }
39
+
40
+ int err = ENaddcontrol(type, linkIndex, setting, nodeIndex, level, &index);
41
+
42
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
43
+ }
44
+
45
+ PyObject* method_ENaddcurve(PyObject* self, PyObject* args)
46
+ {
47
+ char* id = NULL;
48
+ if(!PyArg_ParseTuple(args, "s", &id)) {
49
+ return NULL;
50
+ }
51
+
52
+ int err = ENaddcurve(id);
53
+
54
+ return PyTuple_Pack(1, PyLong_FromLong(err));
55
+ }
56
+
57
+ PyObject* method_ENadddemand(PyObject* self, PyObject* args)
58
+ {
59
+ int nodeIndex;
60
+ float baseDemand;
61
+ char* demandPattern = NULL;
62
+ char* demandName = NULL;
63
+
64
+ if(!PyArg_ParseTuple(args, "ifss", &nodeIndex, &baseDemand, &demandPattern, &demandName)) {
65
+ return NULL;
66
+ }
67
+
68
+ int err = ENadddemand(nodeIndex, baseDemand, demandPattern, demandName);
69
+
70
+ return PyTuple_Pack(1, PyLong_FromLong(err));
71
+ }
72
+
73
+ PyObject* method_ENaddlink(PyObject* self, PyObject* args)
74
+ {
75
+ char* id = NULL;
76
+ int linkType;
77
+ char* fromNode = NULL;
78
+ char* toNode = NULL;
79
+ int index;
80
+
81
+ if(!PyArg_ParseTuple(args, "siss", &id, &linkType, &fromNode, &toNode)) {
82
+ return NULL;
83
+ }
84
+
85
+ int err = ENaddlink(id, linkType, fromNode, toNode, &index);
86
+
87
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
88
+ }
89
+
90
+ PyObject* method_ENaddnode(PyObject* self, PyObject* args)
91
+ {
92
+ char* id = NULL;
93
+ int nodeType;
94
+ int index;
95
+
96
+ if(!PyArg_ParseTuple(args, "si", &id, &nodeType)) {
97
+ return NULL;
98
+ }
99
+
100
+ int err = ENaddnode(id, nodeType, &index);
101
+
102
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
103
+ }
104
+
105
+ PyObject* method_ENaddpattern(PyObject* self, PyObject* args)
106
+ {
107
+ char* id = NULL;
108
+
109
+ if(!PyArg_ParseTuple(args, "s", &id)) {
110
+ return NULL;
111
+ }
112
+
113
+ int err = ENaddpattern(id);
114
+
115
+ return PyTuple_Pack(1, PyLong_FromLong(err));
116
+ }
117
+
118
+ PyObject* method_ENaddrule(PyObject* self, PyObject* args)
119
+ {
120
+ char* rule = NULL;
121
+
122
+ if(!PyArg_ParseTuple(args, "s", &rule)) {
123
+ return NULL;
124
+ }
125
+
126
+ int err = ENaddrule(rule);
127
+
128
+ return PyTuple_Pack(1, PyLong_FromLong(err));
129
+ }
130
+
131
+ PyObject* method_ENclearreport(PyObject* self, PyObject* Py_UNUSED(args))
132
+ {
133
+ int err = ENclearreport();
134
+
135
+ return PyTuple_Pack(1, PyLong_FromLong(err));
136
+ }
137
+
138
+ PyObject* method_ENcloseH(PyObject* self, PyObject* Py_UNUSED(args))
139
+ {
140
+ int err = ENcloseH();
141
+
142
+ return PyTuple_Pack(1, PyLong_FromLong(err));
143
+ }
144
+
145
+ PyObject* method_ENcloseQ(PyObject* self, PyObject* Py_UNUSED(args))
146
+ {
147
+ int err = ENcloseQ();
148
+
149
+ return PyTuple_Pack(1, PyLong_FromLong(err));
150
+ }
151
+
152
+ PyObject* method_ENcopyreport(PyObject* self, PyObject* args)
153
+ {
154
+ char* filename = NULL;
155
+
156
+ if(!PyArg_ParseTuple(args, "s", &filename)) {
157
+ return NULL;
158
+ }
159
+
160
+ int err = ENcopyreport(filename);
161
+
162
+ return PyTuple_Pack(1, PyLong_FromLong(err));
163
+ }
164
+
165
+ PyObject* method_ENdeletecontrol(PyObject* self, PyObject* args)
166
+ {
167
+ int index;
168
+
169
+ if(!PyArg_ParseTuple(args, "i", &index)) {
170
+ return NULL;
171
+ }
172
+
173
+ int err = ENdeletecontrol(index);
174
+
175
+ return PyTuple_Pack(1, PyLong_FromLong(err));
176
+ }
177
+
178
+ PyObject* method_ENdeletecurve(PyObject* self, PyObject* args)
179
+ {
180
+ int index;
181
+
182
+ if(!PyArg_ParseTuple(args, "i", &index)) {
183
+ return NULL;
184
+ }
185
+
186
+ int err = ENdeletecurve(index);
187
+
188
+ return PyTuple_Pack(1, PyLong_FromLong(err));
189
+ }
190
+
191
+ PyObject* method_ENdeletedemand(PyObject* self, PyObject* args)
192
+ {
193
+ int nodeIndex, demandIndex;
194
+
195
+ if(!PyArg_ParseTuple(args, "ii", &nodeIndex, &demandIndex)) {
196
+ return NULL;
197
+ }
198
+
199
+ int err = ENdeletedemand(nodeIndex, demandIndex);
200
+
201
+ return PyTuple_Pack(1, PyLong_FromLong(err));
202
+ }
203
+
204
+ PyObject* method_ENdeletelink(PyObject* self, PyObject* args)
205
+ {
206
+ int index, actionCode;
207
+
208
+ if(!PyArg_ParseTuple(args, "ii", &index, &actionCode)) {
209
+ return NULL;
210
+ }
211
+
212
+ int err = ENdeletelink(index, actionCode);
213
+
214
+ return PyTuple_Pack(1, PyLong_FromLong(err));
215
+ }
216
+
217
+ PyObject* method_ENdeletenode(PyObject* self, PyObject* args)
218
+ {
219
+ int index, actionCode;
220
+
221
+ if(!PyArg_ParseTuple(args, "ii", &index, &actionCode)) {
222
+ return NULL;
223
+ }
224
+
225
+ int err = ENdeletenode(index, actionCode);
226
+
227
+ return PyTuple_Pack(1, PyLong_FromLong(err));
228
+ }
229
+
230
+ PyObject* method_ENdeletepattern(PyObject* self, PyObject* args)
231
+ {
232
+ int index;
233
+
234
+ if(!PyArg_ParseTuple(args, "i", &index)) {
235
+ return NULL;
236
+ }
237
+
238
+ int err = ENdeletepattern(index);
239
+
240
+ return PyTuple_Pack(1, PyLong_FromLong(err));
241
+ }
242
+
243
+ PyObject* method_ENdeleterule(PyObject* self, PyObject* args)
244
+ {
245
+ int index;
246
+
247
+ if(!PyArg_ParseTuple(args, "i", &index)) {
248
+ return NULL;
249
+ }
250
+
251
+ int err = ENdeleterule(index);
252
+
253
+ return PyTuple_Pack(1, PyLong_FromLong(err));
254
+ }
255
+
256
+ PyObject* method_ENgetaveragepatternvalue(PyObject* self, PyObject* args)
257
+ {
258
+ int index;
259
+ float value;
260
+
261
+ if(!PyArg_ParseTuple(args, "i", &index)) {
262
+ return NULL;
263
+ }
264
+
265
+ int err = ENgetaveragepatternvalue(index, &value);
266
+
267
+ return PyTuple_Pack(1, PyLong_FromLong(err));
268
+ }
269
+
270
+ PyObject* method_ENgetbasedemand(PyObject* self, PyObject* args)
271
+ {
272
+ int nodeIndex, demandIndex;
273
+ float baseDemand;
274
+
275
+ if(!PyArg_ParseTuple(args, "ii", &nodeIndex, &demandIndex)) {
276
+ return NULL;
277
+ }
278
+
279
+ int err = ENgetbasedemand(nodeIndex, demandIndex, &baseDemand);
280
+
281
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyFloat_FromDouble(baseDemand));
282
+ }
283
+
284
+ PyObject* method_ENgetcomment(PyObject* self, PyObject* args)
285
+ {
286
+ int object, index;
287
+ if(!PyArg_ParseTuple(args, "ii", &object, &index)) {
288
+ return NULL;
289
+ }
290
+
291
+ char comment[MAXLINE + 1];
292
+ int err = ENgetcomment(object, index, &comment[0]);
293
+
294
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&comment[0]));
295
+ }
296
+
297
+ PyObject* method_ENgetcontrol(PyObject* self, PyObject* args)
298
+ {
299
+ int index, type, linkIndex, nodeIndex;
300
+ float setting, level;
301
+
302
+ if(!PyArg_ParseTuple(args, "i", &index)) {
303
+ return NULL;
304
+ }
305
+
306
+ int err = ENgetcontrol(index, &type, &linkIndex, &setting, &nodeIndex, &level);
307
+
308
+ return Py_BuildValue("(iiifif)", err, type, linkIndex, setting, nodeIndex, level);
309
+ return PyTuple_Pack(6, PyLong_FromLong(err), PyLong_FromLong(type), PyLong_FromLong(linkIndex), PyFloat_FromDouble(setting), PyLong_FromLong(nodeIndex), PyFloat_FromDouble(level));
310
+ }
311
+
312
+ PyObject* method_ENgetcoord(PyObject* self, PyObject* args)
313
+ {
314
+ int index;
315
+ double x, y;
316
+
317
+ if(!PyArg_ParseTuple(args, "i", &index)) {
318
+ return NULL;
319
+ }
320
+
321
+ int err = ENgetcoord(index, &x, &y);
322
+
323
+ return PyTuple_Pack(3, PyLong_FromLong(err), PyFloat_FromDouble(x), PyFloat_FromDouble(y));
324
+ }
325
+
326
+ PyObject* method_ENgetcount(PyObject* self, PyObject* args)
327
+ {
328
+ int object, count;
329
+
330
+ if(!PyArg_ParseTuple(args, "i", &object)) {
331
+ return NULL;
332
+ }
333
+
334
+ int err = ENgetcount(object, &count);
335
+
336
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(count));
337
+ }
338
+
339
+ PyObject* method_ENgetcurve(PyObject* self, PyObject* args)
340
+ {
341
+ int index;
342
+ if(!PyArg_ParseTuple(args, "i", &index)) {
343
+ return NULL;
344
+ }
345
+
346
+ int len;
347
+ int err = ENgetcurvelen(index, &len);
348
+ if(err != 0) {
349
+ return PyTuple_Pack(1, PyLong_FromLong(err));
350
+ }
351
+
352
+ char out_id[MAXID + 1];
353
+ int nPoints;
354
+ float* xValues = (float*) PyMem_Calloc(len, sizeof(float));
355
+ float* yValues = (float*) PyMem_Calloc(len, sizeof(float));
356
+ err = ENgetcurve(index, &out_id[0], &nPoints, xValues, yValues);
357
+
358
+ PyObject* xValuesList = PyList_New(nPoints);
359
+ PyObject* yValuesList = PyList_New(nPoints);
360
+
361
+ for(int i=0; i != nPoints; i++) {
362
+ PyList_SetItem(xValuesList, i, PyFloat_FromDouble(xValues[i]));
363
+ PyList_SetItem(yValuesList, i, PyFloat_FromDouble(yValues[i]));
364
+ }
365
+
366
+ PyMem_Free(xValues);
367
+ PyMem_Free(yValues);
368
+
369
+ return PyTuple_Pack(5, PyLong_FromLong(err), PyUnicode_FromString(&out_id[0]), PyLong_FromLong(nPoints), xValuesList, yValuesList);
370
+ }
371
+
372
+ PyObject* method_ENgetcurveid(PyObject* self, PyObject* args)
373
+ {
374
+ int index;
375
+ char* id = NULL;
376
+
377
+ if(!PyArg_ParseTuple(args, "i", &index)) {
378
+ return NULL;
379
+ }
380
+
381
+ int err = ENgetcurveid(index, id);
382
+
383
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&id[0]));
384
+ }
385
+
386
+ PyObject* method_ENgetcurveindex(PyObject* self, PyObject* args)
387
+ {
388
+ char* id = NULL;
389
+ int index;
390
+
391
+ if(!PyArg_ParseTuple(args, "s", &id)) {
392
+ return NULL;
393
+ }
394
+
395
+ int err = ENgetcurveindex(id, &index);
396
+
397
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
398
+ }
399
+
400
+ PyObject* method_ENgetcurvelen(PyObject* self, PyObject* args)
401
+ {
402
+ int index, len;
403
+
404
+ if(!PyArg_ParseTuple(args, "i", &index)) {
405
+ return NULL;
406
+ }
407
+
408
+ int err = ENgetcurvelen(index, &len);
409
+
410
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(len));
411
+ }
412
+
413
+ PyObject* method_ENgetcurvetype(PyObject* self, PyObject* args)
414
+ {
415
+ int index, type;
416
+
417
+ if(!PyArg_ParseTuple(args, "i", &index)) {
418
+ return NULL;
419
+ }
420
+
421
+ int err = ENgetcurvetype(index, &type);
422
+
423
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(type));
424
+ }
425
+
426
+ PyObject* method_ENgetcurvevalue(PyObject* self, PyObject* args)
427
+ {
428
+ int curveIndex, pointIndex;
429
+ float x, y;
430
+
431
+ if(!PyArg_ParseTuple(args, "ii", &curveIndex, &pointIndex)) {
432
+ return NULL;
433
+ }
434
+
435
+ int err = ENgetcurvevalue(curveIndex, pointIndex, &x, &y);
436
+
437
+ return PyTuple_Pack(3, PyLong_FromLong(err), PyFloat_FromDouble(x), PyFloat_FromDouble(y));
438
+ }
439
+
440
+ PyObject* method_ENgetdemandindex(PyObject* self, PyObject* args)
441
+ {
442
+ int nodeIndex, demandIndex;
443
+ char* demandName = NULL;
444
+
445
+ if(!PyArg_ParseTuple(args, "is", &nodeIndex, &demandName)) {
446
+ return NULL;
447
+ }
448
+
449
+ int err = ENgetdemandindex(nodeIndex, demandName, &demandIndex);
450
+
451
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(demandIndex));
452
+ }
453
+
454
+ PyObject* method_ENgetdemandmodel(PyObject* self, PyObject* Py_UNUSED(args))
455
+ {
456
+ int model;
457
+ float pmin, preq, pexp;
458
+
459
+ int err = ENgetdemandmodel(&model, &pmin, &preq, &pexp);
460
+
461
+ return PyTuple_Pack(5, PyLong_FromLong(err), PyLong_FromLong(model), PyFloat_FromDouble(pmin), PyFloat_FromDouble(preq), PyFloat_FromDouble(pexp));
462
+ }
463
+
464
+ PyObject* method_ENgetdemandname(PyObject* self, PyObject* args)
465
+ {
466
+ int nodeIndex, demandIndex;
467
+ if(!PyArg_ParseTuple(args, "ii", &nodeIndex, &demandIndex)) {
468
+ return NULL;
469
+ }
470
+
471
+ char demandName[MAXID + 1];
472
+ int err = ENgetdemandname(nodeIndex, demandIndex, &demandName[0]);
473
+
474
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&demandName[0]));
475
+ }
476
+
477
+ PyObject* method_ENgetdemandpattern(PyObject* self, PyObject* args)
478
+ {
479
+ int nodeIndex, demandIndex, patIndex;
480
+
481
+ if(!PyArg_ParseTuple(args, "ii", &nodeIndex, &demandIndex)) {
482
+ return NULL;
483
+ }
484
+
485
+ int err = ENgetdemandpattern(nodeIndex, demandIndex, &patIndex);
486
+
487
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(patIndex));
488
+ }
489
+
490
+ PyObject* method_ENgetelseaction(PyObject* self, PyObject* args)
491
+ {
492
+ int ruleIndex, actionIndex, linkIndex, status;
493
+ float setting;
494
+
495
+ if(!PyArg_ParseTuple(args, "ii", &ruleIndex, &actionIndex)) {
496
+ return NULL;
497
+ }
498
+
499
+ int err = ENgetelseaction(ruleIndex, actionIndex, &linkIndex, &status, &setting);
500
+
501
+ return PyTuple_Pack(4, PyLong_FromLong(err), PyLong_FromLong(linkIndex), PyLong_FromLong(status), PyFloat_FromDouble(setting));
502
+ }
503
+
504
+ PyObject* method_ENgeterror(PyObject* self, PyObject* args)
505
+ {
506
+ int errcode;
507
+ char errmsg[MAXMSG + 1];
508
+
509
+ if(!PyArg_ParseTuple(args, "i", &errcode)) {
510
+ return NULL;
511
+ }
512
+
513
+ int err = ENgeterror(errcode, &errmsg[0], MAXMSG);
514
+
515
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&errmsg[0]));
516
+ }
517
+
518
+ PyObject* method_ENgetflowunits(PyObject* self, PyObject* Py_UNUSED(args))
519
+ {
520
+ int units;
521
+ int err = ENgetflowunits(&units);
522
+
523
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(units));
524
+ }
525
+
526
+ PyObject* method_ENgetheadcurveindex(PyObject* self, PyObject* args)
527
+ {
528
+ int linkIndex, curveIndex;
529
+
530
+ if(!PyArg_ParseTuple(args, "i", &linkIndex)) {
531
+ return NULL;
532
+ }
533
+
534
+ int err = ENgetheadcurveindex(linkIndex, &curveIndex);
535
+
536
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(curveIndex));
537
+ }
538
+
539
+ PyObject* method_ENgetlinkid(PyObject* self, PyObject* args)
540
+ {
541
+ int index;
542
+ char id[MAXID + 1];
543
+
544
+ if(!PyArg_ParseTuple(args, "i", &index)) {
545
+ return NULL;
546
+ }
547
+
548
+ int err = ENgetlinkid(index, &id[0]);
549
+
550
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&id[0]));
551
+ }
552
+
553
+ PyObject* method_ENgetlinkindex(PyObject* self, PyObject* args)
554
+ {
555
+ int index;
556
+ char* id = NULL;
557
+
558
+ if(!PyArg_ParseTuple(args, "s", &id)) {
559
+ return NULL;
560
+ }
561
+
562
+ int err = ENgetlinkindex(id, &index);
563
+
564
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
565
+ }
566
+
567
+ PyObject* method_ENgetlinknodes(PyObject* self, PyObject* args)
568
+ {
569
+ int index, node1, node2;
570
+
571
+ if(!PyArg_ParseTuple(args, "i", &index)) {
572
+ return NULL;
573
+ }
574
+
575
+ int err = ENgetlinknodes(index, &node1, &node2);
576
+
577
+ return PyTuple_Pack(3, PyLong_FromLong(err), PyLong_FromLong(node1), PyLong_FromLong(node2));
578
+ }
579
+
580
+ PyObject* method_ENgetlinktype(PyObject* self, PyObject* args)
581
+ {
582
+ int index, linkType;
583
+
584
+ if(!PyArg_ParseTuple(args, "i", &index)) {
585
+ return NULL;
586
+ }
587
+
588
+ int err = ENgetlinktype(index, &linkType);
589
+
590
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(linkType));
591
+ }
592
+
593
+ PyObject* method_ENgetlinkvalue(PyObject* self, PyObject* args)
594
+ {
595
+ int index, property;
596
+ float value;
597
+
598
+ if(!PyArg_ParseTuple(args, "ii", &index, &property)) {
599
+ return NULL;
600
+ }
601
+
602
+ int err = ENgetlinkvalue(index, property, &value);
603
+
604
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyFloat_FromDouble(value));
605
+ }
606
+
607
+ PyObject* method_ENgetnodeid(PyObject* self, PyObject* args)
608
+ {
609
+ int index;
610
+ if(!PyArg_ParseTuple(args, "i", &index)) {
611
+ return NULL;
612
+ }
613
+
614
+ char id[MAXID + 1];
615
+ int err = ENgetnodeid(index, &id[0]);
616
+
617
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&id[0]));
618
+ }
619
+
620
+ PyObject* method_ENgetnodeindex(PyObject* self, PyObject* args)
621
+ {
622
+ char* id = NULL;
623
+ if(!PyArg_ParseTuple(args, "s", &id)) {
624
+ return NULL;
625
+ }
626
+
627
+ int index;
628
+ int err = ENgetnodeindex(id, &index);
629
+
630
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
631
+ }
632
+
633
+ PyObject* method_ENgetnodetype(PyObject* self, PyObject* args)
634
+ {
635
+ int index, nodeType;
636
+
637
+ if(!PyArg_ParseTuple(args, "i", &index)) {
638
+ return NULL;
639
+ }
640
+
641
+ int err = ENgetnodetype(index, &nodeType);
642
+
643
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(nodeType));
644
+ }
645
+
646
+ PyObject* method_ENgetnodevalue(PyObject* self, PyObject* args)
647
+ {
648
+ int index, property;
649
+ float value;
650
+
651
+ if(!PyArg_ParseTuple(args, "ii", &index, &property)) {
652
+ return NULL;
653
+ }
654
+
655
+ int err = ENgetnodevalue(index, property, &value);
656
+
657
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyFloat_FromDouble(value));
658
+ }
659
+
660
+ PyObject* method_ENgetnumdemands(PyObject* self, PyObject* args)
661
+ {
662
+ int nodeIndex, numDemands;
663
+
664
+ if(!PyArg_ParseTuple(args, "i", &nodeIndex)) {
665
+ return NULL;
666
+ }
667
+
668
+ int err = ENgetnumdemands(nodeIndex, &numDemands);
669
+
670
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(numDemands));
671
+ }
672
+
673
+ PyObject* method_ENgetoption(PyObject* self, PyObject* args)
674
+ {
675
+ int option;
676
+ float value;
677
+
678
+ if(!PyArg_ParseTuple(args, "i", &option)) {
679
+ return NULL;
680
+ }
681
+
682
+ int err = ENgetoption(option, &value);
683
+
684
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromDouble(value));
685
+ }
686
+
687
+ PyObject* method_ENgetpatternid(PyObject* self, PyObject* args)
688
+ {
689
+ int index;
690
+ if(!PyArg_ParseTuple(args, "i", &index)) {
691
+ return NULL;
692
+ }
693
+
694
+ char id[MAXID + 1];
695
+ int err = ENgetpatternid(index, &id[0]);
696
+
697
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&id[0]));
698
+ }
699
+
700
+ PyObject* method_ENgetpatternindex(PyObject* self, PyObject* args)
701
+ {
702
+ char *id = NULL;
703
+ if(!PyArg_ParseTuple(args, "s", &id)) {
704
+ return NULL;
705
+ }
706
+
707
+ int index;
708
+ int err = ENgetpatternindex(id, &index);
709
+
710
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(index));
711
+ }
712
+
713
+ PyObject* method_ENgetpatternlen(PyObject* self, PyObject* args)
714
+ {
715
+ int index, len;
716
+
717
+ if(!PyArg_ParseTuple(args, "i", &index)) {
718
+ return NULL;
719
+ }
720
+
721
+ int err = ENgetpatternlen(index, &len);
722
+
723
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(len));
724
+ }
725
+
726
+ PyObject* method_ENgetpatternvalue(PyObject* self, PyObject* args)
727
+ {
728
+ int index, period;
729
+ float value;
730
+
731
+ if(!PyArg_ParseTuple(args, "ii", &index, &period)) {
732
+ return NULL;
733
+ }
734
+
735
+ int err = ENgetpatternvalue(index, period, &value);
736
+
737
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyFloat_FromDouble(value));
738
+ }
739
+
740
+ PyObject* method_ENgetpremise(PyObject* self, PyObject* args)
741
+ {
742
+ int ruleIndex, premiseIndex, logop, object, objIndex, variable, relop, status;
743
+ float value;
744
+
745
+ if(!PyArg_ParseTuple(args, "ii", &ruleIndex, &premiseIndex)) {
746
+ return NULL;
747
+ }
748
+
749
+ int err = ENgetpremise(ruleIndex, premiseIndex, &logop, &object, &objIndex, &variable, &relop, &status, &value);
750
+
751
+ return PyTuple_Pack(8, PyLong_FromLong(err), PyLong_FromLong(logop), PyLong_FromLong(object), PyLong_FromLong(objIndex), PyLong_FromLong(variable), PyLong_FromLong(relop), PyLong_FromLong(status), PyFloat_FromDouble(value));
752
+ }
753
+
754
+ PyObject* method_ENgetpumptype(PyObject* self, PyObject* args)
755
+ {
756
+ int linkIndex, pumpType;
757
+
758
+ if(!PyArg_ParseTuple(args, "i", &linkIndex)) {
759
+ return NULL;
760
+ }
761
+
762
+ int err = ENgetpumptype(linkIndex, &pumpType);
763
+
764
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(pumpType));
765
+ }
766
+
767
+ PyObject* method_ENgetqualinfo(PyObject* self, PyObject* Py_UNUSED(args))
768
+ {
769
+ int qualType, traceNode;
770
+ char chemName[MAXID + 1];
771
+ char chemUnits[MAXID + 1];
772
+
773
+ int err = ENgetqualinfo(&qualType, &chemName[0], &chemUnits[0], &traceNode);
774
+
775
+ return PyTuple_Pack(5, PyLong_FromLong(err), PyLong_FromLong(qualType), PyUnicode_FromString(&chemName[0]), PyUnicode_FromString(&chemUnits[0]), PyLong_FromLong(traceNode));
776
+ }
777
+
778
+ PyObject* method_ENgetqualtype(PyObject* self, PyObject* Py_UNUSED(args))
779
+ {
780
+ int qualType, traceNode;
781
+
782
+ int err = ENgetqualtype(&qualType, &traceNode);
783
+
784
+ return PyTuple_Pack(3, PyLong_FromLong(err), PyLong_FromLong(qualType), PyLong_FromLong(traceNode));
785
+ }
786
+
787
+ PyObject* method_ENgetresultindex(PyObject* self, PyObject* args)
788
+ {
789
+ int type, index, value;
790
+
791
+ if(!PyArg_ParseTuple(args, "ii", &type, &index)) {
792
+ return NULL;
793
+ }
794
+
795
+ int err = ENgetresultindex(type, index, &value);
796
+
797
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(value));
798
+ }
799
+
800
+ PyObject* method_ENgetrule(PyObject* self, PyObject* args)
801
+ {
802
+ int index, nPremises, nThenActions, nElseActions;
803
+ float priority;
804
+
805
+ if(!PyArg_ParseTuple(args, "i", &index)) {
806
+ return NULL;
807
+ }
808
+
809
+ int err = ENgetrule(index, &nPremises, &nThenActions, &nElseActions, &priority);
810
+
811
+ return PyTuple_Pack(5, PyLong_FromLong(err), PyLong_FromLong(nPremises), PyLong_FromLong(nThenActions), PyLong_FromLong(nElseActions), PyFloat_FromDouble(priority));
812
+ }
813
+
814
+ PyObject* method_ENgetruleID(PyObject* self, PyObject* args)
815
+ {
816
+ int index;
817
+ char id[MAXID + 1];
818
+
819
+ if(!PyArg_ParseTuple(args, "i", &index)) {
820
+ return NULL;
821
+ }
822
+
823
+ int err = ENgetruleID(index, &id[0]);
824
+
825
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&id[0]));
826
+ }
827
+
828
+ PyObject* method_ENgetstatistic(PyObject* self, PyObject* args)
829
+ {
830
+ int type;
831
+ float value;
832
+
833
+ if(!PyArg_ParseTuple(args, "i", &type)) {
834
+ return NULL;
835
+ }
836
+
837
+ int err = ENgetstatistic(type, &value);
838
+
839
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyFloat_FromDouble(value));
840
+ }
841
+
842
+ PyObject* method_ENgetthenaction(PyObject* self, PyObject* args)
843
+ {
844
+ int ruleIndex, actionIndex, linkIndex, status;
845
+ float setting;
846
+
847
+ if(!PyArg_ParseTuple(args, "ii", &ruleIndex, &actionIndex)) {
848
+ return NULL;
849
+ }
850
+
851
+ int err = ENgetthenaction(ruleIndex, actionIndex, &linkIndex, &status, &setting);
852
+
853
+ return PyTuple_Pack(4, PyLong_FromLong(err), PyLong_FromLong(linkIndex), PyLong_FromLong(status), PyFloat_FromDouble(setting));
854
+ }
855
+
856
+ PyObject* method_ENgettimeparam(PyObject* self, PyObject* args)
857
+ {
858
+ int param;
859
+ long value;
860
+
861
+ if(!PyArg_ParseTuple(args, "i", &param)) {
862
+ return NULL;
863
+ }
864
+
865
+ int err = ENgettimeparam(param, &value);
866
+
867
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(value));
868
+ }
869
+
870
+ PyObject* method_ENgettitle(PyObject* self, PyObject* Py_UNUSED(args))
871
+ {
872
+ char line1[TITLELEN + 1];
873
+ char line2[TITLELEN + 1];
874
+ char line3[TITLELEN + 1];
875
+
876
+ int err = ENgettitle(&line1[0], &line2[0], &line3[0]);
877
+
878
+ return PyTuple_Pack(4, PyLong_FromLong(err), PyUnicode_FromString(&line1[0]), PyUnicode_FromString(&line2[0]), PyUnicode_FromString(&line3[0]));
879
+ }
880
+
881
+ PyObject* method_ENgetversion(PyObject* self, PyObject* Py_UNUSED(args))
882
+ {
883
+ int version;
884
+ int err = ENgetversion(&version);
885
+
886
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(version));
887
+ }
888
+
889
+ PyObject* method_ENgetvertex(PyObject* self, PyObject* args)
890
+ {
891
+ int index, vertex;
892
+ double x, y;
893
+
894
+ if(!PyArg_ParseTuple(args, "ii", &index, &vertex)) {
895
+ return NULL;
896
+ }
897
+
898
+ int err = ENgetvertex(index, vertex, &x, &y);
899
+
900
+ return PyTuple_Pack(3, PyLong_FromLong(err), PyFloat_FromDouble(x), PyFloat_FromDouble(y));
901
+ }
902
+
903
+ PyObject* method_ENgetvertexcount(PyObject* self, PyObject* args)
904
+ {
905
+ int index, count;
906
+
907
+ if(!PyArg_ParseTuple(args, "i", &index)) {
908
+ return NULL;
909
+ }
910
+
911
+ int err = ENgetvertexcount(index, &count);
912
+
913
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(count));
914
+ }
915
+
916
+ PyObject* method_ENinit(PyObject* self, PyObject* args)
917
+ {
918
+ char* rptFile, *outFile = NULL;
919
+ int unitsType, headlossType;
920
+
921
+ if(!PyArg_ParseTuple(args, "ssii", &rptFile, &outFile, &unitsType, &headlossType)) {
922
+ return NULL;
923
+ }
924
+
925
+ int err = ENinit(rptFile, outFile, unitsType, headlossType);
926
+
927
+ return PyTuple_Pack(1, PyLong_FromLong(err));
928
+ }
929
+
930
+ PyObject* method_ENinitH(PyObject* self, PyObject* args)
931
+ {
932
+ int initFlag;
933
+ if(!PyArg_ParseTuple(args, "i", &initFlag)) {
934
+ return NULL;
935
+ }
936
+
937
+ int err = ENinitH(initFlag);
938
+
939
+ return PyTuple_Pack(1, PyLong_FromLong(err));
940
+ }
941
+
942
+ PyObject* method_ENinitQ(PyObject* self, PyObject* args)
943
+ {
944
+ int saveFlag;
945
+ if(!PyArg_ParseTuple(args, "i", &saveFlag)) {
946
+ return NULL;
947
+ }
948
+
949
+ int err = ENinitQ(saveFlag);
950
+
951
+ return PyTuple_Pack(1, PyLong_FromLong(err));
952
+ }
953
+
954
+ PyObject* method_ENnextH(PyObject* self, PyObject* Py_UNUSED(args))
955
+ {
956
+ long lStep;
957
+ int err = ENnextH(&lStep);
958
+
959
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(lStep));
960
+ }
961
+
962
+ PyObject* method_ENnextQ(PyObject* self, PyObject* Py_UNUSED(args))
963
+ {
964
+ long tStep;
965
+ int err = ENnextQ(&tStep);
966
+
967
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(tStep));
968
+ }
969
+
970
+ PyObject* method_ENopenH(PyObject* self, PyObject* Py_UNUSED(args))
971
+ {
972
+ int err = ENopenH();
973
+
974
+ return PyTuple_Pack(1, PyLong_FromLong(err));
975
+ }
976
+
977
+ PyObject* method_ENopenQ(PyObject* self, PyObject* Py_UNUSED(args))
978
+ {
979
+ int err = ENopenQ();
980
+
981
+ return PyTuple_Pack(1, PyLong_FromLong(err));
982
+ }
983
+
984
+ PyObject* method_ENreport(PyObject* self, PyObject* Py_UNUSED(args))
985
+ {
986
+ int err = ENreport();
987
+
988
+ return PyTuple_Pack(1, PyLong_FromLong(err));
989
+ }
990
+
991
+ PyObject* method_ENresetreport(PyObject* self, PyObject* Py_UNUSED(args))
992
+ {
993
+ int err = ENresetreport();
994
+
995
+ return PyTuple_Pack(1, PyLong_FromLong(err));
996
+ }
997
+
998
+ PyObject* method_ENrunH(PyObject* self, PyObject* Py_UNUSED(args))
999
+ {
1000
+ long currentTime;
1001
+ int err = ENrunH(&currentTime);
1002
+
1003
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(currentTime));
1004
+ }
1005
+
1006
+ PyObject* method_ENrunQ(PyObject* self, PyObject* Py_UNUSED(args))
1007
+ {
1008
+ long currentTime;
1009
+ int err = ENrunQ(&currentTime);
1010
+
1011
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(currentTime));
1012
+ }
1013
+
1014
+ PyObject* method_ENsavehydfile(PyObject* self, PyObject* args)
1015
+ {
1016
+ char* filename = NULL;
1017
+
1018
+ if(!PyArg_ParseTuple(args, "s", &filename)) {
1019
+ return NULL;
1020
+ }
1021
+
1022
+ int err = ENsavehydfile(filename);
1023
+
1024
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1025
+ }
1026
+
1027
+ PyObject* method_ENsaveH(PyObject* self, PyObject* Py_UNUSED(args))
1028
+ {
1029
+ int err = ENsaveH();
1030
+
1031
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1032
+ }
1033
+
1034
+ PyObject* method_ENsaveinpfile(PyObject* self, PyObject* args)
1035
+ {
1036
+ char* filename = NULL;
1037
+
1038
+ if(!PyArg_ParseTuple(args, "s", &filename)) {
1039
+ return NULL;
1040
+ }
1041
+
1042
+ int err = ENsaveinpfile(filename);
1043
+
1044
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1045
+ }
1046
+
1047
+ PyObject* method_ENsetbasedemand(PyObject* self, PyObject* args)
1048
+ {
1049
+ int nodeIndex, demandIndex;
1050
+ float baseDemand;
1051
+
1052
+ if(!PyArg_ParseTuple(args, "iif", &nodeIndex, &demandIndex, &baseDemand)) {
1053
+ return NULL;
1054
+ }
1055
+
1056
+ int err = ENsetbasedemand(nodeIndex, demandIndex, baseDemand);
1057
+
1058
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1059
+ }
1060
+
1061
+ PyObject* method_ENsetcomment(PyObject* self, PyObject* args)
1062
+ {
1063
+ int object, index;
1064
+ char* comment = NULL;
1065
+
1066
+ if(!PyArg_ParseTuple(args, "iis", &object, &index, &comment)) {
1067
+ return NULL;
1068
+ }
1069
+
1070
+ int err = ENsetcomment(object, index, comment);
1071
+
1072
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1073
+ }
1074
+
1075
+ PyObject* method_ENsetcontrol(PyObject* self, PyObject* args)
1076
+ {
1077
+ int index, type, linkIndex, nodeIndex;
1078
+ float setting, level;
1079
+
1080
+ if(!PyArg_ParseTuple(args, "iiifif", &index, &type, &linkIndex, &setting, &nodeIndex, &level)) {
1081
+ return NULL;
1082
+ }
1083
+
1084
+ int err = ENsetcontrol(index, type, linkIndex, setting, nodeIndex, level);
1085
+
1086
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1087
+ }
1088
+
1089
+ PyObject* method_ENsetcurveid(PyObject* self, PyObject* args)
1090
+ {
1091
+ int index;
1092
+ char* id = NULL;
1093
+
1094
+ if(!PyArg_ParseTuple(args, "is", &index, &id)) {
1095
+ return NULL;
1096
+ }
1097
+
1098
+ int err = ENsetcurveid(index, id);
1099
+
1100
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1101
+ }
1102
+
1103
+ PyObject* method_ENsetcurve(PyObject* self, PyObject* args)
1104
+ {
1105
+ int index, nPoints;
1106
+ PyObject* xValues = NULL;
1107
+ PyObject* yValues = NULL;
1108
+ if(!PyArg_ParseTuple(args, "iOOi", &index, &xValues, &yValues, &nPoints)) {
1109
+ return NULL;
1110
+ }
1111
+
1112
+ float* xValuesRaw = (float*) malloc(sizeof(float) * nPoints);
1113
+ float* yValuesRaw = (float*) malloc(sizeof(float) * nPoints);
1114
+
1115
+ for(int i=0; i != nPoints; i++) {
1116
+ xValuesRaw[i] = (float) PyFloat_AsDouble(PyList_GET_ITEM(xValues, i));
1117
+ yValuesRaw[i] = (float) PyFloat_AsDouble(PyList_GET_ITEM(yValues, i));
1118
+ }
1119
+
1120
+ int err = ENsetcurve(index, xValuesRaw, yValuesRaw, nPoints);
1121
+ free(xValuesRaw);
1122
+ free(yValuesRaw);
1123
+
1124
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1125
+ }
1126
+
1127
+ PyObject* method_ENsetcoord(PyObject* self, PyObject* args)
1128
+ {
1129
+ int index;
1130
+ double x, y;
1131
+
1132
+ if(!PyArg_ParseTuple(args, "idd", &index, &x, &y)) {
1133
+ return NULL;
1134
+ }
1135
+
1136
+ int err = ENsetcoord(index, x, y);
1137
+
1138
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1139
+ }
1140
+
1141
+ PyObject* method_ENsetcurvevalue(PyObject* self, PyObject* args)
1142
+ {
1143
+ int curveIndex, pointIndex;
1144
+ float x, y;
1145
+
1146
+ if(!PyArg_ParseTuple(args, "iiff", &curveIndex, &pointIndex, &x, &y)) {
1147
+ return NULL;
1148
+ }
1149
+
1150
+ int err = ENsetcurvevalue(curveIndex, pointIndex, x, y);
1151
+
1152
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1153
+ }
1154
+
1155
+ PyObject* method_ENsetdemandmodel(PyObject* self, PyObject* args)
1156
+ {
1157
+ int model;
1158
+ float pmin, preq, pexp;
1159
+
1160
+ if(!PyArg_ParseTuple(args, "ifff", &model, &pmin, &preq, &pexp)) {
1161
+ return NULL;
1162
+ }
1163
+
1164
+ int err = ENsetdemandmodel(model, pmin, preq, pexp);
1165
+
1166
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1167
+ }
1168
+
1169
+ PyObject* method_ENsetdemandname(PyObject* self, PyObject* args)
1170
+ {
1171
+ int nodeIndex, demandIndex;
1172
+ char* demandName = NULL;
1173
+
1174
+ if(!PyArg_ParseTuple(args, "iis", &nodeIndex, &demandIndex, &demandName)) {
1175
+ return NULL;
1176
+ }
1177
+
1178
+ int err = ENsetdemandname(nodeIndex, demandIndex, demandName);
1179
+
1180
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1181
+ }
1182
+
1183
+ PyObject* method_ENsetdemandpattern(PyObject* self, PyObject* args)
1184
+ {
1185
+ int nodeIndex, demandIndex, patIndex;
1186
+
1187
+ if(!PyArg_ParseTuple(args, "iii", &nodeIndex, &demandIndex, &patIndex)) {
1188
+ return NULL;
1189
+ }
1190
+
1191
+ int err = ENsetdemandpattern(nodeIndex, demandIndex, patIndex);
1192
+
1193
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1194
+ }
1195
+
1196
+ PyObject* method_ENsetelseaction(PyObject* self, PyObject* args)
1197
+ {
1198
+ int ruleIndex, actionIndex, linkIndex, status;
1199
+ float setting;
1200
+
1201
+ if(!PyArg_ParseTuple(args, "iiiif", &ruleIndex, &actionIndex, &linkIndex, &status, &setting)) {
1202
+ return NULL;
1203
+ }
1204
+
1205
+ int err = ENsetelseaction(ruleIndex, actionIndex, linkIndex, status, setting);
1206
+
1207
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1208
+ }
1209
+
1210
+ PyObject* method_ENsetflowunits(PyObject* self, PyObject* args)
1211
+ {
1212
+ int units;
1213
+
1214
+ if(!PyArg_ParseTuple(args, "i", &units)) {
1215
+ return NULL;
1216
+ }
1217
+
1218
+ int err = ENsetflowunits(units);
1219
+
1220
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1221
+ }
1222
+
1223
+ PyObject* method_ENsetheadcurveindex(PyObject* self, PyObject* args)
1224
+ {
1225
+ int linkIndex, curveIndex;
1226
+
1227
+ if(!PyArg_ParseTuple(args, "ii", &linkIndex, &curveIndex)) {
1228
+ return NULL;
1229
+ }
1230
+
1231
+ int err = ENsetheadcurveindex(linkIndex, curveIndex);
1232
+
1233
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1234
+ }
1235
+
1236
+ PyObject* method_ENsetjuncdata(PyObject* self, PyObject* args)
1237
+ {
1238
+ int index;
1239
+ float elev, dmnd;
1240
+ char* dmndpat = NULL;
1241
+
1242
+ if(!PyArg_ParseTuple(args, "iffs", &index, &elev, &dmnd, &dmndpat)) {
1243
+ return NULL;
1244
+ }
1245
+
1246
+ int err = ENsetjuncdata(index, elev, dmnd, dmndpat);
1247
+
1248
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1249
+ }
1250
+
1251
+ PyObject* method_ENsetlinkid(PyObject* self, PyObject* args)
1252
+ {
1253
+ int index;
1254
+ char* newid = NULL;
1255
+
1256
+ if(!PyArg_ParseTuple(args, "is", &index, &newid)) {
1257
+ return NULL;
1258
+ }
1259
+
1260
+ int err = ENsetlinkid(index, newid);
1261
+
1262
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1263
+ }
1264
+
1265
+ PyObject* method_ENsetlinknodes(PyObject* self, PyObject* args)
1266
+ {
1267
+ int index, node1, node2;
1268
+
1269
+ if(!PyArg_ParseTuple(args, "iii", &index, &node1, &node2)) {
1270
+ return NULL;
1271
+ }
1272
+
1273
+ int err = ENsetlinknodes(index, node1, node2);
1274
+
1275
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1276
+ }
1277
+
1278
+ PyObject* method_ENsetlinktype(PyObject* self, PyObject* args)
1279
+ {
1280
+ int index;
1281
+ int linkType, actionCode;
1282
+
1283
+ if(!PyArg_ParseTuple(args, "iii", &index, &linkType, &actionCode)) {
1284
+ return NULL;
1285
+ }
1286
+
1287
+ int err = ENsetlinktype(&index, linkType, actionCode);
1288
+
1289
+
1290
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1291
+ }
1292
+
1293
+ PyObject* method_ENsetlinkvalue(PyObject* self, PyObject* args)
1294
+ {
1295
+ int index, property;
1296
+ float value;
1297
+
1298
+ if(!PyArg_ParseTuple(args, "iif", &index, &property, &value)) {
1299
+ return NULL;
1300
+ }
1301
+
1302
+ int err = ENsetlinkvalue(index, property, value);
1303
+
1304
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1305
+ }
1306
+
1307
+ PyObject* method_ENsetnodeid(PyObject* self, PyObject* args)
1308
+ {
1309
+ int index;
1310
+ char* newid = NULL;
1311
+
1312
+ if(!PyArg_ParseTuple(args, "is", &index, &newid)) {
1313
+ return NULL;
1314
+ }
1315
+
1316
+ int err = ENsetnodeid(index, newid);
1317
+
1318
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1319
+ }
1320
+
1321
+ PyObject* method_ENsetnodevalue(PyObject* self, PyObject* args)
1322
+ {
1323
+ int index, property;
1324
+ float value;
1325
+
1326
+ if(!PyArg_ParseTuple(args, "iif", &index, &property, &value)) {
1327
+ return NULL;
1328
+ }
1329
+
1330
+ int err = ENsetnodevalue(index, property, value);
1331
+
1332
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1333
+ }
1334
+
1335
+ PyObject* method_ENsetoption(PyObject* self, PyObject* args)
1336
+ {
1337
+ int option;
1338
+ float value;
1339
+
1340
+ if(!PyArg_ParseTuple(args, "if", &option, &value)) {
1341
+ return NULL;
1342
+ }
1343
+
1344
+ int err = ENsetoption(option, value);
1345
+
1346
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1347
+ }
1348
+
1349
+ PyObject* method_ENsetpattern(PyObject* self, PyObject* args)
1350
+ {
1351
+ int index;
1352
+ PyObject* values = NULL;
1353
+ int len;
1354
+ if(!PyArg_ParseTuple(args, "iOi", &index, &values, &len)) {
1355
+ return NULL;
1356
+ }
1357
+
1358
+ int numValues = PyList_Size(values);
1359
+ float* valuesRaw = (float*) malloc(sizeof(float) * numValues);
1360
+ for(int i=0; i != numValues; i++) {
1361
+ valuesRaw[i] = (float) PyFloat_AsDouble(PyList_GET_ITEM(values, i));
1362
+ }
1363
+
1364
+ int err = ENsetpattern(index, valuesRaw, len);
1365
+ free(valuesRaw);
1366
+
1367
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1368
+ }
1369
+
1370
+ PyObject* method_ENsetpatternid(PyObject* self, PyObject* args)
1371
+ {
1372
+ int index;
1373
+ char* id = NULL;
1374
+
1375
+ if(!PyArg_ParseTuple(args, "is", &index, &id)) {
1376
+ return NULL;
1377
+ }
1378
+
1379
+ int err = ENsetpatternid(index, id);
1380
+
1381
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1382
+ }
1383
+
1384
+ PyObject* method_ENsetpatternvalue(PyObject* self, PyObject* args)
1385
+ {
1386
+ int index, period;
1387
+ float value;
1388
+
1389
+ if(!PyArg_ParseTuple(args, "iif", &index, &period, &value)) {
1390
+ return NULL;
1391
+ }
1392
+
1393
+ int err = ENsetpatternvalue(index, period, value);
1394
+
1395
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1396
+ }
1397
+
1398
+ PyObject* method_ENsetpipedata(PyObject* self, PyObject* args)
1399
+ {
1400
+ int index;
1401
+ float length, diam, rough, mloss;
1402
+
1403
+ if(!PyArg_ParseTuple(args, "iffff", &index, &length, &diam, &rough, &mloss)) {
1404
+ return NULL;
1405
+ }
1406
+
1407
+ int err = ENsetpipedata(index, length, diam, rough, mloss);
1408
+
1409
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1410
+ }
1411
+
1412
+ PyObject* method_ENsetpremise(PyObject* self, PyObject* args)
1413
+ {
1414
+ int ruleIndex, premiseIndex, logop, object, objIndex, variable, relop, status;
1415
+ float value;
1416
+
1417
+ if(!PyArg_ParseTuple(args, "iiiiiiiif", &ruleIndex, &premiseIndex, &logop, &object, &objIndex, &variable, &relop, &status, &value)) {
1418
+ return NULL;
1419
+ }
1420
+
1421
+ int err = ENsetpremise(ruleIndex, premiseIndex, logop, object, objIndex, variable, relop, status, value);
1422
+
1423
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1424
+ }
1425
+
1426
+ PyObject* method_ENsetpremiseindex(PyObject* self, PyObject* args)
1427
+ {
1428
+ int ruleIndex, premiseIndex, objIndex;
1429
+
1430
+ if(!PyArg_ParseTuple(args, "iii", &ruleIndex, &premiseIndex, &objIndex)) {
1431
+ return NULL;
1432
+ }
1433
+
1434
+ int err = ENsetpremiseindex(ruleIndex, premiseIndex, objIndex);
1435
+
1436
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1437
+ }
1438
+
1439
+ PyObject* method_ENsetpremisevalue(PyObject* self, PyObject* args)
1440
+ {
1441
+ int ruleIndex, premiseIndex;
1442
+ float value;
1443
+
1444
+ if(!PyArg_ParseTuple(args, "iif", &ruleIndex, &premiseIndex, &value)) {
1445
+ return NULL;
1446
+ }
1447
+
1448
+ int err = ENsetpremisevalue(ruleIndex, premiseIndex, value);
1449
+
1450
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1451
+ }
1452
+
1453
+ PyObject* method_ENsetpremisestatus(PyObject* self, PyObject* args)
1454
+ {
1455
+ int ruleIndex, premiseIndex, status;
1456
+ if(!PyArg_ParseTuple(args, "iii", &ruleIndex, &premiseIndex, &status)) {
1457
+ return NULL;
1458
+ }
1459
+
1460
+ int err = ENsetpremisestatus(ruleIndex, premiseIndex, status);
1461
+
1462
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1463
+ }
1464
+
1465
+ PyObject* method_ENsetqualtype(PyObject* self, PyObject* args)
1466
+ {
1467
+ int qualtype;
1468
+ char* chemName = NULL;
1469
+ char* chemUnits = NULL;
1470
+ char* traceNode = NULL;
1471
+
1472
+ if(!PyArg_ParseTuple(args, "isss", &qualtype, &chemName, &chemUnits, &traceNode)) {
1473
+ return NULL;
1474
+ }
1475
+
1476
+ int err = ENsetqualtype(qualtype, chemName, chemUnits, traceNode);
1477
+
1478
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1479
+ }
1480
+
1481
+ PyObject* method_ENsetreport(PyObject* self, PyObject* args)
1482
+ {
1483
+ char* format = NULL;
1484
+
1485
+ if(!PyArg_ParseTuple(args, "s", &format)) {
1486
+ return NULL;
1487
+ }
1488
+
1489
+ int err = ENsetreport(format);
1490
+
1491
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1492
+ }
1493
+
1494
+ PyObject* method_ENsetrulepriority(PyObject* self, PyObject* args)
1495
+ {
1496
+ int index;
1497
+ float priority;
1498
+
1499
+ if(!PyArg_ParseTuple(args, "if", &index, &priority)) {
1500
+ return NULL;
1501
+ }
1502
+
1503
+ int err = ENsetrulepriority(index, priority);
1504
+
1505
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1506
+ }
1507
+
1508
+ PyObject* method_ENsetstatusreport(PyObject* self, PyObject* args)
1509
+ {
1510
+ int level;
1511
+
1512
+ if(!PyArg_ParseTuple(args, "i", &level)) {
1513
+ return NULL;
1514
+ }
1515
+
1516
+ int err = ENsetstatusreport(level);
1517
+
1518
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1519
+ }
1520
+
1521
+ PyObject* method_ENsettankdata(PyObject* self, PyObject* args)
1522
+ {
1523
+ int index;
1524
+ float elev, initlvl, minlvl, maxlvl, diam, minvol;
1525
+ char* volcurve = NULL;
1526
+
1527
+ if(!PyArg_ParseTuple(args, "iffffffs", &index, &elev, &initlvl, &minlvl, &maxlvl, &diam, &minvol, &volcurve)) {
1528
+ return NULL;
1529
+ }
1530
+
1531
+ int err = ENsettankdata(index, elev, initlvl, minlvl, maxlvl, diam, minvol, volcurve);
1532
+
1533
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1534
+ }
1535
+
1536
+ PyObject* method_ENsetthenaction(PyObject* self, PyObject* args)
1537
+ {
1538
+ int ruleIndex, actionIndex, linkIndex, status;
1539
+ float setting;
1540
+
1541
+ if(!PyArg_ParseTuple(args, "iiiif", &ruleIndex, &actionIndex, &linkIndex, &status, &setting)) {
1542
+ return NULL;
1543
+ }
1544
+
1545
+ int err = ENsetthenaction(ruleIndex, actionIndex, linkIndex, status, setting);
1546
+
1547
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1548
+ }
1549
+
1550
+ PyObject* method_ENsettimeparam(PyObject* self, PyObject* args)
1551
+ {
1552
+ int param;
1553
+ long value;
1554
+
1555
+ if(!PyArg_ParseTuple(args, "il", &param, &value)) {
1556
+ return NULL;
1557
+ }
1558
+
1559
+ int err = ENsettimeparam(param, value);
1560
+
1561
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1562
+ }
1563
+
1564
+ PyObject* method_ENsettitle(PyObject* self, PyObject* args)
1565
+ {
1566
+ char* line1 = NULL;
1567
+ char* line2 = NULL;
1568
+ char* line3 = NULL;
1569
+
1570
+ if(!PyArg_ParseTuple(args, "sss", &line1, &line2, &line3)) {
1571
+ return NULL;
1572
+ }
1573
+
1574
+ int err = ENsettitle(line1, line2, line3);
1575
+
1576
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1577
+ }
1578
+
1579
+ PyObject* method_ENsetvertices(PyObject* self, PyObject* args)
1580
+ {
1581
+ int index;
1582
+ double* x = NULL;
1583
+ double* y = NULL;
1584
+ int count;
1585
+ if(!PyArg_ParseTuple(args, "iOOi", &index, &x, &y, &count)) {
1586
+ return NULL;
1587
+ }
1588
+
1589
+ double* xRaw = (double*) malloc(sizeof(double) * count);
1590
+ double* yRaw = (double*) malloc(sizeof(double) * count);
1591
+
1592
+ for(int i=0; i != count; i++) {
1593
+ xRaw[i] = PyFloat_AsDouble(PyList_GET_ITEM(x, i));
1594
+ yRaw[i] = PyFloat_AsDouble(PyList_GET_ITEM(y, i));
1595
+ }
1596
+
1597
+ int err = ENsetvertices(index, xRaw, yRaw, count);
1598
+ free(xRaw);
1599
+ free(yRaw);
1600
+
1601
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1602
+ }
1603
+
1604
+ PyObject* method_ENsolveH(PyObject* self, PyObject* Py_UNUSED(args))
1605
+ {
1606
+ int err = ENsolveH();
1607
+
1608
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1609
+ }
1610
+
1611
+ PyObject* method_ENsolveQ(PyObject* self, PyObject* Py_UNUSED(args))
1612
+ {
1613
+ int err = ENsolveQ();
1614
+
1615
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1616
+ }
1617
+
1618
+ PyObject* method_ENstepQ(PyObject* self, PyObject* Py_UNUSED(args))
1619
+ {
1620
+ long timeLeft;
1621
+ int err = ENstepQ(&timeLeft);
1622
+
1623
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(timeLeft));
1624
+ }
1625
+
1626
+ PyObject* method_ENusehydfile(PyObject* self, PyObject* args)
1627
+ {
1628
+ char* filename = NULL;
1629
+ if(!PyArg_ParseTuple(args, "s", &filename)) {
1630
+ return NULL;
1631
+ }
1632
+
1633
+ int err = ENusehydfile(filename);
1634
+
1635
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1636
+ }
1637
+
1638
+ PyObject* method_ENwriteline(PyObject* self, PyObject* args)
1639
+ {
1640
+ char* line = NULL;
1641
+ if(!PyArg_ParseTuple(args, "s", &line)) {
1642
+ return NULL;
1643
+ }
1644
+
1645
+ int err = ENwriteline(line);
1646
+
1647
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1648
+ }
1649
+
1650
+ PyObject* method_ENgettag(PyObject* self, PyObject* args)
1651
+ {
1652
+ int object, index;
1653
+ if(!PyArg_ParseTuple(args, "ii", &object, &index)) {
1654
+ return NULL;
1655
+ }
1656
+
1657
+ char tag[MAXID + 1];
1658
+ int err = ENgettag(object, index, &tag[0]);
1659
+
1660
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyUnicode_FromString(&tag[0]));
1661
+ }
1662
+
1663
+ PyObject* method_ENsettag(PyObject* self, PyObject* args)
1664
+ {
1665
+ int object, index;
1666
+ char* tag = NULL;
1667
+ if(!PyArg_ParseTuple(args, "iis", &object, &index, &tag)) {
1668
+ return NULL;
1669
+ }
1670
+
1671
+ int err = ENsettag(object, index, tag);
1672
+
1673
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1674
+ }
1675
+
1676
+ PyObject* method_ENtimetonextevent(PyObject* self, PyObject* Py_UNUSED(args))
1677
+ {
1678
+ int eventType, elemIndex;
1679
+ long duration;
1680
+ int err = ENtimetonextevent(&eventType, &duration, &elemIndex);
1681
+
1682
+ return PyTuple_Pack(4, PyLong_FromLong(err), PyLong_FromLong(eventType), PyLong_FromLong(duration), PyLong_FromLong(elemIndex));
1683
+ }
1684
+
1685
+ PyObject* method_ENgetnodevalues(PyObject* self, PyObject* args)
1686
+ {
1687
+ int property;
1688
+ if(!PyArg_ParseTuple(args, "i", &property)) {
1689
+ return NULL;
1690
+ }
1691
+
1692
+ int numNodes;
1693
+ int err = ENgetcount(EN_NODECOUNT, &numNodes);
1694
+ if(err != 0) {
1695
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1696
+ }
1697
+
1698
+ float* values = (float*) malloc(sizeof(float) * numNodes);
1699
+ err = ENgetnodevalues(property, values);
1700
+
1701
+ PyObject* valuesList = PyList_New(numNodes);
1702
+ for(int i=0; i != numNodes; i++) {
1703
+ PyList_SET_ITEM(valuesList, i, PyFloat_FromDouble((double) values[i]));
1704
+ }
1705
+
1706
+ free(values);
1707
+
1708
+ return PyTuple_Pack(2, PyLong_FromLong(err), valuesList);
1709
+ }
1710
+
1711
+ PyObject* method_ENgetlinkvalues(PyObject* self, PyObject* args)
1712
+ {
1713
+ int property;
1714
+ if(!PyArg_ParseTuple(args, "i", &property)) {
1715
+ return NULL;
1716
+ }
1717
+
1718
+ int numLinks;
1719
+ int err = ENgetcount(EN_LINKCOUNT, &numLinks);
1720
+ if(err != 0) {
1721
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1722
+ }
1723
+
1724
+ float* value = (float*) malloc(sizeof(float) * numLinks);
1725
+ err = ENgetlinkvalues(property, value);
1726
+
1727
+ PyObject* valuesList = PyList_New(numLinks);
1728
+ for(int i=0; i != numLinks; i++) {
1729
+ PyList_SET_ITEM(valuesList, i, PyFloat_FromDouble(value[i]));
1730
+ }
1731
+
1732
+ free(value);
1733
+
1734
+ return PyTuple_Pack(2, PyLong_FromLong(err), valuesList);
1735
+ }
1736
+
1737
+ PyObject* method_ENsetvertex(PyObject* self, PyObject* args)
1738
+ {
1739
+ int index, vertex;
1740
+ double x, y;
1741
+ if(!PyArg_ParseTuple(args, "iidd", &index, &vertex, &x, &y)) {
1742
+ return NULL;
1743
+ }
1744
+
1745
+ int err = ENsetvertex(index, vertex, x, y);
1746
+
1747
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1748
+ }
1749
+
1750
+ PyObject* method_ENloadpatternfile(PyObject* self, PyObject* args)
1751
+ {
1752
+ char* filename = NULL;
1753
+ char* id = NULL;
1754
+ if(!PyArg_ParseTuple(args, "ss", &filename, &id)) {
1755
+ return NULL;
1756
+ }
1757
+
1758
+ int err = ENloadpatternfile(filename, id);
1759
+
1760
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1761
+ }
1762
+
1763
+ PyObject* method_ENsetcurvetype(PyObject* self, PyObject* args)
1764
+ {
1765
+ int index, type;
1766
+ if(!PyArg_ParseTuple(args, "ii", &index, &type)) {
1767
+ return NULL;
1768
+ }
1769
+
1770
+ int err = ENsetcurvetype(index, type);
1771
+
1772
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1773
+ }
1774
+
1775
+ PyObject* method_ENgetcontrolenabled(PyObject* self, PyObject* args)
1776
+ {
1777
+ int index;
1778
+ if(!PyArg_ParseTuple(args, "i", &index)) {
1779
+ return NULL;
1780
+ }
1781
+
1782
+ int out_enabled;
1783
+ int err = ENgetcontrolenabled(index, &out_enabled);
1784
+
1785
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(out_enabled));
1786
+ }
1787
+
1788
+ PyObject* method_ENsetcontrolenabled(PyObject* self, PyObject* args)
1789
+ {
1790
+ int index, enabled;
1791
+ if(!PyArg_ParseTuple(args, "ii", &index, &enabled)) {
1792
+ return NULL;
1793
+ }
1794
+
1795
+ int err = ENsetcontrolenabled(index, enabled);
1796
+
1797
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1798
+ }
1799
+
1800
+ PyObject* method_ENgetruleenabled(PyObject* self, PyObject* args)
1801
+ {
1802
+ int index;
1803
+ if(!PyArg_ParseTuple(args, "i", &index)) {
1804
+ return NULL;
1805
+ }
1806
+
1807
+ int out_enabled;
1808
+ int err = ENgetruleenabled(index, &out_enabled);
1809
+
1810
+ return PyTuple_Pack(2, PyLong_FromLong(err), PyLong_FromLong(out_enabled));
1811
+ }
1812
+
1813
+ PyObject* method_ENsetruleenabled(PyObject* self, PyObject* args)
1814
+ {
1815
+ int index, enabled;
1816
+ if(!PyArg_ParseTuple(args, "ii", &index, &enabled)) {
1817
+ return NULL;
1818
+ }
1819
+
1820
+ int err = ENsetruleenabled(index, enabled);
1821
+
1822
+ return PyTuple_Pack(1, PyLong_FromLong(err));
1823
+ }