private void timerStream_Tick(object sender, EventArgs e) { if (LogStreamer == null || (LogInfo != null && !LogInfo.Live)) { StopStreaming(); return; } if (LogStreamer.QueueCount() >= 3) { WaitForLoadingPlotting(); PlottingLog = true; List <DSLOGEntry> newEntries = new List <DSLOGEntry>(); while (LogStreamer.QueueCount() != 0) { DSLOGEntry entry = LogStreamer.PopEntry(); if (entry != null) { LogEntries.Add(entry); newEntries.Add(entry); } } StreamPlot(); DateTime now = DateTime.Now; if ((now - LastEnergyAdd).Seconds > 2) { EnergyView.AddEnergy(newEntries); LastEnergyAdd = now; } PlottingLog = false; } }
private void SetEnergy() { if (LogEntries != null) { EnergyView.SetEnergy(LogEntries); } else { EnergyView.SetEnergy(null); } }