diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-09-20 13:57:22 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-09-20 13:57:22 +0300 |
| commit | 2ebd882d708fe4d78d985fcd5d318d8f1794eca9 (patch) | |
| tree | ec5bdecf3aae29f6949f483d3298d590f03c02d7 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | a2c128c1c00ac74c9c1835a8581aa8f2c4123bde (diff) | |
| download | Tango-2ebd882d708fe4d78d985fcd5d318d8f1794eca9.tar.gz Tango-2ebd882d708fe4d78d985fcd5d318d8f1794eca9.zip | |
Added support for ColorLib 6.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
3 files changed, 31 insertions, 25 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs index 9c2c957ab..0882d43e0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -227,8 +227,9 @@ namespace Tango.MachineStudio.RML.ViewModels //input.DeltaChroma = DeltaChroma; //input.DeltaL = DeltaL; input.ForwardData = ByteString.CopyFrom(CCT.Data); - input.GbdData = ByteString.CopyFrom(GBD.Data); - input.LubData = ByteString.CopyFrom(LUB.Data); + + if (GBD != null) input.GbdData = ByteString.CopyFrom(GBD.Data); + if (LUB != null) input.LubData = ByteString.CopyFrom(LUB.Data); input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; @@ -372,8 +373,8 @@ namespace Tango.MachineStudio.RML.ViewModels ConversionInput input = new ConversionInput(); input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.ForwardData = ByteString.CopyFrom(CCT.Data); - input.GbdData = ByteString.CopyFrom(GBD.Data); - input.LubData = ByteString.CopyFrom(LUB.Data); + if (GBD != null) input.GbdData = ByteString.CopyFrom(GBD.Data); + if (LUB != null) input.LubData = ByteString.CopyFrom(LUB.Data); input.GenerateHive = false; input.InputCoordinates = new InputCoordinates(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index bb6a3c467..6da1cf64b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -444,23 +444,7 @@ namespace Tango.MachineStudio.RML.ViewModels .WithSpools() .BuildAsync(); - if (ActiveRML.Cct != null) - { - _selectedCCT = CCTS.SingleOrDefault(x => x.Guid == ActiveRML.Cct.Guid); - RaisePropertyChanged(nameof(SelectedCCT)); - } - - if (ActiveRML.Gbd != null) - { - _selectedGBD = GBDS.SingleOrDefault(x => x.Guid == ActiveRML.Gbd.Guid); - RaisePropertyChanged(nameof(SelectedGBD)); - } - - if (ActiveRML.Lub != null) - { - _selectedLUB = LUBS.SingleOrDefault(x => x.Guid == ActiveRML.Lub.Guid); - RaisePropertyChanged(nameof(SelectedLUB)); - } + InvalidateRelayCommands(); if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) { @@ -526,6 +510,27 @@ namespace Tango.MachineStudio.RML.ViewModels LiquidTypesRmls = LiquidTypesRmls, }; + if (ActiveRML.Cct != null) + { + _selectedCCT = CCTS.SingleOrDefault(x => x.Guid == ActiveRML.Cct.Guid); + await OnSelectedCCTChanged(); + RaisePropertyChanged(nameof(SelectedCCT)); + } + + if (ActiveRML.Gbd != null) + { + _selectedGBD = GBDS.SingleOrDefault(x => x.Guid == ActiveRML.Gbd.Guid); + await OnSelectedGBDChanged(); + RaisePropertyChanged(nameof(SelectedGBD)); + } + + if (ActiveRML.Lub != null) + { + _selectedLUB = LUBS.SingleOrDefault(x => x.Guid == ActiveRML.Lub.Guid); + await OnSelectedLUBChanged(); + RaisePropertyChanged(nameof(SelectedLUB)); + } + ColorCalibrationVM = new ColorCalibrationViewVM(_notification) { RML = ActiveRML, @@ -554,7 +559,7 @@ namespace Tango.MachineStudio.RML.ViewModels private async Task OnSelectedCCTChanged() { - if (SelectedCCT != null && !SelectedCCT.IsNew) + if (ColorConversionViewVM != null && SelectedCCT != null && !SelectedCCT.IsNew) { using (_notification.PushTaskItem("Loading CCT data...")) { @@ -575,7 +580,7 @@ namespace Tango.MachineStudio.RML.ViewModels private async Task OnSelectedGBDChanged() { - if (SelectedGBD != null && !SelectedGBD.IsNew) + if (ColorConversionViewVM != null && SelectedGBD != null && !SelectedGBD.IsNew) { using (_notification.PushTaskItem("Loading GBD data...")) { @@ -596,7 +601,7 @@ namespace Tango.MachineStudio.RML.ViewModels private async Task OnSelectedLUBChanged() { - if (SelectedLUB != null && !SelectedLUB.IsNew) + if (ColorConversionViewVM != null && SelectedLUB != null && !SelectedLUB.IsNew) { using (_notification.PushTaskItem("Loading LUB data...")) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e2ef8b229..7e3b4fa4a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -263,7 +263,7 @@ </StackPanel> <TextBlock Margin="0 40 0 0" Text="Color Conversion Version:" HorizontalAlignment="Center"></TextBlock> - <mahapps:NumericUpDown Minimum="1" Maximum="5" Value="{Binding ActiveRML.ColorConversionVersion}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> + <mahapps:NumericUpDown Minimum="1" Maximum="6" Value="{Binding ActiveRML.ColorConversionVersion}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> <CheckBox ToolTip="Use the color conversion engine to generate gradients" IsChecked="{Binding ActiveRML.UseColorLibGradients}" HorizontalAlignment="Left" Margin="0 20 0 0">Enable Gradient Generation</CheckBox> <CheckBox ToolTip="Use light inks when converting colors to liquid volumes" IsChecked="{Binding ActiveRML.UseLightInks}" HorizontalAlignment="Left" Margin="0 10 0 0">Use Light Inks</CheckBox> |
