Exemplo n.º 1
0
        /// <summary>
        /// 窗体消息循环
        /// </summary>
        /// <param name="m"></param>
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            //完成一趟操作
            case MessageID.VSW_SWEEP_DONE:
                if (!bCalSuccess)
                {
                    if (bErrorRf)
                    {
                        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());
                    }
                    if (bErrorSpec)
                    {
                        MessageBox.Show(this, "Spectrum analysis failed. It may be caused by the spectrum device does not connect or scanning failed!");
                    }
                    //if (bErrorRf == false && bErrorSpec == false)
                    //{
                    //    MessageBox.Show(this, "AutoCAL failed,please check your attenuator!");
                    //}
                    this.DialogResult = DialogResult.Cancel;
                }
                else
                {
                    this.DialogResult = DialogResult.OK;
                }
                break;

            //完成单点扫描
            case MessageID.VSW_SUCCED:
                FillCalData(m.LParam.ToInt32());
                break;

            //功放操作错误
            case MessageID.RF_ERROR:
                bCalSuccess = false;
                bErrorRf    = true;
                break;

            //频谱分析错误
            case MessageID.SPECTRUM_ERROR:
                bCalSuccess = false;
                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;
            }
        }
Exemplo n.º 2
0
        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;
            }
            }
        }