From 009a02d57e244e9a8ed5d70fc0743f10f68f5a33 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 11 Jul 2018 16:12:53 +0300 Subject: Done some work on PPC & Color Lab Module. --- .../ViewModels/MainViewVM.cs | 41 ++++++++++++ .../Views/MainView.xaml | 73 ++++++++++++++-------- 2 files changed, 87 insertions(+), 27 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index 48d16104a..0e9109b28 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using Tango.BL; using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Controls; @@ -32,6 +33,33 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region Properties + private bool _isVolumesOutOfRange; + /// + /// Gets or sets a value indicating whether the liquid volumes are out of range. + /// + public bool IsVolumesOutOfRange + { + get { return _isVolumesOutOfRange; } + set + { + if (_isVolumesOutOfRange != value) + { + _isVolumesOutOfRange = value; + RaisePropertyChangedAuto(); + } + } + } + + private bool _isOutOfGamut; + /// + /// Gets or sets a value indicating whether the source color is out of gamut. + /// + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set { _isOutOfGamut = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection _machines; /// /// Gets or sets the machines. @@ -280,6 +308,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels var output = TangoColorConverter.GetSuggestions(input); + IsOutOfGamut = output.OutOfGamut; + HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(output); }); } @@ -396,6 +426,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels try { if (LiquidsCalibrationData == null) return; + + //TODO: This is temporary because of out of range volumes. + if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 200) + { + IsVolumesOutOfRange = true; + return; + } + else + { + IsVolumesOutOfRange = false; + } ConversionInput input = new ConversionInput(); input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index 8b62604d6..d8ef015be 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -26,6 +26,7 @@ + @@ -163,6 +164,12 @@ + + + + Color is out of gamut + + @@ -254,30 +261,39 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -286,11 +302,14 @@ COMPOSITE - - - - - + + + + + + + + -- cgit v1.3.1