Exemple #1
0
        private void btnLabEvaluation_Click(object sender, EventArgs e)
        {
            if (this.isValidateSelectionComplete())
            {
                this._runMode = RunMode.LabEval;
                this.flpOptionControls.Visible = true;
                this.flpOptionControls.Controls.Clear();
                this._aux = null;
                this._ftu = null;
                this._frr = null;
                this._ist = null;
                this._pop = null;
                this._rxf = null;
                this._rxo = null;
                this._txf = null;
                this.flpOptionControls.Dock = DockStyle.Fill;
                this.flpOptionControls.BringToFront();
                string[] interactionOptions = this._selectedProject.LabEvaluation.InteractionOptions;
                for (int i = 0; i < interactionOptions.Length; i++)
                {
                    switch (interactionOptions[i])
                    {
                        case "AuxiliaryFunction":
                            this._aux = new AuxiliaryFunction();
                            this.flpOptionControls.Controls.Add(this._aux);
                            break;

                        case "FineTune":
                            this._ftu = new FineTune();
                            this._ftu.SetTuning += new FineTune.FineTuneEventHandler(this.ftu_setTuning);
                            this._ftu.paHelpClicked = (EventHandler) Delegate.Combine(this._ftu.paHelpClicked, new EventHandler(this.btnPaPowerLeveHelp_Click));
                            this._ftu.xoHelpClicked = (EventHandler) Delegate.Combine(this._ftu.xoHelpClicked, new EventHandler(this.btnXtalCapBankHelp_Click));
                            this._ftu.initTuningValues(this._selectedConfig.FreqBandLow, this._selectedConfig.FreqBandHigh, (double) this.nudCenterFrequency.Value, (byte) this.nudPaPowerLevel.Value, (byte) this.nudXtalCapBank.Value, ((int) this.nudChannelSpacing.Value) * 0x3e8, (int) this.nudChannelNumber.Value);
                            this._ftu.setInfoValues(this._selectedConfig.DataRate.ToString() + " kbps", this._selectedConfig.Deviation.ToString() + " kHz", this._selectedConfig.ModulationMode.ToString(), this._selectedConfig.CrystalTolerance.ToString(), this._chipType);
                            this.flpOptionControls.Controls.Add(this._ftu);
                            break;

                        case "FRR":
                            this._frr = new FRR();
                            this._frr.readFRR += new EventHandler(this.frr_readFRR);
                            this.flpOptionControls.Controls.Add(this._frr);
                            this._frr.setIsDirectMode(this.cbbModulationSource.SelectedIndex == 1);
                            break;

                        case "InterruptStatus":
                            this._ist = new InterruptStatus();
                            this._ist.readInterruptStatus += new EventHandler(this.ist_readInterruptStatus);
                            this._ist.setChipType(this._chipType);
                            this.flpOptionControls.Controls.Add(this._ist);
                            break;

                        case "PowerOption":
                            this._pop = new PowerOption();
                            this._pop.setPowerMode += new PowerOption.FineTuneEventHandler(this.pop_setPowerMode);
                            this.flpOptionControls.Controls.Add(this._pop);
                            break;

                        case "RxFifo":
                            this._rxf = new RxFifo();
                            this._rxf.restartRx += new EventHandler(this.rx_restartRx);
                            this._rxf.restartRxHelpClicked += new EventHandler(this.rxf_restartRxHelpClicked);
                            this._rxf.readRx += new RxFifo.ReadRxEventHandler(this.rxf_readRx);
                            this.flpOptionControls.Controls.Add(this._rxf);
                            break;

                        case "RxOption":
                            this._rxo = new RxOption();
                            this._rxo.restartRx += new EventHandler(this.rx_restartRx);
                            this._rxo.restartRxHelpClicked += new EventHandler(this.rxo_restartRxHelpClicked);
                            this.flpOptionControls.Controls.Add(this._rxo);
                            break;

                        case "TxFifo":
                            this._txf = new TxFifo();
                            this._txf.writeTxData += new TxFifo.WriteTxEventHandler(this.txf_writeTxData);
                            this._txf.initTx((int) this.nudPreambeLength.Value, WDSConverters.ToByteArray(this.mtbSynchronWord.Text.Replace(" ", "").Trim()), this.chbEnableCRC.Checked);
                            this.flpOptionControls.Controls.Add(this._txf);
                            break;
                    }
                }
                BackButton button = new BackButton();
                button.goBack += new EventHandler(this.bck_goBack);
                this.flpOptionControls.Controls.Add(button);
                this.startCalculation();
            }
        }
