Skip to content

Commit

Permalink
Added option to retrieve the pumps price pattern
Browse files Browse the repository at this point in the history
Added to ENgetlinkvalue function like the speed\status pattern. use the
new EN_PRICEPATTERN constant.
  • Loading branch information
eladsal committed Apr 13, 2017
1 parent 8d96873 commit 8ab0f06
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/epanet2.bas
Expand Up @@ -53,6 +53,7 @@ Global Const EN_ENERGY = 13
Global Const EN_LINKQUAL = 14 'ES
Global Const EN_LINKPATTERN = 15
Global Const EN_EFFICIENCY = 16
Global Const EN_PRICEPATTERN = 17

Global Const EN_DURATION = 0 ' Time parameters
Global Const EN_HYDSTEP = 1
Expand Down
3 changes: 2 additions & 1 deletion include/epanet2.h
Expand Up @@ -111,7 +111,8 @@ typedef enum {
EN_ENERGY = 13,
EN_LINKQUAL = 14,
EN_LINKPATTERN = 15,
EN_EFFICIENCY = 16
EN_EFFICIENCY = 16,
EN_PRICEPATTERN = 17
} EN_LinkProperty;

/// Time parameter codes
Expand Down
1 change: 1 addition & 0 deletions include/epanet2.vb
Expand Up @@ -57,6 +57,7 @@ Public Const EN_ENERGY = 13
Public Const EN_LINKQUAL = 14 'ES
Public Const EN_LINKPATTERN = 15
Public Const EN_EFFICIENCY = 16
Public Const EN_PRICEPATTERN = 17

Public Const EN_DURATION = 0 ' Time parameters
Public Const EN_HYDSTEP = 1
Expand Down
5 changes: 5 additions & 0 deletions src/epanet.c
Expand Up @@ -1460,6 +1460,11 @@ int DLLEXPORT ENgetlinkvalue(int index, int code, EN_API_FLOAT_TYPE *value)
v = (double)Pump[PUMPINDEX(index)].Upat;
break;

case EN_PRICEPATTERN:
if (Link[index].Type == PUMP)
v = (double)Pump[PUMPINDEX(index)].Epat;
break;

case EN_EFFICIENCY:
getenergy(index, &a, &v);
break;
Expand Down

0 comments on commit 8ab0f06

Please sign in to comment.