From 7baca4061db66b1c5fde1c200f0d9323ba1be23f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 26 Jan 2022 19:29:26 +0200 Subject: Color shade window. GUI. Related Work Items: #5831 --- .../Models/ColorShadesModel.cs | 6 +- .../ViewModels/ColorCalibrationViewVM.cs | 2 +- .../ViewModels/ColorShadeTabVM.cs | 14 ++- .../ViewModels/ColorShadeViewVM.cs | 24 ++-- .../Views/ColorShadeView.xaml | 136 +++++++++++++-------- .../Views/MachineTestResultsView.xaml | 3 + .../Views/TestResultsView.xaml | 42 ++++--- 7 files changed, 141 insertions(+), 86 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorShadesModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorShadesModel.cs index cc4351891..98d4afe07 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorShadesModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorShadesModel.cs @@ -11,16 +11,20 @@ namespace Tango.MachineStudio.ThreadExtensions.Models { public class ColorShadesDataItem { - public double ColorNumber { get; set; } + public int ColorNumber { get; set; } public double L { get; set; } public double A { get; set; } public double B { get; set; } public double C { get; set; } public double M { get; set; } public double Y { get; set; } + public double K { get; set; } + public double TI { get; set; } public double L2 { get; set; } public double A2 { get; set; } public double B2 { get; set; } + public double DelteE { get; set; } + } public void GetDataFromFile(string fileName, out List items, ref string errors) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs index fc15c8caf..3f4d8a415 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs @@ -370,7 +370,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels newtab.RmlExtensionColorCalibrationsTest = new RmlExtensionColorCalibrationsTest() { - RmlExtensionColorCalibrationGuid = RMLExtentionGUID, + RmlExtensionColorCalibrationGuid = RmlExtensionColorCalibration.Guid, Name = name }; var liquidDataCollection = new SynchronizedObservableCollection(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeTabVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeTabVM.cs index df0ba521c..eaaf7dc96 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeTabVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeTabVM.cs @@ -83,13 +83,14 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels #endregion - RelayCommand ImportColorsCommand { get; set; } + public RelayCommand ImportColorsCommand { get; set; } public ColorShadeTabVM(INotificationProvider notification, IActionLogManager actionLogManager) { _notification = notification; _actionLogManager = actionLogManager; ImportColorsCommand = new RelayCommand(ImportColors); + RemovedDataList = new List(); } private void ImportColors(object obj) @@ -108,11 +109,18 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels if (false == String.IsNullOrEmpty(errors) || items == null || items.Count == 0) { _notification.ShowError("An error occurred while trying to import data form the selected excel file. Please check the file format if valid and is available to read."); - + } else { - //Settings data to object + if (RemovedDataList.Count == 0 && RmlExtensionColorShadesTest.RmlExtensionColorShadesTestsData.Count > 0) + { + RemovedDataList = new List(RmlExtensionColorShadesTest.RmlExtensionColorShadesTestsData.ToList()); + } + RmlExtensionColorShadesTest.RmlExtensionColorShadesTestsData.Clear(); + items.ForEach(x => RmlExtensionColorShadesTest.RmlExtensionColorShadesTestsData.Add(new RmlExtensionColorShadesTestsData() { + ColorNum = x.ColorNumber, L = x.L, A = x.A, B = x.B, C = x.C, M = x.M, Y = x.Y, K = x.K, Ti = x.TI, LRes = x.L2, ARes = x.A2, BRes = x.B2, DeltaE = x.DelteE })); + } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeViewVM.cs index b1dac5ce9..f305d5139 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorShadeViewVM.cs @@ -231,14 +231,14 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels newtab.RmlExtensionColorShadesTest = new RmlExtensionColorShadesTest() { - RmlExtensionColorShadesGuid = RMLExtentionGUID, + RmlExtensionColorShadesGuid = RmlExtensionColorShade.Guid, Name = name }; if (RmlExtensionColorShade != null) { RmlExtensionColorShade.RmlExtensionColorShadesTests.Add(newtab.RmlExtensionColorShadesTest); } - + return newtab; } #endregion @@ -372,21 +372,15 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels foreach (var tab in ColorShadeTabs) { tab.RmlExtensionColorShadesTest.LastUpdated = lastUpdated; - //var removedPoints = tab.RemovedPoints; - //foreach (var liquidData in tab.RmlExtensionColorCalibrationsTest.RmlExtensionColorCalibrationsTestsLiquidData) - //{ - // var liquidtype = _liquids.Where(l => l.Guid == liquidData.LiquidTypeGuid).FirstOrDefault(); - // if (liquidtype != null && removedPoints.ContainsKey(liquidtype.Type)) - // { - // _active_context.RmlExtensionColorCalibrationsTestsLiquidDataPoints.RemoveRange(removedPoints[liquidtype.Type]); - // } - // liquidData.LastUpdated = lastUpdated; - //} - //tab.RemovedPoints.Clear(); + var removedPoints = tab.RemovedDataList; + if (removedPoints.Count > 0) + { + _active_context.RmlExtensionColorShadesTestsData.RemoveRange(removedPoints); + } + tab.RemovedDataList.Clear(); } await _active_context.SaveChangesAsync(); - - // LoadColorParameters(); + } catch (Exception ex) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorShadeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorShadeView.xaml index 70df4d6bf..f8aaa5e24 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorShadeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorShadeView.xaml @@ -17,6 +17,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml index b46cb4cf9..820c68715 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml @@ -61,6 +61,9 @@ + + + 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 50a2537e1..b8a4b7f28 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 @@ -265,20 +265,16 @@ - - - - Conclusion: - - - - - Comments: - - - - - + + + + + + + + + + @@ -631,7 +627,23 @@ - + + + + + + + + + + + Conclusion: + + + Comments: + + + -- cgit v1.3.1