Ejemplo n.º 1
0
        public static RadioViewModel GetInstance()
        {
            lock (_instanceLock)
            {
                if (_instance == null)
                {
                    _instance = new RadioViewModel();
                }
            }

            return(_instance);
        }
Ejemplo n.º 2
0
        public SpectrumViewModel(RadioViewModel radioViewModel, ISpectrumAnalyzer spectrumAnalyzer)
        {
            _radioViewModel  = radioViewModel;
            SpectrumAnalyzer = spectrumAnalyzer;

            Resolutions = new ObservableCollection <ResolutionBandwidth>();
            for (uint i = 0; i < 8; i++)
            {
                Resolutions.Add(new ResolutionBandwidth()
                {
                    Resolution = Extensions.Pow(2, i)
                });
            }

            if (SpectrumAnalyzer != null)
            {
                SpectrumAnalyzer.BandwidthChanged += (range, value) =>
                {
                    if (_updating)
                    {
                        return;
                    }

                    // var shift = TransformFromChartSamples(value);
                    // var bandwidth = TransformFromChartSamples(range.End) - TransformFromChartSamples(range.Start);

                    var shift     = value;
                    var bandwidth = range.End - range.Start;

                    if ((shift >= long.MinValue && shift <= long.MaxValue) &&
                        (bandwidth >= uint.MinValue && bandwidth <= uint.MaxValue))
                    {
                        Shift     = (long)shift;
                        Bandwidth = (uint)bandwidth;

                        Update();
                    }
                };

                SpectrumAnalyzer.NotchChanged += (range, value) =>
                {
                    var bandwidth = range.End - range.Start;
                };
            }
        }
Ejemplo n.º 3
0
 public IfSpectrumViewModel(RadioViewModel radioViewModel, ISpectrumAnalyzer spectrumAnalyzer)
     : base(radioViewModel, spectrumAnalyzer)
 {
     SelectedResolution = Resolutions.ToArray <ResolutionBandwidth>()[3];
 }
Ejemplo n.º 4
0
 public Ddc1SpectrumViewModel(RadioViewModel radioViewModel, Arction.ISpectrumAnalyzer spectrumAnalyzer)
     : base(radioViewModel, spectrumAnalyzer)
 {
     SelectedResolution = Resolutions.ToArray <ResolutionBandwidth>()[4];
 }