/// <summary> /// 准备扫描参数 /// </summary> /// <param name="sweeps"></param> internal void Prepare(SweepParams usr_sweeps) { usr_sweeps.Clone(exe_params); //设置功放消息的目标窗体句柄 RFSignal.SetWndHandle(exe_params.WndHandle); //建立频谱分析对象 if (exe_params.DevInfo.Spectrum == SpectrumType.SPECAT2) { ISpectrumObj = new SpectrumLib.Spectrums.SpeCat2(exe_params.WndHandle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); } else { ISpectrumObj = new SpectrumLib.Spectrums.BirdSh(exe_params.WndHandle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); } }
/// <summary> /// 窗体加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TestForm_Load(object sender, EventArgs e) { _handle = this.Handle; //频谱类型 type = App_Configure.Cnfgs.Spectrum; switch (type) { case 0: ISpectrumObj = new SpectrumLib.Spectrums.SpeCat2(this.Handle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); break; case 1: ISpectrumObj = new SpectrumLib.Spectrums.BirdSh(this.Handle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); break; case 2: ISpectrumObj = new SpectrumLib.Spectrums.Deli(this.Handle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); break; case 3: ISpectrumObj = new SpectrumLib.Spectrums.FanShuang(this.Handle, MessageID.SPECTRUEME_SUCCED, MessageID.SPECTRUM_ERROR); break; } ISpectrumObj.EnableLog(); //绑定RBW Bind(comboBoxRbw); if (type == 0) { comboBoxVbw.Enabled = false; comboBoxVbw.Visible = false; label19.Visible = false; } else if (type == 1) { //绑定VBW Bind(comboBoxVbw); } else { comboBoxVbw.Enabled = false; comboBoxVbw.Visible = false; label19.Visible = false; } //绑定Fun BindFun(); //扫描对象 exe_params = new SweepParams(); exe_params.SweepType = SweepType.Time_Sweep; exe_params.WndHandle = this.Handle; exe_params.DevInfo = new DeviceInfo(); exe_params.TmeParam = new TimeSweepParam(); exe_params.WndHandle = _handle; power1_Handle = new ManualResetEvent(false); power2_Handle = new ManualResetEvent(false); //建立射频功放层 RFSignal.SetWndHandle(exe_params.WndHandle); btnRF1_On.Enabled = true; btnRF1_Off.Enabled = false; btnRF2_On.Enabled = true; btnRF2_Off.Enabled = false; btnSpe_On.Enabled = true; btnSpe_Off.Enabled = false; //范围 numericUpDownFreq1.Minimum = (decimal)App_Settings.sgn_1.Min_Freq; numericUpDownFreq1.Maximum = (decimal)App_Settings.sgn_1.Max_Freq; numericUpDownFreq2.Minimum = (decimal)App_Settings.sgn_2.Min_Freq; numericUpDownFreq2.Maximum = (decimal)App_Settings.sgn_2.Max_Freq; numericUpDownRF1.Minimum = (decimal)App_Settings.sgn_1.Min_Power; numericUpDownRF1.Maximum = (decimal)App_Settings.sgn_1.Max_Power; numericUpDownRF2.Minimum = (decimal)App_Settings.sgn_2.Min_Power; numericUpDownRF2.Maximum = (decimal)App_Settings.sgn_2.Max_Power; //初值 numericUpDownFreq1.Value = (decimal)App_Settings.sgn_1.Min_Freq; numericUpDownFreq2.Value = (decimal)App_Settings.sgn_2.Min_Freq; numericUpDownRF1.Value = (decimal)App_Settings.sgn_1.Min_Power; numericUpDownRF2.Value = (decimal)App_Settings.sgn_2.Min_Power; numericUpDownSpe.Value = (decimal)App_Settings.sgn_1.Min_Freq; if (App_Configure.Cnfgs.Cal_Use_Table) { btnOffset.Enabled = false; chkTable.Checked = true; rad_frd.Enabled = true; rad_rev.Enabled = true; } else { btnOffset.Enabled = true; chkTable.Checked = false; rad_frd.Enabled = false; rad_rev.Enabled = false; } }