fixed the getstatistic api call -- should return floattype by ref
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
22322FA41068369500641384 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
22322FA41068369500641384 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
||||||
22322FA51068369500641384 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
22322FA51068369500641384 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
||||||
22322FA61068369500641384 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
22322FA61068369500641384 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
||||||
22322FAA106836BC00641384 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; };
|
22322FAA106836BC00641384 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
2255753F17551234009946B1 /* epanet.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F711068369500641384 /* epanet.c */; };
|
2255753F17551234009946B1 /* epanet.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F711068369500641384 /* epanet.c */; };
|
||||||
2255754017551234009946B1 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F731068369500641384 /* hash.c */; };
|
2255754017551234009946B1 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F731068369500641384 /* hash.c */; };
|
||||||
2255754117551234009946B1 /* hydraul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F751068369500641384 /* hydraul.c */; };
|
2255754117551234009946B1 /* hydraul.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F751068369500641384 /* hydraul.c */; };
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
2255754917551234009946B1 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
2255754917551234009946B1 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
|
||||||
2255754A17551234009946B1 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
2255754A17551234009946B1 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
|
||||||
2255754B17551234009946B1 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
2255754B17551234009946B1 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
|
||||||
|
226537E0179EDEEB00258C60 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -180,6 +181,7 @@
|
|||||||
isa = PBXHeadersBuildPhase;
|
isa = PBXHeadersBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
226537E0179EDEEB00258C60 /* epanet2.h in Headers */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ extern "C" {
|
|||||||
int DLLEXPORT ENgetaveragepatternvalue(int index, EN_API_FLOAT_TYPE *value);
|
int DLLEXPORT ENgetaveragepatternvalue(int index, EN_API_FLOAT_TYPE *value);
|
||||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||||
int DLLEXPORT ENgeterror(int, char *, int);
|
int DLLEXPORT ENgeterror(int, char *, int);
|
||||||
int DLLEXPORT ENgetstatistic(int code, int* value);
|
int DLLEXPORT ENgetstatistic(int code, EN_API_FLOAT_TYPE* value);
|
||||||
|
|
||||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||||
int DLLEXPORT ENgetnodeid(int, char *);
|
int DLLEXPORT ENgetnodeid(int, char *);
|
||||||
|
|||||||
@@ -1248,7 +1248,7 @@ int DLLEXPORT ENgeterror(int errcode, char *errmsg, int n)
|
|||||||
else return(0);
|
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
|
** Input: code = type of simulation statistic to retrieve
|
||||||
** Output: value = value of requested statistic
|
** Output: value = value of requested statistic
|
||||||
@@ -1259,10 +1259,10 @@ int DLLEXPORT ENgetstatistic(int code, int* value)
|
|||||||
{
|
{
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case EN_ITERATIONS:
|
case EN_ITERATIONS:
|
||||||
*value = _iterations;
|
*value = (EN_API_FLOAT_TYPE)_iterations;
|
||||||
break;
|
break;
|
||||||
case EN_RELATIVEERROR:
|
case EN_RELATIVEERROR:
|
||||||
*value = _relativeError;
|
*value = (EN_API_FLOAT_TYPE)_relativeError;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ int runhyd(long *t)
|
|||||||
if (Statflag) writehydstat(iter,relerr);
|
if (Statflag) writehydstat(iter,relerr);
|
||||||
|
|
||||||
/* solution info */
|
/* solution info */
|
||||||
_relativeError = (int)relerr;
|
_relativeError = relerr;
|
||||||
_iterations = iter;
|
_iterations = iter;
|
||||||
|
|
||||||
/*** Updated 3/1/01 ***/
|
/*** Updated 3/1/01 ***/
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ void initqual()
|
|||||||
Qtime = 0;
|
Qtime = 0;
|
||||||
Rtime = Rstart;
|
Rtime = Rstart;
|
||||||
Nperiods = 0;
|
Nperiods = 0;
|
||||||
|
|
||||||
|
initsegs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -463,12 +465,19 @@ int gethyd(long *hydtime, long *hydstep)
|
|||||||
{
|
{
|
||||||
|
|
||||||
/* Compute reaction rate coeffs. */
|
/* Compute reaction rate coeffs. */
|
||||||
if (Reactflag && Qualflag != AGE) ratecoeffs();
|
if (Reactflag && Qualflag != AGE) {
|
||||||
|
ratecoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize pipe segments (at time 0) or */
|
/* Initialize pipe segments (at time 0) or */
|
||||||
/* else re-orient segments if flow reverses.*/
|
/* else re-orient segments if flow reverses.*/
|
||||||
if (Qtime == 0) initsegs();
|
//if (Qtime == 0)
|
||||||
else reorientsegs();
|
// initsegs();
|
||||||
|
//else
|
||||||
|
if (Qtime != 0) {
|
||||||
|
reorientsegs();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return(errcode);
|
return(errcode);
|
||||||
}
|
}
|
||||||
@@ -784,8 +793,12 @@ void accumulate(long dt)
|
|||||||
VolIn[j]++;
|
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 */
|
/* Move mass from first segment of each pipe into downstream node */
|
||||||
memset(VolIn,0,(Nnodes+1)*sizeof(double));
|
memset(VolIn,0,(Nnodes+1)*sizeof(double));
|
||||||
|
|||||||
@@ -171,7 +171,8 @@ EXTERN Svalve *Valve; /* Valve data */
|
|||||||
EXTERN Scontrol *Control; /* Control data */
|
EXTERN Scontrol *Control; /* Control data */
|
||||||
EXTERN HTtable *Nht, *Lht; /* Hash tables for ID labels */
|
EXTERN HTtable *Nht, *Lht; /* Hash tables for ID labels */
|
||||||
EXTERN Padjlist *Adjlist; /* Node adjacency lists */
|
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
|
** NOTE: Hydraulic analysis of the pipe network at a given point in time
|
||||||
|
|||||||
Reference in New Issue
Block a user