Exemple #2
0
 private void btnLabEvaluation_Click(object sender, EventArgs e)
 {
     if (this.isValidateSelectionComplete())
     {
         base.Enabled = this.dgvEzConfigEnable = false;
         this.flpOptionControls.Visible = true;
         this.flpOptionControls.Controls.Clear();
         this.flpOptionControls.Dock = DockStyle.Fill;
         this.flpOptionControls.BringToFront();
         this._tun = null;
         this._led = null;
         this._sts = null;
         this._str = null;
         this._txf = null;
         foreach (string str in this._selectedProject.LabEvaluation.InteractionOptions)
         {
             string str2 = str;
             if (str2 != null)
             {
                 if (!(str2 == "Tune"))
                 {
                     if (str2 == "LEDControl")
                     {
                         goto Label_01DB;
                     }
                     if (str2 == "StateSelection")
                     {
                         goto Label_025E;
                     }
                     if (str2 == "StatusRead")
                     {
                         goto Label_02A7;
                     }
                     if (str2 == "TxFifo")
                     {
                         goto Label_033D;
                     }
                 }
                 else
                 {
                     this._tun = new Tune();
                     this._tun.SetTuning += new Tune.FineTuneEventHandler(this.tun_SetTuning);
                     this._tun.paLevelHelpClicked = (EventHandler) Delegate.Combine(this._tun.paLevelHelpClicked, new EventHandler(this.btnPALevelHelp_Click));
                     this._tun.initTuningValues((double) this.nudCenterFrequency.Value, (int) this.nudPALevel.Value);
                     this._tun.setInfoValues(this._selectedConfig.DataRate.ToString() + " kbps", this._selectedConfig.Deviation.ToString() + " kHz", this._selectedConfig.ModulationMode.ToString());
                     this.flpOptionControls.Controls.Add(this._tun);
                 }
             }
             continue;
         Label_01DB:
             this._led = new LEDControl();
             this._led.SetLedControl += new LEDControl.LedControlEventHandler(this.led_SetLedControl);
             LedIntensity off = LedIntensity.Off;
             if (this.rdbLED37.Checked)
             {
                 off = LedIntensity.Low;
             }
             if (this.rdbLED60.Checked)
             {
                 off = LedIntensity.Medium;
             }
             if (this.rdbLED97.Checked)
             {
                 off = LedIntensity.High;
             }
             this._led.initLedControl(this.chbLEDControl.Checked, off);
             this.flpOptionControls.Controls.Add(this._led);
             continue;
         Label_025E:
             this._sts = new StateSelection();
             this._sts.stateChanged += new StateSelection.StateChangedEventHandler(this.sts_stateChanged);
             this._sts.setState(ChipPowerState.Standby);
             this.flpOptionControls.Controls.Add(this._sts);
             continue;
         Label_02A7:
             this._str = new StatusRead();
             this._str.readInterruptStatus += new EventHandler(this.str_readInterruptStatus);
             this._str.readChipRevision += new EventHandler(this.str_readChipRevision);
             this._str.readChipStatus += new EventHandler(this.str_readChipStatus);
             this._str.readBatteryVoltage += new EventHandler(this.str_readBatteryVoltage);
             this._str.readCapBank += new EventHandler(this.str_readCapBank);
             this.flpOptionControls.Controls.Add(this._str);
             continue;
         Label_033D:
             this._txf = new NewWDS.Applications.App_Si4012.OptionControls.TxFifo();
             this._txf.writeTxData += new NewWDS.Applications.App_Si4012.OptionControls.TxFifo.WriteTxEventHandler(this.txf_writeTxData);
             this._txf.initTx((int) this.nudPreambeLength.Value, WDSConverters.ToByteArray(this.mtbSynchronWord.Text.Replace(" ", "").Trim()));
             this.flpOptionControls.Controls.Add(this._txf);
         }
         BackButton button = new BackButton();
         button.goBack += new EventHandler(this.bck_goBack);
         this.flpOptionControls.Controls.Add(button);
         if (this.loadFirmwareCode(this._selectedProject.LabEvaluation.Firmware, null))
         {
             Thread.Sleep(0x3e8);
             this.loadProjectSpecificCommands();
         }
         base.Enabled = this.dgvEzConfigEnable = true;
     }
 }