Updated more float types in function APIs
Updated APIs calls to support EN_API_FLOAT_TYPE and few updates to the DEF file
This commit is contained in:
@@ -78,12 +78,12 @@ EXPORTS
|
|||||||
ENgetrule = _ENgetrule@20
|
ENgetrule = _ENgetrule@20
|
||||||
ENsetrulepriority = _ENsetrulepriority@8
|
ENsetrulepriority = _ENsetrulepriority@8
|
||||||
ENgetpremise = _ENgetpremise@36
|
ENgetpremise = _ENgetpremise@36
|
||||||
ENsetpremise = _ENsetpremise@40
|
ENsetpremise = _ENsetpremise@36
|
||||||
ENsetpremiseindex = _ENsetpremiseindex@12
|
ENsetpremiseindex = _ENsetpremiseindex@12
|
||||||
ENsetpremisestatus = _ENsetpremisestatus@12
|
ENsetpremisestatus = _ENsetpremisestatus@12
|
||||||
ENsetpremisevalue = _ENsetpremisevalue@16
|
ENsetpremisevalue = _ENsetpremisevalue@12
|
||||||
ENgettrueaction = _ENgettrueaction@20
|
ENgettrueaction = _ENgettrueaction@20
|
||||||
ENsettrueaction = _ENsettrueaction@24
|
ENsettrueaction = _ENsettrueaction@20
|
||||||
ENgetfalseaction = _ENgetfalseaction@20
|
ENgetfalseaction = _ENgetfalseaction@20
|
||||||
ENsetfalseaction = _ENsetfalseaction@24
|
ENsetfalseaction = _ENsetfalseaction@20
|
||||||
ENgetruleID = _ENgetruleID@8
|
ENgetruleID = _ENgetruleID@8
|
||||||
@@ -953,7 +953,7 @@ extern "C" {
|
|||||||
@param value The value of the variable to be checked (e.g. 5.5)
|
@param value The value of the variable to be checked (e.g. 5.5)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENsetpremise(int indexRule, int indexPremise, int logop, int object, int indexObj, int variable, int relop, int status, double value);
|
int DLLEXPORT ENsetpremise(int indexRule, int indexPremise, int logop, int object, int indexObj, int variable, int relop, int status, EN_API_FLOAT_TYPE value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Sets the index of an object in a premise of an existing rule-based control.
|
@brief Sets the index of an object in a premise of an existing rule-based control.
|
||||||
@@ -980,7 +980,7 @@ extern "C" {
|
|||||||
@param value The value of the variable to be checked (e.g. 5.5)
|
@param value The value of the variable to be checked (e.g. 5.5)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENsetpremisevalue(int indexRule, int indexPremise, double value);
|
int DLLEXPORT ENsetpremisevalue(int indexRule, int indexPremise, EN_API_FLOAT_TYPE value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Gets the components of a true-action in an existing rule-based control.
|
@brief Gets the components of a true-action in an existing rule-based control.
|
||||||
@@ -991,7 +991,7 @@ extern "C" {
|
|||||||
@param setting The value of the link (e.g. pump speed 0.9)
|
@param setting The value of the link (e.g. pump speed 0.9)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENgettrueaction(int indexRule, int indexAction, int *indexLink, int *status, double *setting);
|
int DLLEXPORT ENgettrueaction(int indexRule, int indexAction, int *indexLink, int *status, EN_API_FLOAT_TYPE *setting);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Sets the components of a true-action in an existing rule-based control.
|
@brief Sets the components of a true-action in an existing rule-based control.
|
||||||
@@ -1002,7 +1002,7 @@ extern "C" {
|
|||||||
@param setting The value of the link (e.g. pump speed 0.9)
|
@param setting The value of the link (e.g. pump speed 0.9)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENsettrueaction(int indexRule, int indexAction, int indexLink, int status, double setting);
|
int DLLEXPORT ENsettrueaction(int indexRule, int indexAction, int indexLink, int status, EN_API_FLOAT_TYPE setting);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Gets the components of a false-action in an existing rule-based control.
|
@brief Gets the components of a false-action in an existing rule-based control.
|
||||||
@@ -1013,7 +1013,7 @@ extern "C" {
|
|||||||
@param setting The value of the link (e.g. pump speed 0.9)
|
@param setting The value of the link (e.g. pump speed 0.9)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENgetfalseaction(int indexRule, int indexAction, int *indexLink, int *status, double *setting);
|
int DLLEXPORT ENgetfalseaction(int indexRule, int indexAction, int *indexLink, int *status, EN_API_FLOAT_TYPE *setting);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Sets the components of a false-action in an existing rule-based control.
|
@brief Sets the components of a false-action in an existing rule-based control.
|
||||||
@@ -1024,7 +1024,7 @@ extern "C" {
|
|||||||
@param setting The value of the link (e.g. pump speed 0.9)
|
@param setting The value of the link (e.g. pump speed 0.9)
|
||||||
@return Error code.
|
@return Error code.
|
||||||
*/
|
*/
|
||||||
int DLLEXPORT ENsetfalseaction(int indexRule, int indexAction, int indexLink, int status,double setting);
|
int DLLEXPORT ENsetfalseaction(int indexRule, int indexAction, int indexLink, int status, EN_API_FLOAT_TYPE setting);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Returns the ID of a rule.
|
@brief Returns the ID of a rule.
|
||||||
|
|||||||
46
src/epanet.c
46
src/epanet.c
@@ -3263,8 +3263,8 @@ int DLLEXPORT ENsetrulepriority(int index, EN_API_FLOAT_TYPE priority)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsetpremise(int indexRule, int indexPremise, int logop, int object, int indexObj, int variable, int relop, int status, double value)
|
int DLLEXPORT ENsetpremise(int indexRule, int indexPremise, int logop, int object, int indexObj, int variable, int relop, int status, EN_API_FLOAT_TYPE value)
|
||||||
{
|
{
|
||||||
int count = 1,error = 0, nPremises, a, b;
|
int count = 1,error = 0, nPremises, a, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Premise *p;
|
struct Premise *p;
|
||||||
@@ -3287,11 +3287,11 @@ int DLLEXPORT ENsetpremise(int indexRule, int indexPremise, int logop, int obje
|
|||||||
p->status = status;
|
p->status = status;
|
||||||
p->value = value;
|
p->value = value;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsetpremiseindex(int indexRule, int indexPremise, int indexObj)
|
int DLLEXPORT ENsetpremiseindex(int indexRule, int indexPremise, int indexObj)
|
||||||
{
|
{
|
||||||
int count = 1,error = 0, nPremises, a, b;
|
int count = 1,error = 0, nPremises, a, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Premise *p;
|
struct Premise *p;
|
||||||
@@ -3308,11 +3308,11 @@ int DLLEXPORT ENsetpremiseindex(int indexRule, int indexPremise, int indexObj)
|
|||||||
}
|
}
|
||||||
p->index = indexObj;
|
p->index = indexObj;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsetpremisestatus(int indexRule, int indexPremise, int status)
|
int DLLEXPORT ENsetpremisestatus(int indexRule, int indexPremise, int status)
|
||||||
{
|
{
|
||||||
int count = 1, error = 0, nPremises, a, b;
|
int count = 1, error = 0, nPremises, a, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Premise *p;
|
struct Premise *p;
|
||||||
@@ -3329,11 +3329,11 @@ int DLLEXPORT ENsetpremisestatus(int indexRule, int indexPremise, int status)
|
|||||||
}
|
}
|
||||||
p->status = status;
|
p->status = status;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsetpremisevalue(int indexRule, int indexPremise, double value)
|
int DLLEXPORT ENsetpremisevalue(int indexRule, int indexPremise, EN_API_FLOAT_TYPE value)
|
||||||
{
|
{
|
||||||
int count = 1,error = 0, nPremises, a, b;
|
int count = 1,error = 0, nPremises, a, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Premise *p;
|
struct Premise *p;
|
||||||
@@ -3350,11 +3350,11 @@ int DLLEXPORT ENsetpremisevalue(int indexRule, int indexPremise, double value)
|
|||||||
}
|
}
|
||||||
p->value = value;
|
p->value = value;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENgettrueaction(int indexRule, int indexAction, int *indexLink, int *status, double *setting)
|
int DLLEXPORT ENgettrueaction(int indexRule, int indexAction, int *indexLink, int *status, EN_API_FLOAT_TYPE *setting)
|
||||||
{
|
{
|
||||||
int count = 1, error = 0, nTrueAction, c, b;
|
int count = 1, error = 0, nTrueAction, c, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Action *a;
|
struct Action *a;
|
||||||
@@ -3373,11 +3373,11 @@ int DLLEXPORT ENgettrueaction(int indexRule, int indexAction, int *indexLink, i
|
|||||||
*status = a->status;
|
*status = a->status;
|
||||||
*setting = a->setting;
|
*setting = a->setting;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsettrueaction(int indexRule, int indexAction, int indexLink, int status,double setting)
|
int DLLEXPORT ENsettrueaction(int indexRule, int indexAction, int indexLink, int status, EN_API_FLOAT_TYPE setting)
|
||||||
{
|
{
|
||||||
int count = 1, error = 0, nTrueAction, c, b;
|
int count = 1, error = 0, nTrueAction, c, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Action *a;
|
struct Action *a;
|
||||||
@@ -3396,11 +3396,11 @@ int DLLEXPORT ENsettrueaction(int indexRule, int indexAction, int indexLink, in
|
|||||||
a->status = status;
|
a->status = status;
|
||||||
a->setting = setting;
|
a->setting = setting;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENgetfalseaction(int indexRule, int indexAction, int *indexLink, int *status, double *setting)
|
int DLLEXPORT ENgetfalseaction(int indexRule, int indexAction, int *indexLink, int *status, EN_API_FLOAT_TYPE *setting)
|
||||||
{
|
{
|
||||||
int count = 1, error = 0, nFalseAction, c, b;
|
int count = 1, error = 0, nFalseAction, c, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Action *a;
|
struct Action *a;
|
||||||
@@ -3419,11 +3419,11 @@ int DLLEXPORT ENgetfalseaction(int indexRule, int indexAction, int *indexLink,
|
|||||||
*status = a->status;
|
*status = a->status;
|
||||||
*setting = a->setting;
|
*setting = a->setting;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DLLEXPORT ENsetfalseaction(int indexRule, int indexAction, int indexLink, int status,double setting)
|
int DLLEXPORT ENsetfalseaction(int indexRule, int indexAction, int indexLink, int status,EN_API_FLOAT_TYPE setting)
|
||||||
{
|
{
|
||||||
int count = 1, error = 0, nFalseAction, c, b;
|
int count = 1, error = 0, nFalseAction, c, b;
|
||||||
EN_API_FLOAT_TYPE priority;
|
EN_API_FLOAT_TYPE priority;
|
||||||
struct Action *a;
|
struct Action *a;
|
||||||
@@ -3447,14 +3447,12 @@ int DLLEXPORT ENsetfalseaction(int indexRule, int indexAction, int indexLink, i
|
|||||||
|
|
||||||
int DLLEXPORT ENgetruleID(int indexRule, char* id)
|
int DLLEXPORT ENgetruleID(int indexRule, char* id)
|
||||||
{
|
{
|
||||||
|
|
||||||
strcpy(id,"");
|
strcpy(id,"");
|
||||||
if (!Openflag) return(102);
|
if (!Openflag) return(102);
|
||||||
if (indexRule < 1 || indexRule > Nrules) return(257);
|
if (indexRule < 1 || indexRule > Nrules) return(257);
|
||||||
strcpy(id,Rule[indexRule].label);
|
strcpy(id,Rule[indexRule].label);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*************************** END OF EPANET.C ***************************/
|
/*************************** END OF EPANET.C ***************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user