Net1.inp have 0 MinorLoss / GUI accepts values zero for MINORLOSS. Similar to the parameter Power of pumps

This commit is contained in:
mariosmsk
2020-06-25 20:11:27 +03:00
parent 9b42b19f56
commit 532f89d14b

View File

@@ -3862,7 +3862,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu
case EN_MINORLOSS:
if (Link[index].Type != PUMP)
{
if (value <= 0.0) return 211;
if (value < 0.0) return 211;
Link[index].Km = 0.02517 * value / SQR(Link[index].Diam) /
SQR(Link[index].Diam);
}
@@ -3953,7 +3953,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu
case EN_PUMP_POWER:
if (Link[index].Type == PUMP)
{
if (value <= 0.0) return 211;
if (value < 0.0) return 211;
pumpIndex = findpump(&p->network, index);
net->Pump[pumpIndex].Ptype = CONST_HP;
net->Pump[pumpIndex].Hcurve = 0;