aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:42:52 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:42:52 +0200
commit92de61904c6ae3f8455827944b4aa62c5582bbb5 (patch)
treed02f1ce1294b93400d7732356d54edf24766af17 /Software/Visual_Studio/PPC/Tango.PPC.Common
parent84708ec080fb94ccf637ac623967fd0e538c1fb5 (diff)
parentb77fbb01ed5b63b65f6e755fef9ca49c3e58ea50 (diff)
downloadTango-92de61904c6ae3f8455827944b4aa62c5582bbb5.tar.gz
Tango-92de61904c6ae3f8455827944b4aa62c5582bbb5.zip
Merged Extra Inks to Software.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs23
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs9
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/LiquidOutputModel.cs27
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs59
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj3
6 files changed, 78 insertions, 45 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs
index 00b4f5ad1..b42a3206c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs
@@ -180,10 +180,14 @@ namespace Tango.PPC.Common.RemoteJob
switch (colorSpace)
{
case BL.Enumerations.ColorSpaces.Volume:
- inputOutput.Input.Add(new Tuple<string, String>("C", i.CurrentBrushStop.Cyan.ToString("0.00")));
- inputOutput.Input.Add(new Tuple<string, String>("M", i.CurrentBrushStop.Magenta.ToString("0.00")));
- inputOutput.Input.Add(new Tuple<string, String>("Y", i.CurrentBrushStop.Yellow.ToString("0.00")));
- inputOutput.Input.Add(new Tuple<string, String>("K", i.CurrentBrushStop.Black.ToString("0.00")));
+ if (i.CurrentBrushStop.LiquidVolumes != null)
+ {
+ foreach (var input in i.CurrentBrushStop.LiquidVolumesOrderedPigmentedForStandardUser.ToList())
+ {
+ inputOutput.Input.Add(new Tuple<string, string>(input.IdsPack.LiquidType.ShortName, input.Volume.ToString()));
+ }
+ }
+
break;
case BL.Enumerations.ColorSpaces.RGB:
inputOutput.Input.Add(new Tuple<string, String>("R", i.CurrentBrushStop.Red.ToString()));
@@ -205,13 +209,10 @@ namespace Tango.PPC.Common.RemoteJob
try
{
- inputOutput.Output.Add(new Tuple<string, string>("C", i.CyanOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("LC", i.LightCyanOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("M", i.MagentaOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("LM", i.LightMagentaOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("Y", i.YellowOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("LY", i.LightYellowOutput.ToString()));
- inputOutput.Output.Add(new Tuple<string, string>("K", i.BlackOutput.ToString()));
+ foreach (var output in i.LiquidOutputs)
+ {
+ inputOutput.Output.Add(new Tuple<string, string>(output.LiquidType.ShortName, output.Volume.ToString()));
+ }
}
catch
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs
index cc98bd419..85dd66f7c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/IRemoteJobInputOutputProvider.cs
@@ -10,13 +10,6 @@ namespace Tango.PPC.Common.RemoteJob
public interface IRemoteJobInputOutputProvider
{
BrushStop CurrentBrushStop { get; }
-
- double CyanOutput { get; }
- double MagentaOutput { get; }
- double YellowOutput { get; }
- double BlackOutput { get; }
- double LightCyanOutput { get; }
- double LightMagentaOutput { get; }
- double LightYellowOutput { get; }
+ List<LiquidOutputModel> LiquidOutputs { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/LiquidOutputModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/LiquidOutputModel.cs
new file mode 100644
index 000000000..113d11ddc
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/LiquidOutputModel.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL.Entities;
+using Tango.Core;
+
+namespace Tango.PPC.Common.RemoteJob
+{
+ public class LiquidOutputModel : ExtendedObject
+ {
+ private LiquidType _liquidType;
+ public LiquidType LiquidType
+ {
+ get { return _liquidType; }
+ set { _liquidType = value; RaisePropertyChangedAuto(); }
+ }
+
+ private double _volume;
+ public double Volume
+ {
+ get { return _volume; }
+ set { _volume = value; RaisePropertyChangedAuto(); }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml
index 816d72de3..acd4c7406 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml
@@ -9,6 +9,8 @@
<SolidColorBrush x:Key="TangoMagentaInkBrush" Color="#ed008c" />
<SolidColorBrush x:Key="TangoCyanInkBrush" Color="#1662EB" />
<SolidColorBrush x:Key="TangoYellowInkBrush" Color="#e8e10c" />
+ <Color x:Key="TangoVioletInkColor">#7F00FF</Color>
+ <SolidColorBrush x:Key="TangoVioletInkBrush" Color="#7F00FF" />
<SolidColorBrush x:Key="TangoWasteBrush" Color="#2BA221" />
<SolidColorBrush x:Key="TangoTransparentInkBrush" Color="#A0A0A0" />
<SolidColorBrush x:Key="TangoLubricantBrush" Color="#B6AD7C" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
index a98641b25..d05b4c6bf 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
@@ -29,6 +29,7 @@ namespace Tango.PPC.Common.Statistics
private List<ColorCatalog> _catalogs;
private List<ColorCatalogsItem> _color_catalog_Items;
private List<ColorSpace> _colorSpaces;
+ private Dictionary<String, LiquidType> _liquidTypes;
public bool Enabled { get; set; } = true;
@@ -107,6 +108,8 @@ namespace Tango.PPC.Common.Statistics
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
+ response.Result.LiquidTypes = db.LiquidTypes.ToList().Select(x => LiquidTypeDTO.FromObservable(x)).ToList();
+
var filters = request.Filters;
var db_JobRuns = db.JobRuns.Where(x => (x.StartDate <= filters.EndDateUTC && x.StartDate >= filters.StartDateUTC));
@@ -173,6 +176,19 @@ namespace Tango.PPC.Common.Statistics
}
}
+ if (_liquidTypes == null)
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var types = await db.LiquidTypes.ToListAsync();
+ _liquidTypes = new Dictionary<string, LiquidType>();
+ foreach (var t in types)
+ {
+ _liquidTypes.Add(t.Name, t);
+ }
+ }
+ }
+
JobRunComposition jobRunComposition = new JobRunComposition();
jobRunComposition.JobRun = JobRunDTO.FromObservable(jobRun);
@@ -197,11 +213,17 @@ namespace Tango.PPC.Common.Statistics
foreach (var liquidType in stop.LiquidVolumes)
{
PresentationLiquidVolume plt = new PresentationLiquidVolume();
- plt.LiquidType = (LiquidTypes)Enum.Parse(typeof(LiquidTypes), liquidType.LiquidTypeName.Replace(" ", ""));
- plt.Volume = liquidType.Volume;
- pbs.LiquidVolumes.Add(plt);
+
+ if (_liquidTypes.ContainsKey(liquidType.LiquidTypeName))
+ {
+ plt.LiquidType = _liquidTypes[liquidType.LiquidTypeName];
+ plt.Volume = liquidType.Volume;
+ pbs.LiquidVolumes.Add(plt);
+ }
}
+ pbs.LiquidVolumes = pbs.LiquidVolumes.OrderBy(x => x.LiquidType.PreferredIndex).ToList();
+
switch (pbs.ColorSpace)
{
case ColorSpaces.RGB:
@@ -215,29 +237,16 @@ namespace Tango.PPC.Common.Statistics
pbs.B = stop.B;
break;
case ColorSpaces.Volume:
- pbs.Cyan = pbs.LiquidVolumes.First(x => x.LiquidType == LiquidTypes.Cyan).Volume;
- pbs.Magenta = pbs.LiquidVolumes.First(x => x.LiquidType == LiquidTypes.Magenta).Volume;
- pbs.Yellow = pbs.LiquidVolumes.First(x => x.LiquidType == LiquidTypes.Yellow).Volume;
- pbs.Black = pbs.LiquidVolumes.First(x => x.LiquidType == LiquidTypes.Black).Volume;
-
- var lightCyan = pbs.LiquidVolumes.FirstOrDefault(x => x.LiquidType == LiquidTypes.LightCyan);
- var lightMagenta = pbs.LiquidVolumes.FirstOrDefault(x => x.LiquidType == LiquidTypes.LightMagenta);
- var lightYellow = pbs.LiquidVolumes.FirstOrDefault(x => x.LiquidType == LiquidTypes.LightYellow);
-
- if (lightCyan != null && lightCyan.Volume > 0)
- {
- pbs.Cyan = lightCyan.Volume / 10d;
- }
-
- if (lightMagenta != null && lightMagenta.Volume > 0)
- {
- pbs.Magenta = lightMagenta.Volume / 10d;
- }
- if (lightYellow != null && lightYellow.Volume > 0)
- {
- pbs.Yellow = lightYellow.Volume / 10d;
- }
+ //foreach (var lightInk in pbs.LiquidVolumes.Where(x => x.LiquidType.IsLightInk && x.Volume > 0))
+ //{
+ // var darkInk = pbs.LiquidVolumes.FirstOrDefault(x => x.LiquidType.Code == lightInk.LiquidType.DarkInkCode);
+ // if (darkInk != null)
+ // {
+ // darkInk.Volume = (double)((decimal)lightInk.Volume / 10m);
+ // lightInk.Volume = 0;
+ // }
+ //}
break;
case ColorSpaces.Catalog:
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index f3e7d4e5e..41b3f94e1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -224,6 +224,7 @@
<Compile Include="RemoteJob\IRemoteJobInputOutputProvider.cs" />
<Compile Include="RemoteJob\IRemoteJobService.cs" />
<Compile Include="RemoteActions\IRemoteActionsService.cs" />
+ <Compile Include="RemoteJob\LiquidOutputModel.cs" />
<Compile Include="RemoteNotifications\DefaultRemoteNotificationsService.cs" />
<Compile Include="RemoteNotifications\IRemoteNotificationsService.cs" />
<Compile Include="Resume\DefaultJobResumeManager.cs" />
@@ -648,7 +649,7 @@
</Target>
<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