fixed the getstatistic api call -- should return floattype by ref
This commit is contained in:
@@ -1248,7 +1248,7 @@ int DLLEXPORT ENgeterror(int errcode, char *errmsg, int n)
|
||||
else return(0);
|
||||
}
|
||||
|
||||
int DLLEXPORT ENgetstatistic(int code, int* value)
|
||||
int DLLEXPORT ENgetstatistic(int code, EN_API_FLOAT_TYPE* value)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: code = type of simulation statistic to retrieve
|
||||
** Output: value = value of requested statistic
|
||||
@@ -1259,10 +1259,10 @@ int DLLEXPORT ENgetstatistic(int code, int* value)
|
||||
{
|
||||
switch (code) {
|
||||
case EN_ITERATIONS:
|
||||
*value = _iterations;
|
||||
*value = (EN_API_FLOAT_TYPE)_iterations;
|
||||
break;
|
||||
case EN_RELATIVEERROR:
|
||||
*value = _relativeError;
|
||||
*value = (EN_API_FLOAT_TYPE)_relativeError;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1492,7 +1492,7 @@ int DLLEXPORT ENgetnodevalue(int index, int code, EN_API_FLOAT_TYPE *value)
|
||||
v = (Tank[index-Njuncs].Hmin - Node[index].El) * Ucf[ELEV];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case EN_MAXLEVEL:
|
||||
v = 0.0;
|
||||
if ( index > Njuncs )
|
||||
|
||||
@@ -205,7 +205,7 @@ int runhyd(long *t)
|
||||
if (Statflag) writehydstat(iter,relerr);
|
||||
|
||||
/* solution info */
|
||||
_relativeError = (int)relerr;
|
||||
_relativeError = relerr;
|
||||
_iterations = iter;
|
||||
|
||||
/*** Updated 3/1/01 ***/
|
||||
|
||||
@@ -203,6 +203,8 @@ void initqual()
|
||||
Qtime = 0;
|
||||
Rtime = Rstart;
|
||||
Nperiods = 0;
|
||||
|
||||
initsegs();
|
||||
}
|
||||
|
||||
|
||||
@@ -463,12 +465,19 @@ int gethyd(long *hydtime, long *hydstep)
|
||||
{
|
||||
|
||||
/* Compute reaction rate coeffs. */
|
||||
if (Reactflag && Qualflag != AGE) ratecoeffs();
|
||||
|
||||
if (Reactflag && Qualflag != AGE) {
|
||||
ratecoeffs();
|
||||
}
|
||||
|
||||
/* Initialize pipe segments (at time 0) or */
|
||||
/* else re-orient segments if flow reverses.*/
|
||||
if (Qtime == 0) initsegs();
|
||||
else reorientsegs();
|
||||
//if (Qtime == 0)
|
||||
// initsegs();
|
||||
//else
|
||||
if (Qtime != 0) {
|
||||
reorientsegs();
|
||||
}
|
||||
|
||||
}
|
||||
return(errcode);
|
||||
}
|
||||
@@ -784,9 +793,13 @@ void accumulate(long dt)
|
||||
VolIn[j]++;
|
||||
}
|
||||
}
|
||||
for (k=1; k<=Nnodes; k++)
|
||||
if (VolIn[k] > 0.0) XC[k] = MassIn[k]/VolIn[k];
|
||||
|
||||
|
||||
for (k=1; k<=Nnodes; k++) {
|
||||
if (VolIn[k] > 0.0) {
|
||||
XC[k] = MassIn[k]/VolIn[k];
|
||||
}
|
||||
}
|
||||
|
||||
/* Move mass from first segment of each pipe into downstream node */
|
||||
memset(VolIn,0,(Nnodes+1)*sizeof(double));
|
||||
memset(MassIn,0,(Nnodes+1)*sizeof(double));
|
||||
|
||||
@@ -171,7 +171,8 @@ EXTERN Svalve *Valve; /* Valve data */
|
||||
EXTERN Scontrol *Control; /* Control data */
|
||||
EXTERN HTtable *Nht, *Lht; /* Hash tables for ID labels */
|
||||
EXTERN Padjlist *Adjlist; /* Node adjacency lists */
|
||||
EXTERN int _relativeError, _iterations; /* Info about hydraulic solution */
|
||||
EXTERN double _relativeError;
|
||||
EXTERN int _iterations; /* Info about hydraulic solution */
|
||||
|
||||
/*
|
||||
** NOTE: Hydraulic analysis of the pipe network at a given point in time
|
||||
|
||||
Reference in New Issue
Block a user