From c4e8c98689dcedf035484cd079eac8d9678286db Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 24 Jul 2022 16:45:32 +0300 Subject: Added Washing test results tables Related Work Items: #6660 --- .../ViewModels/TestResultsViewVM.cs | 35 ++- .../Views/TestResultsView.xaml | 316 +++++++++++++-------- 2 files changed, 236 insertions(+), 115 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs index 8a75c526f..cc1bba0e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs @@ -34,6 +34,10 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels public event EventHandler SaveTestResults; #region Properties + + public List WashingTestMaterials { get; set; } + + private SynchronizedObservableCollection _selectedTestResults; public SynchronizedObservableCollection SelectedTestResults @@ -269,15 +273,21 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } _active_context = ObservablesContext.CreateDefault(); ResultTabs.Clear(); - LogManager.Log("Loading selected test results..."); + + if(WashingTestMaterials == null) + WashingTestMaterials = _active_context.WashingTestMaterials.ToList(); + + LogManager.Log("Loading selected test results..."); using (_notification.PushTaskItem("Loading Test Results Parameters ...")) { - var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().BuildAsync(); + var testResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(SelectedMachineGUID).WithRubbingAndTensileResults().WithTestResultsFiles().WithWashingTestResults().BuildAsync(); SelectedTestResults = testResults.OrderBy(x => x.ResultIndex).ToSynchronizedObservableCollection(); foreach (var result in SelectedTestResults) { - ResultTabs.Add(new TestResultViewVM(_notification, _actionLogManager) { TestResult = result, ThreadName = ThreadName }); + var testResultViewVM = new TestResultViewVM(_notification, _actionLogManager) { TestResult = result, ThreadName = ThreadName }; + CreateWashingResult(testResultViewVM); + ResultTabs.Add(testResultViewVM); if (result.ResultIndex == 1) { SelectedTab = ResultTabs[ResultTabs.Count - 1]; @@ -324,9 +334,28 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels tensileresults.Add(new TensileResult() { RmlExtensionTestResultsGuid = newtab.TestResult.Guid, TestResultColor = TestResultColors.WHITE, ColorPercent = null }); newtab.TestResult.TensileResults = tensileresults; + CreateWashingResult(newtab); + return newtab; } + private void CreateWashingResult(TestResultViewVM testresultViewVM) + { + if(testresultViewVM.TestResult.RmlExtensionTestWashingResults != null) + return; + + var whashingresults = new SynchronizedObservableCollection(); + foreach (var material in WashingTestMaterials) + { + foreach (WashingResultColor color in Enum.GetValues(typeof(WashingResultColor))) + { + whashingresults.Add(new RmlExtensionTestWashingResult() { RmlExtensionTestResultsGuid = testresultViewVM.TestResult.Guid, WashingTestMaterialsGuid = material.Guid, Color = (int)color }); + } + } + testresultViewVM.TestResult.RmlExtensionTestWashingResults = whashingresults; + + } + #endregion #region Save diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml index f6262b52d..0aceebc9a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml @@ -255,57 +255,148 @@ - - - - - - - - - - + + + + + + - - - - Process Parameters - + + + + Process Parameters + - - - Dryer temperature - - - - - - Tunnel temperature - - - - - - Tunnel flow - - - - - - Tunnel AVG temperature - - - - - - - - - Rubbing results - - + + + Dryer temperature + + + + + + Tunnel temperature + + + + + + Tunnel flow + + + + + + Tunnel AVG temperature + + + + + + + + + + Rubbing results + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uniformity + + + + Uniformity + + + Severity + + + Zone 1 + + + + + - + + + + + Zone 2 + + + + + - + + + + + + + + Washing results + - + - - + + - - + + + + + + + + + - + - + - - - + + + + + + + + + + @@ -360,29 +464,49 @@ + + + + + + + + + + + + + + + + + + + + Tension through the thread path Tension in Zone - + - Tensiometer (gr) - + Tensiometer (gr) + Tension in Zone - + MS - + - Head - + Head + @@ -392,7 +516,7 @@ BTSR - + @@ -402,7 +526,7 @@ After dryer - + @@ -412,7 +536,7 @@ Puller tension - + @@ -422,7 +546,7 @@ Winder - + @@ -441,7 +565,7 @@ - + Mechanical properties @@ -499,9 +623,9 @@ - + - + @@ -515,45 +639,12 @@ - + - - Uniformity - - - - Uniformity - - - Severity - - - Zone 1 - - - - - - - - - - - Zone 2 - - - - - - - - - - - - COF @@ -599,12 +690,13 @@ - + - + + - - + + -- cgit v1.3.1