aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-11-22 21:50:21 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-11-22 21:50:21 +0200
commitfd5aa92662a4244637ef362d5feaff2293cbf2bb (patch)
tree591cb73393f2b47180e9665406c50ea117dec355 /Software/Visual_Studio
parent4b7ca7de06c5a9ec6fb3e11e5a4b01f2d20144f6 (diff)
downloadTango-fd5aa92662a4244637ef362d5feaff2293cbf2bb.tar.gz
Tango-fd5aa92662a4244637ef362d5feaff2293cbf2bb.zip
Vector Fine Tuning. Gui changes.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml49
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs189
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs4
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs56
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml88
6 files changed, 238 insertions, 150 deletions
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 2943e6054..3016706d5 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
@@ -1041,7 +1041,7 @@ namespace Tango.PPC.Jobs.Dialogs
{
SelectedBrushStop.SaveLABBeforeChanges();
- VectorFineTuningDialogVM.Init( SelectedBrushStop, SelectedBrushStop.BestMatchL, SelectedBrushStop.BestMatchA, SelectedBrushStop.BestMatchB, SelectedBrushStop.Color);
+ VectorFineTuningDialogVM.Init( SelectedBrushStop, SelectedBrushStop.L, SelectedBrushStop.A, SelectedBrushStop.B, SelectedBrushStop.Color);
IsOpenVectorFineTuningDialog = true;
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 505eec660..9b5f511bd 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
@@ -290,9 +290,8 @@
</StackPanel>
</Grid>
- <Grid Visibility="{Binding IsManualFineTuning, Converter={StaticResource BooleanToVisibilityConverter}}" x:Name="visualCorrection">
-
- <Grid Margin="0 -20 5 40">
+ <Grid x:Name="visualCorrection" Visibility="{Binding IsManualFineTuning, Converter={StaticResource BooleanToVisibilityConverter}}" >
+ <Grid Margin="0 -20 5 40">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
@@ -318,7 +317,7 @@
<touch:TouchNumericTextBox Margin="0 10 5 0" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" BorderBrush="{StaticResource TangoDividerBrush}" Maximum="127" Minimum="-128" Value="{Binding MeasuredB, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold" HideUnderline="True" HasDecimalPoint="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
</UniformGrid>
- </StackPanel>
+ </StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="1">
<TextBlock FontSize="{StaticResource TangoComboBoxItemFontSize}" >Target Vs Results:</TextBlock>
<UniformGrid Grid.Column="1" Columns="4" Rows="1" Height="Auto" VerticalAlignment="Top" Width="Auto" Margin="0 20 0 0">
@@ -360,54 +359,54 @@
</UniformGrid>
</StackPanel>
<Rectangle Height="1" Fill="{StaticResource TangoDividerBrush}" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Center" Margin="0 0 0 0"></Rectangle>
-
- <StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="0" Margin="0 0 0 0">
+ <DockPanel Grid.Row="2" Grid.ColumnSpan="2">
+ <StackPanel Orientation="Vertical" Margin="0 0 0 0">
<TextBlock FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" >Enter Manual Correction:</TextBlock>
<Grid Height="Auto" Margin="0 10 0 0">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
<ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
</Grid.ColumnDefinitions>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinLightness.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="60" />
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinLightness.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="55" />
<StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text="Lightness:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 5" FontSize="{StaticResource TangoSmallFontSize}"></TextBlock>
- <touch:TouchNumericUpDownConrol Margin="10 10 10 0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5" Value="{Binding LightnessOffset, Mode=TwoWay}" />
+ <touch:TouchNumericUpDownConrol Margin="10 16 10 0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericBorderUpDownControl}" Step="0.5" Value="{Binding LightnessOffset, Mode=TwoWay}" VerticalAlignment="Center" />
</StackPanel>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxLightness.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0" />
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxLightness.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="55" Margin="0 25 0 0" />
</Grid>
<Grid Height="Auto" Margin="0 0 0 0">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
<ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
</Grid.ColumnDefinitions>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinChroma.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="60"/>
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinChroma.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="55"/>
<StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text="Chroma:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 5" FontSize="{StaticResource TangoSmallFontSize}"></TextBlock>
- <touch:TouchNumericUpDownConrol Margin="10 10 10 0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5" Value="{Binding ChromaOffset, Mode=TwoWay}"/>
+ <touch:TouchNumericUpDownConrol Margin="10 16 10 0" Padding="0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericBorderUpDownControl}" Step="0.5" Value="{Binding ChromaOffset, Mode=TwoWay}" VerticalAlignment="Center"/>
</StackPanel>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxChroma.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0" />
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxChroma.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="55" Margin="0 25 0 0" />
</Grid>
<Grid Height="Auto" Margin="0 0 0 0">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
<ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="55"/>
</Grid.ColumnDefinitions>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinHue.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="60" />
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MinHue.ColorBrush}" CornerRadius="8" Margin="0 25 0 0" Height="55" />
<StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text="Hue:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 0" FontSize="{StaticResource TangoSmallFontSize}"></TextBlock>
- <touch:TouchNumericUpDownConrol Margin="10 10 10 0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5" Value="{Binding HueOffset, Mode=TwoWay}"/>
+ <touch:TouchNumericUpDownConrol Margin="10 20 10 0" Height="35" NumericPartWidth="50" HorizontalAlignment="Center" BorderThickness="2" MaxValue="6" MinValue="-6" Style="{StaticResource TouchNumericBorderUpDownControl}" Step="0.5" Value="{Binding HueOffset, Mode=TwoWay}" VerticalAlignment="Center"/>
</StackPanel>
- <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxHue.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0" />
+ <Border BorderBrush="Transparent" Background="{Binding VisualCorrectionModel.MaxHue.ColorBrush}" CornerRadius="8" Grid.Column="2" Height="55" Margin="0 25 0 0" />
</Grid>
</StackPanel>
- <Grid Grid.Row="2" Grid.Column="1" Height="Auto" Margin="40 -10 0 0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
+ <Grid Height="Auto" Margin="40 -10 0 0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1.8*"/>
@@ -419,7 +418,7 @@
<TextBlock FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" Grid.ColumnSpan="2" VerticalAlignment="Center">Adjustment Preview:</TextBlock>
<StackPanel Orientation="Vertical" Grid.ColumnSpan="2" Grid.Row="1" Margin="0 20 0 0">
<TextBlock FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Margin="10 0 0 -5" >Previous</TextBlock>
- <Border Grid.Row="1" Height="230" Margin="0 10 0 0" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="1" Background="{Binding VisualCorrectionModel.SourceColorBrush}" CornerRadius="12" >
+ <Border Grid.Row="1" Height="220" Margin="0 10 0 0" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="1" Background="{Binding VisualCorrectionModel.SourceColorBrush}" CornerRadius="12" >
<UniformGrid Rows="3" Columns="1" VerticalAlignment="Bottom" Background="Transparent">
<TextBlock FontWeight="Medium" Margin="10 10 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoSmallFontSize}">
<Run Text="L:" ></Run>
@@ -439,7 +438,7 @@
<StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1" Margin="0 20 0 0">
<TextBlock FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Margin="10 0 0 -5" HorizontalAlignment="Center" >New</TextBlock>
- <Border Grid.Row="1" Height="230" Margin="0 10 0 0" CornerRadius="12" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}" Background="{Binding VisualCorrectionModel.ManualColorBrush}">
+ <Border Grid.Row="1" Height="220" Margin="0 10 0 0" CornerRadius="12" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}" Background="{Binding VisualCorrectionModel.ManualColorBrush}">
<UniformGrid Rows="3" Columns="1" VerticalAlignment="Bottom" Background="Transparent">
<TextBlock FontWeight="Medium" Margin="10 10 0 0" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoSmallFontSize}">
<Run Text="L:" ></Run>
@@ -457,7 +456,7 @@
</Border>
</StackPanel>
</Grid>
-
+ </DockPanel>
</Grid>
</Grid>
</Grid>
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 d5b324a40..909f4f665 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
@@ -577,6 +577,9 @@ namespace Tango.PPC.Jobs.Dialogs
if(_lightnessOffset != value)
{
_lightnessOffset = value;
+ if (ActiveLogModel != null)
+ ActiveLogModel.LightnessOffset = _lightnessOffset;
+
OnLightnessOffsetChanged();
RaisePropertyChangedAuto();
}
@@ -593,6 +596,8 @@ namespace Tango.PPC.Jobs.Dialogs
if (_chromaOffset != value)
{
_chromaOffset = value;
+ if (ActiveLogModel != null)
+ ActiveLogModel.ChromaOffset = _chromaOffset;
OnChromaOffsetChanged();
RaisePropertyChangedAuto();
}
@@ -609,6 +614,8 @@ namespace Tango.PPC.Jobs.Dialogs
if (_hueOffset != value)
{
_hueOffset = value;
+ if (ActiveLogModel != null)
+ ActiveLogModel.HueOffset = _hueOffset;
OnHueOffsetChanged();
RaisePropertyChangedAuto();
}
@@ -680,8 +687,9 @@ namespace Tango.PPC.Jobs.Dialogs
TestColor = null;
TestColor = TrialsLogEngine.Default.GetByBrushStopGuid(BrushStopModel.Guid);
+
- if (TestColor == null)
+ if (TestColor == null )
{
ActiveLogModel = new TrialsLogModel(0, Cyan, Magenta, Yellow, Black);
ActiveLogModel.SuggestionL = TargetL;
@@ -714,20 +722,10 @@ namespace Tango.PPC.Jobs.Dialogs
}
if (ActiveLogModel.IsTested == false)
{
- if(ActiveLogModel.L != null)
- {
MeasuredL = ActiveLogModel.L;
- }
- if (ActiveLogModel.A != null)
- {
MeasuredA = ActiveLogModel.A;
- }
- if (ActiveLogModel.B != null)
- {
MeasuredB = ActiveLogModel.B;
- }
- TestCommand.RaiseCanExecuteChanged();
- ByPassTestCommand.RaiseCanExecuteChanged();
+
}
ActiveLogModel.IsActiveTrial = true;
ActiveLogModel.IsSelectionEnable = true;
@@ -742,7 +740,9 @@ namespace Tango.PPC.Jobs.Dialogs
TestCommand.RaiseCanExecuteChanged();
ByPassTestCommand.RaiseCanExecuteChanged();
UpdateManualCorrection();
-
+ LightnessOffset = ActiveLogModel.LightnessOffset;
+ ChromaOffset = ActiveLogModel.ChromaOffset;
+ HueOffset = ActiveLogModel.HueOffset;
}
IsVisible = true;
@@ -772,7 +772,7 @@ namespace Tango.PPC.Jobs.Dialogs
double a = MeasuredA == null ? ActiveLogModel.SuggestionA : (double)MeasuredA;
double b = MeasuredB == null ? ActiveLogModel.SuggestionB : (double)MeasuredB;
- VisualCorrectionModel.UpdateSourceLAB(l, a, b);
+ VisualCorrectionModel.UpdateSourceLAB(l, a, b );
}
#region Methods
@@ -939,7 +939,9 @@ namespace Tango.PPC.Jobs.Dialogs
}
VectorCorrection();
UpdateManualCorrection();
- LightnessOffset = ChromaOffset = HueOffset = 0;
+ LightnessOffset = ActiveLogModel.LightnessOffset;
+ ChromaOffset = ActiveLogModel.ChromaOffset;
+ HueOffset = ActiveLogModel.HueOffset;
}
}
@@ -993,7 +995,11 @@ namespace Tango.PPC.Jobs.Dialogs
if (TestColor != null )
{
- if (TrialsLogitems.Count > 0)
+ if (TrialsLogitems.Count == 1 && (MeasuredL == null || MeasuredA == null || MeasuredB == null))
+ {
+ TrialsLogEngine.Default.Delete(TestColor);
+ }
+ else if (TrialsLogitems.Count > 0)
{
TestColor.L = TargetL;
TestColor.A = TargetA;
@@ -1006,7 +1012,8 @@ namespace Tango.PPC.Jobs.Dialogs
//else
// TrialsLogEngine.Default.Delete(TestColor);
}
- else if(TrialsLogitems.Count > 0)
+ else if(TrialsLogitems.Count > 0
+ && (TrialsLogitems.Count > 1 || (MeasuredL != null && MeasuredA != null || MeasuredB != null)))
{
TestColor = new TestColor();
TestColor.BrushStopGuid = BrushStopModel.Guid;
@@ -1039,19 +1046,22 @@ namespace Tango.PPC.Jobs.Dialogs
{
SelectedTabIndex = 0;
CorrectOnlyHue = false;
- _lightnessOffset = 0.0;
- _chromaOffset = 0.0;
- _hueOffset = 0.0;
+
+ _measuredL = null;
+ _measuredB = null;
+ _measuredA = null;
+ RaisePropertyChanged(nameof(MeasuredL));
+ RaisePropertyChanged(nameof(MeasuredA));
+ RaisePropertyChanged(nameof(MeasuredB));
+ LightnessOffset = 0.0;
+ ChromaOffset = 0.0;
+ HueOffset = 0.0;
DC = null;
DL = null;
DH = null;
DeltaE = null;
-
- RaisePropertyChanged(nameof(LightnessOffset));
- RaisePropertyChanged(nameof(ChromaOffset));
- RaisePropertyChanged(nameof(HueOffset));
-
+
if (ActiveLogModel != null)
{
VisualCorrectionModel.UpdateSourceLAB(ActiveLogModel.SuggestionL, ActiveLogModel.SuggestionA, ActiveLogModel.SuggestionB);
@@ -1060,14 +1070,6 @@ namespace Tango.PPC.Jobs.Dialogs
{
VisualCorrectionModel.UpdateSourceLAB(TargetL, TargetA, TargetB);
}
-
- _measuredL = null;
- _measuredB = null;
- _measuredA = null;
- RaisePropertyChanged(nameof(MeasuredL));
- RaisePropertyChanged(nameof(MeasuredA));
- RaisePropertyChanged(nameof(MeasuredB));
-
}
private void OnLABChanged()
{
@@ -1109,7 +1111,8 @@ namespace Tango.PPC.Jobs.Dialogs
{
if (ActiveLogModel == null )
return;
-
+
+ VisualCorrectionModel.LightnessOffset = LightnessOffset;
VisualCorrectionModel.ManualCorrection(LightnessOffset, ChromaOffset, HueOffset);
ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L;
ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A;
@@ -1123,7 +1126,7 @@ namespace Tango.PPC.Jobs.Dialogs
{
if (ActiveLogModel == null )
return;
-
+ VisualCorrectionModel.ChromaOffset = ChromaOffset;
VisualCorrectionModel.ManualCorrection(LightnessOffset, ChromaOffset, HueOffset);
ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L;
ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A;
@@ -1137,6 +1140,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (ActiveLogModel == null )
return;
+ VisualCorrectionModel.HueOffset = HueOffset;
VisualCorrectionModel.ManualCorrection(LightnessOffset, ChromaOffset, HueOffset);
ActiveLogModel.VectorCorrectionL = VisualCorrectionModel.L;
ActiveLogModel.VectorCorrectionA = VisualCorrectionModel.A;
@@ -1171,40 +1175,7 @@ namespace Tango.PPC.Jobs.Dialogs
}
BrushStopModel.ColorSpace = ColorSpaces.LAB;
- ActiveLogModel.IsTested = true;
- Cyan = BrushStopModel.Cyan;
- Magenta = BrushStopModel.Magenta;
- Yellow = BrushStopModel.Yellow;
- Black = BrushStopModel.Black;
- //ActiveLogModel.TestC = BrushStopModel.Cyan;
- //ActiveLogModel.TestM = BrushStopModel.Magenta;
- //ActiveLogModel.TestY = BrushStopModel.Yellow;
- //ActiveLogModel.TestK = BrushStopModel.Black;
- if (ActiveLogModel != null && TrialsLogitems.Count <= 10)
- {
- var suggestionL = ActiveLogModel.NewSuggestionL;
- var suggestionA = ActiveLogModel.NewSuggestionA;
- var suggestionB = ActiveLogModel.NewSuggestionB;
- ActiveLogModel = new TrialsLogModel(ActiveLogModel.TrialNumber + 1, Cyan, Magenta, Yellow, Black);
- ActiveLogModel.SuggestionL = suggestionL;
- ActiveLogModel.SuggestionA = suggestionA;
- ActiveLogModel.SuggestionB = suggestionB;
-
- ActiveLogModel.VectorCorrectionL = suggestionL;
- ActiveLogModel.VectorCorrectionA = suggestionA;
- ActiveLogModel.VectorCorrectionB = suggestionB;
-
- TrialsLogitems.Insert(0, ActiveLogModel);
- var minDelataE = TrialsLogitems.Min(x => (double?)x.DeltaE);
- if (minDelataE != null && minDelataE < 2)
- TrialsLogitems.ToList().ForEach(x => x.IsBest = ((double?)x.DeltaE == minDelataE));
-
- RaisePropertyChanged(nameof(TrialsLogitems));
- RaisePropertyChanged(nameof(TrialNumber));
-
- ClearFoNextTrial();
- }
- RaisePropertyChanged(nameof(IsDisableInputLAB));
+ UpdateOnEndJob();
InvalidateRelayCommands();
}
@@ -1394,8 +1365,7 @@ namespace Tango.PPC.Jobs.Dialogs
//}
}
-
-
+
private void JobHandler_Completed(object sender, EventArgs e)
{
if (_handler != null)
@@ -1403,44 +1373,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (IsVisible)
{
IsJobRunning = false;
- // Dispatcher.CurrentDispatcher.Invoke(() =>
- // {
- ActiveLogModel.IsTested = true;
- Cyan = BrushStopModel.Cyan;
- Magenta = BrushStopModel.Magenta;
- Yellow = BrushStopModel.Yellow;
- Black = BrushStopModel.Black;
- //ActiveLogModel.TestC = BrushStopModel.Cyan;
- //ActiveLogModel.TestM = BrushStopModel.Magenta;
- //ActiveLogModel.TestY = BrushStopModel.Yellow;
- //ActiveLogModel.TestK = BrushStopModel.Black;
- if (ActiveLogModel != null && TrialsLogitems.Count <= 10)
- {
- var suggestionL = ActiveLogModel.NewSuggestionL;
- var suggestionA = ActiveLogModel.NewSuggestionA;
- var suggestionB = ActiveLogModel.NewSuggestionB;
- ActiveLogModel = new TrialsLogModel(ActiveLogModel.TrialNumber + 1, Cyan, Magenta, Yellow, Black);
- ActiveLogModel.SuggestionL = suggestionL;
- ActiveLogModel.SuggestionA = suggestionA;
- ActiveLogModel.SuggestionB = suggestionB;
-
- ActiveLogModel.VectorCorrectionL = suggestionL;
- ActiveLogModel.VectorCorrectionA = suggestionA;
- ActiveLogModel.VectorCorrectionB = suggestionB;
-
- TrialsLogitems.Insert(0, ActiveLogModel);
- var minDelataE = TrialsLogitems.Min(x=>(double?)x.DeltaE);
- if(minDelataE != null && minDelataE < 2)
- TrialsLogitems.ToList().ForEach( x=> x.IsBest = ((double?)x.DeltaE == minDelataE));
-
- RaisePropertyChanged(nameof(TrialsLogitems));
- RaisePropertyChanged(nameof(TrialNumber));
-
- ClearFoNextTrial();
- }
- RaisePropertyChanged(nameof(IsDisableInputLAB));
-
- //});
+ UpdateOnEndJob();
}
_handler.StatusChanged -= JobHandler_StatusChanged;
@@ -1462,6 +1395,44 @@ namespace Tango.PPC.Jobs.Dialogs
}
}
+ private void UpdateOnEndJob()
+ {
+ ActiveLogModel.IsTested = true;
+ Cyan = BrushStopModel.Cyan;
+ Magenta = BrushStopModel.Magenta;
+ Yellow = BrushStopModel.Yellow;
+ Black = BrushStopModel.Black;
+ //ActiveLogModel.TestC = BrushStopModel.Cyan;
+ //ActiveLogModel.TestM = BrushStopModel.Magenta;
+ //ActiveLogModel.TestY = BrushStopModel.Yellow;
+ //ActiveLogModel.TestK = BrushStopModel.Black;
+ if (ActiveLogModel != null && TrialsLogitems.Count <= 10)
+ {
+ var suggestionL = ActiveLogModel.NewSuggestionL;
+ var suggestionA = ActiveLogModel.NewSuggestionA;
+ var suggestionB = ActiveLogModel.NewSuggestionB;
+ ActiveLogModel = new TrialsLogModel(ActiveLogModel.TrialNumber + 1, Cyan, Magenta, Yellow, Black);
+ ActiveLogModel.SuggestionL = suggestionL;
+ ActiveLogModel.SuggestionA = suggestionA;
+ ActiveLogModel.SuggestionB = suggestionB;
+
+ ActiveLogModel.VectorCorrectionL = suggestionL;
+ ActiveLogModel.VectorCorrectionA = suggestionA;
+ ActiveLogModel.VectorCorrectionB = suggestionB;
+
+ TrialsLogitems.Insert(0, ActiveLogModel);
+ var minDelataE = TrialsLogitems.Min(x => (double?)x.DeltaE);
+ if (minDelataE != null && minDelataE < 2)
+ TrialsLogitems.ToList().ForEach(x => x.IsBest = ((double?)x.DeltaE == minDelataE));
+
+ RaisePropertyChanged(nameof(TrialsLogitems));
+ RaisePropertyChanged(nameof(TrialNumber));
+
+ UpdateManualCorrection();
+ ClearFoNextTrial();
+ }
+ RaisePropertyChanged(nameof(IsDisableInputLAB));
+ }
#endregion
#region Delta E
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
index 5b1fbedce..95d8afe7d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
@@ -63,6 +63,10 @@ namespace Tango.PPC.Jobs.Models
public double VectorCorrectionA { get; set; }
public double VectorCorrectionB { get; set; }
+ public double LightnessOffset { get; set; }
+ public double ChromaOffset { get; set; }
+ public double HueOffset { get; set; }
+
public bool IsManualCorrection { get; set; }
//LCH
private double _LCH_C;
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs
index 9ea714d4e..f7bf43ee0 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs
@@ -188,9 +188,9 @@ namespace Tango.PPC.Jobs.Models
}
}
- private double LightnessOffset { get; set; }
- private double ChromaOffset { get; set; }
- private double HueOffset { get; set; }
+ public double LightnessOffset { get; set; }
+ public double ChromaOffset { get; set; }
+ public double HueOffset { get; set; }
@@ -219,6 +219,10 @@ namespace Tango.PPC.Jobs.Models
{
//Lch lch = new Lch() { L = L, C = C, H = H };
//IRgb rgb = lch.ToRgb();
+ if(LightnessOffset == 0 && ChromaOffset == 0 && HueOffset == 0)
+ {
+ return SourceColorBrush;
+ }
Lab lab = new Lab(L, A, B);
Rgb rgb = new Rgb(lab.ToRgb());
return new SolidColorBrush() { Color = Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B) };
@@ -240,13 +244,24 @@ namespace Tango.PPC.Jobs.Models
public void InitLAB(double l, double a, double b, double c, double h)
{
- SourceL = L = l;
- SourceA = A = a;
- SourceB = B = b;
- SourceC = C = c;
- SourceH = H = h;
+ L = l;
+ A = a;
+ B = b;
+ C = c;
+ H = h;
LightnessOffset = ChromaOffset = HueOffset = 0;
+ _sourcel = l;
+ RaisePropertyChanged(nameof(SourceL));
+ _sourcea = a;
+ RaisePropertyChanged(nameof(SourceA));
+ _sourceb = b;
+ RaisePropertyChanged(nameof(SourceB));
+ _sourcec = c;
+ RaisePropertyChanged(nameof(SourceC));
+ _sourceh = h;
+ RaisePropertyChanged(nameof(SourceH));
+
Lch lch = Correction(-6, 0, 0);
MinLightness.Init(lch);
lch = Correction(6, 0, 0);
@@ -259,8 +274,7 @@ namespace Tango.PPC.Jobs.Models
MinHue.Init(lch);
lch = Correction(0, 0, 6);
MaxHue.Init(lch);
- LightnessOffset = ChromaOffset = HueOffset = 0;
- ManualCorrection(0, 0, 0);
+
RaisePropertyChanged(nameof(SourceColorBrush));
RaisePropertyChanged(nameof(ManualColorBrush));
}
@@ -288,12 +302,17 @@ namespace Tango.PPC.Jobs.Models
lch = Correction(0, 0, 6);
MaxHue.Init(lch);
- ManualCorrection(0, 0, 0);
+ //ManualCorrection(0, 0, 0);
RaisePropertyChanged(nameof(SourceColorBrush));
RaisePropertyChanged(nameof(ManualColorBrush));
}
-
+ /// <summary>
+ /// Manuals the correction. During change lightnessOffset, chromaOffset or hueOffset in app caused to change LAB of visual correction.
+ /// </summary>
+ /// <param name="lightnessOffset">The lightness offset.</param>
+ /// <param name="chromaOffset">The chroma offset.</param>
+ /// <param name="hueOffset">The hue offset.</param>
public void ManualCorrection(double lightnessOffset, double chromaOffset, double hueOffset)
{
Lch lch = Correction(lightnessOffset, chromaOffset, hueOffset);
@@ -306,11 +325,18 @@ namespace Tango.PPC.Jobs.Models
}
+ /// <summary>
+ /// Calculate Lch on the specified lightness offset.
+ /// </summary>
+ /// <param name="lightnessOffset">The lightness offset.</param>
+ /// <param name="chromaOffset">The chroma offset.</param>
+ /// <param name="hueOffset">The hue offset.</param>
+ /// <returns></returns>
public Lch Correction( double lightnessOffset, double chromaOffset, double hueOffset)
{
- LightnessOffset = lightnessOffset;
- ChromaOffset = chromaOffset;
- HueOffset = hueOffset;
+ //LightnessOffset = lightnessOffset;
+ //ChromaOffset = chromaOffset;
+ //HueOffset = hueOffset;
double L1 = SourceL;
double C1 = SourceC;
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
index d29cd2a48..3978e6c4c 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
@@ -94,5 +94,93 @@
</Setter.Value>
</Setter>
</Style>
+ <Style x:Key="TouchNumericBorderUpDownControl" TargetType="{x:Type controls:TouchNumericUpDownConrol}">
+ <Setter Property="Background" Value="{StaticResource TangoNotificationBarMaskBrush}"/>
+ <Setter Property="Height" Value="40"/>
+ <Setter Property="Width" Value="160"/>
+ <Setter Property="BorderBrush" Value="{StaticResource TangoDividerBrush}"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="controls:TouchNumericUpDownConrol">
+ <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0.6" Height="{TemplateBinding Height}">
+ <Grid Width="{TemplateBinding Width}">
+ <Grid.Resources>
+ <Style x:Key="emptyButton" TargetType="RepeatButton" >
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Focusable" Value="False"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoMidAccentBrush}" />
+ <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
+ <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <Trigger Property="RepeatButton.IsPressed" Value="True">
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Foreground" Value="{StaticResource TangoKeyboardKeyLightBrush}" />
+ </Trigger>
+ <EventTrigger RoutedEvent="RepeatButton.TouchDown">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyLightTextBrush}"></DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ <EventTrigger RoutedEvent="RepeatButton.TouchLeave">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground">
+ <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyDarkTextBrush}"></DiscreteObjectKeyFrame>
+ </ObjectAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Resources>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="1*"/>
+ </Grid.ColumnDefinitions>
+
+ <RepeatButton Margin="2 0 2 0" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Height="{TemplateBinding Height}" VerticalContentAlignment="Stretch" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=DecrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Stretch" KeyboardNavigation.TabNavigation ="None">
+ <controls:TouchIcon Icon="Minus" Width="22" Height="Auto" VerticalAlignment="Center"/>
+ </RepeatButton>
+
+ <Rectangle DockPanel.Dock="Right" Width="0.6" Fill="{Binding RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Path= BorderBrush}" Height="32" HorizontalAlignment="Right"></Rectangle>
+
+ <controls:TouchNumericTextBox x:Name="Number_PART" Grid.Column="1" Margin="1 4 1 0" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalAlignment="Center" BorderBrush="Transparent" VerticalContentAlignment="Center" UpdateBindingOnlyWhenFocused="True"
+ Value="{Binding Value,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" Minimum="{Binding MinValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}}" Maximum="{Binding MaxValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" HideUnderline="True" HasDecimalPoint="True" KeyboardNavigation.TabNavigation="Continue"/>
+
+ <Rectangle Grid.Column="1" Width="0.6" Fill="{Binding RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Path= BorderBrush}" Height="40" HorizontalAlignment="Right"></Rectangle>
+
+ <RepeatButton Grid.Column="2" Background="Transparent" BorderBrush="Transparent" Margin="0 0 0 0" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=IncrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" KeyboardNavigation.TabNavigation ="None">
+ <controls:TouchIcon Icon="Plus" Width="22" VerticalAlignment="Center"/>
+ </RepeatButton>
+
+ </Grid>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
</ResourceDictionary> \ No newline at end of file