Add EN_PRESS_UNITS to EN_getoption & EN_setoption

This commit is contained in:
Luke Butler
2023-03-16 16:13:49 -04:00
parent ffe272462f
commit 4beebbd470
10 changed files with 123 additions and 8 deletions

View File

@@ -1208,6 +1208,9 @@ int DLLEXPORT EN_getoption(EN_Project p, int option, double *value)
case EN_EMITBACKFLOW:
v = hyd->EmitBackFlag;
break;
case EN_PRESS_UNITS:
v = (double)p->parser.Pressflag;
break;
default:
return 251;
}
@@ -1231,7 +1234,7 @@ int DLLEXPORT EN_setoption(EN_Project p, int option, double value)
int Njuncs = net->Njuncs;
double *Ucf = p->Ucf;
int i, j, pat;
int i, j, pat, unit;
double Ke, n, ucf;
if (!p->Openflag) return 102;
@@ -1375,6 +1378,14 @@ int DLLEXPORT EN_setoption(EN_Project p, int option, double value)
else return 213;
break;
case EN_PRESS_UNITS:
unit = ROUND(value);
if (unit < 0 || unit > METERS) return 205;
if (p->parser.Unitsflag == US && unit > PSI) return 0;
p->parser.Pressflag = unit;
initunits(p);
break;
default:
return 251;
}