diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
4 files changed, 38 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> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index ac52d55c5..eca12dfef 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -544,6 +544,13 @@ <Name>Tango.MachineStudio.Common</Name> </ProjectReference> <!--ColorLib--> + <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v6\Tango.ColorLib_v6.vcxproj"> + <Project>{D74E49AA-4C6B-4427-BEFF-D7CE2690D059}</Project> + <Name>Tango.ColorLib_v6</Name> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + <OutputItemType>Content</OutputItemType> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </ProjectReference> <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v5\Tango.ColorLib_v5.vcxproj"> <Project>{0F87D32E-B65F-4AE8-862C-29F4CCC38240}</Project> <Name>Tango.ColorLib_v5</Name> |
