private void RebuildGuideHistoryList() { lock (lockObj) { if (overallGuideSteps.Count > 0) { var collection = new LinkedList <HistoryStep>(); var startIndex = overallGuideSteps.Count - historySize; if (startIndex < 0) { startIndex = 0; } RMS.Clear(); for (int i = startIndex; i < overallGuideSteps.Count; i++) { var p = overallGuideSteps.ElementAt(i); RMS.AddDataPoint(p.RADistanceRaw, p.DECDistanceRaw); if (Scale == GuiderScaleEnum.ARCSECONDS) { p = p.AdjustPixelScale(PixelScale); } else { p = p.AdjustPixelScale(1); } collection.AddLast(p); } GuideSteps = new AsyncObservableLimitedSizedStack <HistoryStep>(historySize, collection); CalculateMaximumDurationY(); } } }
public void Clear() { lock (lockObj) { overallGuideSteps.Clear(); GuideSteps.Clear(); RMS.Clear(); MaxDurationY = 1; HistoryStep.ResetIdProvider(); } }