Пример #1
0
        /*
         * 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);
            }
        }
Пример #2
0
        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));
        }
Пример #3
0
        private void InitInstruments()
        {
            if (SpecAn is null)
            {
                SpecAn = new SpecAn(SpecAnAddress);
                Console.WriteLine(SpecAn.ToString());
                SpecAn.SelectMode(FSQMode.SpectrumAnalyzer);
                SpecAn.SelectScreen(FSQScreen.A);
            }

            if (SigGen1 is null)
            {
                SigGen1 = new SigGen(SigGen1Address);
                Console.WriteLine(SigGen1.ToString());
            }

            /*
             * if (PowerSensor is null)
             * {
             *  PowerSensor = new PowerSensor(PowerSensorAddress);
             *  Console.WriteLine(PowerSensor.ToString());
             * }*/
        }