示例#1
0
        private void UpdatePlot()
        {
            SampleComputationFlags computation = SampleComputationFlags.None;

            if (_darkSubtraction)
            {
                computation = computation | SampleComputationFlags.DarkSubtraction;
            }

            if (_intensityCorrection)
            {
                computation = computation | SampleComputationFlags.IntensityCorrection;
            }

            IComputedSample computedSample = _clientContext.ComputeSample(_computationDependencies, computation);

            _plotModel.Series.Clear();

            LineSeries lineSeries = new LineSeries();

            _plotModel.Axes.Clear();
            _plotModel.Series.Add(lineSeries);

            _plotModel.Axes.Add(new LinearAxis {
                Key = "sigY", Position = AxisPosition.Left, Title = "Counts"
            });
            if (_ramanShift)
            {
                _plotModel.Axes.Add(new LinearAxis {
                    Key = "sigX", Position = AxisPosition.Bottom, Title = "Raman Shift"
                });

                for (int i = 0; i < computedSample.Data.Length; i++)
                {
                    lineSeries.Points.Add(new DataPoint(computedSample.RamanShiftData[i], computedSample.Data[i]));
                }
            }
            else
            {
                _plotModel.Axes.Add(new LinearAxis {
                    Key = "sigX", Position = AxisPosition.Bottom, Title = "Wavelength"
                });

                for (int i = 0; i < computedSample.Data.Length; i++)
                {
                    lineSeries.Points.Add(new DataPoint(computedSample.WavelengthData[i], computedSample.Data[i]));
                }
            }

            PlotView.InvalidatePlot();
        }