while (_CameraDataPlot.TryDequeue(out PlotData record))
{
Parallel.ForEach(record.Values, val =>
{
try
{
IRenderableSeriesViewModel render = CameraChannels
.First(x => x.ChannelId == val.Key)
.RenderableSeries
.FirstOrDefault(r => (int)(r as LineRenderableSeriesViewModel).Tag == record.Group);
if (render != null)
{
using (render.DataSeries.SuspendUpdates())
{
long ticks = record.Timestamp / 100;
(render.DataSeries as XyDataSeries<TimeSpan, double>).Append(new TimeSpan(ticks), val.Value);
}
}
}
catch (DivideByZeroException ex)
{
Console.WriteLine($"DivideByZeroException caught: {ex.Message}");
Console.WriteLine($"Timestamp: {record.Timestamp}, Value: {val.Value}");
Console.WriteLine($"Stack Trace: {ex.StackTrace}");
}
catch (Exception ex)
{
// Optional: Add logging or handling for general exceptions
}
});
}
Here is my code. When my frame rate is set to greater than 1, rendering is normal, but when I set the frame rate to less than 1, an error occurs at the “render.DataSeries as XyDataSeries<TimeSpan, double>).Append(new TimeSpan(ticks), val.Value);” position: attempting to divide by 0.
The detailed error message is as follows:
引发的异常:“System.DivideByZeroException”(位于 SciChart.Data.dll 中)
DivideByZeroException caught: 尝试除以零。
Timestamp: 2209466241, Value: 0.000170655727634525
Stack Trace: 在 puq1.nuo()
1.Add(a item)
在 puq
在 SciChart.Charting.Model.DataSeries.XyDataSeries2.Append(TX x, TY y, IPointMetadata metadata)
2.Append(TX x, TY y)
在 SciChart.Charting.Model.DataSeries.XyDataSeries
引发的异常:“System.DivideByZeroException”(位于 SciChart.Data.dll 中)
- zhang yu asked 2 months ago
- last edited 1 week ago
-
Hi Zhang, Thank you for reporting this. Please accept my apologies for the delayed response. I’m going to discuss the provided information with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
- You must login to post comments
Hi Zhang,
Hope you are doing well.
We looked at your inquiry.
To avoid the mentioned issue, you could use the ThreadedRenderTimer instead:
RenderSurfaceBase.UseThreadedRenderTimer = true;
Additionally, we have logged the reported issue in our tracking system for further investigation.
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 3 weeks ago
- You must login to post comments
Please login first to submit.