private bool TestItemIni() { TestItem testItem = (TestItem)LocalConfig.GetObjFromXmlFile("config\\testitem.xml", typeof(TestItem)); chkList_Diff.Items.Clear(); chkList_Single.Items.Clear(); chkList_TDR.Items.Clear(); chkList_SPair.Items.Clear(); chkList_NextPair.Items.Clear(); chkList_FextPair.Items.Clear(); foreach (string temp in testItem.Diff) { chkList_Diff.Items.Add(temp, false); } foreach (string temp in testItem.Single) { chkList_Single.Items.Add(temp, false); } foreach (string temp in testItem.Tdr) { chkList_TDR.Items.Add(temp, false); } foreach (string temp in testItem.DiffPair) { chkList_SPair.Items.Add(temp, false); } foreach (string temp in testItem.NextPair) { chkList_NextPair.Items.Add(temp, false); } foreach (string temp in testItem.FextPair) { chkList_FextPair.Items.Add(temp, false); } foreach (string temp in testItem.Speed) { cmbSpeed.Items.Add(temp); } foreach (string temp in testItem.ProductType) { cmbTypeL.Items.Add(temp); cmbTypeR.Items.Add(temp); } foreach (string temp in testItem.Power) { cmbPower.Items.Add(temp); } return(true); }
private void PnChangeHandle(string pn) { ResetUi(); string msg = ""; _curretnProject = ProjectHelper.Find(pn); _hardware = (Hardware)LocalConfig.GetObjFromXmlFile("config\\hardware.xml", typeof(Hardware)); if (_curretnProject == null) { //AddStatus("未能找到对应的料号档案"); AddStatus(LanguageHelper.GetMsgText("未能找到对应的料号档案")); return; } //AddStatus("成功找到对应的料号档案"); AddStatus(LanguageHelper.GetMsgText("成功找到对应的料号档案")); if (_hardware == null) { AddStatus("未能找到对应的硬件设置档案"); return; } AddStatus("成功找到对应硬件设置档案"); if (!Util.SetHardware(_hardware, ref _switch, ref _iAnalyzer, ref msg, BlockedMsg)) { AddStatus(msg); return; } _iAnalyzer.LoadCalFile(_curretnProject.CalFilePath, ref msg); AddStatus("连接开关成功"); AddStatus("连接网分设备成功"); bool setProjectFlag = Util.SetTestParams(_curretnProject, ref _testConfigs); if (!setProjectFlag) { AddStatus("开关对数与测试对数不一致"); return; } SetInformation(); _spec = TestUtil.GetPnSpec(_curretnProject); ClearTestItems(); DisplayTestItems(); AddCharts(); SetKeyPoint(); btnTest.Enabled = true; txtSN.Focus(); }
private void HardwareLoad() { Hardware hardware = (Hardware)LocalConfig.GetObjFromXmlFile("config\\hardware.xml", typeof(Hardware)); cmbNwaType.SelectedIndex = cmbNwaType.FindString(hardware.AnalyzerType.ToString()); cmbSwitchBox.SelectedIndex = cmbSwitchBox.FindString(hardware.SwitchBox.ToString()); txtNwaVisaAdd.Text = hardware.VisaNetWorkAnalyzer; txtSbVisaAdd.Text = hardware.VisaSwitchBox; cmbAdapterType.SelectedIndex = cmbAdapterType.FindString(hardware.Adapter.ToString()); cmbAdpaterPort.Text = hardware.AdapterPort; txtSnpSaveFolder.Text = hardware.SnpFolder; txtTxtSaveFolder.Text = hardware.TxtFolder; numNwaRespTime.Value = hardware.AnalyzerResponseTime; numSwtRespTime.Value = hardware.SwitchResponseTime; }