Add emitter backflow option

Adds a global hydraulic option to allow backflow or not through emitter elements. To maintain backward compatibility the default is YES.
This commit is contained in:
Lew Rossman
2023-02-05 15:16:20 -05:00
parent 9814564e29
commit 847fa82139
13 changed files with 55 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 08/13/2022
Last Updated: 02/05/2023
******************************************************************************
*/
@@ -1205,6 +1205,9 @@ int DLLEXPORT EN_getoption(EN_Project p, int option, double *value)
case EN_DEMANDPATTERN:
v = hyd->DefPat;
break;
case EN_EMITBACKFLOW:
v = hyd->EmitBackFlag;
break;
default:
return 251;
}
@@ -1367,6 +1370,11 @@ int DLLEXPORT EN_setoption(EN_Project p, int option, double value)
hyd->DefPat = pat;
break;
case EN_EMITBACKFLOW:
if (value == 0.0 || value == 1.0) hyd->EmitBackFlag = (int)value;
else return 213;
break;
default:
return 251;
}