示例#1
0
        public FrequencyResponseTest(
            Transceiver transceiver,
            double startFrequency   = 995E6,
            double stopFrequency    = 1.005E9,
            int steps               = 60,
            double sgPowerLevel     = -10,
            double saReferenceLevel = 0,
            double bandwidth        = 1E6, //10E3,
            double dwellTime        = 1E-3,
            double deskew           = 0,
            string triggerLine      = "PXI_Trig0",
            double timeout          = 10)
        {
            this.transceiver      = transceiver;
            this.startFrequency   = startFrequency;
            this.stopFrequency    = stopFrequency;
            this.steps            = steps;
            this.sgPowerLevel     = sgPowerLevel;
            this.saReferenceLevel = saReferenceLevel;
            this.bandwidth        = bandwidth;
            this.dwellTime        = dwellTime;
            this.deskew           = deskew;
            this.triggerLine      = triggerLine;
            this.timeout          = new PrecisionTimeSpan(timeout);

            transceiver.Initialize(); // initializing the hardware ahead of time can dramatically speed up execution of the caller
        }
示例#2
0
        public NoiseFloorTest(
            Transceiver transceiver,
            string band,
            string waveformName,
            ComplexWaveform <ComplexDouble> waveform,
            double txStartFrequency     = 1920E6,
            double txStopFrequency      = 1980E6,
            double rxStartFrequency     = 2110E6,
            double rxStopFrequency      = 2170E6,
            double frequencyStep        = 1E6,
            int numberOfRuns            = 1,
            string referenceTriggerLine = "PXI_Trig0",
            double sgPowerLevel         = -10,
            double saReferenceLevel     = 10,
            double vbw                   = 10000,
            bool preSoakSweep            = false,
            double soakFrequency         = 1955E6,
            double soakTime              = 0,
            double dwellTime             = 1E-3,
            double idleTime              = 300E-6,
            double referenceTriggerDelay = 15E-6,
            double timeout               = 10)
        {
            this.transceiver          = transceiver;
            this.band                 = band;
            this.waveformName         = waveformName;
            this.waveform             = waveform;
            this.txStartFrequency     = txStartFrequency;
            this.txStopFrequency      = txStopFrequency;
            this.rxStartFrequency     = rxStartFrequency;
            this.rxStopFrequency      = rxStopFrequency;
            this.frequencyStep        = frequencyStep;
            this.numberOfRuns         = numberOfRuns;
            this.referenceTriggerLine = referenceTriggerLine;
            this.sgPowerLevel         = sgPowerLevel;
            this.saReferenceLevel     = saReferenceLevel;
            this.vbw                   = vbw;
            this.preSoakSweep          = preSoakSweep;
            this.soakFrequency         = soakFrequency;
            this.soakTime              = soakTime;
            this.dwellTime             = dwellTime;
            this.idleTime              = idleTime;
            this.referenceTriggerDelay = referenceTriggerDelay;
            this.timeout               = new PrecisionTimeSpan(timeout);

            ThreadPool.QueueUserWorkItem(o => LVFilters.Initialize()); // this is launched asynchronously and will never be waited on

            transceiver.Initialize();
        }
示例#3
0
文件: Program.cs 项目: pmtate/RfxCom
        private static void Main(string[] args)
        {
            using (var communicationInterface = new UsbInterface("COM3"))
            {
                var logger      = new ConsoleLogger();
                var transceiver = new Transceiver(communicationInterface, logger);

                var observable = transceiver.Receive();

                observable.Subscribe(@event =>
                {
                    if (!(@event is ErrorEvent))
                    {
                        logger.Info(@event.ToString());
                    }
                    else
                    {
                        logger.Error(@event.ToString());
                    }
                });

                observable.MessagesOf <ChimeMessage>().Subscribe(Handle);

                observable.Connect();

                transceiver.Initialize().Wait();
                transceiver.SetMode(Protocol.ByronSx).Wait();

                var soundMap = new Dictionary <ConsoleKey, ChimeSound>
                {
                    { ConsoleKey.D0, ChimeSound.BigBen },
                    { ConsoleKey.D1, ChimeSound.Clarinet },
                    { ConsoleKey.D2, ChimeSound.Solo },
                    { ConsoleKey.D3, ChimeSound.Tubular2Notes },
                    { ConsoleKey.D4, ChimeSound.Tubular3Notes },
                    { ConsoleKey.D5, ChimeSound.TubularMix },
                    { ConsoleKey.D6, ChimeSound.Saxophone },
                    { ConsoleKey.D7, ChimeSound.MorningDew }
                };

                while (true)
                {
                    foreach (var sound in soundMap)
                    {
                        Console.WriteLine("Press [{0}] for {1}", sound.Key.ToString().Replace("D", ""), sound.Value.Description);
                    }

                    Console.WriteLine("Press Q to quit");


                    var result = Console.ReadKey();


                    if (soundMap.ContainsKey(result.Key))
                    {
                        var sound = soundMap[result.Key];

                        logger.Info("Playing {0} ", sound);

                        transceiver.SendChime(ChimeSubType.ByronSx, sound).Wait();
                    }
                    else if ((result.KeyChar == 'Q' || result.KeyChar == 'q'))
                    {
                        Console.WriteLine("Quit");
                        break;
                    }
                }
            }
        }