Feature wrapper (#136)
this quite sizable commit does several things, but is primarily focussed on building a toolkit that can run simultaneous simulations/analyses within a shared memory space. Versions <=2.1 use a long list of global variables that prevent multiple instantiations on linux systems without resorting to compilation tricks (like duplicate binaries or similar via static linkage). This version uses a single "Project" pointer to encapsulate the network and analysis data. There are no changes to existing algo implementations other than to accomodate dereferencing of the passed-in pointers. A more detailed list of major changes below: - mirrors all “ENxxxx” function calls with “EN_xxxx” versions (note the underscore) that take an extra first parameter: a pointer to an EN_Project struct, which contains all network, hydraulic, quality, and associated data. - tweaks some code formatting to make it more readable - removes some deprecated/commented code that was sufficiently old - fixes implicit type-cast warnings * Added ENaddnode and ENaddlink functions * More memory reallocations * Added ENInit, ENsetheadcurveindex * Added ENdeletelink and ENdeletenode * restored default behavior for float types * fixed type * Added docstrings for ENinit * cleanup change * moves global rule variables to vars.h * migrates rule structs to typedefs for better readability * char types to proper enums fixes #93 * Change some variable declarations for compatibility Changes to keep compatibility with C89 compilers: variables must be declared at the top of the functions. Remove the use of EN_LinkType in function call as it is not compatible with ENgetnodetype. * Moved declaration of idstodelete to top of function * Updated ENinit function and headers Updated header files with new functions Updated def file with new functions For ENinit changes names of parameters #98 Added enum for headloss formula * Missed these files in 1a033fc * migrates char types to enums fixes #93, supports unified link/node type enums, rather than public/private redefinitions * removing links in reverse-index order maintains proper indexing fixes #96 * style * clarifies curve getter units issue (dox) closes #95 * fixes link/node confusion in ENsetlinktype partially reverts a3bce95dc330a5a297634a303d438e2e1bc41cc9 * partial compilation fix * fixes dox issue * fixes allocation issues with enums - updates style in various places - introduces FlowDirection enum - use snprintf to prevent overflow * fixes enum type cast * updated mac project settings * Use of _snprintf on Windows and remove DLLEXPORT from mempool.h snprintf it not compatible on Windows so we use _snprintf mempool gave starnge compilation errors while removing DLLEXPORT worked. Not sure why these functions needed to be exposed in the DLL? * Revert "Use of _snprintf on Windows and remove DLLEXPORT from mempool.h" This reverts commit 6238f77d47fa0feaabe5836043c006937de433a2. * use of _snprintf instead of snprintf on Windows and removed DLLEXPORT from mempool.h Had compilation errors on mempool.h. Removed DLLEXPORT so solve it. Not sure why there was a need to expose these functions? * Shift indices for Links in ENaddnode Need to shift indices for Links not just Pipes since a pump could be connected directly to a reservoir. Also set the defult base demand to zero (was 5). * Set defualts for madatory link properties in ENaddlink and small fix for ENsetheadcurveindex Relates to #102 and closes #103 * wraps globals into structs, duplicates api functions with objective versions * parse and serialize Comment field for network elements related to #47 * adds getter for head/efficiency curve in EN_getlinkvalue * adds getter for event node index … to return the index of the junction (tank) that triggered the event. * fixes edge case in parsing … where inp files without demands in [JUNCTIONS] and without any [DEMAND] categories will fail. * adds freeing function for project pointer * removes redundant string literals, fixes overrun issue in error message getter function * check for hydraulics already closed * moving error definitions to data file * deprecates ENR err message getter (unused) * updates location of errors data file also begins to expose blind structs to curves and patterns, anticipating buildout of APIs for those. * updates CLI output to reflect executable name as invoked relates to #109 * Feature nrtest (#131) * Initial commit EPANET testing tools. * Initial commit for epanet-nrtestsuite * SWIG wrapper for EPANET outputapi (#118) * Removed pervious version of outputapi and wrapper * SWIG wrapper for EPANET outputapi * Patching cmake build script fixed target for outputapi * Build failing on deprecated test script * Minor changes. Responding to review comments. * Feature nrtest (#121) * Configured python setup to automatically build nrtest tools. * Working on build / testing automation * Adding EPANET 2.0.12 benchmark * Updated Travis yml to run nrtest * Fixing InsecurePlatformWarning * Fixing InsecurePlatformWarning again * Fixing InsecurePlatformWarning * Fixing InsecurePlatformWarning * Fixing InsecurePlatformWarning * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Working on configuring python environment and building test tools under Travis CI. * Making gen-config.sh and run-nrtest.sh executable * Debugging .travis.yml * Debugging .travis.yml * Debugging .travis.yml again * Debugging .travis.yml again * debugging travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * debugging Travis setup * Fixing bug with __strncpy_chk destlen < len * nrtesting clean up * re-implements fixes from:5eead5ae403c788567a4* removes extraneous build files, moves cmake and updates travis * mirror of 9b37035560f9683f1514b439f7586a5c17bca5bf * Move some variable declarations * More variable declarations * Fix TmpDir * Allocate _defaultModel * Fix EN_addcurve funcrion * Fix for inpfile * Fix writeRuleinInp call * Set MAXMSG to 79 chars * Fix for flow direction * Refactoring testing related python packages and SWIG wrapper bug fix (#139) * Eliminated epanet-reader package. Removed numpy dependency from epanet-output. Fixed reference counting bug in SWIG wrapper. Added error checking to run_nrtest.sh. Added nrtest package to requirements file. * changing buildhome directory * Fixing bug related to preprocessor definition of PI
This commit is contained in:
75
src/errors.dat
Normal file
75
src/errors.dat
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
DAT(0,EN_OK,"ok")
|
||||
DAT(101,ENERR_INSUF_MEM,"insufficient memory available")
|
||||
DAT(102,ENERR_NO_NET_DATA,"no network data available")
|
||||
DAT(103,ENERR_HYD_NOT_INIT,"hydraulics not initialized")
|
||||
DAT(104,ENERR_NO_HYD,"no hydraulics for water quality analysis")
|
||||
DAT(105,ENERR_WQ_NOT_INIT,"water quality not initialized")
|
||||
DAT(106,ENERR_NO_RESULT,"no results saved to report on")
|
||||
DAT(107,ENERR_HYD_EXT_FILE,"hydraulics supplied from external file")
|
||||
DAT(108,ENERR_CANT_USE_EXT_FILE,"cannot use external file while hydraulics solver is active")
|
||||
DAT(109,ENERR_CANT_CHANGE_TIME_PARAM,"cannot change time parameter when solver is active")
|
||||
DAT(110,ENERR_CANT_SOLVE_HYD,"cannot solve network hydraulic equations")
|
||||
DAT(120,ENERR_CANT_SOLVE_WQ,"cannot solve water quality transport equations")
|
||||
|
||||
DAT(200,ENERR_INP_ERR,"one or more errors in input file")
|
||||
DAT(201,ENERR_SYNTAX_LINE,"syntax error in following line of section")
|
||||
DAT(202,ENERR_ILLEGAL_NUM,"function call contains illegal numeric value")
|
||||
DAT(203,ENERR_UNDEF_NODE,"function call refers to undefined node")
|
||||
DAT(204,ENERR_UNDEF_LINK,"function call refers to undefined link")
|
||||
DAT(205,ENERR_UNDEF_PAT,"function call refers to undefined time pattern")
|
||||
DAT(206,ENERR_UNDEF_CURVE,"function call refers to undefined curve")
|
||||
DAT(207,ENERR_CANT_CONTROL_CV,"function call attempts to control a CV")
|
||||
|
||||
DAT(208,ENERR_SPEC_UNDEF_NODE,"undefined Node")
|
||||
DAT(209,ENERR_ILLEGAL_VAL_NODE,"illegal value for Node")
|
||||
DAT(210,ENERR_SPEC_UNDEF_LINK,"specified for undefined Link")
|
||||
DAT(211,ENERR_ILLEGAL_VAL_LINK,"illegal value for Link")
|
||||
DAT(212,ENERR_TRACE_NODE,"trace node")
|
||||
DAT(213,ENERR_ILLEGAL_OPT,"illegal option value in section")
|
||||
DAT(214,ENERR_TOO_MANY_CHAR,"following line of section contains too many characters")
|
||||
DAT(215,ENERR_DUPLICATE_ID,"duplicate ID")
|
||||
DAT(216,ENERR_UNDEF_PUMP,"data specified for undefined Pump")
|
||||
DAT(217,ENERR_INVALID_DATA_PUMP,"invalid data for Pump")
|
||||
DAT(219,ENERR_ILLEGAL_CON_TANK,"illegally connected to a tank")
|
||||
DAT(220,ENERR_ILLEGAL_CON_VALVE,"illegally connected to another valve")
|
||||
|
||||
DAT(222,ENERR_SAME_START_END,"same start and end nodes")
|
||||
|
||||
DAT(223,ENERR_NOT_ENOUGH_NODES,"not enough nodes in network")
|
||||
DAT(224,ENERR_NO_TANKS_RES,"no tanks or reservoirs in network")
|
||||
DAT(225,ENERR_INVALID_LEVELS,"invalid lower/upper levels for Tank")
|
||||
DAT(226,ENERR_NO_HEAD_CURVE,"no head curve supplied for Pump")
|
||||
DAT(227,ENERR_INVALID_HEAD_CURVE,"invalid head curve for Pump")
|
||||
DAT(230,ENERR_X_NONINCREASING,"Curve has nonincreasing x-values")
|
||||
DAT(233,ENERR_NODE_UNCONNECTED,"Node is unconnected")
|
||||
DAT(240,ENERR_UNDEF_SOURCE,"undefined source")
|
||||
DAT(241,ENERR_UNDEF_CONTROL,"refers to undefined control")
|
||||
DAT(250,ENERR_INVALID_FORMAT,"function call contains invalid format")
|
||||
DAT(251,ENERR_INVALID_CODE,"function call contains invalid parameter code")
|
||||
|
||||
DAT(253,ENERR_NO_DEMAND_CAT,"Function call error - No such demand category index")
|
||||
DAT(254,ENERR_NO_COORDS,"Function call error - Node have no coordinates")
|
||||
DAT(255,ENERR_COORDS_NOT_LOADED,"Function call error - Coordinates were not loaded")
|
||||
|
||||
DAT(257,ENERR_NO_RULE,"rule does not exist")
|
||||
DAT(258,ENERR_NO_CONDITION_ACTION,"condition or action index specified in rule does not exist")
|
||||
|
||||
DAT(301,ENERR_FILES_ARE_SAME,"identical file names")
|
||||
DAT(302,ENERR_CANT_OPEN_INP,"cannot open input file")
|
||||
DAT(303,ENERR_CANT_OPEN_RPT,"cannot open report file")
|
||||
DAT(304,ENERR_CANT_OPEN_BIN,"cannot open binary output file")
|
||||
DAT(305,ENERR_CANT_OPEN_HYD,"cannot open hydraulics file")
|
||||
DAT(306,ENERR_HYD_FILE_NOMATCH,"hydraulics file does not match network data")
|
||||
DAT(307,ENERR_CANT_READ_HYD,"cannot read hydraulics file")
|
||||
DAT(308,ENERR_CANT_SAVE_RES,"cannot save results to file")
|
||||
DAT(309,ENERR_CANT_SAVE_RPT,"cannot save results to report file")
|
||||
|
||||
DAT(401,ENERR_QSTEP_NOT_DIVISIBLE,"Qstep is not dividable by Hstep")
|
||||
|
||||
|
||||
DAT(411,ENERR_NO_MEM_ALLOC,"no memory allocated for results")
|
||||
DAT(412,ENERR_NO_RESULTS_NO_FILE,"no results; binary file hasn't been opened")
|
||||
DAT(435,ENERR_RUN_TERMINATED,"run terminated; no results in binary file")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user