sWhat | (String) Specification of what to be returned:
It is possible to enter a list of variables whose values has to be returned: - "a1;" or "a1;a2;a3;" - If an array of variables of the "Data" tab has to be returned.
It is necessary to keep the order of variables on the tab. For example, if the order of variables is a1,a2,a3,... on the tab, then in the parameter it is possible to enter, for example, "a1;a3;" but "a3;a1" is wrong. - "time;" - If an array of the time has to be returned.
Time selection can be changed by entering "time:winter;" and then all time values are returned in the "standard time" otherwise they are in the "local time". - "attr;" - If an array of the record attributes has to be returned.
- "*data;" - Mean all variables except time and attribute ("time;*data;" returns time and all data variables).
- "*;" - Returns time, attribute and all data variables.
It is possible to enter also a function for calculation whose final values has to be returned. The functions can be concatenated by the ; char, for example "avg(a1);min(a1)". The following functions are supported: - "avg(xx)" - The method returns the average value of the xx variable from the values that meet filtering conditions specified by the vFilter filter.
- "avg(xx;weighted)" - The method returns the weighed value of the xx variable from the values that meet filtering conditions specified by the vFilter filter. The weight of the value is here the length of its duration until the time of saving the next value.
- "min(xx)" - The method returns the minimum value of the xx variable from the values that meet filtering conditions specified by the vFilter filter.
- "max(xx)" - The method returns the maximum value of the xx variable from the values that meet filtering conditions specified by the vFilter filter.
- "sum(xx)" - The method returns the sum of all values of the xx variable from the values that meet filtering conditions specified by the vFilter filter.
- "count(xx)" - The method returns the number of values of the xx variable from the values that meet filtering conditions specified by the vFilter filter.
It is possible to enter only the list of variables or function for calculation - but not at the same time. For example, "avg(0);a1" is WRONG. |
---|---|
vFilter | (Variant) Value that defines, for example, the time range of the got data (time from, time to, number of points, etc.), eventually specifies whether the data have to be filtered by the value. It is created by calling the CreateFilter, AddFilter methods.
The value filter (filter for each value added by the AddFilter method) will be applied following way: If the sWhat parameter contains the list of variables, then it could happen that for each variable there would be a different number of lines (different number of stored values). Therefore it is necessary to process "lines intersection" - i.e. select only lines common for all variables. If the sWhat parameter contains the calculation function, then the value filters for each variable will be used only for calculating these variables and will not affect calcualtion of another variables. |
var oTrend = pMe.Pm("/Trends");
var arr = oTrend.GetData("time;*data;", vFilter);