diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-02-09 17:07:17 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-02-09 17:07:17 +0200 |
| commit | 54d607cb361d40eccf2d31da2305423360cc4b09 (patch) | |
| tree | 89ba1326111daae27beceb7cc3ae913894f646a5 /Software/Visual_Studio/PPC | |
| parent | 54c994826413839434d3a541345898af45311682 (diff) | |
| download | Tango-54d607cb361d40eccf2d31da2305423360cc4b09.tar.gz Tango-54d607cb361d40eccf2d31da2305423360cc4b09.zip | |
Critical fix on job rgb/lab cmyk & MyColors.
Diffstat (limited to 'Software/Visual_Studio/PPC')
10 files changed, 141 insertions, 23 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 diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index 0d64da83e..61bc9574e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -139,8 +139,10 @@ namespace Tango.PPC.Common.MachineSetup Token = response.NotifyCompletedToken, Status = BL.Enumerations.TangoUpdateStatuses.SetupFailed, FailedReason = ex.FlattenMessage(), - FailedLog = GetLogsStringAndClear(), + FailedLog = null, }); + + GetLogsStringAndClear(); } catch (Exception xx) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 47ffe6f19..80dbef645 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -253,7 +253,7 @@ namespace Tango.PPC.Common.MachineUpdate Token = response.NotifyCompletedToken, Status = BL.Enumerations.TangoUpdateStatuses.UpdateFailed, FailedReason = ex.FlattenMessage(), - FailedLog = logs, + FailedLog = null, }); } catch (Exception xx) @@ -473,7 +473,7 @@ namespace Tango.PPC.Common.MachineUpdate Token = response.NotifyCompletedToken, Status = BL.Enumerations.TangoUpdateStatuses.DatabaseFailed, FailedReason = ex.FlattenMessage(), - FailedLog = logs, + FailedLog = null, }).Result; } catch (Exception xx) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs index 61a9f720d..d1fb283b0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs @@ -593,8 +593,10 @@ namespace Tango.PPC.Common.Synchronization Token = notifyToken, Status = TangoUpdateStatuses.SynchronizationFailed, FailedReason = ex.FlattenMessage(), - FailedLog = GetLogsStringAndClear(), + FailedLog = null, }); + + GetLogsStringAndClear(); } catch (Exception ee) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> + <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> </requestedPrivileges> </security> </trustInfo> |
