Added ENgetcurvetype API
Also update curve type on EN_setheadcurveindex. Co-Authored-By: milad ghiami <milad-ghiami@users.noreply.github.com>
This commit is contained in:
19
src/epanet.c
19
src/epanet.c
@@ -435,6 +435,10 @@ int DLLEXPORT ENgetpumptype(int index, int *type) {
|
||||
return EN_getpumptype(_defaultModel, index, type);
|
||||
}
|
||||
|
||||
int DLLEXPORT ENgetcurvetype(int curveindex, int *type) {
|
||||
return EN_getcurvetype(_defaultModel, curveindex, type);
|
||||
}
|
||||
|
||||
int DLLEXPORT ENgetnumdemands(int nodeIndex, int *numDemands) {
|
||||
return EN_getnumdemands(_defaultModel, nodeIndex, numDemands);
|
||||
}
|
||||
@@ -3349,7 +3353,8 @@ int DLLEXPORT EN_setheadcurveindex(EN_Project *p, int index, int curveindex) {
|
||||
pump->Q0 /= Ucf[FLOW];
|
||||
pump->Qmax /= Ucf[FLOW];
|
||||
pump->Hmax /= Ucf[HEAD];
|
||||
|
||||
|
||||
p->network.Curve[curveindex].Type = P_CURVE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -3370,6 +3375,18 @@ int DLLEXPORT EN_getpumptype(EN_Project *p, int index, int *type) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
int DLLEXPORT EN_getcurvetype(EN_Project *p, int curveindex, int *type) {
|
||||
|
||||
EN_Network *net = &p->network;
|
||||
|
||||
if (!p->Openflag)
|
||||
return (102);
|
||||
if (curveindex < 1 || curveindex > net->Ncurves)
|
||||
return (206);
|
||||
*type = net->Curve[curveindex].Type;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------
|
||||
Functions for opening files
|
||||
|
||||
Reference in New Issue
Block a user