fwConfigs
|
Files | |
file | fwDpFunction.ctl |
Configuration object indexes | |
Used to access the configuration object attributes (object of type dyn_anytype). | |
const int | fwDpFunction_OBJ_FUNCTION = 5 |
const int | fwDpFunction_OBJ_PARAM = 6 |
const int | fwDpFunction_OBJ_GLOBAL = 7 |
const int | fwDpFunction_OBJ_TYPE = 8 |
const int | fwDpFunction_OBJ_STAT_TYPE = 9 |
const int | fwDpFunction_OBJ_STAT_INTERVAL = 10 |
const int | fwDpFunction_OBJ_STAT_DELAY = 11 |
const int | fwDpFunction_OBJ_STAT_READ_ARCHIVE = 12 |
Utility functions | |
Used to access the configuration object attributes (object of type dyn_anytype). | |
fwDpFunction_objectInitialize (dyn_mixed &functionObject) | |
int | fwDpFunction_objectExtractType (dyn_mixed functionObject) |
Set/Get functions | |
Used to set/get the dp function settings to/from the dpe. The settings are stored into the settings object. | |
fwDpFunction_deleteMultiple (dyn_string dpes, dyn_string &exceptionInfo) | |
fwDpFunction_deleteMany (dyn_string dpes, dyn_string &exceptionInfo) | |
fwDpFunction_delete (string dpe, dyn_string &exceptionInfo) | |
fwDpFunction_objectSet (string dpe, dyn_mixed functionObject, dyn_string &exceptionInfo, bool runChecks=TRUE) | |
fwDpFunction_objectSetMany (dyn_string &dpes, dyn_mixed &functionObjects, dyn_string &exceptionInfo, bool runChecks=TRUE) | |
fwDpFunction_objectGet (string dpe, bool &configExists, dyn_mixed &functionObject, dyn_string &exceptionInfo) | |
fwDpFunction_objectGetMany (dyn_string &dpes, dyn_bool &configExists, dyn_mixed &functionObjects, dyn_string &exceptionInfo) |
This is a list of variables and functions used by both fwDpFunction DPE Connection and fwDpFunction Statistical
fwDpFunction_delete | ( | string | dpe, |
dyn_string & | exceptionInfo | ||
) |
Deletes the DP function config for the given data point element
dpe | data point element |
exceptionInfo | details of any errors are returned here |
fwDpFunction_deleteMany | ( | dyn_string | dpes, |
dyn_string & | exceptionInfo | ||
) |
Deletes the DP function config for the given data point elements
dpes | list of data point elements |
exceptionInfo | details of any errors are returned here |
fwDpFunction_deleteMultiple | ( | dyn_string | dpes, |
dyn_string & | exceptionInfo | ||
) |
/** Deletes the DP function config for the given data point elements
dpes | list of data point elements |
exceptionInfo | details of any errors are returned here |
int fwDpFunction_objectExtractType | ( | dyn_mixed | functionObject | ) |
Return the type of dp function stored in the dp function object.
functionObject | This object containing the dp function parameters. |
References fwDpFunction_OBJ_TYPE.
fwDpFunction_objectGet | ( | string | dpe, |
bool & | configExists, | ||
dyn_mixed & | functionObject, | ||
dyn_string & | exceptionInfo | ||
) |
Get the dp function settings from a single dpe
dyn_string exc; string dpe; dyn_mixed dpFuncObject; dyn_string functionParams; dyn_string functionGlobals; string functionDefinition; dyn_int statTypes; int intervalS; int delayS; bool readArchive; bool configExists; //dpe containing the dp function dpe = "sys1:dpe1.val"; //get the dp function, store it to the dp function settings object fwDpFunction_objectGet(dpe, configExists, dpFuncObject, exc); //extract the statistical function settings, if it exists if(fwDpFunction_objectIsStatistical(dpFuncObject)) fwDpFunction_objectExtractStatistical(dpFuncObject, functionParams, functionGlobals, functionDefinition, statTypes, intervalS, delayS, readArchive, exc); DebugN( "fwDpFunction_objectGet():", functionParams, functionGlobals, functionDefinition, statTypes, intervalS, delayS, readArchive, exc);
dyn_string exc; string dpe; dyn_mixed dpFuncObject; dyn_string functionParams; dyn_string functionGlobals; string functionDefinition; bool configExists; //dpe containing the dp function dpe = "sys1:dpe1.val"; //get the dp function, store it to the dp function settings object fwDpFunction_objectGet(dpe, configExists, dpFuncObject, exc); //extract the statistical function settings, if it exists if(fwDpFunction_objectIsDpeConnection(dpFuncObject)) fwDpFunction_objectExtractDpeConnection(dpFuncObject, functionParams, functionGlobals, functionDefinition, exc); DebugN( "fwDpFunction_objectGet():", functionParams, functionGlobals, functionDefinition, exc);
dpe | dpe from which to extract dpFunction. |
configExists | True if dp config exists, false if dp config does not exist |
functionObject | Function parameter object to be returend. |
exceptionInfo | Details of any exceptions are returned here |
fwDpFunction_objectGetMany | ( | dyn_string & | dpes, |
dyn_bool & | configExists, | ||
dyn_mixed & | functionObjects, | ||
dyn_string & | exceptionInfo | ||
) |
Get the dp function settings from a list of dpes
dpes | List of dpes from which to extract the dpFunction. Passed as reference only for performance reasons. Not modified. |
configExists | True if dp config exists, false if dp config does not exist |
functionObjects | List of function parameter objects to be returend. |
exceptionInfo | Details of any exceptions are returned here |
fwDpFunction_objectInitialize | ( | dyn_mixed & | functionObject | ) |
Initialize the dp function object with default parameters. This function is not needed if using the functions fwDpFunction_objectCreateStatistical() or fwDpFunction_objectCreateDpeConnection(). By default, the object is initialized as no dp function.
functionObject | This object will contain the dp function parameters with default values. |
References fwDpFunction_OBJ_FUNCTION, fwDpFunction_OBJ_GLOBAL, fwDpFunction_OBJ_PARAM, fwDpFunction_OBJ_STAT_DELAY, fwDpFunction_OBJ_STAT_INTERVAL, fwDpFunction_OBJ_STAT_READ_ARCHIVE, fwDpFunction_OBJ_STAT_TYPE, and fwDpFunction_OBJ_TYPE.
Referenced by fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractDpeConnection(), and fwDpFunction_objectExtractStatistical().
fwDpFunction_objectSet | ( | string | dpe, |
dyn_mixed | functionObject, | ||
dyn_string & | exceptionInfo, | ||
bool | runChecks = TRUE |
||
) |
Set the dp-function object to the dpe
dyn_string exc; string dpe; //func object containing one dpfunc set dyn_mixed dpFuncObject; //dp func parameters dyn_string functionParams; dyn_string functionGlobals; string functionDefinition; dyn_int statTypes; int intervalS; int delayS; bool readArchive; //dp function setting: //parameters p1, p2 dynClear(functionParams); dynAppend(functionParams,"sys1:dp1.val2:_original.._value"); dynAppend(functionParams,"sys1:dp1.val3:_original.._value"); //global parameters g1, g2 dynClear(functionGlobals); dynAppend(functionGlobals,"sys1:dp1.val4:_original.._value"); dynAppend(functionGlobals,"sys1:dp1.val5:_original.._value"); //parameter p1 is a Maximum function, parameter p2 is an Average function dynClear(statTypes); dynAppend(statTypes,SF_MAX); dynAppend(statTypes,SF_AVG); //the function definition using the parameters functionDefinition = "p1+p2+g1+g2"; //time interval intervalS = 3; //delay on first start delayS = 4; //start reading from archive readArchive = true; //create the func object fwDpFunction_objectCreateStatistical( dpFuncObject, functionParams, functionGlobals, functionDefinition, statTypes, intervalS, delayS, readArchive, exc); //dpe where to set the dp function dpe = "sys1:dp1.val"; //set the func object to the dpe fwDpFunction_objectSet(dpe, dpFuncObject, exc, true);
dpe | dpe to be configured with dpFunction. |
functionObject | This object contains the dp function parameters. |
exceptionInfo | Details of any exceptions are returned here |
runChecks | Optional parameter - default TRUE TRUE: Run consistency checks on the input to the function (HIGHLY RECOMMENDED) FALSE: Do not run any checks at all - can result in badly configured or non configured dp functions. Use only for performance reasons. |
fwDpFunction_objectSetMany | ( | dyn_string & | dpes, |
dyn_mixed & | functionObjects, | ||
dyn_string & | exceptionInfo, | ||
bool | runChecks = TRUE |
||
) |
Set the dp-function object to the dpes
dyn_string exc, dpe; //func object containing one dpfunc set dyn_mixed dpFuncObject; //this contains all the func objects dyn_mixed dpFuncObjects; //dp func parameters dyn_string functionParams; dyn_string functionGlobals; string functionDefinition; dyn_int statTypes; int intervalS; int delayS; bool readArchive; //dp function settings for dpe1: //parameters p1, p2 dynClear(functionParams); dynAppend(functionParams,"sys1:dp1.val2:_original.._value"); dynAppend(functionParams,"sys1:dp1.val3:_original.._value"); //global parameters g1, g2 dynClear(functionGlobals); dynAppend(functionGlobals,"sys1:dp1.val4:_original.._value"); dynAppend(functionGlobals,"sys1:dp1.val5:_original.._value"); //parameter p1 is a Maximum function, parameter p2 is an Average function dynClear(statTypes); dynAppend(statTypes,SF_MAX); dynAppend(statTypes,SF_AVG); //the function definition using the parameters functionDefinition = "p1+p2+g1+g2"; //time interval intervalS = 3; //delay on first start delayS = 4; //start reading from archive readArchive = true; //create the func object fwDpFunction_objectCreateStatistical( dpFuncObject, functionParams, functionGlobals, functionDefinition, statTypes, intervalS, delayS, readArchive, exc); //add the func object to the objects array dpFuncObjects[1] = dpFuncObject; //dp function settings for dpe2: //clear temp parameters dynClear(functionParams); dynClear(functionGlobals); dynClear(statTypes); //parameters p1, p2 dynClear(functionParams); dynAppend(functionParams,"sys1:dp2.float2:_original.._value"); dynAppend(functionParams,"sys1:dp2.float3:_original.._value"); //global parameters g1, g2 dynClear(functionGlobals); dynAppend(functionGlobals,"sys1:dp2.float4:_original.._value"); dynAppend(functionGlobals,"sys1:dp2.int1:_original.._value"); //parameter p1 is a Maximum function, parameter p2 is an Average function dynClear(statTypes); dynAppend(statTypes,SF_MAX); dynAppend(statTypes,SF_AVG); //the function definition using the parameters functionDefinition = "p1+p2/(g1-g2)"; //time interval intervalS = 3; //delay on first start delayS = 4; //start reading from archive readArchive = true; //create the func object fwDpFunction_objectCreateStatistical( dpFuncObject, functionParams, functionGlobals, functionDefinition, statTypes, intervalS, delayS, readArchive, exc); //add the second func object to the objects array dpFuncObjects[2] = dpFuncObject; //list of dpes where to set the dp function dpe = makeDynString("sys1:dp1.val", "sys1:dp2.val"); //set the func object array to the dpe array fwDpFunction_objectSetMany(dpe, dpFuncObjects, exc, true);
dpes | List of dpes to be configured with dpFunction. |
functionObjects | List of function parameter objects. Each of this object contains the dp function parameters. The list lenght must be the same length as dpes. Nevertheless, if the length is 1 (i.e. only one configuration), the same configuration is applied to all the dpes. Passed as reference only for performance reasons. Not modified. |
exceptionInfo | Details of any exceptions are returned here |
runChecks | Optional parameter - default TRUE TRUE: Run consistency checks on the input to the function (HIGHLY RECOMMENDED) FALSE: Do not run any checks at all - can result in badly configured or non configured dp functions. Use only for performance reasons. |
const int fwDpFunction_OBJ_FUNCTION = 5 |
Referenced by fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractDpeConnection(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_GLOBAL = 7 |
Referenced by fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractDpeConnection(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_PARAM = 6 |
Compulsory. For Dpe Connection and Statistical. See use example on fwDpFunction_OBJ_objectSet().
Referenced by fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractDpeConnection(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_STAT_DELAY = 11 |
Referenced by fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_STAT_INTERVAL = 10 |
Referenced by fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_STAT_READ_ARCHIVE = 12 |
Referenced by fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_STAT_TYPE = 9 |
Referenced by fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractStatistical(), and fwDpFunction_objectInitialize().
const int fwDpFunction_OBJ_TYPE = 8 |
Referenced by fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectCreateStatistical(), fwDpFunction_objectExtractDpeConnection(), fwDpFunction_objectExtractStatistical(), fwDpFunction_objectExtractType(), fwDpFunction_objectInitialize(), fwDpFunction_objectIsDpeConnection(), and fwDpFunction_objectIsStatistical().