These functions are used to report simulation results. More...
Functions | |
int | EN_writeline (EN_Project ph, char *line) |
Writes a line of text to a project's report file. More... | |
int | EN_report (EN_Project ph) |
Writes simulation results in a tabular format to a project's report file. More... | |
int | EN_copyreport (EN_Project ph, char *filename) |
Copies the current contents of a project's report file to another file. More... | |
int | EN_clearreport (EN_Project ph) |
Clears the contents of a project's report file. More... | |
int | EN_resetreport (EN_Project ph) |
Resets a project's report options to their default values. More... | |
int | EN_setreport (EN_Project ph, char *format) |
Processes a reporting format command. More... | |
int | EN_setstatusreport (EN_Project ph, int level) |
Sets the level of hydraulic status reporting. More... | |
int | EN_getversion (int *out_version) |
Retrieves the toolkit API version number. More... | |
int | EN_geterror (int errcode, char *out_errmsg, int maxLen) |
Returns the text of an error message generated by an error code. More... | |
int | EN_getstatistic (EN_Project ph, int type, double *out_value) |
Retrieves a particular simulation statistic. More... | |
int | EN_getresultindex (EN_Project ph, int type, int index, int *out_value) |
Retrieves the order in which a node or link appears in an output file. More... | |
These functions are used to report simulation results.
int EN_clearreport | ( | EN_Project | ph | ) |
Clears the contents of a project's report file.
ph | an EPANET project handle. |
int EN_copyreport | ( | EN_Project | ph, |
char * | filename | ||
) |
Copies the current contents of a project's report file to another file.
ph | an EPANET project handle. |
filename | the full path name of the destination file. |
This function allows toolkit clients to retrieve the contents of a project's report file while the project is still open.
int EN_geterror | ( | int | errcode, |
char * | out_errmsg, | ||
int | maxLen | ||
) |
Returns the text of an error message generated by an error code.
errcode | an error code. | |
[out] | out_errmsg | the error message generated by the error code |
maxLen | maximum number of characters that errmsg can hold |
Error message strings should be at least EN_MAXMSG characters in length.
int EN_getresultindex | ( | EN_Project | ph, |
int | type, | ||
int | index, | ||
int * | out_value | ||
) |
Retrieves the order in which a node or link appears in an output file.
ph | an EPANET project handle. | |
type | a type of element (either EN_NODE or EN_LINK). | |
index | the element's current index (starting from 1). | |
[out] | value | the order in which the element's results were written to file. |
If the element does not appear in the file then its result index is 0.
This function can be used to correctly retrieve results from an EPANET binary output file after the order of nodes or links in a network's database has been changed due to editing operations.
int EN_getstatistic | ( | EN_Project | ph, |
int | type, | ||
double * | out_value | ||
) |
Retrieves a particular simulation statistic.
ph | an EPANET project handle. | |
type | the type of statistic to retrieve (see EN_AnalysisStatistic). | |
[out] | value | the value of the statistic. |
int EN_getversion | ( | int * | out_version | ) |
Retrieves the toolkit API version number.
[out] | version | the version of the OWA-EPANET toolkit. |
The version number is to be interpreted with implied decimals, i.e., "20100" == "2(.)01(.)00"
int EN_report | ( | EN_Project | ph | ) |
Writes simulation results in a tabular format to a project's report file.
ph | an EPANET project handle. |
Either a full hydraulic analysis or full hydraulic and water quality analysis must have been run, with results saved to file, before EN_report is called. In the former case, EN_saveH must also be called first to transfer results from the project's intermediate hydraulics file to its output file.
The format of the report is controlled by commands issued with EN_setreport.
int EN_resetreport | ( | EN_Project | ph | ) |
Resets a project's report options to their default values.
ph | an EPANET project handle. |
After calling this function the default reporting options are in effect. These are:
int EN_setreport | ( | EN_Project | ph, |
char * | format | ||
) |
Processes a reporting format command.
ph | an EPANET project handle. |
format | a report formatting command. |
Acceptable report formatting commands are described in the [REPORT] section of the Input File topic.
Formatted results of a simulation can be written to a project's report file using the EN_report function.
int EN_setstatusreport | ( | EN_Project | ph, |
int | level | ||
) |
Sets the level of hydraulic status reporting.
ph | an EPANET project handle. |
level | a status reporting level code (see EN_StatusReport). |
Status reporting writes changes in the hydraulics status of network elements to a project's report file as a hydraulic simulation unfolds. There are three levels of reporting: EN_NO_REPORT (no status reporting), EN_NORMAL_REPORT (normal reporting) EN_FULL_REPORT (full status reporting).
The full status report contains information at each trial of the solution to the system hydraulic equations at each time step of a simulation. It is useful mainly for debugging purposes.
If many hydraulic analyses will be run in the application it is recommended that status reporting be turned off (level = EN_NO_REPORT).
int EN_writeline | ( | EN_Project | ph, |
char * | line | ||
) |
Writes a line of text to a project's report file.
ph | an EPANET project handle. |
line | a text string to write. |