Commit Graph

67 Commits

Author SHA1 Message Date
Lew Rossman 6a3d3d5b8a Update project.c 2025-04-24 09:40:56 -04:00
Lew Rossman e206baaaab Add EN_VALVE_TYPE to link getter & setter 2025-04-23 12:59:48 -04:00
Lew Rossman f37e4934c6 Fix copy/paste error in project.c 2025-02-19 10:32:49 -05:00
Lew Rossman 7a1673994c Set/Get node & link tags added 2025-02-19 09:49:09 -05:00
Lew Rossman 65594132ce Close scratch hydraulics file between runs 2025-02-08 10:11:13 -05:00
Lew Rossman b0796f346a Adding leakage model 2024-06-26 11:15:01 -04:00
Lew Rossman 10d5079d75 Add EN_openX function
EN_openX allows an EPANET input file to be opened even if it has errors. This required re-arranging code, mainly in input3.c, so that default values are assigned to an object before its input line is parsed.
2023-10-04 09:53:05 -04:00
Sam Hatchett d0ab568a5d using int/bool convention instead of new enum type 2023-09-13 09:14:57 -04:00
Sam Hatchett 06a43cdb4e adds api support for enabling/disabling controls and rules 2023-09-12 14:51:44 -04:00
0tkl 2f63e513f0 fix potential memory leaks
Co-authored-by: Lew Rossman <LRossman@cinci.rr.com>
2023-08-10 12:32:28 +08:00
0tkl 434cd68a23 fix potential deref of a null pointer 2023-08-05 01:20:09 +08:00
Lew Rossman 789d42f248 Merge pull request #732 from OpenWaterAnalytics/dev-controls
Allow simple controls to set valves OPEN/CLOSED
2023-06-08 10:37:45 -04:00
Lew Rossman a9079b023b Allow simple controls to set valves OPEN/CLOSED 2023-05-13 12:29:35 -04:00
james uber f709c199bc correct error in adjustpumpparams() where a curveindex was being used instead of the pump index 2023-04-22 17:40:25 -04:00
Lew Rossman 2f8561632f Allows string literals as arguments in C++ clients
See issue #651. Also addresses issue #602.
2023-01-29 12:34:58 -05:00
Sam Hatchett 30c511ca78 Merge branch 'dev' into 683-request-better-logging-functionality 2023-01-19 09:01:43 -05:00
Lew Rossman 6db17193f5 New positional control valve added 2022-08-16 11:47:44 -04:00
Sam Hatchett 41887e9016 adds client callback API function 2022-07-27 16:37:49 -04:00
Elad Salomons ec11556d88 Change error number 2331 to 234 2020-08-10 11:20:51 +03:00
Alex Sinske 32732dbdd5 This solves the garbled error message and optionally adds an improved specific error message, which existed in EPANET 2.1 when a network has unconnected nodes. Another similar case in was code found and corrected with the same pattern, but could not be tested. 2020-08-05 18:43:17 +02:00
Lew Rossman 67f7d8f76b Merge branch 'dev' into dev_2.3 2020-07-10 14:36:46 -04:00
Lew Rossman b64e070354 Update project.c 2020-04-13 09:39:58 -04:00
Corey McNeish ee5e910454 Alloc, free persistent parts of Hydraul in allocdata, rather than in allocmatrix 2020-04-11 11:33:37 -07:00
Lew Rossman 80f9acfe4d Network building enhancements 2020-02-04 10:01:23 -05:00
Lew Rossman 2033ddfc22 Fixed editing errors made to project.c 2019-11-15 12:55:29 -05:00
Lew Rossman 94b6cb28b6 Restored prior update to project.c that got overwritten 2019-11-15 12:50:54 -05:00
Lew Rossman ce2a27f38e Bug fix for valvecheck function
See issue #561
2019-11-15 11:53:09 -05:00
Sam Hatchett 88e09ba8df fixes a crashing issue in freedata (#559)
The freedata function used cached values for sizes of certain arrays found in the parser struct. However, now that the network is mutable, those values can become invalid. Relying instead on the actual array lengths prevents freeing unallocated memory, or ignoring cleanup on newly created elements.
2019-11-15 09:57:32 -05:00
Lew Rossman 3bd4039d95 Bug fix for EN_setcurve
Adjusts params of any pump that uses the curve whose data is modified by EN_setcurve or EN_setcurvevalue (issue #550 ).
2019-11-02 11:17:25 -04:00
Lew Rossman 7aadc83ddf Adds link vertex get/set functions to the API 2019-10-29 16:33:40 -04:00
Lew Rossman b640a8685c Adds EN_getresultindex function to the API
See issue #546 . Also fixes a small bug in project.c.
2019-10-26 11:25:09 -04:00
Lew Rossman 38278f7d46 Fixed use of strncpy in xstrcpy() 2019-09-30 15:51:17 -04:00
Lew Rossman 3300ef00cb getTmpName() and xstrcpy() made safer 2019-09-30 14:05:38 -04:00
Lew Rossman f2ef979d95 Removed dependence on unistd.h in project.c
Travis CI failed because system could not find unistd.h.
2019-09-26 11:18:39 -04:00
Lew Rossman da1253f4ea Fixes bugs in pump and demand head loss gradients 2019-09-26 11:01:01 -04:00
Sam Hatchett 647abd71c1 fixes mkstemp file handle-leaking behavior (#529) 2019-09-25 10:47:38 -04:00
Lew Rossman 40c39fd3c6 Fixes problem with findpattern() function (issue #498) 2019-05-24 10:33:36 -04:00
Lew Rossman c9b836973e Removes _DEBUG directives from all source files
This commit removes the #ifdef _DEBUG statements at the top of all source code files per issue #482. It also updates the doc files to stress that the speedup observed for hydraulic analysis with the MMD node re-ordering method only applies to single period runs.
2019-05-13 23:49:19 -04:00
Lew Rossman 365ab00dcb Refactors the API's demand editing functions 2019-05-09 10:26:40 -04:00
Michael Tryby cf97cf8c9c Work in progress
code cleanup, addressed issue raised in review, and implemented EN_adddemand()
2019-04-23 17:52:11 -04:00
Michael Tryby 5d3eeb91d9 Reverted handling of default pattern
When creating demands, no pattern is marked with a zero. Then when data is adjusted it gets updated to default.
2019-04-23 11:44:02 -04:00
michaeltryby f19d43d3a4 Merge branch 'dev' of https://github.com/OpenWaterAnalytics/EPANET into dev-list 2019-04-22 13:36:44 -04:00
Lew Rossman d985a69248 Refactored xstrcpy function 2019-04-20 11:54:33 -04:00
Michael Tryby e9650d2d6d Work in progress
Fixing memory leaks
Unit tests passing
2019-04-19 21:21:58 -04:00
Lew Rossman a4ac34d5d6 Updated criteria for valid object ID name 2019-04-18 17:12:56 -04:00
Michael Tryby bf519fdd94 Work in progress
Fixing problems when demand lists are null
2019-04-18 14:24:30 -04:00
Lew Rossman 1583bea154 Return object index from EN_addnode and EN_addlink (issue #432)
Adds an output argument to EN_addnode and EN_addlink that returns the index of the newly added object.
Also refactors the validity check on object ID names.
2019-04-18 07:00:07 -04:00
Michael Tryby 109276e379 Work in progress
Implementing generic demand pattern lists. Compiles but does not run.
2019-04-17 17:24:34 -04:00
Michael Tryby 9c4665a661 Fixes memory leak in EN_addnode() (#455)
* Fixing memory leak in EN_addnode()

* Separating test_net_builder from test_toolkit

Making test_net_builder a standalone test

* Removing BOOST_TEST_MAIN

* Work in progress
2019-04-11 18:04:20 -04:00
Lew Rossman edcd4b69c7 Eliminates use of temporary linked lists to process Patterns & Curves (issue #449) 2019-04-05 13:02:39 -04:00