New function clearreport added (see issue #383)
The newly added `gettitle` and `settitle` functions were moved from the Reporting Functions section to the Project (formerly System) Functions section of epanet2.c and epanet.c.
This commit is contained in:
@@ -5,7 +5,7 @@ Attribute VB_Name = "Module1"
|
||||
'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT
|
||||
'(EPANET2.DLL)
|
||||
|
||||
'Last updated on 01/08/2019
|
||||
'Last updated on 02/08/2019
|
||||
|
||||
' These are codes used by the DLL functions
|
||||
Public Const EN_ELEVATION = 0 ' Node parameters
|
||||
@@ -220,11 +220,13 @@ Public Const EN_R_IS_ACTIVE = 3
|
||||
|
||||
'These are the external functions that comprise the DLL
|
||||
|
||||
'System Functions
|
||||
'Project Functions
|
||||
Declare Function ENgetversion Lib "epanet2.dll" (value As Long) As Long
|
||||
Declare Function ENepanet Lib "epanet2.dll" (ByVal inpFile As String, ByVal rptFile As String, ByVal outFile As String, ByVal pviewprog As Any) As Long
|
||||
Declare Function ENinit Lib "epanet2.dll" (ByVal rptFile As String, ByVal outFile As String, ByVal unitsType As Long, ByVal headlossType As Long) As Long
|
||||
Declare Function ENopen Lib "epanet2.dll" (ByVal inpFile As String, ByVal rptFile As String, ByVal outFile As String) As Long
|
||||
Declare Function ENgettitle Lib "epanet2.dll" (ByVal line1 As String, ByVal line2 As String, ByVal line3 As String) As Long
|
||||
Declare Function ENsettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Long
|
||||
Declare Function ENsaveinpfile Lib "epanet2.dll" (ByVal filename As String) As Long
|
||||
Declare Function ENclose Lib "epanet2.dll" () As Long
|
||||
|
||||
@@ -251,14 +253,13 @@ Public Const EN_R_IS_ACTIVE = 3
|
||||
'Reporting Functions
|
||||
Declare Function ENwriteline Lib "epanet2.dll" (ByVal line As String) As Long
|
||||
Declare Function ENreport Lib "epanet2.dll" () As Long
|
||||
Declare Function ENclearreport Lib "epanet2.dll" () As Long
|
||||
Declare Function ENresetreport Lib "epanet2.dll" () As Long
|
||||
Declare Function ENsetreport Lib "epanet2.dll" (ByVal format As String) As Long
|
||||
Declare Function ENsetstatusreport Lib "epanet2.dll" (ByVal level As Long) As Long
|
||||
Declare Function ENgetcount Lib "epanet2.dll" (ByVal object As Long, count As Long) As Long
|
||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal errcode As Long, ByVal errmsg As String, ByVal maxLen As Long) As Long
|
||||
Declare Function ENgetstatistic Lib "epanet2.dll" (ByVal type_ As Long, ByRef value As Single) As Long
|
||||
Declare Function ENgettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Long
|
||||
Declare Function ENsettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Long
|
||||
|
||||
'Analysis Options Functions
|
||||
Declare Function ENgetoption Lib "epanet2.dll" (ByVal option_ As Long, value As Single) As Long
|
||||
|
||||
@@ -7,6 +7,7 @@ EXPORTS
|
||||
ENaddnode = _ENaddnode@8
|
||||
ENaddpattern = _ENaddpattern@4
|
||||
ENaddrule = _ENaddrule@4
|
||||
ENclearreport = _ENclearreport@0
|
||||
ENclose = _ENclose@0
|
||||
ENcloseH = _ENcloseH@0
|
||||
ENcloseQ = _ENcloseQ@0
|
||||
@@ -57,7 +58,8 @@ EXPORTS
|
||||
ENgetruleID = _ENgetruleID@8
|
||||
ENgetstatistic = _ENgetstatistic@8
|
||||
ENgetthenaction = _ENgetthenaction@20
|
||||
ENgettimeparam = _ENgettimeparam@8
|
||||
ENgettimeparam = _ENgettimeparam@8
|
||||
ENgettitle = _ENgettitle@12
|
||||
ENgetversion = _ENgetversion@4
|
||||
ENinit = _ENinit@16
|
||||
ENinitH = _ENinitH@4
|
||||
@@ -106,7 +108,8 @@ EXPORTS
|
||||
ENsetstatusreport = _ENsetstatusreport@4
|
||||
ENsettankdata = _ENsettankdata@32
|
||||
ENsetthenaction = _ENsetthenaction@20
|
||||
ENsettimeparam = _ENsettimeparam@8
|
||||
ENsettimeparam = _ENsettimeparam@8
|
||||
ENsettitle = _ENsettitle@12
|
||||
ENsolveH = _ENsolveH@0
|
||||
ENsolveQ = _ENsolveQ@0
|
||||
ENstepQ = _ENstepQ@4
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 01/08/2019
|
||||
Last Updated: 02/08/2019
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ extern "C" {
|
||||
|
||||
/********************************************************************
|
||||
|
||||
System Functions
|
||||
Project Functions
|
||||
|
||||
********************************************************************/
|
||||
|
||||
@@ -72,6 +72,12 @@ extern "C" {
|
||||
|
||||
int DLLEXPORT ENopen(const char *inpFile, const char *rptFile,
|
||||
const char *outFile);
|
||||
|
||||
int DLLEXPORT ENgettitle(char *line1, char *line2, char *line3);
|
||||
|
||||
int DLLEXPORT ENsettitle(char *line1, char *line2, char *line3);
|
||||
|
||||
int DLLEXPORT ENgetcount(int object, int *count);
|
||||
|
||||
int DLLEXPORT ENsaveinpfile(const char *filename);
|
||||
|
||||
@@ -131,6 +137,8 @@ extern "C" {
|
||||
|
||||
int DLLEXPORT ENreport();
|
||||
|
||||
int DLLEXPORT ENclearreport();
|
||||
|
||||
int DLLEXPORT ENresetreport();
|
||||
|
||||
int DLLEXPORT ENsetreport(char *format);
|
||||
@@ -139,15 +147,10 @@ extern "C" {
|
||||
|
||||
int DLLEXPORT ENgetversion(int *version);
|
||||
|
||||
int DLLEXPORT ENgetcount(int object, int *count);
|
||||
|
||||
int DLLEXPORT ENgeterror(int errcode, char *errmsg, int maxLen);
|
||||
|
||||
int DLLEXPORT ENgetstatistic(int type, EN_API_FLOAT_TYPE* value);
|
||||
|
||||
int DLLEXPORT ENgettitle(char *titleline1, char *titleline2, char *titleline3);
|
||||
|
||||
int DLLEXPORT ENsettitle(char *titleline1, char *titleline2, char *titleline3);
|
||||
|
||||
/********************************************************************
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'Declarations of functions in the EPANET PROGRAMMERs TOOLKIT
|
||||
'(EPANET2.DLL) for use with VB.Net.
|
||||
|
||||
'Last updated on 01/08/2019
|
||||
'Last updated on 02/08/2019
|
||||
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
@@ -225,11 +225,13 @@ Public Const EN_R_IS_ACTIVE = 3
|
||||
|
||||
'These are the external functions that comprise the DLL
|
||||
|
||||
'System Functions
|
||||
'Project Functions
|
||||
Declare Function ENgetversion Lib "epanet2.dll" (value As Int32) As Int32
|
||||
Declare Function ENepanet Lib "epanet2.dll" (ByVal inpFile As String, ByVal rptFile As String, ByVal outFile As String, ByVal pviewprog As Any) As Int32
|
||||
Declare Function ENinit Lib "epanet2.dll" (ByVal rptFile As String, ByVal outFile As String, ByVal unitsType As Int32, ByVal headlossType As Int32) As Int32
|
||||
Declare Function ENopen Lib "epanet2.dll" (ByVal inpFile As String, ByVal rptFile As String, ByVal outFile As String) As Int32
|
||||
Declare Function ENgettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Int32
|
||||
Declare Function ENsettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Int32
|
||||
Declare Function ENsaveinpfile Lib "epanet2.dll" (ByVal filename As String) As Int32
|
||||
Declare Function ENclose Lib "epanet2.dll" () As Int32
|
||||
|
||||
@@ -256,14 +258,13 @@ Public Const EN_R_IS_ACTIVE = 3
|
||||
'Reporting Functions
|
||||
Declare Function ENwriteline Lib "epanet2.dll" (ByVal line As String) As Int32
|
||||
Declare Function ENreport Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENclearreport Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENresetreport Lib "epanet2.dll" () As Int32
|
||||
Declare Function ENsetreport Lib "epanet2.dll" (ByVal format As String) As Int32
|
||||
Declare Function ENsetstatusreport Lib "epanet2.dll" (ByVal level As Int32) As Int32
|
||||
Declare Function ENgetcount Lib "epanet2.dll" (ByVal object As Int32, count As Int32) As Int32
|
||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal errcode As Int32, ByVal errmsg As String, ByVal maxLen As Int32) As Int32
|
||||
Declare Function ENgetstatistic Lib "epanet2.dll" (ByVal type_ As Int32, ByRef value As Single) As Int32
|
||||
Declare Function ENgettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Int32
|
||||
Declare Function ENsettitle Lib "epanet2.dll" (ByVal titleline1 As String, ByVal titleline2 As String, ByVal titleline3 As String) As Int32
|
||||
|
||||
'Analysis Options Functions
|
||||
Declare Function ENgetoption Lib "epanet2.dll" (ByVal option As Int32, value As Single) As Int32
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 01/08/2019
|
||||
Last Updated: 02/08/2019
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef struct Project *EN_Project;
|
||||
|
||||
/********************************************************************
|
||||
|
||||
System Functions
|
||||
Project Functions
|
||||
|
||||
********************************************************************/
|
||||
|
||||
@@ -126,6 +126,33 @@ typedef struct Project *EN_Project;
|
||||
int DLLEXPORT EN_open(EN_Project ph, const char *inpFile, const char *rptFile,
|
||||
const char *outFile);
|
||||
|
||||
/**
|
||||
@brief Retrieves the title lines of the project
|
||||
@param[out] line1 first title line
|
||||
@param[out] line2 second title line
|
||||
@param[out] line3 third title line
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_gettitle(EN_Project ph, char *line1, char *line2, char *line3);
|
||||
|
||||
/**
|
||||
@brief Sets the title lines of the project
|
||||
@param line1 first title line
|
||||
@param line2 second title line
|
||||
@param line3 third title line
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_settitle(EN_Project ph, char *line1, char *line2, char *line3);
|
||||
|
||||
/**
|
||||
@brief Retrieves the number of objects of a given type in a project.
|
||||
@param ph an EPANET project handle.
|
||||
@param object a type of object to count (see @ref EN_CountType)
|
||||
@param[out] count number of objects of the specified type
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_getcount(EN_Project ph, int object, int *count);
|
||||
|
||||
/**
|
||||
@brief Saves a project's data to an EPANET-formatted text file.
|
||||
@param ph an EPANET project handle.
|
||||
@@ -490,6 +517,13 @@ typedef struct Project *EN_Project;
|
||||
*/
|
||||
int DLLEXPORT EN_report(EN_Project ph);
|
||||
|
||||
/**
|
||||
@brief Clears the contents of a project's report file.
|
||||
@param ph an EPANET project handle.
|
||||
@return and error code.
|
||||
*/
|
||||
int DLLEXPORT EN_clearreport(EN_Project ph);
|
||||
|
||||
/**
|
||||
@brief Resets a project's report options to their default values.
|
||||
@param ph an EPANET project handle.
|
||||
@@ -551,15 +585,6 @@ typedef struct Project *EN_Project;
|
||||
*/
|
||||
int DLLEXPORT EN_getversion(int *version);
|
||||
|
||||
/**
|
||||
@brief Retrieves the number of objects of a given type in a project.
|
||||
@param ph an EPANET project handle.
|
||||
@param object a type of object to count (see @ref EN_CountType)
|
||||
@param[out] count number of objects of the specified type
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_getcount(EN_Project ph, int object, int *count);
|
||||
|
||||
/**
|
||||
@brief Returns the text of an error message generated by an error code.
|
||||
@param errcode an error code.
|
||||
@@ -579,24 +604,6 @@ typedef struct Project *EN_Project;
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_getstatistic(EN_Project ph, int type, double* value);
|
||||
|
||||
/**
|
||||
@brief Retrieves the title lines of the project
|
||||
@param[out] titleline1 first title line
|
||||
@param[out] titleline2 second title line
|
||||
@param[out] titleline3 third title line
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_gettitle(EN_Project ph, char *titleline1, char *titleline2, char *titleline3);
|
||||
|
||||
/**
|
||||
@brief Sets the title lines of the project
|
||||
@param titleline1 first title line
|
||||
@param titleline2 second title line
|
||||
@param titleline3 third title line
|
||||
@return an error code
|
||||
*/
|
||||
int DLLEXPORT EN_settitle(EN_Project ph, char *titleline1, char *titleline2, char *titleline3);
|
||||
|
||||
/********************************************************************
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 12/10/2018
|
||||
Last Updated: 02/08/2019
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,8 @@ int EXPORT_PY_API proj_delete(Handle *ph_inout);
|
||||
int EXPORT_PY_API proj_run(Handle ph, const char *input_path, const char *report_path, const char *output_path);
|
||||
int EXPORT_PY_API proj_init(Handle ph, const char *rptFile, const char *outFile, EN_FlowUnits unitsType, EN_HeadLossType headLossType);
|
||||
int EXPORT_PY_API proj_open(Handle ph, const char *inpFile, const char *rptFile, const char *binOutFile);
|
||||
int EXPORT_PY_API proj_gettitle(Handle ph, char *line1, char *line2, char *line3);
|
||||
int EXPORT_PY_API proj_settitle(Handle ph, const char *line1, const char *line2, const char *line3);
|
||||
int EXPORT_PY_API proj_savefile(Handle ph, const char *inpfilename);
|
||||
int EXPORT_PY_API proj_close(Handle ph);
|
||||
|
||||
@@ -60,6 +62,7 @@ int EXPORT_PY_API qual_close(Handle ph);
|
||||
|
||||
int EXPORT_PY_API rprt_writeline(Handle ph, char *line);
|
||||
int EXPORT_PY_API rprt_writeresults(Handle ph);
|
||||
int EXPORT_PY_API rprt_clear(Handle ph);
|
||||
int EXPORT_PY_API rprt_reset(Handle ph);
|
||||
int EXPORT_PY_API rprt_set(Handle ph, char *reportCommand);
|
||||
int EXPORT_PY_API rprt_setlevel(Handle ph, EN_StatusReport code);
|
||||
|
||||
Reference in New Issue
Block a user