fwConfigs
8.4.2
|
Modules | |
fwDpFunction common functions and variables | |
Files | |
file | fwDpFunction.ctl |
Configuration object indexes | |
Used to access the configuration object attributes (object of type dyn_anytype). | |
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_objectCreateStatistical (dyn_mixed &functionObject, dyn_string functionParams, dyn_string functionGlobals, string functionDefinition, dyn_int statTypes, int intervalS, int delayS, bool readArchive, dyn_string &exceptionInfo, bool runChecks=true) | |
fwDpFunction_objectExtractStatistical (dyn_mixed functionObject, dyn_string &functionParams, dyn_string &functionGlobals, string &functionDefinition, dyn_int &statTypes, int &intervalS, int &delayS, bool &readArchive, dyn_string &exceptionInfo) | |
bool | fwDpFunction_objectIsStatistical (dyn_mixed functionObject) |
Define dpFunctions of type statistical. Please refer also to fwDpFunction common functions and variables. For type dpe Connection, refer to fwDpFunction DPE Connection.
The fwDpFunctions library makes use of a configuration object. In order to configure a dpe with a dp function, the configuration setting object must be previously initialized with the dp function parameterization (using utility functions). Such object is then passed to the set function that will make the necessary dpSet.
Statistical functions are partially supported by fwDpFunction. The utility functions allow creating/extracting basic setting of statistical function. For more advanced settings, see their availability using the Configuration object indexes
A function of statistical type can be set in the following way: one should declare a configuration object of type dyn_anytype, then fill it with the dpFunction settings using the function fwDpFunction_objectCreateStatistical(), then set the setting to the dpe using the function fwDpFunction_objectSet().
Example:
A function of statistical type can be retrieved from a dpe in the following way: one should declare a configuration object of type dyn_anytype, then fill it with the dpFunction settings from the dpe using the function fwDpFunction_objectGet(), then extract the settings from the configuration object using the function fwDpFunction_objectExtractStatistical(). Before extracting the settings, it is possible to check that the settings are really of type stiatistical (function fwDpFunction_objectIsStatistical()).
Example:
Functions of statistical type can be set in batch in the following way: one should declare a configuration object of type dyn_anytype (dpFuncObject). This object will be contained in an array of object (one object per dpe), of type dyn_anytype (call it dpFuncObjects). Each dpFuncObject then must be filled with the function fwDpFunction_objectCreateStatistical(), and stored into the array of objects dpFuncObjects. The array of objects is then passed together with the array of dpes to the function fwDpFunction_objectSetMany(). Such procedure is more performing than looping into the dpes with the function fwDpFunction_objectSet().
Example: set 2 dp configs into 2 dpes:
It is also possible to set many dpes with the same dp function settings. In this case, the array of settings objects must contain one only object, at the index 1.
A function of statistical type can be retrieved from a dpe in the following way: one should declare a configuration object of type dyn_anytype, then fill it with the dpFunction settings from the dpe using the function fwDpFunction_objectGet(), then extract the settings from the configuration object using the function fwDpFunction_objectExtractStatistical(). Before extracting the settings, it is possible to check that the settings are really of type dpeConnection (function fwDpFunction_objectIsStatistical()).
Example:
Functions of statistical type can be retrieved in batch. This is more performing than looping into the dpes with the function fwDpFunction_objectGet(). It can be done in the following way: one should declare a configuration object of type dyn_anytype (dpFuncObject). This object will be contained in an array of object (one object per dpe), of type dyn_anytype (call it dpFuncObjects). The array of objects dpFuncObjects then must be filled with the function fwDpFunction_objectGetMany(). The array is the accessed in a loop, getting each element dpFuncObject inside dpFunctionObject. The parameters can be then accessed using fwDpFunction_objectEctractStatistical().
Example: set 2 dp configs into 2 dpes:
fwDpFunction_objectCreateStatistical | ( | dyn_mixed & | functionObject, |
dyn_string | functionParams, | ||
dyn_string | functionGlobals, | ||
string | functionDefinition, | ||
dyn_int | statTypes, | ||
int | intervalS, | ||
int | delayS, | ||
bool | readArchive, | ||
dyn_string & | exceptionInfo, | ||
bool | runChecks = true |
||
) |
Configures the dp function object with statistical parameters See fwDpFunction_objectSet() for an example. For more advanced parametrization, see parameters availability on the Variable Documentation for the availability of the options.
functionObject | This object will contain the dp function parameters. |
functionParams | The list of dp elements to be used as parameters in the dp function. The # of elements must be = to the # of elements in fwDpFunction_OBJ_STAT_TYPE. |
functionGlobals | The list of dp elements to be used as globals in the dp function |
functionDefinition | The dp function is given here (in terms of p's (parameters) and g's (globals)) |
statTypes | Type of stat function (i.e. min, max... see full list on PVSS help, "_dp_fct.._stat_type"). One per parameter. The # of elements must be = to the # of elements in fwDpFunction_OBJ_PARAM. |
intervalS | Time interval of stat function, in seconds |
delayS | Time delay of stat function, in seconds |
readArchive | Read values from archive starting the stat function |
exceptionInfo | Details of any exceptions are returned here |
runChecks | Perform some consistency checks. Optional. Default value = true |
fwDpFunction_objectExtractStatistical | ( | dyn_mixed | functionObject, |
dyn_string & | functionParams, | ||
dyn_string & | functionGlobals, | ||
string & | functionDefinition, | ||
dyn_int & | statTypes, | ||
int & | intervalS, | ||
int & | delayS, | ||
bool & | readArchive, | ||
dyn_string & | exceptionInfo | ||
) |
Reads the dp function object
functionObject | This object will contain the dp function parameters. |
functionParams | The list of dp elements to be used as parameters in the dp function. |
functionGlobals | The list of dp elements to be used as globals in the dp function |
functionDefinition | The dp function is given here (in terms of p's (parameters) and g's (globals)) |
statTypes | Type of stat function (i.e. min, max... see full list on PVSS help, "_dp_fct.._stat_type"). One per parameter (contained in functionParams). |
intervalS | Time interval of stat function, in seconds |
delayS | Time delay of stat function, in seconds |
readArchive | Read values from archive starting the stat function |
exceptionInfo | Details of any exceptions are returned here |
bool fwDpFunction_objectIsStatistical | ( | dyn_mixed | functionObject | ) |
Check wether the configuration object contains statistical function.
functionObject | This object containing the dp function parameters. |
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 |