Commit Graph

328 Commits

Author SHA1 Message Date
Lew Rossman
f673aa2f20 Modifications made to EN_getlinkvalue & EN_setlinkvalue in EPANET.C
1. EN__PUMP_ECOST added to EN_getlinkvalue.
2. Order of cases in switch statement of both EN_getlinkvalue and EN_setlinkvalue changed to match the order of EN_LinkProperty enumeration.
2019-01-11 12:52:09 -05:00
Lew Rossman
dd376692ad Floating pt. args in thread-safe API changed to doubles (Issue #365) 2019-01-09 15:14:10 -05:00
Lew Rossman
628fffc718 Added additional network building features (#367) 2019-01-02 10:33:58 -05:00
Lew Rossman
3ce0361c1d Network validity checks added to openhyd()
Checks on illegal valve connections made whenever API creates a new link, changes its end nodes, or changes its type.
2018-12-20 08:36:05 -05:00
Lew Rossman
a66f5a2c92 Checks addded to prevent changing network structure when solver active (#361) 2018-12-18 15:35:06 -05:00
Lew Rossman
f1175b1f92 Error reporting fixes and re-formatting (issue #358) 2018-12-15 15:13:19 -05:00
Michael Tryby
b0c7714d72 Keeping legacy api in epanet2.h epanet2.c and moving new api to epanet2_2.h epanet.c 2018-11-29 12:51:47 -05:00
Michael Tryby
be2ca0a9f6 Implmenting Toolkit API versioning 2018-11-29 11:57:51 -05:00
Lew Rossman
d3a50dc490 Fixed refactoring bug in EN_setlinkid 2018-11-27 19:25:01 -05:00
Lew Rossman
9a540cc0f4 Code cleanup
1. Added a standard header to each code module and removed obsolete comments.
2. Re-named several of the sub-structs in the project struct and re-arranged some of their contents.
3. Re-named _defaultModel to _defaultProject.
4. Removed the need to call EN_createproject and EN_deleteproject when working with the default project.
5. Made X & Y coords. part of Snode properties instead of a separate struct.
6. Moved the non-API functions in epanet.c into a new module named project.c.
7. Re-factored the quality module so that it uses the same nodal adjacency lists as the hydraulics solver.
8. Re-factored the sparse matrix module (smatrix.c) to be more memory efficient.
9. Restricted line lengths to < 90 columns.
10. Grouped the placement of functions in EPANET2.H and EPANET.C by category.
2018-11-27 14:22:06 -05:00
Michael Tryby
440230ef6d Rolling back errormanager 2018-11-19 16:33:30 -05:00
Lew Rossman
6397a01363 Merge branch 'dev' into lrossman-dev 2018-11-07 23:19:16 -05:00
Lew Rossman
7443cea9d4 Fixes #172 (adjust controls when node/link is deleted) & EN_addrule added
- Deleting controls with node/link deletion made conditional.
- New EN_addrule function added along with a test file.
- Rule structures re-named & rules.c heavily modified.
- Issue with exceeding limit on number of temporary file names fixed.
- VB declaration and DEF files updated.
2018-11-07 23:09:47 -05:00
Elad Salomons
18fb352527 Merge pull request #327 from eladsal/dev-link-nodes
Add ENsetlinknodes to DEF file and add a function check
2018-10-31 18:23:03 +02:00
Lew Rossman
ee335ab077 Fixes bug #172 (adjust controls & rules when node/link added or deleted)
- Also adds new API function EN_deletecontrol
- Updates and re-arranges entries in the VBA and VB.Net headers
2018-10-31 11:32:01 -04:00
Elad Salomons
4394c53f9b Add ENsetlinknodes to DEF file and add a function check 2018-10-29 17:20:45 +02:00
Lew Rossman
c2b16a6466 Deleted previous, commented-out version of EN_setlinktype 2018-10-28 20:07:54 -04:00
Lew Rossman
8514929622 Rewrite of EN_setlinktype function (#305)
- Complete rewrite of EN_setlinktype with link index argument passed by reference
- New unit test of EN_setlinktype added
- New function EN_setlinknodes added
2018-10-28 16:58:43 -04:00
Lew Rossman
320dec3ff7 Replaced main() for runnable version of the library 2018-10-27 11:00:00 -04:00
Lew Rossman
9d0b738e77 Removed writecon function and all calls to it 2018-10-27 09:36:21 -04:00
Lew Rossman
8286918b94 Removed unused runconcurrent() function 2018-10-27 09:05:30 -04:00
Lew Rossman
39fcfa2162 Fixed bug setting pump curve params (#314) and in setting demand categories
-Split off calc. of a pump's curve coeffs. from getpumpparams to updatepumpparams.
- Fixed problem with initializing node demand category when default demand pattern set before node is created.
- Increased MAXLINE to 1024 to accomodate increase in MAXMSG.
- Replaced EN_geterror calls in input2.c with geterrmsg (it's bad form to call API functions in the body of the library)
2018-10-25 09:39:28 -04:00
Lew Rossman
69388024fb Fixed bug in EN_deletelink (#312) 2018-10-23 16:00:14 -04:00
Lew Rossman
f7346cef5f Modified re-factored version of hash.c 2018-10-19 10:36:39 -04:00
Lew Rossman
60a79de4a9 Fixed bug in hash.c
A bug in the delete function in hash.c was preventing the unit test of the new set ID API functions from running properly. In fixing this bug the entire hash table code was refactored to make it look more like the mempool service routines. Also the need to copy the string passed into the table's insert function was eliminated.
2018-10-18 10:03:09 -04:00
Lew Rossman
76419e0b4c Added EN_setnodeid and EN_setlinkid (Issue #306) 2018-10-17 09:05:16 -04:00
Lew Rossman
1c3044c948 Fix #211 for EN_setreport 2018-10-14 11:05:15 -04:00
Lew Rossman
7c021cf533 Fixed water quality mass balance issue (#160) 2018-10-09 12:53:20 -04:00
Elad Salomons
4848f692f6 Merge pull request #296 from eladsal/dev-dem-cat
Add demand names get\set APIs
Close #294
2018-10-01 10:47:40 +03:00
Elad Salomons
c1c80da667 Add APIs to get\set demand categories names 2018-09-26 11:15:37 +03:00
Marios Kyriakou
982ff903e3 add option EN_HEADLOSSFORM in function ENgetoption 2018-09-23 19:41:27 +03:00
Elad Salomons
dad11cce8d Add option to get\set default demand pattern
also updates the net builder test
2018-09-15 14:22:20 +03:00
Michael Tryby
aadfb19a74 Reverting ENepanet from runconcurrent() to EN_runproject() 2018-09-14 15:59:41 -04:00
Michael Tryby
945280e441 Fixing bug in geterrmsg() 2018-09-14 15:51:51 -04:00
Michael Tryby
bec729a669 Fixing compiler warnings 2018-09-13 10:48:55 -04:00
Elad Salomons
40a53718cc Fix EN_setnodevalue for EN_MINLEVEL
Vmin was not updated correctly
2018-09-06 12:01:09 +03:00
Elad Salomons
756e8be735 Merge pull request #265 from eladsal/dev-control
Add EN_addcontrol function
2018-09-05 07:42:02 +03:00
Michael Tryby
ec6bb25a11 Merge branch 'dev' into issue-172 2018-09-04 15:00:21 -04:00
Elad Salomons
0f296db492 Initialize node and link comments in add functions 2018-09-04 21:15:57 +03:00
Michael Tryby
b7e9988b15 Adding unit test for reentrancy 2018-09-04 09:38:44 -04:00
Elad Salomons
fcbb47251e Fix old function calls 2018-09-04 08:26:22 +03:00
Elad Salomons
d09548992f Add EN_addcontrol function 2018-09-03 12:35:39 +03:00
Elad Salomons
5d241e2fbd Create headers for EN_addcontrol 2018-09-03 08:18:42 +03:00
Michael Tryby
d33167161a Revert "Make memorypool threadsafe " 2018-08-31 11:14:16 -04:00
Elad Salomons
25db9cfe8f Merge pull request #242 from Mariosmsk/pr86
add ENsetdemandpattern. Closes #241
2018-08-31 06:51:39 +03:00
Michael Tryby
c4b6756926 Fixing compile error on Travis 2018-08-30 15:39:06 -04:00
Michael Tryby
21f40f0daf Making memorypool.c reentrant and adding test 2018-08-30 15:30:34 -04:00
Elad Salomons
7d8d780a8b Merge branch 'dev' into pr86 2018-08-30 17:55:35 +03:00
Marios Kyriakou
d41f362ab5 Fix crash with wrong parameters
ENgetbasedemand, ENsetbasedemand, ENgetdemandpattern, ENsetdemandpattern

Co-Authored-By: Elad Salomons <selad@optiwater.com>
2018-08-30 12:52:23 +03:00
Elad Salomons
7d374338a7 Merge pull request #250 from eladsal/dev-232
Add legacy ENinit API and set status for new links in EN_addlink
2018-08-30 12:47:27 +03:00