Origin uses the animate mode internally for operations like moving of data points. When you turn a data plot into animate mode, the trace will be drawn in reverse video, such that drawing over the same trace will erase it. The drawback is when you have many data points, portion of the trace can erase another portion, resulting in a not so complete curve. Currently there is no Origin C access to enable/disable animate mode, so labtalk Set -an must be used.
I have created a DialogBuilder example to show how to make a realtime graph in a dialog, and portion of the code looks like this,
static BOOL OnStartScope(Control cButton)
{
GraphControl og1 = MyDlg.GetItem( IDC_REALTIME_GRAPH );
GraphPage gp = og1.GetPage(); // Get the graph in the control
gp.LT_execute("set %C -an 1"); // make sure data plot is in animate mode
GraphLayer gl = gp.Layers(); // Get active layer
DataPlot dp = gl.DataPlots(0);
Dataset bb(dp.GetDatasetName());
if(!bb)
{
ASSERT(FALSE);
return TRUE;
}
for(int jj = 0; jj < 10; jj++)
{
make_peak(jj/9.0, bb); // some function to change data
bb.Update(FALSE, REDRAW_REALTIME_SCOPE);
}
return TRUE;
}
This example will be included in the next service release.
CP
Edited by - cpyang on 01/10/2003 7:11:59 PM