Replace fixed-sized comment strings with dynamic strings

This commit is contained in:
Lew Rossman
2019-03-17 19:54:51 -04:00
parent c26775314c
commit 18f65eb8b0
17 changed files with 494 additions and 85 deletions

View File

@@ -5,7 +5,7 @@ Attribute VB_Name = "Module1"
'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT
'(EPANET2.DLL)
'Last updated on 02/28/2019
'Last updated on 03/17/2019
' These are codes used by the DLL functions
Public Const EN_ELEVATION = 0 ' Node parameters
@@ -83,6 +83,13 @@ Public Const EN_MAXHEADERROR = 2
Public Const EN_MAXFLOWCHANGE = 3
Public Const EN_MASSBALANCE = 4
Public Const EN_NODE = 0 ' Component types
Public Const EN_LINK = 1
Public Const EN_TIMEPAT = 2
Public Const EN_CURVE = 3
Public Const EN_CONTROL = 4
Public Const EN_RULE = 5
Public Const EN_NODECOUNT = 0 ' Component counts
Public Const EN_TANKCOUNT = 1
Public Const EN_LINKCOUNT = 2

View File

@@ -21,6 +21,7 @@ EXPORTS
ENepanet = _ENepanet@16
ENgetaveragepatternvalue = _ENgetaveragepatternvalue@8
ENgetbasedemand = _ENgetbasedemand@12
ENgetcomment = _ENgetcomment@12
ENgetcontrol = _ENgetcontrol@24
ENgetcoord = _ENgetcoord@12
ENgetcount = _ENgetcount@8
@@ -80,6 +81,7 @@ EXPORTS
ENsavehydfile = _ENsavehydfile@4
ENsaveinpfile = _ENsaveinpfile@4
ENsetbasedemand = _ENsetbasedemand@12
ENsetcomment = _ENsetcomment@12
ENsetcontrol = _ENsetcontrol@24
ENsetcoord = _ENsetcoord@20
ENsetcurve = _ENsetcurve@16

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 02/28/2019
Last Updated: 03/17/2019
******************************************************************************
*/
@@ -77,6 +77,10 @@ extern "C" {
int DLLEXPORT ENsettitle(char *line1, char *line2, char *line3);
int DLLEXPORT ENgetcomment(int object, int index, char *comment);
int DLLEXPORT ENsetcomment(int object, int index, char *comment);
int DLLEXPORT ENgetcount(int object, int *count);
int DLLEXPORT ENsaveinpfile(const char *filename);

View File

@@ -4,7 +4,7 @@
'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT
'(EPANET2.DLL) for use with VB.Net.
'Last updated on 02/28/2019
'Last updated on 03/17/2019
Imports System.Runtime.InteropServices
Imports System.Text
@@ -88,6 +88,13 @@ Public Const EN_MAXHEADERROR = 2
Public Const EN_MAXFLOWCHANGE = 3
Public Const EN_MASSBALANCE = 4
Public Const EN_NODE = 0 ' Component types
Public Const EN_LINK = 1
Public Const EN_TIMEPAT = 2
Public Const EN_CURVE = 3
Public Const EN_CONTROL = 4
Public Const EN_RULE = 5
Public Const EN_NODECOUNT = 0 'Component counts
Public Const EN_TANKCOUNT = 1
Public Const EN_LINKCOUNT = 2

View File

@@ -11,7 +11,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 02/08/2019
Last Updated: 03/17/2019
******************************************************************************
*/
@@ -146,6 +146,26 @@ typedef struct Project *EN_Project;
*/
int DLLEXPORT EN_settitle(EN_Project ph, char *line1, char *line2, char *line3);
/**
@brief Retrieves a descriptive comment assigned to a Node, Link, Pattern or Curve.
@param ph an EPANET project handle.
@param object a type of object (either EN_NODE, EN_LINK, EN_TIMEPAT or EN_CURVE)
@param index the object's index starting from 1
@param[out] comment the comment string assigned to the object
@return an error code
*/
int DLLEXPORT EN_getcomment(EN_Project ph, int object, int index, char *comment);
/**
@brief Assigns a descriptive comment to a Node, Link, Pattern or Curve.
@param ph an EPANET project handle.
@param object a type of object (either EN_NODE, EN_LINK, EN_TIMEPAT or EN_CURVE)
@param index the object's index starting from 1
@param[out] comment the comment string assigned to the object
@return an error code
*/
int DLLEXPORT EN_setcomment(EN_Project ph, int object, int index, char *comment);
/**
@brief Retrieves the number of objects of a given type in a project.
@param ph an EPANET project handle.

View File

@@ -9,7 +9,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 01/14/2019
Last Updated: 03/17/2019
******************************************************************************
*/
@@ -128,6 +128,19 @@ typedef enum {
EN_MASSBALANCE = 4 //!< Cumulative water quality mass balance ratio
} EN_AnalysisStatistic;
/// Types of network objects
/**
A network model is composed of these types of objects.
*/
typedef enum {
EN_NODE = 0, //!< Nodes
EN_LINK = 1, //!< Links
EN_TIMEPAT = 2, //!< Time patterns
EN_CURVE = 3, //!< Data curves
EN_CONTROL = 4, //!< Simple controls
EN_RULE = 5 //!< Control rules
} EN_ObjectType;
/// Types of objects to count
/**
These options tell @ref EN_getcount which type of object to count.