public void ScanFinished() { // update the gate window startSpectrumGate = window.SpectrumGate.Minimum; endSpectrumGate = window.SpectrumGate.Maximum; startTOFGate = window.TOFGate.Minimum; endTOFGate = window.TOFGate.Maximum; UpdatePMTAveragePlots(); UpdateTOFAveragePlots(); // update the fits if (spectrumFitMode == FitMode.Average) { Scan averageScan = Controller.GetController().DataStore.AverageScan; FitAndPlotSpectrum(averageScan); } if (tofFitMode == FitMode.Average) { FitAverageTOF(); } // clear the realtime spectra pointsToPlot.Points.Clear(); window.ClearRealtimeSpectra(); numberOfScansSoFar++; window.UpdateNumberOfScansSoFar(numberOfScansSoFar); }