Example #1
0
        public SweepTest()
        {
            InitializeComponent();
            this.FormClosing += new FormClosingEventHandler(SweepTest_FormClosing);
            this.dgvSweepResult.RowsAdded += new DataGridViewRowsAddedEventHandler(dgvSweepResult_RowsAdded);
            this.cbxWaveform.SelectedIndexChanged += new EventHandler(cbxWaveform_SelectedIndexChanged);

            #region Initialize  Datatable

            #region --- GMSK LB ---
            this.dtCWLB.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtCWLB.Columns.Add(new DataColumn("Frequency(MHz)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("Vramp(V)", typeof(string)));
            this.dtCWLB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("ICC(mA)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("2fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("3fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("4fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("5fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("6fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("7fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("8fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("9fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("10fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("11fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("12fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("13fo(dBm)", typeof(double)));
            this.dtCWLB.Columns.Add(new DataColumn("14fo(dBm)", typeof(double)));
            //this.dtCWLB.PrimaryKey = new DataColumn[] { dtCWLB.Columns["#"] };
            //this.dtCWLBData.Columns["#"].AutoIncrement = true;
            //this.dtCWLBData.Columns["#"].AutoIncrementSeed = 1;
            //this.dtCWLBData.Columns["#"].AutoIncrementStep = 1;
            #endregion --- GMSK LB ---

            #region --- GMSK HB ---
            this.dtCWHB.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtCWHB.Columns.Add(new DataColumn("Frequency(MHz)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("Vramp(V)", typeof(string)));
            this.dtCWHB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("ICC(mA)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("2fo(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("3fo(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("4fo(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("5fo(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("6fo(dBm)", typeof(double)));
            this.dtCWHB.Columns.Add(new DataColumn("7fo(dBm)", typeof(double)));
            //this.dtCWHB.PrimaryKey = new DataColumn[] { dtCWHB.Columns["#"] };
            //this.dtCWHBData.Columns["#"].AutoIncrement = true;
            //this.dtCWHBData.Columns["#"].AutoIncrementSeed = 1;
            //this.dtCWHBData.Columns["#"].AutoIncrementStep = 1;
            #endregion --- GMSK HB ---

            #region --- EDGE LB ---

            this.dtEDGELB.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtEDGELB.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("ACP -400kHz(dB)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("ACP +400kHz(dB)", typeof(double)));
            this.dtEDGELB.Columns.Add(new DataColumn("EVM(%)", typeof(double)));

            #endregion --- EDGE LB ---

            #region --- EDGE HB ---

            this.dtEDGEHB = this.dtEDGELB.Clone();

            //this.dtEDGEHB.Columns.Add(new DataColumn("#", typeof(int)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("ACP -400kHz(dB)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("ACP +400kHz(dB)", typeof(double)));
            //this.dtEDGEHB.Columns.Add(new DataColumn("EVM(%)", typeof(double)));

            #endregion --- EDGE HB ---

            #region --- TDSCDMA ---

            this.dtTDSCDMA.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("ACP -1.6MHz(dB)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("ACP +1.6MHz(dB)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("ACP -3.2MHz(dB)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("ACP +3.2MHz(dB)", typeof(double)));
            this.dtTDSCDMA.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            //this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion --- TDSCDMA ---

            #region --- WCDMA ---

            this.dtWCDMA.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtWCDMA.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("ACP -5MHz(dB)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("ACP +5MHz(dB)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("ACP -10MHz(dB)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("ACP +10MHz(dB)", typeof(double)));
            this.dtWCDMA.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            //this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion --- WCDMA ---

            #region --- LTETDD_B38 ---

            this.dtLTETDD_B38.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_EULTRA -10MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_EULTRA +10MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_ULTRA -0.8MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_ULTRA +0.8MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_ULTRA -2.4MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("ACP_ULTRA +2.4MHz(dB)", typeof(double)));
            this.dtLTETDD_B38.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            //this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion

            #region --- LTETDD_B40 ---
            this.dtLTETDD_B40 = this.dtLTETDD_B38.Clone();

            //this.dtLTETDD_B40.Columns.Add(new DataColumn("#", typeof(int)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_EULTRA -10MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_EULTRA +10MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_ULTRA -0.8MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_ULTRA +0.8MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_ULTRA -2.4MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("ACP_ULTRA +2.4MHz(dB)", typeof(double)));
            //this.dtLTETDD_B40.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            ////this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion --- LTETDD_B40 ---

            #region --- LTEFDD_B1 ---

            this.dtLTEFDD_B1.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_EULTRA -10MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_EULTRA +10MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_ULTRA -2.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_ULTRA +2.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_ULTRA -7.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("ACP_ULTRA +7.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B1.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            //this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion --- LTEFDD_B1 ---

            #region --- LTEFDD_B2 ---

            this.dtLTEFDD_B2.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Frequency (MHz)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Target Pout(dBm)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("Icc(mA)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_EULTRA -10MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_EULTRA +10MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_ULTRA -2.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_ULTRA +2.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_ULTRA -7.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("ACP_ULTRA +7.5MHz(dB)", typeof(double)));
            this.dtLTEFDD_B2.Columns.Add(new DataColumn("EVM(%)", typeof(double)));
            //this.dtWCDMA.PrimaryKey = new DataColumn[] { dtWCDMA.Columns["#"] };

            #endregion --- LTEFDD_B2 ---

            #region --- CDMA & EVDO ---

            dtCDMA = dtWCDMA.Clone();
            //dtCDMA.Columns[8].ColumnName = "ACP -1.6MHz(dB)";
            dtEVDO = dtWCDMA.Clone();

            #endregion --- CDMA & EVDO ---

            #region --- LINEAR GMSK LB ---
            this.dtLCWLB.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtLCWLB.Columns.Add(new DataColumn("Frequency(MHz)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("Target_Pout(dBm)", typeof(string)));
            this.dtLCWLB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("ICC(mA)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("2fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("3fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("4fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("5fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("6fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("7fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("8fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("9fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("10fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("11fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("12fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("13fo(dBm)", typeof(double)));
            this.dtLCWLB.Columns.Add(new DataColumn("14fo(dBm)", typeof(double)));
            //this.dtLCWLB.PrimaryKey = new DataColumn[] { dtLCWLB.Columns["#"] };
            //this.dtLCWLBData.Columns["#"].AutoIncrement = true;
            //this.dtLCWLBData.Columns["#"].AutoIncrementSeed = 1;
            //this.dtLCWLBData.Columns["#"].AutoIncrementStep = 1;
            #endregion --- LINEAR GMSK LB ---

            #region --- LINEAR GMSK HB ---
            this.dtLCWHB.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtLCWHB.Columns.Add(new DataColumn("Frequency(MHz)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("Target_Pout(dBm)", typeof(string)));
            this.dtLCWHB.Columns.Add(new DataColumn("Pout(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("Pin(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("Gain(dB)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("ICC(mA)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("PAE(%)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("2fo(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("3fo(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("4fo(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("5fo(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("6fo(dBm)", typeof(double)));
            this.dtLCWHB.Columns.Add(new DataColumn("7fo(dBm)", typeof(double)));
            //this.dtLCWHB.PrimaryKey = new DataColumn[] { dtCWHB.Columns["#"] };
            //this.dtLCWHB.Columns["#"].AutoIncrement = true;
            //this.dtLCWHB.Columns["#"].AutoIncrementSeed = 1;
            //this.dtLCWHB.Columns["#"].AutoIncrementStep = 1;
            #endregion --- LINEAR GMSK HB ---

            #endregion Initialize  Datatable

            #region Intialize Radio Button
            foreach (Control control in this.gbMode.Controls)
            {
                RadioButton radioButton = control as RadioButton;

                if (radioButton != null)
                {
                    radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);
                    radioButton.Enabled = false;
                }
            }
            rbnCWLB.Text = TestSetting.MODE_CW_LB;
            rbnCWHB.Text = TestSetting.MODE_CW_HB;
            rbnEDGELB.Text = TestSetting.MODE_EDGE_LB;
            rbnEDGEHB.Text = TestSetting.MODE_EDGE_HB;
            rbnTDSCDMA.Text = TestSetting.MODE_TDSCDMA;
            rbnWCDMA.Text = TestSetting.MODE_WCDMA;
            rbnLTETDD_B38.Text = TestSetting.MODE_LTETDD_B38;
            rbnLTETDD_B40.Text = TestSetting.MODE_LTETDD_B40;
            rbnLTEFDDLB.Text = TestSetting.MODE_LTEFDD_LB;
            rbnLTEFDDHB.Text = TestSetting.MODE_LTEFDD_HB;
            rbnCDMA.Text = TestSetting.MODE_CDMA;
            rbnEVDo.Text = TestSetting.MODE_EVDO;
            rbnLCWLB.Text = TestSetting.MODE_LCW_LB;
            rbnLCWHB.Text = TestSetting.MODE_LCW_HB;

            rbnCWLB.Checked = true;

            #endregion Intialize Radio Button

            #region Intialize Setting TextBox Change
            foreach (Control control in this.gpParameter.Controls)
            {
                TextBox textBox = control as TextBox;

                if (textBox != null)
                {
                    //textBox.TextChanged += new EventHandler(textBox_TextChanged);
                    textBox.LostFocus += new EventHandler(textBox_LostFocus);
                    textBox.KeyDown += new KeyEventHandler(textBox_KeyDown);
                }
            }
            #endregion Intialize Setting TextBox Change

            //if (true) return;

            #region Initialize instruments

            try
            {
                if (Program.Location == LocationList.BJ_1)
                {
                    _PS_66332A = new Vanchip.Testing.PS_66332A(Instruments_address._05);

                    _Arb_33522A_USB = new Arb_33522A_USB(Instruments_VISA.Arb_33522A);
                    _Arb_33220A = new Vanchip.Testing.Arb_33220A(Instruments_address._16);

                    _PM_U2001A = new Vanchip.Testing.PM_U2001A();
                    _MXA_N9020A = new Vanchip.Testing.MXA_N9020A(Instruments_address._22);
                    _E4438C = new Vanchip.Testing.E4438C(Instruments_address._12);

                    //Initialize
                    _E4438C.Initialize();
                    _Arb_33220A.Initialize();
                    _Arb_33522A_USB.Initialize(dblPulse_Freq_Gmsk);  //208.5KHz

                    _PS_66332A.Initialize();

                    _PM_U2001A.Initialize();
                    _MXA_N9020A.Initialize(rbnDisplayON.Checked);
                }
                else if (Program.Location == LocationList.SH_1)
                {
                    _PS_66332A = new PS_66332A(Instruments_address._05);

                    _Arb_33522A_USB = new Arb_33522A_USB(Instruments_VISA.Arb_33522A);
                    _Arb_33220A = new Arb_33220A(Instruments_address._11);

                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXA_N9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new Vanchip.Testing.E4438C(Instruments_address._19);

                    _E4438C.Initialize();
                    _Arb_33220A.Initialize();
                    _Arb_33522A_USB.Initialize(dblPulse_Freq_Gmsk);  //208.5KHz

                    _PS_66332A.Initialize();

                    _PM_N1913A.Initialize(rbnDisplayON.Checked);
                    _MXA_N9020A.Initialize(rbnDisplayON.Checked);
                }
                else if (Program.Location == LocationList.SH_2)
                {
                    _PS_66332A = new PS_66332A(Instruments_address._05);
                    _PS_66319B = new PS_66319B(Instruments_address._05);
                    _Arb_33522A = new Arb_33522A(Instruments_address._10);

                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXA_N9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new Vanchip.Testing.E4438C(Instruments_address._19);

                    _E4438C.Initialize();
                    _Arb_33522A.Initialize(dblPulse_Freq_Gmsk);  //208.5KHz

                    _PS_66332A.Initialize();
                    _PS_66319B.Initialize();

                    _PM_N1913A.Initialize(rbnDisplayON.Checked);
                    _MXA_N9020A.Initialize(rbnDisplayON.Checked);
                }
                else if (Program.Location == LocationList.SH_3 ||
                                 Program.Location == LocationList.SH_4)
                {
                    _PS_66332A = new PS_66332A(Instruments_address._05);
                    _PS_66319B = new PS_66319B(Instruments_address._05);

                    _Arb_33522A = new Arb_33522A(Instruments_address._10);
                    _Arb_33220A = new Arb_33220A(Instruments_address._11);

                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXA_N9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new Vanchip.Testing.E4438C(Instruments_address._19);

                    _E4438C.Initialize();
                    _Arb_33220A.Initialize();
                    _Arb_33522A.Initialize(dblPulse_Freq_Gmsk);  //208.5KHz

                    _PS_66332A.Initialize();
                    _PS_66319B.Initialize();

                    _PM_N1913A.Initialize(rbnDisplayON.Checked);
                    _MXA_N9020A.Initialize(rbnDisplayON.Checked);
                }
                else if (Program.Location == LocationList.Simulation)
                {
                    this.Text = this.Text + "  --- Simulation ";
                }
                else
                {
                    throw new Exception("Bad Location");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Refresh();
            }

            #endregion Intialize instruments
        }
Example #2
0
        public NewLossComp()
        {
            InitializeComponent();

            lblInfo.Text = "Please click Next for cable loss calibration";
            lblError.Text = "";
            lblError.ForeColor = Color.Red;
            btnCal.Enabled = false;

            this.FormClosing += new FormClosingEventHandler(NewLossComp_FormClosing);
            this.dgvLossResult.CellFormatting += new DataGridViewCellFormattingEventHandler(dgvLossResult_CellFormatting);
            this.dgvLossResult.RowsAdded += new DataGridViewRowsAddedEventHandler(dgvLossResult_RowsAdded);

            #region Initialize GridView

            int intcolWidth = dgvLossResult.Width / 5;

            dtLossComp.Columns.Add(new DataColumn("Frequency", typeof(string)));
            dtLossComp.Columns.Add(new DataColumn("Result", typeof(string)));
            dtLossComp.Columns.Add(new DataColumn("LowLimit", typeof(string)));
            dtLossComp.Columns.Add(new DataColumn("UpperLimit", typeof(string)));
            dtLossComp.Columns.Add(new DataColumn("Status", typeof(string)));

            dgvLossResult.DataSource = dtLossComp;

            dgvLossResult.Columns["Frequency"].Width = 90;
            dgvLossResult.Columns["Result"].Width = 80;
            dgvLossResult.Columns["LowLimit"].Width = 80;
            dgvLossResult.Columns["UpperLimit"].Width = 80;
            dgvLossResult.Columns["Status"].Width = 80;

            dgvLossResult.AllowUserToAddRows = false;
            dgvLossResult.AllowUserToOrderColumns = false;
            dgvLossResult.AllowUserToResizeRows = false;
            dgvLossResult.ReadOnly = true;
            dgvLossResult.RowHeadersVisible = false;

            #endregion Initialize GridView

            #region Initialize instruments

            try
            {
                if (Program.Location == LocationList.BJ_1)
                {
                    _E4438C = new E4438C(Instruments_address._12);
                    _HP8665B = new HP8665B(Instruments_address._11);

                    _Arb33522A_USB = new Arb_33522A_USB(Instruments_VISA.Arb_33522A);
                    _Arb33120A = new Arb_33120A(Instruments_address._16);
                    _PS66332A = new PS_66332A(Instruments_address._05);

                    _PM_437B = new PM_437B(Instruments_address._23);
                    _PM_U2001A = new PM_U2001A();
                    _MXAN9020A = new MXA_N9020A(Instruments_address._22);

                    _E4438C.Initialize();
                    _HP8665B.Initialize();

                    _Arb33120A.Initialize();
                    _Arb33522A_USB.Initialize(208.5);
                    _PS66332A.Initialize();

                    _PM_437B.Initialize();
                    _PM_U2001A.Initialize();
                    _MXAN9020A.Initialize(true);
                    _MXAN9020A.SetAttenuattor(0);
                }
                else if (Program.Location == LocationList.SH_1)
                {
                    _PS66332A = new PS_66332A(Instruments_address._05);
                    _Arb33522A_USB = new Arb_33522A_USB(Instruments_VISA.Arb_33522A);
                    _Arb33220A = new Arb_33220A(Instruments_address._11);
                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXAN9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new E4438C(Instruments_address._19);

                    _E4438C.Initialize();
                    _Arb33220A.Initialize();
                    _Arb33522A_USB.Initialize(TestSetting.ARB_PULSE_FREQ_GMSK_in_khz);
                    _PS66332A.Initialize();
                    _PM_N1913A.Initialize(true);
                    _MXAN9020A.Initialize(true);
                    _MXAN9020A.SetAttenuattor(0);
                }
                else if (Program.Location == LocationList.SH_2)
                {
                    _PS66332A = new PS_66332A(Instruments_address._05);
                    _Arb33522A = new Arb_33522A(Instruments_address._10);
                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXAN9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new E4438C(Instruments_address._19);
                    _HP8665B = new HP8665B(Instruments_address._20);

                    _E4438C.Initialize();
                    _HP8665B.Initialize();
                    _PS66332A.Initialize();
                    _PM_N1913A.Initialize(true);
                    _Arb33522A.Initialize(TestSetting.ARB_PULSE_FREQ_GMSK_in_khz);
                    _MXAN9020A.Initialize(true);
                    _MXAN9020A.SetAttenuattor(0);
                }
                else if (Program.Location == LocationList.SH_3 || Program.Location == LocationList.SH_4)
                {
                    _PS66332A = new PS_66332A(Instruments_address._05);
                    _Arb33522A = new Arb_33522A(Instruments_address._10);
                    _Arb33220A = new Arb_33220A(Instruments_address._11);
                    _PM_N1913A = new PM_N1913A(Instruments_address._15);
                    _MXAN9020A = new MXA_N9020A(Instruments_address._18);
                    _E4438C = new E4438C(Instruments_address._19);

                    _E4438C.Initialize();
                    _PS66332A.Initialize();
                    _PM_N1913A.Initialize(true);
                    _Arb33220A.Initialize();
                    _Arb33522A.Initialize(TestSetting.ARB_PULSE_FREQ_GMSK_in_khz);
                    _MXAN9020A.Initialize(true);
                    _MXAN9020A.SetAttenuattor(0);
                }
                else
                {
                    throw new Exception("Bad Location");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Refresh();
            }

            #endregion Intialize instruments
        }