OWA-EPANET Toolkit 2.3
|
Functions | |
int DLLEXPORT | EN_addrule (EN_Project ph, char *rule) |
Adds a new rule-based control to a project. | |
int DLLEXPORT | EN_deleterule (EN_Project ph, int index) |
Deletes an existing rule-based control. | |
int DLLEXPORT | EN_getrule (EN_Project ph, int index, int *out_nPremises, int *out_nThenActions, int *out_nElseActions, double *out_priority) |
Retrieves summary information about a rule-based control. | |
int DLLEXPORT | EN_getruleID (EN_Project ph, int index, char *out_id) |
Gets the ID name of a rule-based control given its index. | |
int DLLEXPORT | EN_getpremise (EN_Project ph, int ruleIndex, int premiseIndex, int *out_logop, int *out_object, int *out_objIndex, int *out_variable, int *out_relop, int *out_status, double *out_value) |
Gets the properties of a premise in a rule-based control. | |
int DLLEXPORT | EN_setpremise (EN_Project ph, int ruleIndex, int premiseIndex, int logop, int object, int objIndex, int variable, int relop, int status, double value) |
Sets the properties of a premise in a rule-based control. | |
int DLLEXPORT | EN_setpremiseindex (EN_Project ph, int ruleIndex, int premiseIndex, int objIndex) |
Sets the index of an object in a premise of a rule-based control. | |
int DLLEXPORT | EN_setpremisestatus (EN_Project ph, int ruleIndex, int premiseIndex, int status) |
Sets the status being compared to in a premise of a rule-based control. | |
int DLLEXPORT | EN_setpremisevalue (EN_Project ph, int ruleIndex, int premiseIndex, double value) |
Sets the value in a premise of a rule-based control. | |
int DLLEXPORT | EN_getthenaction (EN_Project ph, int ruleIndex, int actionIndex, int *out_linkIndex, int *out_status, double *out_setting) |
Gets the properties of a THEN action in a rule-based control. | |
int DLLEXPORT | EN_setthenaction (EN_Project ph, int ruleIndex, int actionIndex, int linkIndex, int status, double setting) |
Sets the properties of a THEN action in a rule-based control. | |
int DLLEXPORT | EN_getelseaction (EN_Project ph, int ruleIndex, int actionIndex, int *out_linkIndex, int *out_status, double *out_setting) |
Gets the properties of an ELSE action in a rule-based control. | |
int DLLEXPORT | EN_setelseaction (EN_Project ph, int ruleIndex, int actionIndex, int linkIndex, int status, double setting) |
Sets the properties of an ELSE action in a rule-based control. | |
int DLLEXPORT | EN_setrulepriority (EN_Project ph, int index, double priority) |
Sets the priority of a rule-based control. | |
int DLLEXPORT | EN_getruleenabled (EN_Project ph, int index, int *out_enabled) |
Gets the enabled status of a rule-based control. | |
int DLLEXPORT | EN_setruleenabled (EN_Project ph, int index, int enabled) |
Sets the enabled status of a rule-based control. | |
These functions are used for working with rule-based controls.
int DLLEXPORT EN_addrule | ( | EN_Project | ph, |
char * | rule ) |
Adds a new rule-based control to a project.
ph | an EPANET project handle. |
rule | text of the rule following the format used in an EPANET input file. |
Consult the [RULES] section of the Input File topic to learn about a rule's format. Each clause of the rule must end with a newline character \n
.
int DLLEXPORT EN_deleterule | ( | EN_Project | ph, |
int | index ) |
Deletes an existing rule-based control.
ph | an EPANET project handle. |
index | the index of the rule to be deleted (starting from 1). |
int DLLEXPORT EN_getelseaction | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | actionIndex, | ||
int * | out_linkIndex, | ||
int * | out_status, | ||
double * | out_setting ) |
Gets the properties of an ELSE action in a rule-based control.
ph | an EPANET project handle. | |
ruleIndex | the rule's index (starting from 1). | |
actionIndex | the index of the ELSE action to retrieve (starting from 1). | |
[out] | out_linkIndex | the index of the link in the action. |
[out] | out_status | the status assigned to the link (see EN_RuleStatus). |
[out] | out_setting | the value assigned to the link's setting. |
int DLLEXPORT EN_getpremise | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | premiseIndex, | ||
int * | out_logop, | ||
int * | out_object, | ||
int * | out_objIndex, | ||
int * | out_variable, | ||
int * | out_relop, | ||
int * | out_status, | ||
double * | out_value ) |
Gets the properties of a premise in a rule-based control.
ph | an EPANET project handle. | |
ruleIndex | the rule's index (starting from 1). | |
premiseIndex | the position of the premise in the rule's list of premises (starting from 1). | |
[out] | out_logop | the premise's logical operator (IF = 1, AND = 2, OR = 3` ). |
[out] | out_object | the type of object the premise refers to (see EN_RuleObject). |
[out] | out_objIndex | the index of the object (e.g. the index of a tank). |
[out] | out_variable | the object's variable being compared (see EN_RuleVariable). |
[out] | out_relop | the premise's comparison operator (see EN_RuleOperator). |
[out] | out_status | the status that the object's status is compared to (see EN_RuleStatus). |
[out] | out_value | the value that the object's variable is compared to. |
int DLLEXPORT EN_getrule | ( | EN_Project | ph, |
int | index, | ||
int * | out_nPremises, | ||
int * | out_nThenActions, | ||
int * | out_nElseActions, | ||
double * | out_priority ) |
Retrieves summary information about a rule-based control.
ph | an EPANET project handle. | |
index | the rule's index (starting from 1). | |
[out] | out_nPremises | number of premises in the rule's IF section. |
[out] | out_nThenActions | number of actions in the rule's THEN section. |
[out] | out_nElseActions | number of actions in the rule's ELSE section. |
[out] | out_priority | the rule's priority value. |
int DLLEXPORT EN_getruleenabled | ( | EN_Project | ph, |
int | index, | ||
int * | out_enabled ) |
Gets the enabled status of a rule-based control.
ph | an EPANET project handle. |
index | the rule's index (starting from 1). |
out_enabled | the rule will be either EN_TRUE=enabled or EN_FALSE=disabled. |
int DLLEXPORT EN_getruleID | ( | EN_Project | ph, |
int | index, | ||
char * | out_id ) |
Gets the ID name of a rule-based control given its index.
ph | an EPANET project handle. | |
index | the rule's index (starting from 1). | |
[out] | out_id | the rule's ID name. |
The ID name must be sized to hold at least EN_MAXID+1 characters.
int DLLEXPORT EN_getthenaction | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | actionIndex, | ||
int * | out_linkIndex, | ||
int * | out_status, | ||
double * | out_setting ) |
Gets the properties of a THEN action in a rule-based control.
ph | an EPANET project handle. | |
ruleIndex | the rule's index (starting from 1). | |
actionIndex | the index of the THEN action to retrieve (starting from 1). | |
[out] | out_linkIndex | the index of the link in the action (starting from 1). |
[out] | out_status | the status assigned to the link (see EN_RuleStatus) |
[out] | out_setting | the value assigned to the link's setting. |
int DLLEXPORT EN_setelseaction | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | actionIndex, | ||
int | linkIndex, | ||
int | status, | ||
double | setting ) |
Sets the properties of an ELSE action in a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (starting from 1). |
actionIndex | the index of the ELSE action being modified (starting from 1). |
linkIndex | the index of the link in the action (starting from 1). |
status | the new status assigned to the link (see EN_RuleStatus) |
setting | the new value assigned to the link's setting. |
int DLLEXPORT EN_setpremise | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | premiseIndex, | ||
int | logop, | ||
int | object, | ||
int | objIndex, | ||
int | variable, | ||
int | relop, | ||
int | status, | ||
double | value ) |
Sets the properties of a premise in a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (starting from 1). |
premiseIndex | the position of the premise in the rule's list of premises. |
logop | the premise's logical operator (IF = 1, AND = 2, OR = 3 ). |
object | the type of object the premise refers to (see EN_RuleObject). |
objIndex | the index of the object (e.g. the index of a tank). |
variable | the object's variable being compared (see EN_RuleVariable). |
relop | the premise's comparison operator (see EN_RuleOperator). |
status | the status that the object's status is compared to (see EN_RuleStatus). |
value | the value that the object's variable is compared to. |
int DLLEXPORT EN_setpremiseindex | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | premiseIndex, | ||
int | objIndex ) |
Sets the index of an object in a premise of a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (starting from 1). |
premiseIndex | the premise's index (starting from 1). |
objIndex | the index of the premise's object (e.g. the index of a tank). |
int DLLEXPORT EN_setpremisestatus | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | premiseIndex, | ||
int | status ) |
Sets the status being compared to in a premise of a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (starting from 1). |
premiseIndex | the premise's index (starting from 1). |
status | the status that the premise's object status is compared to (see EN_RuleStatus). |
int DLLEXPORT EN_setpremisevalue | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | premiseIndex, | ||
double | value ) |
Sets the value in a premise of a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (staring from 1). |
premiseIndex | the premise's index (starting from 1). |
value | The value that the premise's variable is compared to. |
int DLLEXPORT EN_setruleenabled | ( | EN_Project | ph, |
int | index, | ||
int | enabled ) |
Sets the enabled status of a rule-based control.
ph | an EPANET project handle. |
index | the rule's index (starting from 1). |
enabled | set the rule to either EN_TRUE=enabled or EN_FALSE=disabled. |
int DLLEXPORT EN_setrulepriority | ( | EN_Project | ph, |
int | index, | ||
double | priority ) |
Sets the priority of a rule-based control.
ph | an EPANET project handle. |
index | the rule's index (starting from 1). |
priority | the priority value assigned to the rule. |
int DLLEXPORT EN_setthenaction | ( | EN_Project | ph, |
int | ruleIndex, | ||
int | actionIndex, | ||
int | linkIndex, | ||
int | status, | ||
double | setting ) |
Sets the properties of a THEN action in a rule-based control.
ph | an EPANET project handle. |
ruleIndex | the rule's index (starting from 1). |
actionIndex | the index of the THEN action to modify (starting from 1). |
linkIndex | the index of the link in the action. |
status | the new status assigned to the link (see EN_RuleStatus). |
setting | the new value assigned to the link's setting. |