diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-01-26 19:29:26 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-01-26 19:29:26 +0200 |
| commit | 7baca4061db66b1c5fde1c200f0d9323ba1be23f (patch) | |
| tree | dddc4bc64edf9fc44037f74ab3ebe3636d22d7c5 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels | |
| parent | afdaadac0ddb76b5e905ef5eeda581ade4324f9b (diff) | |
| download | Tango-7baca4061db66b1c5fde1c200f0d9323ba1be23f.tar.gz Tango-7baca4061db66b1c5fde1c200f0d9323ba1be23f.zip | |
Color shade window. GUI.
Related Work Items: #5831
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels')
3 files changed, 21 insertions, 19 deletions
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<RmlExtensionColorCalibrationsTestsLiquidData>(); 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<RmlExtensionColorShadesTestsData>(); } 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<RmlExtensionColorShadesTestsData>(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) { |
