protected override void WndProc(ref Message m) { switch (m.Msg) { //完成一趟操作 case MessageID.ISO_SWEEP_DONE: { Sweeping = false; pbxStart.Image = ImagesManage.GetImage("isolation", "start_in.gif"); break; } //完成单点扫描 case MessageID.ISO_SUCCED: { SweepProcessing(); break; } //功放操作错误 case MessageID.RF_ERROR: { SweepObj.CloneReference(ref ps1, ref ps2, ref sr, ref rfr_errors1, ref rfr_errors2); MessageBox.Show(this, rfr_errors1.ToString() + "\n\r" + rfr_errors2.ToString()); BreakSweep(1000); break; } //频谱分析错误 case MessageID.SPECTRUM_ERROR: { MessageBox.Show(this, "Spectrum analysis failed. It may be caused by the spectrum device does not connect or scanning failed!"); BreakSweep(1000); break; } //频谱分析成功 case MessageID.SPECTRUEME_SUCCED: { SweepObj.Spectrum_Succed(); break; } //功放操作成功 case MessageID.RF_SUCCED_ALL: { if (m.WParam.ToInt32() == App_Configure.Cnfgs.ComAddr1) { SweepObj.Power1_Succed(); } else if (m.WParam.ToInt32() == App_Configure.Cnfgs.ComAddr2) { SweepObj.Power2_Succed(); } break; } default: { base.WndProc(ref m); break; } } }
protected override void WndProc(ref Message m) { switch (m.Msg) { //完成一趟操作 case MessageID.ISO_SWEEP_DONE: { Sweeping = false; //if (bErrorRf) //{ // SweepObj.CloneReference(ref ps1, ref ps2, ref sr, ref rfr_errors1, ref rfr_errors2); // bCalsuccess = false; // MessageBox.Show(rfr_errors1.ToString() + "\n\r" + rfr_errors2.ToString()); //} //if (bErrorSpec) //{ // bCalsuccess = false; // MessageBox.Show("SPECTRUM_Error"); //} if (bErrorRf == true || bErrorSpec == true) { bCalsuccess = false; MessageBox.Show(this, "Automatic calibration failed, please check the external attenuator!"); this.DialogResult = DialogResult.Cancel; } else { this.DialogResult = DialogResult.OK; } break; } //完成单点扫描 case MessageID.ISO_SUCCED: { float tx_out, rx_value; Auto_CAL_Items Cal_Carrier; SweepObj.CloneReference(ref ps1, ref ps2, ref sr, ref rfr_errors1, ref rfr_errors2); if (rf_involved == RFInvolved.Rf_1) { if (App_Configure.Cnfgs.Cal_Use_Table) { tx_out = ps1.Status2.OutP + Tx_Tables.iso_tx1_disp.Offset(ps1.Status2.Freq, ps1.Status2.OutP, Tx_Tables.iso_offset1_disp); rx_value = sr.dBmValue + Rx_Tables.Offset(ps1.Status2.Freq, FuncModule.ISO); } else { tx_out = (float)App_Factors.iso_tx1_disp.ValueWithOffset(ps1.Status2.Freq, ps1.Status2.OutP); rx_value = (float)App_Factors.iso_rx1.ValueWithOffset(ps1.Status2.Freq, sr.dBmValue); } Cal_Carrier = RL0_Tables.Cal_Carrier(FuncModule.ISO, RFInvolved.Rf_1); Cal_Carrier.GetItem(PointsDone).Tx0 = tx_out; Cal_Carrier.GetItem(PointsDone).Rx0 = rx_value; } else { if (App_Configure.Cnfgs.Cal_Use_Table) { tx_out = ps2.Status2.OutP + Tx_Tables.iso_tx2_disp.Offset(ps2.Status2.Freq, ps2.Status2.OutP, Tx_Tables.iso_offset2_disp); rx_value = sr.dBmValue + Rx_Tables.Offset(ps2.Status2.Freq, FuncModule.ISO); } else { tx_out = (float)App_Factors.iso_tx2_disp.ValueWithOffset(ps2.Status2.Freq, ps2.Status2.OutP); rx_value = (float)App_Factors.iso_rx2.ValueWithOffset(ps2.Status2.Freq, sr.dBmValue); } Cal_Carrier = RL0_Tables.Cal_Carrier(FuncModule.ISO, RFInvolved.Rf_2); Cal_Carrier.GetItem(PointsDone).Tx0 = tx_out; Cal_Carrier.GetItem(PointsDone).Rx0 = rx_value; } PointsDone++; pbrCAL.Value = PointsDone; break; } //功放操作错误 case MessageID.RF_ERROR: { bErrorRf = true; break; } //频谱分析错误 case MessageID.SPECTRUM_ERROR: { bErrorSpec = true; break; } //频谱分析成功 case MessageID.SPECTRUEME_SUCCED: { SweepObj.Spectrum_Succed(); break; } //功放操作成功 case MessageID.RF_SUCCED_ALL: { if (m.WParam.ToInt32() == App_Configure.Cnfgs.ComAddr1) { SweepObj.Power1_Succed(); } else if (m.WParam.ToInt32() == App_Configure.Cnfgs.ComAddr2) { SweepObj.Power2_Succed(); } break; } default: { base.WndProc(ref m); break; } } }