diff --git a/ReleaseNotes2_3.md b/ReleaseNotes2_3.md index 2914e3c..4f27541 100644 --- a/ReleaseNotes2_3.md +++ b/ReleaseNotes2_3.md @@ -43,4 +43,5 @@ This document describes the changes and updates that have been made in version 2 - Errors in node and link vertex coordinates are now ignored when reading an EPANET input file. - Only non-zero demands are now included in the `[DEMANDS]` section of the input file produced by `EN_saveinpfile`. - `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. \ No newline at end of file + - `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`). \ No newline at end of file diff --git a/include/epanet2.bas b/include/epanet2.bas index 113a240..663c732 100644 --- a/include/epanet2.bas +++ b/include/epanet2.bas @@ -5,7 +5,7 @@ Attribute VB_Name = "Module1" 'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT '(EPANET2.DLL) -'Last updated on 05/13/2023 +'Last updated on 07/18/2023 ' These are codes used by the DLL functions Public Const EN_ELEVATION = 0 ' Node parameters @@ -188,6 +188,7 @@ Public Const EN_CONCENLIMIT = 22 Public Const EN_DEMANDPATTERN = 23 Public Const EN_EMITBACKFLOW = 24 Public Const EN_PRESS_UNITS = 25 +Public Const EN_STATUS_REPORT = 26 Public Const EN_LOWLEVEL = 0 ' Control types Public Const EN_HILEVEL = 1 diff --git a/include/epanet2.cs b/include/epanet2.cs index 040a689..0a6fedc 100644 --- a/include/epanet2.cs +++ b/include/epanet2.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; //epanet2.cs[By Oscar Vegas] -//Last updated on 05/13/2023 +//Last updated on 07/18/2023 //Declarations of functions in the EPANET PROGRAMMERs TOOLKIT //(EPANET2.DLL) for use with C# @@ -192,6 +192,7 @@ namespace EpanetCSharpLibrary public const int EN_DEMANDPATTERN = 23; public const int EN_EMITBACKFLOW = 24; public const int EN_PRESS_UNITS = 25; + public const int EN_STATUS_REPORT = 26; public const int EN_LOWLEVEL = 0; //Control types public const int EN_HILEVEL = 1; diff --git a/include/epanet2.pas b/include/epanet2.pas index 934b3d3..31e2cd4 100644 --- a/include/epanet2.pas +++ b/include/epanet2.pas @@ -191,6 +191,8 @@ const EN_CONCENLIMIT = 22; EN_DEMANDPATTERN = 23; EN_EMITBACKFLOW = 24; + EN_PRESS_UNITS = 25; + EN_STATUS_REPORT = 26; EN_LOWLEVEL = 0; { Control types } EN_HILEVEL = 1; diff --git a/include/epanet2.vb b/include/epanet2.vb index 646a8f8..1a6bf11 100644 --- a/include/epanet2.vb +++ b/include/epanet2.vb @@ -4,7 +4,7 @@ 'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT '(EPANET2.DLL) for use with VB.Net. -'Last updated on 05/13/2023 +'Last updated on 07/18/2023 Imports System.Runtime.InteropServices Imports System.Text @@ -183,6 +183,7 @@ Public Const EN_CONCENLIMIT = 22 Public Const EN_DEMANDPATTERN = 23 Public Const EN_EMITBACKFLOW = 24 Public Const EN_PRESS_UNITS = 25 +Public Const EN_STATUS_REPORT = 26 Public Const EN_LOWLEVEL = 0 ' Control types Public Const EN_HILEVEL = 1 diff --git a/include/epanet2_enums.h b/include/epanet2_enums.h index 066becc..dec12f5 100644 --- a/include/epanet2_enums.h +++ b/include/epanet2_enums.h @@ -3,13 +3,13 @@ /* ****************************************************************************** Project: OWA EPANET - Version: 2.2 + Version: 2.3 Module: epanet2_enums.h Description: enumerations of symbolic constants used by the API functions Authors: see AUTHORS Copyright: see AUTHORS License: see LICENSE - Last Updated: 04/28/2023 + Last Updated: 07/17/2023 ****************************************************************************** */ @@ -352,7 +352,8 @@ typedef enum { EN_CONCENLIMIT = 22, //!< Limiting concentration for growth reactions EN_DEMANDPATTERN = 23, //!< Name of default demand pattern EN_EMITBACKFLOW = 24, //!< 1 if emitters can backflow, 0 if not - EN_PRESS_UNITS = 25 //!< Pressure units (see @ref EN_PressUnits) + EN_PRESS_UNITS = 25, //!< Pressure units (see @ref EN_PressUnits) + EN_STATUS_REPORT = 26 //!< Type of status report to produce (see @ref EN_StatusReport) } EN_Option; /// Simple control types @@ -446,7 +447,8 @@ typedef enum { /// Status reporting levels /** These choices specify the level of status reporting written to a project's report -file during a hydraulic analysis. The level is set using the @ref EN_setstatusreport function. +file during a hydraulic analysis. The level is set using the @ref EN_setstatusreport +or the @ref EN_setoption functions. */ typedef enum { EN_NO_REPORT = 0, //!< No status reporting diff --git a/src/epanet.c b/src/epanet.c index 155bb23..a654420 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -1,13 +1,13 @@ /* ****************************************************************************** Project: OWA EPANET - Version: 2.2 + Version: 2.3 Module: epanet.c Description: implementation of EPANET's API functions Authors: see AUTHORS Copyright: see AUTHORS License: see LICENSE - Last Updated: 04/29/2023 + Last Updated: 07/17/2023 ****************************************************************************** */ @@ -1211,6 +1211,9 @@ int DLLEXPORT EN_getoption(EN_Project p, int option, double *value) case EN_PRESS_UNITS: v = (double)p->parser.Pressflag; break; + case EN_STATUS_REPORT: + v = (double)( p->report.Statflag); + break; default: return 251; } @@ -1401,6 +1404,12 @@ int DLLEXPORT EN_setoption(EN_Project p, int option, double value) qcf = Ucf[FLOW] / qfactor; updateruleunits(p, dcf, pcf, hcf, qcf); break; + + case EN_STATUS_REPORT: + i = ROUND(value); + if (i < EN_NO_REPORT || i > EN_FULL_REPORT) return 213; + p->report.Statflag = i; + break; default: return 251; diff --git a/src/types.h b/src/types.h index bdc5c08..ae837ab 100755 --- a/src/types.h +++ b/src/types.h @@ -1,13 +1,13 @@ /* ****************************************************************************** Project: OWA EPANET - Version: 2.2 + Version: 2.3 Module: types.h Description: symbolic constants and data types used throughout EPANET Authors: see AUTHORS Copyright: see AUTHORS License: see LICENSE - Last Updated: 04/29/2023 + Last Updated: 07/17/2023 ****************************************************************************** */ @@ -31,7 +31,7 @@ typedef int INT4; Various constants ---------------------------------------------- */ -#define CODEVERSION 20200 +#define CODEVERSION 20300 #define MAGICNUMBER 516114521 #define ENGINE_VERSION 201 // Used for binary hydraulics file #define EOFMARK 0x1A // Use 0x04 for UNIX systems