diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-12 18:02:38 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-12 18:02:38 +0300 |
| commit | 9a5f4fde8f1e0fa46c9bf75b9492c57a58249a8a (patch) | |
| tree | 892424fe173f1ce0182616d543a3fe56748f2d2f /Software/Visual_Studio/PPC | |
| parent | 7eb361c1201381c6ad88efa0ebed2c6595b45d13 (diff) | |
| download | Tango-9a5f4fde8f1e0fa46c9bf75b9492c57a58249a8a.tar.gz Tango-9a5f4fde8f1e0fa46c9bf75b9492c57a58249a8a.zip | |
Improved dynamic assignment of catalog item <-> Liquid Volume.
Diffstat (limited to 'Software/Visual_Studio/PPC')
3 files changed, 9 insertions, 46 deletions
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 b24611796..89b44d175 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 @@ -810,36 +810,10 @@ namespace Tango.PPC.Jobs.Dialogs BrushStopModel.PreventPropertyUpdate = true; BrushStopModel.LiquidVolumes.ResetVolume(); - var cyanVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("cyan"); - if (cyanVolume != null) cyanVolume.Volume = brushstop.ColorCatalogsItem.Cyan; - - var magentaVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("magenta"); - if (magentaVolume != null) magentaVolume.Volume = brushstop.ColorCatalogsItem.Magenta; - - var yellowVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("yellow"); - if (yellowVolume != null) yellowVolume.Volume = brushstop.ColorCatalogsItem.Yellow; - - var blackVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("black"); - if (blackVolume != null) blackVolume.Volume = brushstop.ColorCatalogsItem.Black; - - var blueVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("blue"); - if (blueVolume != null) blueVolume.Volume = brushstop.ColorCatalogsItem.Blue; - - var navyVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("navy"); - if (navyVolume != null) navyVolume.Volume = brushstop.ColorCatalogsItem.NavyExtra; - - var orangeVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("orange"); - if (orangeVolume != null) orangeVolume.Volume = brushstop.ColorCatalogsItem.OrangeExtra; - - var redVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("red"); - if (redVolume != null) redVolume.Volume = brushstop.ColorCatalogsItem.RedExtra; - - var rubineVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("rubine"); - if (rubineVolume != null) rubineVolume.Volume = brushstop.ColorCatalogsItem.RubineExtra; - - var violetVolume = BrushStopModel.LiquidVolumes.FindLiquidVolumeForCatalog("violet"); - if (violetVolume != null) violetVolume.Volume = brushstop.ColorCatalogsItem.VioletExtra; - + foreach (var liquidVolume in BrushStopModel.LiquidVolumes.Where(x => x.IdsPack.LiquidType.AvailableForStandardUser)) + { + liquidVolume.Volume = brushstop.ColorCatalogsItem.GetLiquidVolumeByName(liquidVolume.IdsPack.LiquidType.DisplayName); + } BrushStopModel.PreventPropertyUpdate = false; IsOnlyManual = false; 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 dd82d8d1a..ad3dc60e9 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 @@ -1352,16 +1352,11 @@ namespace Tango.PPC.Jobs.Models { LiquidVolumes.ResetVolumeSilent(); - LiquidVolumes.FindLiquidVolumeForCatalog("cyan")?.SetVolumeSilent(ColorCatalogsItem.Cyan); - LiquidVolumes.FindLiquidVolumeForCatalog("magenta")?.SetVolumeSilent(ColorCatalogsItem.Magenta); - LiquidVolumes.FindLiquidVolumeForCatalog("yellow")?.SetVolumeSilent(ColorCatalogsItem.Yellow); - LiquidVolumes.FindLiquidVolumeForCatalog("black")?.SetVolumeSilent(ColorCatalogsItem.Black); - LiquidVolumes.FindLiquidVolumeForCatalog("blue")?.SetVolumeSilent(ColorCatalogsItem.BlueExtra); - LiquidVolumes.FindLiquidVolumeForCatalog("navy")?.SetVolumeSilent(ColorCatalogsItem.NavyExtra); - LiquidVolumes.FindLiquidVolumeForCatalog("orange")?.SetVolumeSilent(ColorCatalogsItem.OrangeExtra); - LiquidVolumes.FindLiquidVolumeForCatalog("red")?.SetVolumeSilent(ColorCatalogsItem.RedExtra); - LiquidVolumes.FindLiquidVolumeForCatalog("rubine")?.SetVolumeSilent(ColorCatalogsItem.RubineExtra); - LiquidVolumes.FindLiquidVolumeForCatalog("violet")?.SetVolumeSilent(ColorCatalogsItem.VioletExtra); + foreach (var liquidVolume in LiquidVolumes.Where(x => x.IdsPack.LiquidType.AvailableForStandardUser)) + { + liquidVolume.SetVolumeSilent(ColorCatalogsItem.GetLiquidVolumeByName(liquidVolume.IdsPack.LiquidType.DisplayName)); + } + LiquidVolumes.RaiseVolume(); IsOutOfGamut = false; // RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange)); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/LiquidVolumesCollection.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/LiquidVolumesCollection.cs index 8eaae4452..704fc36b0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/LiquidVolumesCollection.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/LiquidVolumesCollection.cs @@ -43,12 +43,6 @@ namespace Tango.PPC.Jobs.Models return this.FirstOrDefault(x => x.IdsPack.LiquidType.Type == (LiquidTypes)type); } - public LiquidVolumeModel FindLiquidVolumeForCatalog(String name) - { - var volume = this.Where(x => x.IdsPack.LiquidType.HasPigment && !x.IdsPack.LiquidType.IsLightInk).FirstOrDefault(x => x.IdsPack.LiquidType.Type.ToString().ToLower().Contains(name.ToLower())); - return volume; - } - public void Undo() { this.ToList().ForEach(x => x.Undo()); |
