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!"); } }
private void PowerDetection() { if (!_controlInterface.IsPlaying) { return; } _controlInterface.GetSpectrumSnapshot(_fft_buffer); _smaTunedFrequecy.Add(GetPowerTunedFreq()); _smaTunedBandwidth.Add(GetPowerTunedBandwith()); if (_mode == ScannerCompareMode.Frequency) { _scannerCompareRxLevel = _smaTunedFrequecy.IsValid ? _smaTunedFrequecy.Average : _SIMPLE_AVERAGE_MIN; } else if (_mode == ScannerCompareMode.Bandwidth) { _scannerCompareRxLevel = _smaTunedBandwidth.IsValid ? _smaTunedBandwidth.Average : _SIMPLE_AVERAGE_MIN; } }