Пример #1
0
        public BenchTest()
        {
            InitializeComponent();
            this.FormClosing += new FormClosingEventHandler(BenchTest_FormClosing);

            #region Initialize  Datatable

            this.dtResult.Columns.Add(new DataColumn("#", typeof(int)));
            this.dtResult.Columns.Add(new DataColumn("Test Description", typeof(string)));
            this.dtResult.Columns.Add(new DataColumn("Units", typeof(string)));
            this.dtResult.Columns.Add(new DataColumn("Result", typeof(string)));
            this.dtResult.Columns.Add(new DataColumn("LowLimit", typeof(string)));
            this.dtResult.Columns.Add(new DataColumn("UpperLimit", typeof(string)));
            this.dtResult.Columns.Add(new DataColumn("Status", typeof(string)));
            this.dtResult.PrimaryKey = new DataColumn[] { dtResult.Columns["Test Description"] };

            #endregion Initialize  Datatable

            #region Initialize GridView

            this.dgvResult.DataSource = this.dtResult;

            this.dgvResult.Columns["#"].Width = 35;
            this.dgvResult.Columns["Test Description"].Width = 177;
            this.dgvResult.Columns["Units"].Width = 60;
            this.dgvResult.Columns["Result"].Width = 90;
            this.dgvResult.Columns["LowLimit"].Width = 80;
            this.dgvResult.Columns["UpperLimit"].Width = 80;
            this.dgvResult.Columns["Status"].Width = 65;

            this.dgvResult.AllowUserToAddRows = false;
            this.dgvResult.RowHeadersVisible = false;
            this.dgvResult.ReadOnly = true;

            #endregion Initialize GridView

            #region Initialize instruments

            try
            {
                #region BJ_1
                if (Program.Location == LocationList.BJ_1)
                {
                    _SRC_3G = new Vanchip.Testing.E4438C(Instruments_address._19);
                    _SRC_4G = new Vanchip.Testing.E4438C(Instruments_address._20);

                    _Arb_Mipi = new Arb_33522A_USB(Instruments_VISA.Arb_33522A);
                    _Arb_Ramp = new Arb_33522A(Instruments_address._10);
                    _Arb_Ctrl = new Vanchip.Testing.Arb_33120A(Instruments_address._11);

                    _PS_VCC = new Vanchip.Testing.PS_66332A(Instruments_address._05);
                    _PS_VBAT = new Vanchip.Testing.PS_66319B(Instruments_address._06);

                    _MSR_3G = new Vanchip.Testing.MXA_N9020A(Instruments_address._18);
                    _MSR_4G = new Vanchip.Testing.MXA_N9020A(Instruments_address._17);

                    //Initialize
                    _SRC_3G.Initialize();
                    _SRC_4G.Initialize();

                    _Arb_Ctrl.Initialize();
                    _Arb_Mipi.Initialize(dblPulse_Freq);  //208.5KHz
                    _Arb_Ramp.Initialize(dblPulse_Freq);  //208.5KHz

                    _PS_VCC.Initialize();
                    _PS_VBAT.Initialize();

                    _MSR_3G.Initialize(true);
                    _MSR_4G.Initialize(true);
                }
                #endregion BJ_1

                else
                {
                    throw new Exception("Bad Location");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Refresh();
            }

            #endregion Intialize instruments
        }
Пример #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
        }