aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-12-25 16:54:47 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-12-25 16:54:47 +0200
commite428f272250a212ade71f6ba2d22ea8fa55da095 (patch)
tree3e4fdc73d933135b139bb4c25428ee7840f8db64
parent9e4844af81e4ea13c26f6fdf5d6bd0c5599c13f2 (diff)
downloadTango-e428f272250a212ade71f6ba2d22ea8fa55da095.tar.gz
Tango-e428f272250a212ade71f6ba2d22ea8fa55da095.zip
PPC. CMYK - disable OK when entering a value below approximate 0.5 ( calculated).
Related Work Items: #7546
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml35
-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/Models/BrushStopModel.cs87
-rw-r--r--Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.xaml4
-rw-r--r--Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerHSBControl.xaml4
-rw-r--r--Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerLABControl.xaml4
-rw-r--r--Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerRGBControl.xaml4
7 files changed, 123 insertions, 17 deletions
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 745455ca3..be3e0adc0 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
@@ -149,9 +149,20 @@
</Grid>
<Canvas Grid.Column="1" Width="28" Height="28" VerticalAlignment="Top" HorizontalAlignment="Left">
- <touch:TouchToggleButton Canvas.Left="0" Canvas.Top="0" x:Name="addColorToGroup" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Command="{Binding SaveMyColorsCommand}"
- IsEnabled="{Binding SelectedBrushStop.IsLiquidVolumesOutOfRange, Converter={StaticResource BooleanInverseConverter}}" Style="{StaticResource TangoTouchToggleButtonNoDisable}">
-
+ <touch:TouchToggleButton Canvas.Left="0" Canvas.Top="0" x:Name="addColorToGroup" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Command="{Binding SaveMyColorsCommand}" >
+ <touch:TouchToggleButton.Style>
+ <Style TargetType="touch:TouchToggleButton" BasedOn="{StaticResource TangoTouchToggleButtonNoDisable}">
+ <Setter Property="IsEnabled" Value="True"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding SelectedBrushStop.IsLiquidVolumesOutOfRange}" Value="True">
+ <Setter Property="IsEnabled" Value="False"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding SelectedBrushStop.IsLiquidVolumeBelowMinLimit}" Value="True">
+ <Setter Property="IsEnabled" Value="False"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchToggleButton.Style>
<Border Height="26" Width="28" BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
<Image Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" >
<Image.Style>
@@ -162,7 +173,10 @@
<Setter Property="Source" Value="../Images/ColorSelection/fillheart.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding SelectedBrushStop.IsLiquidVolumesOutOfRange}" Value="True">
- <Setter Property="Source" Value="../Images/ColorSelection/Heart.png"/>
+ <Setter Property="Source" Value="../Images/ColorSelection/Heart_disable.png"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding SelectedBrushStop.IsLiquidVolumeBelowMinLimit}" Value="True">
+ <Setter Property="Source" Value="../Images/ColorSelection/Heart_disable.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
@@ -427,8 +441,17 @@
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
- <touch:TouchImageButton Grid.Row="0" Margin="0 2 45 0" HorizontalAlignment="Right" Width="70" EnableDropShadow="False" Background="Transparent" BorderThickness="0"
- Command="{ Binding VectorFineTuningCommand}" Image="{StaticResource VFineTuning_Dialog}"/>
+ <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="myLabColors" Grid.Row="0" ContentTemplate="{StaticResource myColorsBtn}" Content="{Binding}" IsTabStop="False"/>
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 5365cb198..94511fb51 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
@@ -738,7 +738,7 @@ namespace Tango.PPC.Jobs.Dialogs
protected override bool CanOK()
{
- return SelectedBrushStop != null && !SelectedBrushStop.IsLiquidVolumesOutOfRange;
+ return SelectedBrushStop != null && !SelectedBrushStop.IsLiquidVolumesOutOfRange && !SelectedBrushStop.IsLiquidVolumeBelowMinLimit;
}
#endregion
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs
index dd2a20b21..dc4db9b8a 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs
@@ -659,6 +659,59 @@ namespace Tango.PPC.Jobs.Models
}
}
}
+
+ [JsonIgnore]
+ public bool IsLiquidVolumeBelowMinLimit
+ {
+ get
+ {
+ if ( ColorSpace == ColorSpaces.Volume || ColorSpace == ColorSpaces.CMYK)
+ {
+ var minCyan = GetMinLimitLiquid(LiquidTypes.Cyan);
+ if(Cyan > 0 && Cyan < minCyan)
+ {
+ LiquidVolumeBelowMinLimit = true;
+ return LiquidVolumeBelowMinLimit;
+ }
+ var minMagenta = GetMinLimitLiquid(LiquidTypes.Magenta);
+ if (Magenta > 0 && Magenta < minMagenta)
+ {
+ LiquidVolumeBelowMinLimit = true;
+ return LiquidVolumeBelowMinLimit;
+ }
+ var minYellow = GetMinLimitLiquid(LiquidTypes.Yellow);
+ if (Yellow > 0 && Yellow < minYellow)
+ {
+ LiquidVolumeBelowMinLimit = true;
+ return LiquidVolumeBelowMinLimit;
+ }
+ var minBlack = GetMinLimitLiquid(LiquidTypes.Black);
+ if (Black > 0 && Black < minBlack)
+ {
+ LiquidVolumeBelowMinLimit = true;
+ return LiquidVolumeBelowMinLimit;
+ }
+ LiquidVolumeBelowMinLimit = false;
+ return false;
+ }
+ else return false;
+ }
+ }
+
+ private bool _liquidVolumeBelowMinLimit;
+ [JsonIgnore]
+ public bool LiquidVolumeBelowMinLimit
+ {
+ get { return _liquidVolumeBelowMinLimit; }
+ set
+ {
+ if (_liquidVolumeBelowMinLimit != value)
+ {
+ _liquidVolumeBelowMinLimit = value;
+ LiquidVolumesOutOfRangeChanged?.Invoke(this, new EventArgs());
+ }
+ }
+ }
[JsonIgnore]
public ColorSpaces LastChangedColorSpace { get; set; }
@@ -1034,6 +1087,7 @@ namespace Tango.PPC.Jobs.Models
ColorSpace = ColorSpaces.Volume;
RequiredMaxLiquidTest = true;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
LastChangedColorSpace = ColorSpace;
OnBrushStopFieldValueChanged();
@@ -1245,6 +1299,7 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(Blue));
RequiredMaxLiquidTest = false;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
}
}
@@ -1326,6 +1381,7 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(B));
RequiredMaxLiquidTest = false;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
}
}
@@ -1349,10 +1405,12 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(Magenta));
RaisePropertyChanged(nameof(Black));
IsOutOfGamut = false;
- RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ // RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ // RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
}
ColorSpace = ColorSpaces.Volume;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
return;
}
ColorSpaces colorSpace = LastChangedColorSpace;
@@ -1390,6 +1448,7 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(Magenta));
RaisePropertyChanged(nameof(Black));
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
}
catch (Exception ex)
{
@@ -1404,6 +1463,7 @@ namespace Tango.PPC.Jobs.Models
}
ColorSpace = ColorSpaces.Volume;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
+ RaisePropertyChanged(nameof(IsLiquidVolumeBelowMinLimit));
}
}
@@ -1549,6 +1609,29 @@ namespace Tango.PPC.Jobs.Models
}
}
+ private double GetMinLimitLiquid( LiquidTypes type)
+ {
+ try
+ {
+ var tables = SegmentModel.Job.Rml.GetActiveProcessGroup().ProcessParametersTables.OrderBy(x => x.TableIndex).ToList();
+
+ LiquidTypesRml liquidType = SegmentModel.Job.Rml.LiquidTypesRmls.FirstOrDefault(x => x.LiquidType.Type == type);
+
+ if (tables.Count > 0 && liquidType != null && liquidType.MaxNlPerCm != 0)
+ {
+ return (0.5*tables[0].MinInkUptake)/ liquidType.MaxNlPerCm;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+
public double GetColorNLPerCm(double color, LiquidTypes type)
{
StandardColorDispensingCalc calc = new StandardColorDispensingCalc();
@@ -1572,7 +1655,7 @@ namespace Tango.PPC.Jobs.Models
if (ColorSpace == BL.Enumerations.ColorSpaces.Volume)
{
//RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
- if (IsLiquidVolumesOutOfRange)
+ if (IsLiquidVolumesOutOfRange || IsLiquidVolumeBelowMinLimit)
{
IsBusy = false;
return;
diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.xaml b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.xaml
index 5821680de..57fe300bc 100644
--- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.xaml
@@ -9,9 +9,9 @@
<Style TargetType="{x:Type local:TouchColorPickerCMYKControl}">
<Setter Property="Background" Value="Transparent"/>
- <Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
+ <!--<Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
<Setter Property="keyboard:KeyboardView.Action" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardAction}"></Setter>
- <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>
+ <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchColorPickerCMYKControl}">
diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerHSBControl.xaml b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerHSBControl.xaml
index 367113ad5..4f64e26a1 100644
--- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerHSBControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerHSBControl.xaml
@@ -10,9 +10,9 @@
<Style TargetType="{x:Type local:TouchColorPickerHSBControl}">
<Setter Property="Background" Value="Transparent"/>
- <Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
+ <!--<Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
<Setter Property="keyboard:KeyboardView.Action" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardAction}"></Setter>
- <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>
+ <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchColorPickerHSBControl}">
diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerLABControl.xaml b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerLABControl.xaml
index 8d64bd281..b1a2e8374 100644
--- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerLABControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerLABControl.xaml
@@ -10,9 +10,9 @@
<Style TargetType="{x:Type local:TouchColorPickerLABControl}">
<Setter Property="Background" Value="Transparent"/>
- <Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
+ <!--<Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
<Setter Property="keyboard:KeyboardView.Action" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardAction}"></Setter>
- <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>
+ <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchColorPickerLABControl}">
diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerRGBControl.xaml b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerRGBControl.xaml
index 5f6ba75b7..5560a7538 100644
--- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerRGBControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerRGBControl.xaml
@@ -10,9 +10,9 @@
<Style TargetType="{x:Type local:TouchColorPickerRGBControl}">
<Setter Property="Background" Value="Transparent"/>
- <Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
+ <!--<Setter Property="keyboard:KeyboardView.Mode" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardMode}"></Setter>
<Setter Property="keyboard:KeyboardView.Action" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardAction}"></Setter>
- <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>
+ <Setter Property="keyboard:KeyboardView.Container" Value="{Binding RelativeSource={RelativeSource Self},Path=KeyboardContainer}"></Setter>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchColorPickerRGBControl}">