Lets assume we plot a moving signal window with a non-FIFO data series. Then, the dataseries can be updated in a loop with the fixed-length buffer (YArray) containing the latest signal samples :
using (sciChart.SuspendUpdates())
{
SignalDataSeries.Clear();
SignalDataSeries.Append(XArray, YArray);
}
My question is whether the FIFO dataseries can be used to simplify the above code into
SignalDataSeries.Append(XArray, YArray);
given that we still use the same fixed-length YArray and FifoCapacity is set to its length? Are there any drawbacks in it, save for the doubling memory for the internal FIFO buffer?
- corvex asked 4 years ago
- You must login to post comments
Hi there,
If XArray, YArray length equals the DataSeries.FifoCapacity then you can indeed shorten the entire statement to just
SignalDataSeries.Append(XArray, YArray);
In this case the entire fifo buffer will be replaced with the new arrays and no need to clear.
Give it a try! Let me know if this works
Best regards,
Andrew
- Andrew Burnett-Thompson answered 4 years ago
-
It worked. Thanks, Andrew! Btw, is SuspendUpdates() is called internally in such scenario?
-
Hi there, internally whenever you call .Append() or any function on DataSeries is performs a lock around a synchronisation object. SuspendUpdates() is used to freeze drawing on the chart if you do multiple operations at once, such as changing data, properties on RenderableSeries etc… The above method should be thread safe if that is what you want to know
- You must login to post comments
Please login first to submit.