diff --git a/include/epanet2.bas b/include/epanet2.bas index 585d556..497ca1c 100644 --- a/include/epanet2.bas +++ b/include/epanet2.bas @@ -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 diff --git a/include/epanet2.h b/include/epanet2.h index 3b26116..feb8a37 100644 --- a/include/epanet2.h +++ b/include/epanet2.h @@ -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 diff --git a/src/epanet.c b/src/epanet.c index 0fe9b72..aec91b9 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -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) {