Added support for cubic meters per second (CMS)
This commit is contained in:
@@ -59,7 +59,8 @@ char *RptFlowUnitsTxt[] = {u_CFS,
|
||||
u_LPM,
|
||||
u_MLD,
|
||||
u_CMH,
|
||||
u_CMD};
|
||||
u_CMD,
|
||||
u_CMS};
|
||||
|
||||
char *FlowUnitsTxt[] = {w_CFS,
|
||||
w_GPM,
|
||||
@@ -70,7 +71,8 @@ char *FlowUnitsTxt[] = {w_CFS,
|
||||
w_LPM,
|
||||
w_MLD,
|
||||
w_CMH,
|
||||
w_CMD};
|
||||
w_CMD,
|
||||
w_CMS};
|
||||
|
||||
char *PressUnitsTxt[] = {w_PSI,
|
||||
w_KPA,
|
||||
|
||||
@@ -143,7 +143,7 @@ int DLLEXPORT EN_init(EN_Project p, const char *rptFile, const char *outFile,
|
||||
p->report.Rptflag = 1;
|
||||
|
||||
// Check for valid arguments
|
||||
if (unitsType < 0 || unitsType > CMD) return 251;
|
||||
if (unitsType < 0 || unitsType > CMS) return 251;
|
||||
if (headLossType < 0 || headLossType > CM) return 251;
|
||||
|
||||
// Open files
|
||||
@@ -1427,6 +1427,7 @@ int DLLEXPORT EN_setflowunits(EN_Project p, int units)
|
||||
case MLD:
|
||||
case CMH:
|
||||
case CMD:
|
||||
case CMS:
|
||||
p->parser.Unitsflag = SI;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -254,6 +254,7 @@ void adjustdata(Project *pr)
|
||||
case MLD: // megaliters/day
|
||||
case CMH: // cubic meters/hr
|
||||
case CMD: // cubic meters/day
|
||||
case CMS: // cubic meters/second
|
||||
parser->Unitsflag = SI;
|
||||
break;
|
||||
default:
|
||||
@@ -436,6 +437,7 @@ void initunits(Project *pr)
|
||||
if (parser->Flowflag == MLD) qcf = MLDperCFS;
|
||||
if (parser->Flowflag == CMH) qcf = CMHperCFS;
|
||||
if (parser->Flowflag == CMD) qcf = CMDperCFS;
|
||||
if (parser->Flowflag == CMS) qcf = CMSperCFS;
|
||||
|
||||
hcf = MperFT;
|
||||
if (parser->Pressflag == METERS) pcf = MperFT * hyd->SpGrav;
|
||||
|
||||
@@ -1750,7 +1750,7 @@ int optionchoice(Project *pr, int n)
|
||||
** those listed below, or -1 otherwise
|
||||
** Purpose: processes fixed choice [OPTIONS] data
|
||||
** Formats:
|
||||
** UNITS CFS/GPM/MGD/IMGD/AFD/LPS/LPM/MLD/CMH/CMD/SI
|
||||
** UNITS CFS/GPM/MGD/IMGD/AFD/LPS/LPM/MLD/CMH/CMD/CMS/SI
|
||||
** PRESSURE PSI/KPA/M
|
||||
** HEADLOSS H-W/D-W/C-M
|
||||
** HYDRAULICS USE/SAVE filename
|
||||
@@ -1790,6 +1790,7 @@ int optionchoice(Project *pr, int n)
|
||||
else if (match(parser->Tok[1], w_CMH)) parser->Flowflag = CMH;
|
||||
else if (match(parser->Tok[1], w_CMD)) parser->Flowflag = CMD;
|
||||
else if (match(parser->Tok[1], w_MLD)) parser->Flowflag = MLD;
|
||||
else if (match(parser->Tok[1], w_CMS)) parser->Flowflag = CMS;
|
||||
else if (match(parser->Tok[1], w_SI)) parser->Flowflag = LPS;
|
||||
else return setError(parser, 1, 213);
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#define w_MLD "MLD"
|
||||
#define w_CMH "CMH"
|
||||
#define w_CMD "CMD"
|
||||
#define w_CMS "CMS"
|
||||
#define w_SI "SI"
|
||||
|
||||
#define w_PSI "PSI"
|
||||
@@ -236,6 +237,7 @@
|
||||
#define u_IMGD "Imgd"
|
||||
#define u_LPS "L/s"
|
||||
#define u_LPM "Lpm"
|
||||
#define u_CMS "m3/s"
|
||||
#define u_CMH "m3/h"
|
||||
#define u_CMD "m3/d"
|
||||
#define u_MLD "ML/d"
|
||||
|
||||
@@ -71,6 +71,7 @@ typedef int INT4;
|
||||
#define IMGDperCFS 0.5382
|
||||
#define LPSperCFS 28.317
|
||||
#define LPMperCFS 1699.0
|
||||
#define CMSperCFS 0.028317
|
||||
#define CMHperCFS 101.94
|
||||
#define CMDperCFS 2446.6
|
||||
#define MLDperCFS 2.4466
|
||||
@@ -227,7 +228,8 @@ typedef enum {
|
||||
LPM, // liters per minute
|
||||
MLD, // megaliters per day
|
||||
CMH, // cubic meters per hour
|
||||
CMD // cubic meters per day
|
||||
CMD, // cubic meters per day
|
||||
CMS // cubic meters per second
|
||||
} FlowUnitsType;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user