Merge pull request #750 from OpenWaterAnalytics/dev-trace_node_fix
Fix trace node id parser error
This commit is contained in:
@@ -45,3 +45,4 @@ This document describes the changes and updates that have been made in version 2
|
||||
- `EN_SET_CLOSED` and `EN_SET_OPEN` constants were added that can be used with `EN_setcontrol` to fix the status of pipes and valves to completely closed or completely open.
|
||||
- `EN_EMITTERFLOW` can now be used with `EN_getnodevalue` to retrieve a node's emitter flow rate.
|
||||
- `EN_STATUS_REPORT` can now be used with `EN_getoption` and `EN_setoption` to get or set the type of status report that EPANET will generate (`EN_NO_REPORT`, `EN_NORMAL_REPORT` or `EN_FULL_REPORT`).
|
||||
- A possible parser error that could result in a Trace Node ID in an input file not being recognized was fixed.
|
||||
@@ -3,7 +3,7 @@ unit epanet2;
|
||||
{ Declarations of imported procedures from the EPANET PROGRAMMERs TOOLKIT }
|
||||
{ (EPANET2.DLL) }
|
||||
|
||||
{Last updated on 05/13/2023}
|
||||
{Last updated on 09/11/2023}
|
||||
|
||||
interface
|
||||
|
||||
@@ -12,9 +12,9 @@ const
|
||||
{ These are codes used by the DLL functions }
|
||||
EN_MAXID = 31; { Max. # characters in ID name }
|
||||
EN_MAXMSG = 255; { Max. # characters in strings }
|
||||
EN_MISSING = -1.E10;
|
||||
EN_SET_CLOSED = -1.E10;
|
||||
EN_SET_OPEN = 1.E10;
|
||||
EN_MISSING = -1.0E10;
|
||||
EN_SET_CLOSED = -1.0E10;
|
||||
EN_SET_OPEN = 1.0E10;
|
||||
|
||||
EN_ELEVATION = 0; { Node parameters }
|
||||
EN_BASEDEMAND = 1;
|
||||
@@ -271,7 +271,7 @@ const
|
||||
EN_R_IS_CLOSED = 2;
|
||||
EN_R_IS_ACTIVE = 3;
|
||||
|
||||
{$ifdef WINDOWS}
|
||||
{$ifdef MSWINDOWS}
|
||||
EpanetLib = 'epanet2.dll';
|
||||
{$else}
|
||||
EpanetLib = 'libepanet2.so';
|
||||
|
||||
@@ -7,7 +7,7 @@ Description: parses network data from a line of an EPANET input file
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 02/05/2023
|
||||
Last Updated: 09/11/2023
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -1842,10 +1842,7 @@ int optionchoice(Project *pr, int n)
|
||||
}
|
||||
if (qual->Qualflag == TRACE)
|
||||
{
|
||||
// Copy Trace Node ID to parser->Tok[0] for error reporting
|
||||
strcpy(parser->Tok[0], "");
|
||||
if (n < 2) return 201;
|
||||
strcpy(parser->Tok[0], parser->Tok[2]);
|
||||
qual->TraceNode = findnode(net, parser->Tok[2]);
|
||||
if (qual->TraceNode == 0) return setError(parser, 2, 212);
|
||||
strncpy(qual->ChemName, u_PERCENT, MAXID);
|
||||
|
||||
Reference in New Issue
Block a user