Пример #1
0
 private void GenerateReport(Savepath savepath)
 {
     //DirectoryInfo info = new DirectoryInfo(savepath.TxtFilePath);
     //String path = info.Parent.FullName;
     try
     {
         Reporter aReporter = new Reporter(savepath.ReportTempletePath,
                                           savepath.TxtFilePath + "\\" + savepath.Sn + ".xlsx",
                                           savepath.TxtFilePath + "\\txt", 1, 1);
         error rError = aReporter.genrate();
     }
     catch (Exception e)
     {
         LogHelper.WriteLog("生成报告错误", e);
         Ui.MessageBoxMuti(e.Message);
     }
 }
Пример #2
0
 private void CopySpec(Savepath savepath)
 {
     File.Copy(Gloabal.freSpecFilePath, savepath.TxtFilePath + "\\txt\\1\\Freq Spec.txt", true);
     File.Copy(Gloabal.timeSpecFilePath, savepath.TxtFilePath + "\\txt\\1\\Impedance Spec.txt", true);
 }
Пример #3
0
 public void DoTestManual(TestConfig[] testConfigs, Dictionary <string, object> chartDic,
                          AChart aChart, FormUi formUi, Dictionary <string, plotData> spec, Dictionary <string, float[]> keyPoint, Savepath savePath)
 {
 }
Пример #4
0
 private void SaveSummary(Savepath savepath, Dictionary <string, string> itemTestResult, Dictionary <string, string> information)
 {
     SetInformation(savepath.Sn);
     CopySpec(savepath);
     TestUtil.SaveResult_Sample(savepath.XmlPath, itemTestResult, information);
 }
Пример #5
0
        public void DoTest(TestConfig[] testConfigs, Dictionary <string, object> chartDic,
                           AChart aChart, FormUi formUi, Dictionary <string, plotData> spec, Dictionary <string, float[]> keyPoint, Savepath savepath, bool report)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            TestInitia(formUi, chartDic, aChart);
            StartProducer(testConfigs, formUi, savepath.SnpFilePath);
            Thread.Sleep(2000);
            StartConsumer(testConfigs, chartDic, aChart, formUi, spec, savepath.TxtFilePath);

            formUi.SetKeyPointList(GetKeyValue(keyPoint));
            SetTestResult(formUi.AddStatus, formUi.SetResult, _testResult);


            //SetInformation(savepath.Sn);
            //CopySpec(savepath);
            //TestUtil.SaveResult_Sample(savepath.XmlPath, _itemTestResult, _information);
            SaveSummary(savepath, _itemTestResult, _information);
            if (report)
            {
                GenerateReport(savepath);
            }
            else
            {
                formUi.AddStatus(LanguageHelper.GetMsgText("报告生成设定为false,取消生成报告"));
            }

            stopwatch.Stop();                      //  停止监视
            TimeSpan timespan = stopwatch.Elapsed; //  获取当前实例测量得出的总时间

            formUi.AddStatus(LanguageHelper.GetMsgText("测试结束"));
            formUi.AddStatus(LanguageHelper.GetMsgText("测试用时") + String.Format(":{0:F}S", timespan.TotalSeconds));
        }