Adds get/set for default demand pattern to toolkit

This commit is contained in:
Lew Rossman
2022-01-14 08:50:33 -05:00
parent 64f0d15afe
commit afda609223
6 changed files with 22 additions and 14 deletions

View File

@@ -1188,6 +1188,9 @@ int DLLEXPORT EN_getoption(EN_Project p, int option, double *value)
v = qual->Climit * p->Ucf[QUALITY];
break;
case EN_DEMANDPATTERN:
v = hyd->DefPat;
default:
return 251;
}
@@ -1344,6 +1347,12 @@ int DLLEXPORT EN_setoption(EN_Project p, int option, double value)
qual->Climit = value / p->Ucf[QUALITY];
break;
case EN_DEMANDPATTERN:
pat = ROUND(value);
if (pat < 0 || pat > net->Npats) return 205;
hyd->DefPat = pat;
break;
default:
return 251;
}