aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-01-29 10:39:32 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-01-29 10:39:32 +0200
commitff8c853951d903d33fd2f3290fd82fda018edd3c (patch)
treecb464bcc3fdc0e52a381255d88d568e42c7ae1f3 /Software
parent9c14a83c49a6dc6c449c98f3d5754dd45313c68c (diff)
downloadTango-ff8c853951d903d33fd2f3290fd82fda018edd3c.tar.gz
Tango-ff8c853951d903d33fd2f3290fd82fda018edd3c.zip
Fine Tuning in CMYK and Catalog
Related Work Items: #8000, #8058
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/DeltaLCHToTextConverter.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml29
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs32
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml26
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml.cs16
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs124
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TestColor.cs5
7 files changed, 191 insertions, 43 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/DeltaLCHToTextConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/DeltaLCHToTextConverter.cs
index 3b5a28570..63dc92bcf 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/DeltaLCHToTextConverter.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/DeltaLCHToTextConverter.cs
@@ -35,7 +35,7 @@ namespace Tango.PPC.Jobs.Converters
}
if (type == "H")
{
- if((number >=0 && number <45) || (number >= 315 && number <=360))
+ if((number >0 && number <45) || (number >= 315 && number <=360))
return "Redder";
if ((number >= 45 && number < 135) )
return "Yellower";
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
index 01f88930f..28958cbc8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
@@ -317,8 +317,8 @@
</touch:TouchButton>
</Border>
<!--<Border Background="{Binding Color}" Width="65" Height="65" CornerRadius="6"></Border>-->
- <TextBlock Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" Text="{Binding Name}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList , Converter={StaticResource BooleanToVisibilityInverseConverter}}"></TextBlock>
- <touch:TouchTextBox MaxLength="12" Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" Text="{Binding Name, UpdateSourceTrigger=LostFocus, Mode=TwoWay}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList, Converter={StaticResource BooleanToVisibilityConverter}}"/>
+ <TextBlock Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" HorizontalAlignment="Left" TextAlignment="Left" Text="{Binding Name}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" ToolTip="{Binding Name}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList , Converter={StaticResource BooleanToVisibilityInverseConverter}}"></TextBlock>
+ <touch:TouchTextBox MaxLength="24" Grid.Row="1" Margin="3 12 0 10" MaxWidth="78" Text="{Binding Name, UpdateSourceTrigger=LostFocus, Mode=TwoWay}" FontSize="{StaticResource TangoSmallFontSizeBar}" Visibility="{Binding DataContext.EditColorsGroupMode , ElementName=colorLibraryList, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left" TextBlock.TextAlignment="Left"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
@@ -471,7 +471,7 @@
</StackPanel>
</ControlTemplate>
</touch:TouchImageButton.Template>
- </touch:TouchImageButton>
+ </touch:TouchImageButton>
<ContentControl Name="myLabColors" Grid.Row="0" ContentTemplate="{StaticResource myColorsBtn}" Content="{Binding}" IsTabStop="False"/>
@@ -530,6 +530,18 @@
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
+ <touch:TouchImageButton Grid.Row="0" Margin="0 2 45 0" HorizontalAlignment="Right" Width="Auto" Height="70" EnableDropShadow="False" Background="Transparent" BorderThickness="0"
+ Command="{ Binding VectorFineTuningCommand}" >
+ <touch:TouchImageButton.Template>
+ <ControlTemplate TargetType="touch:TouchImageButton">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Manual Fine-Tuning" Foreground="{StaticResource TangoDarkForegroundBrush}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Regular" Margin="0 18 5 0"/>
+ <Image Source="{StaticResource VFineTuning_Dialog}"/>
+ </StackPanel>
+ </ControlTemplate>
+ </touch:TouchImageButton.Template>
+ </touch:TouchImageButton>
+
<ContentControl Name="myCMYKColors" Grid.Row="0" ContentTemplate="{StaticResource myColorsBtn}" Content="{Binding}" IsTabStop="False"/>
<ContentControl Name="segmentCMYKContent" Grid.Row="1" ContentTemplate="{StaticResource brushColorPanel}" Content="{Binding}" IsTabStop="False"/>
@@ -562,6 +574,17 @@
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
+ <touch:TouchImageButton Grid.Row="0" Margin="0 2 45 0" HorizontalAlignment="Right" Width="Auto" Height="70" EnableDropShadow="False" Background="Transparent" BorderThickness="0"
+ Command="{ Binding VectorFineTuningCommand}" >
+ <touch:TouchImageButton.Template>
+ <ControlTemplate TargetType="touch:TouchImageButton">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Fine-Tuning" Foreground="{StaticResource TangoDarkForegroundBrush}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Regular" Margin="0 18 5 0"/>
+ <Image Source="{StaticResource VFineTuning_Dialog}"/>
+ </StackPanel>
+ </ControlTemplate>
+ </touch:TouchImageButton.Template>
+ </touch:TouchImageButton>
<ContentControl Name="myCatalogsColors" Grid.Row="0" ContentTemplate="{StaticResource myColorsBtn}" Content="{Binding}" IsTabStop="False"/>
<DockPanel Grid.Row="1" Margin="0 0 20 0">
<Grid DockPanel.Dock="Top" HorizontalAlignment="Stretch" Margin="0 0 0 20">
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
index f14da496b..698f80db8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
@@ -1039,11 +1039,16 @@ namespace Tango.PPC.Jobs.Dialogs
#region Vector Fine tuning
- private void OpenVectorFineTuning()
+ private async void OpenVectorFineTuning()
{
+ if (false == await NotifyAboutTrialsDataColorsSpace())
+ {
+ return;
+ }
+
SelectedBrushStop.SaveLABBeforeChanges();
- VectorFineTuningDialogVM.Init( SelectedBrushStop, SelectedBrushStop.L, SelectedBrushStop.A, SelectedBrushStop.B); //, SelectedBrushStop.Color);
+ VectorFineTuningDialogVM.Init( SelectedBrushStop, SelectedBrushStop.ColorSpace);//SelectedBrushStop.L, SelectedBrushStop.A, SelectedBrushStop.B); //, SelectedBrushStop.Color);
IsOpenVectorFineTuningDialog = true;
@@ -1113,6 +1118,29 @@ namespace Tango.PPC.Jobs.Dialogs
return true;
}
+ public async Task<bool> NotifyAboutTrialsDataColorsSpace()
+ {
+ var testColor = TrialsLogEngine.Default.GetByBrushStopGuid(SelectedBrushStop.Guid);
+ if (testColor != null && testColor.TrialslogList.Count > 0 &&
+ ((testColor.OpenedFromCatalog && SelectedColorTab != ColorTab.Catalog)
+ || (testColor.OpenedFromCMYK && SelectedColorTab != ColorTab.Volume)
+ || (testColor.OpenedFromCatalog == false && testColor.OpenedFromCMYK == false && SelectedColorTab != ColorTab.CIELab)))
+ {
+ if (true == await NotificationProvider.ShowQuestion("The color correction is in progress, the trials data will be reset. Are you sure?"))
+ {
+ TrialsLogEngine.Default.Delete(testColor);
+ return true;
+ }
+ else
+ {
+ await NotificationProvider.ShowInfo("The color will not be changed.");
+ return false;
+ }
+
+ }
+ return true;
+ }
+
#endregion
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
index 5e74fb74b..b967ddec2 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
@@ -81,13 +81,16 @@
<Setter Property="TextElement.Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
<Setter Property="BorderBrush" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
</DataTrigger>
- <MultiDataTrigger>
+ <!--<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ApplicationManager.IsInTechnicianMode}" Value="true"/>
<Condition Binding="{Binding IsJobRunning}" Value="False"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"/>
- </MultiDataTrigger>
+ </MultiDataTrigger>-->
+ <DataTrigger Binding="{Binding IsJobRunning}" Value="False">
+ <Setter Property="Visibility" Value="Visible"/>
+ </DataTrigger>
</Style.Triggers>
</Style>
</touch:TouchButton.Style>
@@ -231,9 +234,19 @@
<touch:TouchNavigationLinks Grid.Row="1" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 3" x:Name="navigationCSTLinks" SelectionChanged="TouchNavigationLinks_SelectionChanged" HorizontalContentAlignment="Center"
SelectedIndex="{Binding SelectedTabIndex,Mode=TwoWay}" VerticalAlignment="Bottom" Margin="0,0,0,30" Padding="40 0 40 0"
- FontSize="{StaticResource TangoNavigationLinksFontSize}" Grid.RowSpan="2" >
+ FontSize="{StaticResource TangoNavigationLinksFontSize}" Grid.RowSpan="2" PreviewMouseDown="NavigationCSTLinks_PreviewMouseDown" PreviewTouchDown="NavigationCSTLinks_PreviewTouchDown" >
- <TextBlock HorizontalAlignment="Center" >Automatic</TextBlock>
+ <TextBlock HorizontalAlignment="Center" IsEnabled="{Binding IsOnlyManual, Converter={StaticResource BooleanInverseConverter}}" Text="Automatic">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Style.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
<TextBlock HorizontalAlignment="Center" >Manual</TextBlock>
<touch:TouchNavigationLinks.Style>
<Style TargetType="{x:Type touch:TouchNavigationLinks}">
@@ -244,6 +257,7 @@
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
+
</Style>
</touch:TouchNavigationLinks.Style>
@@ -362,8 +376,8 @@
</Style.Triggers>
</Style>
</StackPanel.Style>
- <TextBlock FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" >Enter Measurement Result ( Optional):</TextBlock>
- <UniformGrid Rows="1" Columns="3" Height="Auto" VerticalAlignment="Top" Width="Auto" HorizontalAlignment="Left" Margin="0 20 0 0">
+ <TextBlock FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" >Enter Measurement Result (Optional):</TextBlock>
+ <UniformGrid Rows="1" Columns="3" Height="Auto" VerticalAlignment="Top" Width="Auto" HorizontalAlignment="Left" Margin="0 20 0 0" IsEnabled="{Binding IsOnlyManual, Converter={StaticResource BooleanInverseConverter}}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<TextBlock Text="L" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="Bold" VerticalAlignment="Center" Margin="10 0 0 0"/>
<touch:TouchNumericTextBox Margin="0 10 5 0" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" BorderBrush="{StaticResource TangoDividerBrush}" Maximum="100" Minimum="0" Value="{Binding MeasuredL, Delay=1000, Converter={StaticResource DoubleNullConverter}, ConverterParameter=1}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold" HideUnderline="True" HasDecimalPoint="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml.cs
index 01c4a2193..b0252be6f 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml.cs
@@ -32,7 +32,23 @@ namespace Tango.PPC.Jobs.Dialogs
private void TouchNavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ }
+ private void NavigationCSTLinks_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (_vm != null && _vm.IsOnlyManual)
+ {
+ e.Handled = true;
+ }
+ }
+
+ private void NavigationCSTLinks_PreviewTouchDown(object sender, TouchEventArgs e)
+ {
+ if (_vm != null && _vm.IsOnlyManual)
+ {
+ e.Handled = true;
+ }
}
+
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
index 7527bfbdd..e473fa420 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
@@ -93,6 +93,7 @@ namespace Tango.PPC.Jobs.Dialogs
public IPPCApplicationManager ApplicationManager { get; set; }
public BrushStopModel BrushStopModel { get; set; }
+ public ColorSpaces OpenFromColorSpace { get; set; }
private bool _isOutOfGamut;
/// <summary>
@@ -625,6 +626,20 @@ namespace Tango.PPC.Jobs.Dialogs
}
}
+ private bool _isOnlyManual;
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is only manual. Opened from CMYK tab.
+ /// </summary>
+ public bool IsOnlyManual
+ {
+ get { return _isOnlyManual; }
+ set {
+ _isOnlyManual = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+
+
private int _selectedTabIndex;
/// <summary>
/// Gets or sets the index of the selected category.
@@ -740,15 +755,15 @@ namespace Tango.PPC.Jobs.Dialogs
_CorrectOnlyHue = true;
IsManualFineTuning = false;
+ IsOnlyManual = false;
VisualCorrectionModel = new VisualOffsetModel();
}
/// <summary>
/// Initializes at open the dialog.
/// </summary>
- public void Init(BrushStopModel brushstop, double l, double a, double b)//, System.Windows.Media.Color targetColor)
+ public void Init(BrushStopModel brushstop, ColorSpaces colorspace)// double l, double a, double b)//, System.Windows.Media.Color targetColor)
{
- SelectedTabIndex = 0;
CorrectOnlyHue = false;
LightnessOffset = 0.0;
@@ -759,8 +774,7 @@ namespace Tango.PPC.Jobs.Dialogs
DL = null;
DH = null;
DeltaE = null;
-
- _sessionID = brushstop.Guid + $"{l}{a}{b}";
+
MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded;
@@ -770,14 +784,45 @@ namespace Tango.PPC.Jobs.Dialogs
BrushStopModel = brushstop.Clone();
BrushStopModel.Guid = brushstop.Guid;
IsOutOfGamut = brushstop.IsOutOfGamut;
- TargetL = l;
- TargetB = b;
- TargetA = a;
+ OpenFromColorSpace = colorspace;
+ if (OpenFromColorSpace == ColorSpaces.Catalog && brushstop.ColorCatalogsItem != null)
+ {
- //TargetColor = targetColor;
+ TargetL = BrushStopModel.ColorCatalogsItem.L;
+ TargetA = BrushStopModel.ColorCatalogsItem.A;
+ TargetB = BrushStopModel.ColorCatalogsItem.B;
+ BrushStopModel.PreventPropertyUpdate = true;
+ BrushStopModel.Cyan = brushstop.ColorCatalogsItem.Cyan;
+ BrushStopModel.Magenta = brushstop.ColorCatalogsItem.Magenta;
+ BrushStopModel.Yellow = brushstop.ColorCatalogsItem.Yellow;
+ BrushStopModel.Black = brushstop.ColorCatalogsItem.Black;
+ BrushStopModel.PreventPropertyUpdate = false;
+ IsOnlyManual = false;
+ }
+ else if(OpenFromColorSpace == ColorSpaces.Volume)
+ {
+ BrushStopModel.PreventPropertyUpdate = true;
+ BrushStopModel.L = 0;
+ BrushStopModel.A = 0;
+ BrushStopModel.B = 0;
+ BrushStopModel.PreventPropertyUpdate = false;
+ BrushStopModel.ConvertColorToLAB();
+ TargetL = BrushStopModel.L;
+ TargetB = BrushStopModel.B;
+ TargetA = BrushStopModel.A;
+ IsOnlyManual = true;
+ }
+ else
+ {
+ TargetL = brushstop.L;
+ TargetB = brushstop.B;
+ TargetA = brushstop.A;
+ BrushStopModel.ConvertColorToVolume();
+ BrushStopModel.ColorSpace = ColorSpaces.LAB;
+ IsOnlyManual = false;
+ }
- BrushStopModel.ConvertColorToVolume();
- BrushStopModel.ColorSpace = ColorSpaces.LAB;
+ _sessionID = BrushStopModel.Guid + $"{TargetL}{TargetA}{TargetB}";
Cyan = BrushStopModel.Cyan;
Magenta = BrushStopModel.Magenta;
@@ -849,6 +894,10 @@ namespace Tango.PPC.Jobs.Dialogs
RaisePropertyChanged(nameof(IsDisableInputLAB));
RaisePropertyChanged(nameof(TrialNumber));
RaisePropertyChanged(nameof(ColorBrush));
+ if(IsOnlyManual)
+ SelectedTabIndex = 1;
+ else
+ SelectedTabIndex = 0;
}
public void InitManualCorrection()
@@ -1131,6 +1180,8 @@ namespace Tango.PPC.Jobs.Dialogs
TestColor.L = TargetL;
TestColor.A = TargetA;
TestColor.B = TargetB;
+ TestColor.OpenedFromCatalog = OpenFromColorSpace == ColorSpaces.Catalog;
+ TestColor.OpenedFromCMYK = OpenFromColorSpace == ColorSpaces.Volume;
TestColor.BrushStopGuid = BrushStopModel.Guid;
TestColor.TrialslogList.Clear();
TestColor.TrialslogList.AddRange(TrialsLogitems);
@@ -1151,6 +1202,8 @@ namespace Tango.PPC.Jobs.Dialogs
TestColor.L = TargetL;
TestColor.A = TargetA;
TestColor.B = TargetB;
+ TestColor.OpenedFromCatalog = OpenFromColorSpace == ColorSpaces.Catalog;
+ TestColor.OpenedFromCMYK = OpenFromColorSpace == ColorSpaces.Volume;
TestColor.TrialslogList.AddRange(TrialsLogitems);
TrialsLogEngine.Default.AddTest(TestColor);
//if (ActiveLogModel != null && !ActiveLogModel.IsTested
@@ -1182,7 +1235,8 @@ namespace Tango.PPC.Jobs.Dialogs
public void ClearFoNextTrial()
{
- SelectedTabIndex = 0;
+ if(IsOnlyManual)
+ SelectedTabIndex = 1;
CorrectOnlyHue = false;
_measuredL = null;
@@ -1231,7 +1285,8 @@ namespace Tango.PPC.Jobs.Dialogs
double dL, dC, dH;
//DeltaE = DeltaE_CMC(TargetL, TargetA, TargetB, (double)MeasuredL, (double)MeasuredA, (double)MeasuredB, out dL, out dC, out dH);
- DeltaE = DeltaE_CMC( (double)MeasuredL, (double)MeasuredA, (double)MeasuredB, TargetL, TargetA, TargetB, out dL, out dC, out dH);
+ //DeltaE = DeltaE_CMC( (double)MeasuredL, (double)MeasuredA, (double)MeasuredB, TargetL, TargetA, TargetB, out dL, out dC, out dH);
+ DeltaE = DeltaE_CMC( TargetL, TargetA, TargetB, (double)MeasuredL, (double)MeasuredA, (double)MeasuredB, out dL, out dC, out dH);
DL = dL;
DC = (Double?)dC;
@@ -1313,12 +1368,16 @@ namespace Tango.PPC.Jobs.Dialogs
BrushStopModel.PreventPropertyUpdate = false;
//calculate CMYK
- BrushStopModel.FineTuningConverter(ActiveLogModel.C, ActiveLogModel.M, ActiveLogModel.Y, ActiveLogModel.K);
- if (BrushStopModel.IsOutOfGamut)
+ if (OpenFromColorSpace == ColorSpaces.LAB || ((MeasuredL != null && MeasuredA != null && MeasuredB != null)
+ || IsManualFineTuning && (LightnessOffset != 0.0 || ChromaOffset != 0.0 || HueOffset != 0.0)))
{
- ActiveLogModel.NewSuggestionL = BrushStopModel.L;
- ActiveLogModel.NewSuggestionA = BrushStopModel.A;
- ActiveLogModel.NewSuggestionB = BrushStopModel.B;
+ BrushStopModel.FineTuningConverter(ActiveLogModel.C, ActiveLogModel.M, ActiveLogModel.Y, ActiveLogModel.K);
+ if (BrushStopModel.IsOutOfGamut)
+ {
+ ActiveLogModel.NewSuggestionL = BrushStopModel.L;
+ ActiveLogModel.NewSuggestionA = BrushStopModel.A;
+ ActiveLogModel.NewSuggestionB = BrushStopModel.B;
+ }
}
BrushStopModel.ColorSpace = ColorSpaces.LAB;
@@ -1347,17 +1406,20 @@ namespace Tango.PPC.Jobs.Dialogs
BrushStopModel.A = ActiveLogModel.NewSuggestionA;
BrushStopModel.B = ActiveLogModel.NewSuggestionB;
BrushStopModel.PreventPropertyUpdate = false;
-
+
//calculate CMYK
- BrushStopModel.FineTuningConverter(ActiveLogModel.C, ActiveLogModel.M, ActiveLogModel.Y, ActiveLogModel.K);
- if(BrushStopModel.IsOutOfGamut)
+ if ( OpenFromColorSpace == ColorSpaces.LAB || ((MeasuredL != null && MeasuredA != null && MeasuredB != null)
+ || IsManualFineTuning && (LightnessOffset != 0.0 || ChromaOffset != 0.0 || HueOffset != 0.0)))
{
- ActiveLogModel.NewSuggestionL = BrushStopModel.L;
- ActiveLogModel.NewSuggestionA = BrushStopModel.A;
- ActiveLogModel.NewSuggestionB = BrushStopModel.B;
+ BrushStopModel.FineTuningConverter(ActiveLogModel.C, ActiveLogModel.M, ActiveLogModel.Y, ActiveLogModel.K);
+ if (BrushStopModel.IsOutOfGamut)
+ {
+ ActiveLogModel.NewSuggestionL = BrushStopModel.L;
+ ActiveLogModel.NewSuggestionA = BrushStopModel.A;
+ ActiveLogModel.NewSuggestionB = BrushStopModel.B;
+ }
+ BrushStopModel.ColorSpace = ColorSpaces.LAB;
}
-
- BrushStopModel.ColorSpace = ColorSpaces.LAB;
var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
using (ObservablesContext db = ObservablesContext.CreateDefault())
@@ -1647,16 +1709,16 @@ namespace Tango.PPC.Jobs.Dialogs
double dECMC = Math.Sqrt(Math.Pow(deltaL / (2 * SL), 2) + Math.Pow(deltaC / SC, 2) + Math.Pow(deltaH / SH, 2));
- dL = (deltaL / (2 * SL));
- dC = (deltaC / SC);
+ dL = (deltaL / (2 * SL)) *(-1);
+ dC = (deltaC / SC)*(-1);
- LabColor labColor = new LabColor(L1, a1, b1);
- LabColor trget_labColor = new LabColor(L2, a2, b2);
+ LabColor target_labColor = new LabColor(L1, a1, b1);
+ LabColor labColor = new LabColor(L2, a2, b2);
var converter = new ColourfulConverter { WhitePoint = Illuminants.D65 };
var LCH_input = converter.ToLChab(labColor);
- var LCH_target = converter.ToLChab(trget_labColor);
+ var LCH_target = converter.ToLChab(target_labColor);
if(LCH_target.h > LCH_input.h)
- dH = (deltaH / SH) * (-1);
+ dH = (deltaH / SH) * (-1);
else
dH = (deltaH / SH);
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TestColor.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TestColor.cs
index a83e0e595..d6ea11b81 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TestColor.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TestColor.cs
@@ -21,9 +21,14 @@ namespace Tango.PPC.Jobs.Models
public double A { get; set; }
public double B { get; set; }
+ public bool OpenedFromCMYK { get; set; }
+ public bool OpenedFromCatalog { get; set; }
+
public TestColor()
{
TrialslogList = new List<TrialsLogModel>();
+ OpenedFromCMYK = false;
+ OpenedFromCatalog = false;
}
}