Commit Graph

587 Commits

Author SHA1 Message Date
0tkl
434cd68a23 fix potential deref of a null pointer 2023-08-05 01:20:09 +08:00
Lew Rossman
353ba4eb34 Allow API to get/set type of status report
The existing EN_setstatusreport function only allows one to set the level of status reporting and not retrieve this value. A new EN_STATUS_REPORT constant was added, to be used with EN_setoption and EN_getoption, to provide read/write access to the level of status reporting.
2023-07-19 09:15:25 -04:00
Lew Rossman
3acfb6dae3 Added retrieval of emitter flow to the API 2023-07-06 15:35:30 -04: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
james uber
7ae9c28e1a setlinkvalue missing a break statement 2023-04-15 12:57:01 -04:00
Lew Rossman
583cca01ca Merge pull request #721 from OpenWaterAnalytics/dev-PDA-coeffs
Use barrier functions for PDA & emitters
2023-04-15 11:01:08 -04:00
Luke Butler
9cde32080a added function updateruleunits 2023-03-30 16:22:58 -04:00
Lew Rossman
9c79a65171 Use barrier functions for PDA & emitters
Uses continuous barrier functions to constrain PDA demands and emitter flows to allowable values (see J. Hydroinformatics, 24:697, 2022).
2023-03-29 10:35:14 -04:00
Luke Butler
6bc1efaf1c Check pressure units in metric are not set to PSI 2023-03-16 16:21:55 -04:00
Luke Butler
4beebbd470 Add EN_PRESS_UNITS to EN_getoption & EN_setoption 2023-03-16 16:13:49 -04:00
Luke Butler
8e68b77f61 Updated outfile to support cubic meters/sec 2023-02-20 10:24:11 -05:00
Luke Butler
843f1f4e37 Added support for cubic meters per second (CMS) 2023-02-20 09:43:42 -05:00
Luke Butler
3856a6310d Fixes incorrect hour set with >9 input tokens
If you create a simple control with nine or more input tokens, the logic skips over assigning the hour variable and EPANET will activate the control at hour zero.
2023-02-15 14:46:39 -05:00
Lew Rossman
847fa82139 Add emitter backflow option
Adds a global hydraulic option to allow backflow or not through emitter elements. To maintain backward compatibility the default is YES.
2023-02-05 15:16:20 -05:00
Lew Rossman
869e441fe8 Revise status test for full/empty tanks
Simplifies status check for links connected to full/empty tanks and now includes case where link connects two tanks.
2023-02-03 11:29:05 -05: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
Lew Rossman
f60102105a Ignore errors in coords. read from file
Ignores errors when reading node & link vertex coordinates from an input file. Also when saving a project to an input file, the [DEMANDS] section only includes non-zero demands.
See issues #603 and #174 .
2023-01-26 12:50:26 -05:00
Elad Salomons
e2df3e87ac Adding support for VB
Also supporting C89 compiler.
2023-01-19 20:45:30 +02:00
Sam Hatchett
2705f8adc1 Merge branch 'dev' into 681-request-additional-api-function-for-getting-finer-grained-time-step-information 2023-01-19 11:52:18 -05:00
Sam Hatchett
736f5ebdd4 updates function signatures to use int-casted enum 2023-01-19 09:50:50 -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
Lew Rossman
6ccddb811d Update hydstatus.c 2022-08-08 18:37:07 -04:00
Lew Rossman
2d783041a4 Fix for FCV problem
This update prevents a solution where the computed loss coefficient for a FCV at its flow setting would be less than the user supplied fully opened coefficient.
2022-08-08 18:08:45 -04:00
Sam Hatchett
9b3007ff55 adds projectless function declarations
and fixes non-camelcase convention
2022-08-08 12:02:22 -04:00
Sam Hatchett
b139684164 fixes non-camelcase convention
and adds rich corinthian vintage-style (projectless) function declarations
2022-08-08 11:58:09 -04:00
Lew Rossman
79b4fa45a1 Update hydcoeffs.c
Only an Active PSV needs to preserve connectivity.
2022-08-05 16:59:32 -04:00
Lew Rossman
93389ad1e4 Fix for PRV directly downstream of a PSV 2022-08-03 19:52:01 -04:00
Sam Hatchett
41887e9016 adds client callback API function 2022-07-27 16:37:49 -04:00
Sam Hatchett
5f8ee49fd6 adds an API function to get information about upcoming events 2022-07-27 14:18:50 -04:00
Sam Hatchett
c500cddd6d fixes issue where a string position an underflow (#676)
under some circumstances, like certain input lines that have long comments, the code here can cause an underflow in size_t which casts to a very large integer during comparison and results in the number of tokens being over-reported (max of 40). Most of these tokens are of course garbage. Changing this `len` variable to an integer permits it to be less than zero, thus allowing an exit from the `while` at L665.
2022-06-14 09:36:56 -04:00
Lew Rossman
4d66af19a5 Merge pull request #669 from OpenWaterAnalytics/dev-pump-fix
Modify const. HP pump
2022-04-05 09:15:18 -04:00
Luke Butler
9c0b576182 Fix for GPV controls in EN_saveinpfile
EN_saveinpfile was incorrectly saving the index of the GPV head loss curve inside of a simple control instead of the control status
2022-03-30 23:13:48 -04:00
Lew Rossman
4bdbe6cd78 Modify const. HP pump 2022-03-30 09:22:01 -04:00
Lew Rossman
cecc941d29 Update to force re-check of PR 2022-03-20 09:27:37 -04:00
Lew Rossman
dbd3f6387d Fixes possible integer overflow
Fixes a possible integer overflow when computing time for a tank to fill/empty (issue #666 ). Also fixes issue #642 that failed to set a pump's initial setting to 0 when its initial status was CLOSED.
2022-03-19 13:25:55 -04:00
Lew Rossman
c8a3eadfdf Merge pull request #634 from OpenWaterAnalytics/dev-PDA_mod
Dev pda mod
2022-03-19 08:53:15 -04:00
Lew Rossman
a63f553b5f Adds PDA convergence test 2022-02-14 11:19:00 -05:00
Lew Rossman
070901d6bf Update hydsolver.c 2022-02-14 11:03:22 -05:00
Lew Rossman
f9189d04b4 Updates to default demand pattern fix 2022-01-15 11:21:24 -05:00
Lew Rossman
14de37d0cb Adjust default pattern index after a pattern is deleted 2022-01-14 09:09:32 -05:00
Lew Rossman
afda609223 Adds get/set for default demand pattern to toolkit 2022-01-14 08:50:33 -05:00
Elad Salomons
64f0d15afe Merge pull request #657 from OpenWaterAnalytics/dev-Qualflag_Fix
Removes silent change to WQ option for 0 duration run
2021-09-28 10:09:26 +03:00
Lew Rossman
d552d0c92c Removes silent change to WQ option for 0 duration run 2021-09-25 09:32:20 -04:00
james uber
3be813facb Return MISSING as initial valve setting
If the initial setting is indeed MISSING, that means the status of the valve has been set to OPEN or CLOSED, and the valve is non-functional (until the setting is changed by a control). This change is required to be able to accurately see the initial setting, because the status does not distinguish between open and active valves.
2021-09-23 11:04:19 -04:00
james uber
886a5cf266 Bugfix for En_getaveragepatternvalue()
Fixes a bug where 0 was not considered to be a valid pattern index.
2021-09-08 10:49:57 -04:00
mariosmsk
79b2c4c8ee add new errcode 263 "node is not a tank" 2021-06-26 17:11:33 +03:00
mariosmsk
6728a59e63 node is not a tank 2021-06-26 12:01:19 +03:00