Add option to get pump's constant power and speed

Details in #215
This commit is contained in:
Elad Salomons
2018-08-18 21:54:52 +03:00
parent 99e7151172
commit 634651d4e6
3 changed files with 23 additions and 1 deletions

View File

@@ -57,6 +57,8 @@ Public Const EN_HEADCURVE = 17
Public Const EN_EFFICIENCYCURVE = 18
Public Const EN_PRICEPATTERN = 19
Public Const EN_STATE = 20
Public Const EN_CONST_POWER = 21
Public Const EN_SPEED = 22
Public Const EN_DURATION = 0 ' Time parameters
Public Const EN_HYDSTEP = 1

View File

@@ -116,7 +116,9 @@ typedef enum {
EN_HEADCURVE = 17,
EN_EFFICIENCYCURVE = 18,
EN_PRICEPATTERN = 19,
EN_STATE = 20
EN_STATE = 20,
EN_CONST_POWER = 21,
EN_SPEED = 22
} EN_LinkProperty;
/// Time parameter codes

View File

@@ -2137,6 +2137,24 @@ int DLLEXPORT EN_getlinkvalue(EN_Project *p, int index, EN_LinkProperty code, EN
}
}
break;
case EN_CONST_POWER:
v = 0;
if (Link[index].Type == EN_PUMP) {
pmp = findpump(net, index);
if (Pump[pmp].Ptype == CONST_HP) {
v = Link[index].Km; // Power in HP
}
}
break;
case EN_SPEED:
v = 0;
if (Link[index].Type == EN_PUMP) {
pmp = findpump(net, index);
v = Link[index].Kc;
}
break;
case EN_SETTING:
if (Link[index].Type == EN_PIPE || Link[index].Type == EN_CVPIPE) {