tvPoints - Deatiled object description
See: the
tvPoints object.
The
tvPoints object holds the buffer of trend data points (one
data point represents the time, value and attribute of a point). If the
tvTrend object is connected to a data source by calling the
tvTrend.Connect method, then the buffer is filled up automatically on each moving on the time axis of the viewer or when the
PmgTrendViewer.ReadData method is called.
The buffer of data points can be controlled - add, delete, overwrite data points by methods of this object. This is particularly useful if the
tvTrend object is not connected to any data source (to the variable in the
PmaTrendGroup object). Then it is possible, for example, by calling the
AddPoints method, to fill up the buffer and it is also possible to do the filling in the
onReadData event of the viewer that is triggered each time the time axis is moved/zoomed.
Example2:
Let's have a
tvTrend object that is not connected to data source (in the example it is the object with
t1 identifier). The buffer for displaying is filled up by methods.
JavaScriptVBScriptSelect and copy to clipboard
var tNow = Pm.Time;
var oTView = pMe;
var oPoints = oTView.Trends("t1").Points;
var vTimes = Pm.Array1(tNow-3/24, tNow-2/24, tNow-1/24, tNow);
var vValues = Pm.Array1(34, 56.6, 13.3, 98);
oTView.TimeSetType = 1;
oPoints.AddPoints(vTimes, vValues, 0, 1);
oTView.Draw();
Dim tNow, oTView, oPoints, vTimes, vValues
tNow = Pm.Time
Set oTView = pMe
Set oPoints = oTView.Trends("t1").Points
vTimes = Pm.Array1(tNow-3/24, tNow-2/24, tNow-1/24, tNow)
vValues = Pm.Array1(34, 56.6, 13.3, 98)
oTView.TimeSetType = 1
oPoints.AddPoints vTimes, vValues, 0, 1
oTView.Draw