Removed writecon function and all calls to it
This commit is contained in:
58
src/epanet.c
58
src/epanet.c
@@ -792,8 +792,8 @@ int DLLEXPORT EN_open(EN_ProjectHandle ph, const char *f1, const char *f2, const
|
|||||||
writelogo(p);
|
writelogo(p);
|
||||||
|
|
||||||
/* Find network size & allocate memory for data */
|
/* Find network size & allocate memory for data */
|
||||||
writecon(FMT02);
|
//// writecon(FMT02);
|
||||||
writewin(p->viewprog, FMT100);
|
//// writewin(p->viewprog, FMT100);
|
||||||
ERRCODE(netsize(p));
|
ERRCODE(netsize(p));
|
||||||
ERRCODE(allocdata(p));
|
ERRCODE(allocdata(p));
|
||||||
|
|
||||||
@@ -920,7 +920,7 @@ int DLLEXPORT EN_solveH(EN_ProjectHandle ph)
|
|||||||
if (!errcode) {
|
if (!errcode) {
|
||||||
/* Initialize hydraulics */
|
/* Initialize hydraulics */
|
||||||
errcode = EN_initH(ph, EN_SAVE);
|
errcode = EN_initH(ph, EN_SAVE);
|
||||||
writecon(FMT14);
|
//// writecon(FMT14);
|
||||||
|
|
||||||
/* Analyze each hydraulic period */
|
/* Analyze each hydraulic period */
|
||||||
if (!errcode)
|
if (!errcode)
|
||||||
@@ -932,7 +932,7 @@ int DLLEXPORT EN_solveH(EN_ProjectHandle ph)
|
|||||||
sprintf(p->Msg, "%-10s",
|
sprintf(p->Msg, "%-10s",
|
||||||
clocktime(p->report.Atime, p->time_options.Htime));
|
clocktime(p->report.Atime, p->time_options.Htime));
|
||||||
|
|
||||||
writecon(p->Msg);
|
//// writecon(p->Msg);
|
||||||
sprintf(p->Msg, FMT101, p->report.Atime);
|
sprintf(p->Msg, FMT101, p->report.Atime);
|
||||||
writewin(p->viewprog, p->Msg);
|
writewin(p->viewprog, p->Msg);
|
||||||
|
|
||||||
@@ -941,14 +941,14 @@ int DLLEXPORT EN_solveH(EN_ProjectHandle ph)
|
|||||||
ERRCODE(EN_runH(ph, &t));
|
ERRCODE(EN_runH(ph, &t));
|
||||||
ERRCODE(EN_nextH(ph, &tstep));
|
ERRCODE(EN_nextH(ph, &tstep));
|
||||||
/*** Updated 6/24/02 ***/
|
/*** Updated 6/24/02 ***/
|
||||||
writecon("\b\b\b\b\b\b\b\b\b\b");
|
//// writecon("\b\b\b\b\b\b\b\b\b\b");
|
||||||
} while (tstep > 0);
|
} while (tstep > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close hydraulics solver */
|
/* Close hydraulics solver */
|
||||||
|
|
||||||
/*** Updated 6/24/02 ***/
|
/*** Updated 6/24/02 ***/
|
||||||
writecon("\b\b\b\b\b\b\b\b ");
|
//// writecon("\b\b\b\b\b\b\b\b ");
|
||||||
|
|
||||||
EN_closeH(ph);
|
EN_closeH(ph);
|
||||||
errcode = MAX(errcode, p->Warnflag);
|
errcode = MAX(errcode, p->Warnflag);
|
||||||
@@ -1190,12 +1190,12 @@ int DLLEXPORT EN_solveQ(EN_ProjectHandle ph) {
|
|||||||
if (!errcode) {
|
if (!errcode) {
|
||||||
/* Initialize WQ */
|
/* Initialize WQ */
|
||||||
errcode = EN_initQ(ph, EN_SAVE);
|
errcode = EN_initQ(ph, EN_SAVE);
|
||||||
if (p->quality.Qualflag)
|
//// if (p->quality.Qualflag)
|
||||||
writecon(FMT15);
|
//// writecon(FMT15);
|
||||||
else {
|
//// else {
|
||||||
writecon(FMT16);
|
//// writecon(FMT16);
|
||||||
writewin(p->viewprog, FMT103);
|
if (!p->quality.Qualflag) writewin(p->viewprog, FMT103);
|
||||||
}
|
//// }
|
||||||
|
|
||||||
/* Analyze each hydraulic period */
|
/* Analyze each hydraulic period */
|
||||||
if (!errcode)
|
if (!errcode)
|
||||||
@@ -1207,7 +1207,7 @@ int DLLEXPORT EN_solveQ(EN_ProjectHandle ph) {
|
|||||||
sprintf(p->Msg, "%-10s",
|
sprintf(p->Msg, "%-10s",
|
||||||
clocktime(p->report.Atime, p->time_options.Htime));
|
clocktime(p->report.Atime, p->time_options.Htime));
|
||||||
|
|
||||||
writecon(p->Msg);
|
//// writecon(p->Msg);
|
||||||
if (p->quality.Qualflag) {
|
if (p->quality.Qualflag) {
|
||||||
sprintf(p->Msg, FMT102, p->report.Atime);
|
sprintf(p->Msg, FMT102, p->report.Atime);
|
||||||
writewin(p->viewprog, p->Msg);
|
writewin(p->viewprog, p->Msg);
|
||||||
@@ -1219,7 +1219,7 @@ int DLLEXPORT EN_solveQ(EN_ProjectHandle ph) {
|
|||||||
ERRCODE(EN_nextQ(ph, &tstep));
|
ERRCODE(EN_nextQ(ph, &tstep));
|
||||||
|
|
||||||
/*** Updated 6/24/02 ***/
|
/*** Updated 6/24/02 ***/
|
||||||
writecon("\b\b\b\b\b\b\b\b\b\b");
|
//// writecon("\b\b\b\b\b\b\b\b\b\b");
|
||||||
|
|
||||||
} while (tstep > 0);
|
} while (tstep > 0);
|
||||||
}
|
}
|
||||||
@@ -1227,7 +1227,7 @@ int DLLEXPORT EN_solveQ(EN_ProjectHandle ph) {
|
|||||||
/* Close WQ solver */
|
/* Close WQ solver */
|
||||||
|
|
||||||
/*** Updated 6/24/02 ***/
|
/*** Updated 6/24/02 ***/
|
||||||
writecon("\b\b\b\b\b\b\b\b ");
|
//// writecon("\b\b\b\b\b\b\b\b ");
|
||||||
EN_closeQ(ph);
|
EN_closeQ(ph);
|
||||||
return set_error(p->error_handle, errcode);
|
return set_error(p->error_handle, errcode);
|
||||||
}
|
}
|
||||||
@@ -4064,20 +4064,20 @@ int openfiles(EN_Project *p, const char *f1, const char *f2, const char *f3)
|
|||||||
/* Check that file names are not identical */
|
/* Check that file names are not identical */
|
||||||
if (strcomp(f1, f2) || strcomp(f1, f3) ||
|
if (strcomp(f1, f2) || strcomp(f1, f3) ||
|
||||||
(strcomp(f2, f3) && (strlen(f2) > 0 || strlen(f3) > 0))) {
|
(strcomp(f2, f3) && (strlen(f2) > 0 || strlen(f3) > 0))) {
|
||||||
writecon(FMT04);
|
//// writecon(FMT04);
|
||||||
return 301;
|
return 301;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to open input and report files */
|
/* Attempt to open input and report files */
|
||||||
if ((par->InFile = fopen(f1, "rt")) == NULL) {
|
if ((par->InFile = fopen(f1, "rt")) == NULL) {
|
||||||
writecon(FMT05);
|
//// writecon(FMT05);
|
||||||
writecon(f1);
|
//// writecon(f1);
|
||||||
return 302;
|
return 302;
|
||||||
}
|
}
|
||||||
if (strlen(f2) == 0)
|
if (strlen(f2) == 0)
|
||||||
rep->RptFile = stdout;
|
rep->RptFile = stdout;
|
||||||
else if ((rep->RptFile = fopen(f2, "wt")) == NULL) {
|
else if ((rep->RptFile = fopen(f2, "wt")) == NULL) {
|
||||||
writecon(FMT06);
|
//// writecon(FMT06);
|
||||||
return 303;
|
return 303;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4208,7 +4208,7 @@ int openoutfile(EN_Project *p)
|
|||||||
if (out->Outflag == SAVE)
|
if (out->Outflag == SAVE)
|
||||||
{
|
{
|
||||||
if ((out->OutFile = fopen(out->OutFname, "w+b")) == NULL) {
|
if ((out->OutFile = fopen(out->OutFname, "w+b")) == NULL) {
|
||||||
writecon(FMT07);
|
//// writecon(FMT07);
|
||||||
errcode = 304;
|
errcode = 304;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4218,7 +4218,7 @@ int openoutfile(EN_Project *p)
|
|||||||
getTmpName(p, out->OutFname);
|
getTmpName(p, out->OutFname);
|
||||||
if ((out->OutFile = fopen(out->OutFname, "w+b")) == NULL)
|
if ((out->OutFile = fopen(out->OutFname, "w+b")) == NULL)
|
||||||
{
|
{
|
||||||
writecon(FMT08);
|
//// writecon(FMT08);
|
||||||
errcode = 304;
|
errcode = 304;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4733,25 +4733,25 @@ void errmsg(EN_Project *p, int errcode)
|
|||||||
{
|
{
|
||||||
if (errcode == 309) /* Report file write error - */
|
if (errcode == 309) /* Report file write error - */
|
||||||
{ /* Do not write msg to file. */
|
{ /* Do not write msg to file. */
|
||||||
writecon("\n ");
|
//// writecon("\n ");
|
||||||
writecon(geterrmsg(errcode,p->Msg));
|
//// writecon(geterrmsg(errcode,p->Msg));
|
||||||
} else if (p->report.RptFile != NULL && p->report.Messageflag) {
|
} else if (p->report.RptFile != NULL && p->report.Messageflag) {
|
||||||
writeline(p, geterrmsg(errcode,p->Msg));
|
writeline(p, geterrmsg(errcode,p->Msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void writecon(const char *s)
|
//void writecon(const char *s)
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
** Input: text string
|
** Input: text string
|
||||||
** Output: none
|
** Output: none
|
||||||
** Purpose: writes string of characters to console
|
** Purpose: writes string of characters to console
|
||||||
**----------------------------------------------------------------
|
**----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
{
|
//{
|
||||||
|
//
|
||||||
fprintf(stdout, "%s", s);
|
// fprintf(stdout, "%s", s);
|
||||||
fflush(stdout);
|
// fflush(stdout);
|
||||||
}
|
//}
|
||||||
|
|
||||||
void writewin(void (*vp)(char *), char *s)
|
void writewin(void (*vp)(char *), char *s)
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ int findvalve(EN_Network *n, int); /* Find valve index from node
|
|||||||
int findpump(EN_Network *n, int); /* Find pump index from node index */ // (AH)
|
int findpump(EN_Network *n, int); /* Find pump index from node index */ // (AH)
|
||||||
char *geterrmsg(int errcode, char *msg); /* Gets text of error message */
|
char *geterrmsg(int errcode, char *msg); /* Gets text of error message */
|
||||||
void errmsg(EN_Project *p, int); /* Reports program error */
|
void errmsg(EN_Project *p, int); /* Reports program error */
|
||||||
void writecon(const char *); /* Writes text to console */
|
////void writecon(const char *); /* Writes text to console */
|
||||||
void writewin(void (*vp)(char *), char *); /* Passes text to calling app */
|
void writewin(void (*vp)(char *), char *); /* Passes text to calling app */
|
||||||
|
|
||||||
/* ------- INPUT1.C --------------------*/
|
/* ------- INPUT1.C --------------------*/
|
||||||
|
|||||||
12
src/report.c
12
src/report.c
@@ -82,8 +82,8 @@ int writereport(EN_Project *pr)
|
|||||||
/* write formatted output to primary report file. */
|
/* write formatted output to primary report file. */
|
||||||
rep->Fprinterr = FALSE;
|
rep->Fprinterr = FALSE;
|
||||||
if (rep->Rptflag && strlen(rep->Rpt2Fname) == 0 && rep->RptFile != NULL) {
|
if (rep->Rptflag && strlen(rep->Rpt2Fname) == 0 && rep->RptFile != NULL) {
|
||||||
writecon(FMT17);
|
//// writecon(FMT17);
|
||||||
writecon(rep->Rpt1Fname);
|
//// writecon(rep->Rpt1Fname);
|
||||||
if (rep->Energyflag)
|
if (rep->Energyflag)
|
||||||
writeenergy(pr);
|
writeenergy(pr);
|
||||||
errcode = writeresults(pr);
|
errcode = writeresults(pr);
|
||||||
@@ -95,8 +95,8 @@ int writereport(EN_Project *pr)
|
|||||||
/* If secondary report file has same name as either input */
|
/* If secondary report file has same name as either input */
|
||||||
/* or primary report file then use primary report file. */
|
/* or primary report file then use primary report file. */
|
||||||
if (strcomp(rep->Rpt2Fname, par->InpFname) || strcomp(rep->Rpt2Fname, rep->Rpt1Fname)) {
|
if (strcomp(rep->Rpt2Fname, par->InpFname) || strcomp(rep->Rpt2Fname, rep->Rpt1Fname)) {
|
||||||
writecon(FMT17);
|
//// writecon(FMT17);
|
||||||
writecon(rep->Rpt1Fname);
|
//// writecon(rep->Rpt1Fname);
|
||||||
if (rep->Energyflag)
|
if (rep->Energyflag)
|
||||||
writeenergy(pr);
|
writeenergy(pr);
|
||||||
errcode = writeresults(pr);
|
errcode = writeresults(pr);
|
||||||
@@ -117,8 +117,8 @@ int writereport(EN_Project *pr)
|
|||||||
/* Write full formatted report to file */
|
/* Write full formatted report to file */
|
||||||
else {
|
else {
|
||||||
rep->Rptflag = 1;
|
rep->Rptflag = 1;
|
||||||
writecon(FMT17);
|
//// writecon(FMT17);
|
||||||
writecon(rep->Rpt2Fname);
|
//// writecon(rep->Rpt2Fname);
|
||||||
writelogo(pr);
|
writelogo(pr);
|
||||||
if (rep->Summaryflag)
|
if (rep->Summaryflag)
|
||||||
writesummary(pr);
|
writesummary(pr);
|
||||||
|
|||||||
Reference in New Issue
Block a user