コード例 #1
0
ファイル: Simova.cs プロジェクト: yi520520/SDRSharpPlugins
        public void TestThis()
        {
            Simova Sma = new Simova(5, 0);

            Console.WriteLine(Sma.Add(1).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(2).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(3).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(4).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(5).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(6).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(7).ToString());
            Console.WriteLine(Sma.BufferToString());


            if (Sma.Add(8) != 6)
            {
                throw new Exception("Simova selftest failed!");
            }
        }
コード例 #2
0
        void MeasureTimer_Tick(object sender, EventArgs e)
        {
            if (!_controlInterface.IsPlaying)
            {
                if (_smaTunedFrequecy.IsValid)
                {
                    _smaTunedFrequecy           = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                    _smaTunedBandwidth          = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                    _smaTunedPeakPowerBandwidth = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                }
                return;
            }

            _controlInterface.GetSpectrumSnapshot(_fft_buffer, POWERLEVEL_MIN, 0);

            _smaTunedFrequecy.Add(GetPowerTunedFreq());
            _smaTunedBandwidth.Add(GetPowerTunedBandwith());
            _smaTunedPeakPowerBandwidth.Add(GetPeakPowerTunedBandwith());
        }
コード例 #3
0
        void GetPowerThreadFunc(object parameter)
        {
            while (true)
            {
                if (!_controlInterface.IsPlaying)
                {
                    if (_smaTunedFrequecy.IsValid)
                    {
                        _smaTunedFrequecy           = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                        _smaTunedBandwidth          = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                        _smaTunedPeakPowerBandwidth = new Simova(_SIMPLE_AVERAGE_SAMPLE_CNT, _SIMPLE_AVERAGE_MIN);
                    }
                    return;
                }

                _controlInterface.GetSpectrumSnapshot(_fft_buffer, POWERLEVEL_MIN, 0);

                _smaTunedFrequecy.Add(MyLib.GetPowerTunedFreq());
                _smaTunedBandwidth.Add(MyLib.GetPowerTunedBandwith());
                _smaTunedPeakPowerBandwidth.Add(MyLib.GetPeakPowerTunedBandwith());

                Thread.Sleep(_MEASURE_TIMER_INTERVALL);
            }
        }
コード例 #4
0
        public void TestThis()
        {
            Simova Sma = new Simova(5, 0);

            Console.WriteLine(Sma.Add(1).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(2).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(3).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(4).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(5).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(6).ToString());
            Console.WriteLine(Sma.BufferToString());
            Console.WriteLine(Sma.Add(7).ToString());
            Console.WriteLine(Sma.BufferToString());

            if (Sma.Add(8) != 6)
            {
              throw new Exception("Simova selftest failed!");
            }
        }