Data points of the trend (see the tvPoints object) are checked by each object of the tvGraph type (there can be created more objects in the tvTrend object, see the tvTrend.AddGraph method) and the time range where data points satisfy the validity function of one in graphs, is drawn just by the tvGraph object.
The SetValidityFce function needn't be called in most cases because the validity function is set also on creating the tvGraph object while calling the tvTrend.AddGraph method where it is possible to enter as a parameter.
sValidityFce | (String) Text definition of the condition for when to use the tvGraph object. In the following text the real number is set into val and the xx has the following meanings: gt=greater than, ge=greater or equal, eq=equal to, le=less or equal, lt=less than. "LimitVal(xx;val)" - The tvGraph object is used if values of data points in the tvPoints object exceed (equal, under pass, see xx) the real value val. Example: "LimitVal(gt;100)" "LimitTrend(xx;t1)" - The tvGraph object is used if values of data points in the tvPoints object exceed (equal, under pass, see xx) values of data points of another trend whose tvTrend.ID is equal to t1. Example: "LimitTrend(gt;t1)" "LimitTrendCompare(xx;t1;val)" - The tvGraph object is used if values of data points of another trend (tvTrend.ID is equal to t1) exceed (equal, under pass, see xx) the real value val. Example: "LimitTrendCompare(gt;t1;100)" |
---|
var oTView = pMe.Items("../TrendView");
var oTrend = oTView.Trends("t1");
var oGraph = oTrend.AddGraph(1, 0, "");
var nRet = oGraph.SetValidityFce("LimitVal(gt;100)");
if (nRet > 0)
//OK
oGraph.SetValidityFce("LimitTrend(gt;t1)");
oGraph.SetValidityFce("LimitTrendCompare(gt;t1;0)");