| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public TsExecution() |
| | | { |
| | | DataContext = this; |
| | |
| | | if (!string.IsNullOrEmpty(lastModel)) |
| | | { |
| | | var product = Products.FirstOrDefault(p => p.Name == lastModel); |
| | | if (product != null) SelectedProduct = product; |
| | | goto Write; |
| | | if (product != null) |
| | | { |
| | | SelectedProduct = product; |
| | | RefershUI(); |
| | | return; |
| | | } |
| | | goto Write; |
| | | |
| | | Write: |
| | | } |
| | | SelectedProduct = Products[0]; |
| | | engine?.Globals.SetValString("StationState.ProductModel", 1, Products[0].Name); |
| | | |
| | | RefershUI(); |
| | | } |
| | | SampleStatus = false; |
| | |
| | | fail = Convert.ToInt32(IniFileHelper.ReadIniData("Count", "Fail", "0", CountIniPath)); |
| | | } |
| | | |
| | | private string csvDir; |
| | | |
| | | /// <summary> |
| | | /// 读取配置文件里的几个属性 |
| | | /// </summary> |
| | |
| | | catch |
| | | { |
| | | UI_ShowInfoDock = false; |
| | | } |
| | | |
| | | try |
| | | { |
| | | |
| | | value = ParameterManager.GetCommonParameterByName("TestReportFolder"); |
| | | csvDir = value.Value; |
| | | if (!Directory.Exists(csvDir)) |
| | | { |
| | | Directory.CreateDirectory(csvDir); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | csvDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestReport"); |
| | | } |
| | | |
| | | //Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableMes", "true", CountIniPath)); |
| | |
| | | //MaskWindow mask = new MaskWindow(); |
| | | try |
| | | { |
| | | engine?.Globals.SetValString("StationState.ProductModel", 1, SelectedProduct?.Name); |
| | | engine?.CommitGlobalsToDisk(promptOnSaveConflicts: false); |
| | | this.modeSeq = this.engine.GetSequenceFileEx(@"C:\Program Files\National Instruments\TestStand 2020\Components\Models\TestStandModels\ParallelModel.seq"); |
| | | this.testSeq = this.engine.GetSequenceFileEx(this.testSeqFile, 0, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType); |
| | | |
| | | //var sb = testSeq.GetSequenceByName("MainSequence"); |
| | | //sb. |
| | | |
| | | this.execution = this.engine.NewExecution(this.testSeq, "Test UUTs", this.modeSeq, false, 0, null, null, null); |
| | | IsTesting = true; |
| | | } |
| | |
| | | this.tsSockets[index].Barcode = barcode; |
| | | } |
| | | |
| | | public void SavePositionCSV(int index) |
| | | { |
| | | var time = DateTime.Now; |
| | | string status = this.tsSockets[index].Status == "Passed" ? "PASS" : "FAIL"; |
| | | string csvPath = Path.Combine(csvDir, SelectedProduct?.Name ?? "未知产品", time.ToString("yyyyMMdd"), status, |
| | | $"{this.tsSockets[index].Barcode}-{time.ToString("HHmmss")}.csv"); |
| | | this.tsSockets[index].WriteToCSV(csvPath); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TestStand用户交互事件 |
| | | /// </summary> |
| | |
| | | this.tsSockets[Index].SetTestProcess(ProcessVal); |
| | | break; |
| | | case 10031://导出CSV |
| | | this.tsSockets[Index].WriteToCSV(e.uiMsg.StringData); |
| | | SavePositionCSV(Index); |
| | | break; |
| | | case 10032://按下标暂停测试 |
| | | this.tsSockets[Index].ShowPausePanel(); |