/* * private async Task SpecAnRefresh() * { * await ...... * if (!SpecAn.IsRefreshing) SpecAn.IsRefreshing = true; * while (!CancelSpecAnRefresh.IsCancellationRequested) * { * Thread.Sleep(10); * SpecAn.GetTraceData(Program.SpectrumTable, 1); * } * }*/ private void SpecAnRefreshWorker() { if (!SpecAn.IsRefreshing) { SpecAn.IsRefreshing = true; } while (!CancelSpecAnRefresh.IsCancellationRequested) { Thread.Sleep(10); SpecAn.GetTraceData(Program.SpectrumTable, 1); } }
private void BtnAutoFindFSQ_Click(object sender, EventArgs e) { if (SpecAn.IsRefreshing) { SpecAn.IsRefreshing = false; } //Console.WriteLine("Center = " + SpecAn.SetCenterFreq(2802236583.2145587487)); //Console.WriteLine("Span = " + SpecAn.SetSpanFreq(63256489.85225522266)); SpecAn.CenterFrequency = 2802236583.2145587487; SpecAn.SpanFrequency = 63256489.85225522266; Thread.Sleep(100); SpecAn.GetTraceData(Program.SpectrumTable, 1); //result.ForEach(n => Console.WriteLine(n.freq + " | " + n.value)); }