internal void LoadAllData()
        {
            var spectrums = Database.GetConnection().Table <SpectrumBase>().ToList();

            foreach (var spectrum in spectrums)
            {
                Spectrums.Add(spectrum);
            }
        }
 public void DeleteSpectrums()
 {
     // .ToList() conversion is important here, as the code itself will modify
     // the elements of the original collection (ToList() instatinates a copy of the collection)
     foreach (var selectedSpectrum in SelectedSpectrums.ToList())
     {
         Database.GetConnection().Delete(selectedSpectrum);
         SelectedSpectrums.Remove(selectedSpectrum);
         PreparedForImport.Remove(selectedSpectrum);
         Spectrums.Remove(selectedSpectrum);
     }
 }
Exemplo n.º 3
0
        public void Clear()
        {
            // Clear this session

            Name            = String.Empty;
            SessionFile     = String.Empty;
            Comment         = String.Empty;
            Livetime        = 0;
            mDetector       = null;
            NumChannels     = 0;
            MaxChannelCount = 0;
            MinChannelCount = 0;
            Spectrums.Clear();
            Background = null;
        }
Exemplo n.º 4
0
        public bool Add(Spectrum spec)
        {
            // Add a new spectrum to the list of spectrums
            int idx = Array.FindLastIndex(Spectrums.ToArray(), x => x.SessionIndex < spec.SessionIndex);

            Spectrums.Insert(idx + 1, spec);

            NumChannels = spec.NumChannels;

            // Update state
            if (spec.MaxCount > MaxChannelCount)
            {
                MaxChannelCount = spec.MaxCount;
            }
            if (spec.MinCount < MinChannelCount)
            {
                MinChannelCount = spec.MinCount;
            }

            return(true);
        }
Exemplo n.º 5
0
        public Bitmap CreateSpectrum(Spectrums spectrum)
        {
            if(Channel == null) return null;

            if (_lastSpectrum != spectrum) _visuals.ClearPeaks();
            _lastSpectrum = spectrum;

            switch (spectrum)
            {
                case Spectrums.Graph:
                    return _visuals.CreateSpectrum(Channel.Handle, Width, Height, Base, Peak, Background, false, false,
                                                   true);
                case Spectrums.Bean:
                    return _visuals.CreateSpectrumBean(Channel.Handle, Width, Height, Base, Peak, Background,
                                                       _genericLineTikness, false, false, true);
                case Spectrums.Dot:
                    return _visuals.CreateSpectrumDot(Channel.Handle, Width, Height, Base, Peak, Background,
                                                      GenericLineTikness, Distance, false, false, true);
                case Spectrums.Ellipse:
                    return _visuals.CreateSpectrumEllipse(Channel.Handle, Width, Height, Base, Peak, Background,
                                                          GenericLineTikness, Distance, false, false, true);
                case Spectrums.Line:
                    return _visuals.CreateSpectrumLine(Channel.Handle, Width, Height, Base, Peak, Background,
                                                       GenericLineTikness, Distance, false, false, true);
                case Spectrums.LinePeak:
                    return _visuals.CreateSpectrumLinePeak(Channel.Handle, Width, Height, Base, Peak, PeakHold,
                                                           Background, GenericLineTikness, 2, Distance,
                                                           20, false, false, true);
                case Spectrums.Wave:
                    return _visuals.CreateSpectrumWave(Channel.Handle, Width, Height, Base, Peak, Background,
                                                       GenericLineTikness, false, false, true);
                default:
                    return _visuals.CreateSpectrumText(Channel.Handle, Width, Height, Base, Peak, Background,
                                                       TextContent, false, false, true);
            }
        }
Exemplo n.º 6
0
        public Bitmap CreateSprectrum(Spectrums playerCode, int width, int height)
        {
            _visualHelper.Width = width;
            _visualHelper.Height = height;

            return _visualHelper.CreateSpectrum(playerCode);
        }