aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs13
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs20
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs97
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColorLiquidVolume.cs15
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj3
6 files changed, 132 insertions, 18 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 68b0a839c..85d35cf4f 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
@@ -617,7 +617,7 @@
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding SelectedBrushStop.LiquidVolumes}" IsTabStop="False" MinWidth="200">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:LiquidVolumeModel}">
- <touch:TouchColorPickerControl Margin=" 0 10 0 0" MinWidth="200" MinValue="0" IsTabStop="False"
+ <touch:TouchColorPickerControl Name="CMYK" Margin=" 0 10 0 0" MinWidth="200" MinValue="0" IsTabStop="False"
ColorPickerText="{Binding IdsPack.LiquidType.Name}"
AutoThumbColor="True"
ThumbHeightInside="28"
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 576ec2850..bc91c10c1 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
@@ -1018,10 +1018,15 @@ namespace Tango.PPC.Jobs.Dialogs
newcolor.Red = SelectedBrushStop.Red;
newcolor.Green = SelectedBrushStop.Green;
newcolor.Blue = SelectedBrushStop.Blue;
- newcolor.Cyan = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Cyan).Volume;
- newcolor.Magenta = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Magenta).Volume;
- newcolor.Yellow = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Yellow).Volume;
- newcolor.Black = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Black).Volume;
+
+ foreach (var liquidVolume in SelectedBrushStop.LiquidVolumes.Where(x => x.IdsPack.LiquidType.AvailableForStandardUser))
+ {
+ newcolor.SetVolume(liquidVolume.IdsPack.LiquidType.Type, liquidVolume.Volume);
+ }
+ //newcolor.Cyan = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Cyan).Volume;
+ //newcolor.Magenta = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Magenta).Volume;
+ //newcolor.Yellow = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Yellow).Volume;
+ //newcolor.Black = SelectedBrushStop.LiquidVolumes.GetLiquidVolume(LiquidTypes.Black).Volume;
newcolor.L = SelectedBrushStop.L;
newcolor.A = SelectedBrushStop.A;
newcolor.B = SelectedBrushStop.B;
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 12911a6e2..5634f783e 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
@@ -928,11 +928,19 @@ namespace Tango.PPC.Jobs.Models
PreventPropertyUpdate = true;
- LiquidVolumes.ResetVolume();
- LiquidVolumes.GetLiquidVolume(LiquidTypes.Cyan).Volume = favoriteColor.Cyan;
- LiquidVolumes.GetLiquidVolume(LiquidTypes.Magenta).Volume = favoriteColor.Magenta;
- LiquidVolumes.GetLiquidVolume(LiquidTypes.Yellow).Volume = favoriteColor.Yellow;
- LiquidVolumes.GetLiquidVolume(LiquidTypes.Black).Volume = favoriteColor.Black;
+ //LiquidVolumes.ResetVolume();
+
+ foreach (var liquidVolume in LiquidVolumes.Where(x => x.IdsPack.LiquidType.AvailableForStandardUser))
+ {
+ liquidVolume.Volume = favoriteColor.GetVolume(liquidVolume.IdsPack.LiquidType.Type);
+ }
+
+ RaisePropertyChanged(nameof(LiquidVolumes));
+
+ //LiquidVolumes.GetLiquidVolume(LiquidTypes.Cyan).Volume = favoriteColor.Cyan;
+ //LiquidVolumes.GetLiquidVolume(LiquidTypes.Magenta).Volume = favoriteColor.Magenta;
+ //LiquidVolumes.GetLiquidVolume(LiquidTypes.Yellow).Volume = favoriteColor.Yellow;
+ //LiquidVolumes.GetLiquidVolume(LiquidTypes.Black).Volume = favoriteColor.Black;
Red = favoriteColor.Red;
@@ -1376,7 +1384,7 @@ namespace Tango.PPC.Jobs.Models
foreach (var outputLiquid in output.SingleCoordinates.OutputLiquids)
{
- LiquidVolumes.GetLiquidVolume(outputLiquid.LiquidType).SetVolumeSilent(outputLiquid.Volume);
+ LiquidVolumes.GetLiquidVolume(outputLiquid.LiquidType)?.SetVolumeSilent(outputLiquid.Volume);
}
IsOutOfGamut = false;
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs
index 1d7b7c7c2..c72e7c530 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs
@@ -70,6 +70,8 @@ namespace Tango.PPC.Jobs.Models
public int BestMatchB { get; set; }
+ public List<FavoriteColorLiquidVolume> LiquidVolumes { get; set; }
+
[BsonIgnore]
public Color Color
{
@@ -102,8 +104,11 @@ namespace Tango.PPC.Jobs.Models
public bool IsSelected
{
get { return _isSelected; }
- set { _isSelected = value;
- RaisePropertyChangedAuto();}
+ set
+ {
+ _isSelected = value;
+ RaisePropertyChangedAuto();
+ }
}
@@ -111,6 +116,7 @@ namespace Tango.PPC.Jobs.Models
public FavoriteColor()
{
+ LiquidVolumes = new List<FavoriteColorLiquidVolume>();
Hue = Saturation = 0;
Brightness = 100;
L = 100;
@@ -125,14 +131,93 @@ namespace Tango.PPC.Jobs.Models
public bool Equals(FavoriteColor color)
{
- if(color == null)
+ if (color == null)
return false;
- return (ColorSpace == color.ColorSpace
- && Cyan == color.Cyan && Magenta == color.Magenta && Yellow == color.Yellow && Black ==color.Black
+ var step1 = (ColorSpace == color.ColorSpace
&& Red == color.Red && Green == color.Green && Blue == color.Blue
- && L == color.L && A == color.A && B == color.B
+ && L == color.L && A == color.A && B == color.B
&& Hue == color.Hue && Saturation == color.Saturation && Brightness == color.Brightness);
+
+ foreach (var liquidType in Enum.GetValues(typeof(LiquidTypes)).Cast<LiquidTypes>())
+ {
+ if (GetVolume(liquidType) != color.GetVolume(liquidType))
+ {
+ return false;
+ }
+ }
+
+ if (step1) return true;
+ return false;
+ }
+
+ public double GetVolume(LiquidTypes liquidType)
+ {
+ if (liquidType == LiquidTypes.Cyan)
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume == null)
+ {
+ var newColor = new FavoriteColorLiquidVolume() { LiquidType = liquidType, Volume = Cyan };
+ LiquidVolumes.Add(newColor);
+ return newColor.Volume;
+ }
+ }
+ else if (liquidType == LiquidTypes.Magenta)
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume == null)
+ {
+ var newColor = new FavoriteColorLiquidVolume() { LiquidType = liquidType, Volume = Magenta };
+ LiquidVolumes.Add(newColor);
+ return newColor.Volume;
+ }
+ }
+ else if (liquidType == LiquidTypes.Yellow)
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume == null)
+ {
+ var newColor = new FavoriteColorLiquidVolume() { LiquidType = liquidType, Volume = Yellow };
+ LiquidVolumes.Add(newColor);
+ return newColor.Volume;
+ }
+ }
+ else if (liquidType == LiquidTypes.Black)
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume == null)
+ {
+ var newColor = new FavoriteColorLiquidVolume() { LiquidType = liquidType, Volume = Black };
+ LiquidVolumes.Add(newColor);
+ return newColor.Volume;
+ }
+ }
+
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume != null)
+ {
+ return liquidVolume.Volume;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+
+ public void SetVolume(LiquidTypes liquidType, double volume)
+ {
+ var liquidVolume = LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ if (liquidVolume != null)
+ {
+ liquidVolume.Volume = volume;
+ }
+ else
+ {
+ LiquidVolumes.Add(new FavoriteColorLiquidVolume() { LiquidType = liquidType, Volume = volume });
+ }
}
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColorLiquidVolume.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColorLiquidVolume.cs
new file mode 100644
index 000000000..a296bcfc4
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColorLiquidVolume.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL.Enumerations;
+
+namespace Tango.PPC.Jobs.Models
+{
+ public class FavoriteColorLiquidVolume
+ {
+ public LiquidTypes LiquidType { get; set; }
+ public double Volume { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
index ca80b27a0..91f5a854d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
@@ -320,6 +320,7 @@
<Compile Include="Models\BrushStopModel.cs" />
<Compile Include="Models\ColorLibrary.cs" />
<Compile Include="Models\FavoriteColor.cs" />
+ <Compile Include="Models\FavoriteColorLiquidVolume.cs" />
<Compile Include="Models\ISegmentModel.cs" />
<Compile Include="Models\JobModel.cs" />
<Compile Include="Models\LiquidVolumeModel.cs" />
@@ -764,7 +765,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file