aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs')
-rw-r--r--Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs
index 0331ab3eb..4934a9013 100644
--- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs
+++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs
@@ -249,8 +249,16 @@ namespace RealTimeGraphX
GraphDataPoint min_y = _range.MinimumY;
GraphDataPoint max_y = _range.MaximumY;
- min_x = _to_render.First().Value.XX.First();
- max_x = _to_render.First().Value.XX.Last();
+ if (_to_render.Count > 0 && _to_render.First().Value.XX.Count > 0)
+ {
+ min_x = _to_render.First().Value.XX.First();
+ max_x = _to_render.First().Value.XX.Last();
+ }
+ else
+ {
+ Thread.Sleep(RefreshRate);
+ continue;
+ }
if (_range.AutoY)
{
@@ -342,6 +350,7 @@ namespace RealTimeGraphX
catch (Exception ex)
{
Debug.WriteLine($"Error in RealTimeGraphX:\n{ex.ToString()}");
+ Thread.Sleep(RefreshRate);
}
}
else