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!"); } }
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()); }
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); } }