diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-06-14 13:11:17 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-06-14 13:11:17 +0300 |
| commit | 039ed91b201069d1658824b608935a20a98fd686 (patch) | |
| tree | 0e4a9d62f833a9ecf5124863dff7212527d27156 /Software/Visual_Studio/PPC/Modules | |
| parent | a1fec1f151489dc6034ca4a3c43110d9d20138c4 (diff) | |
| download | Tango-039ed91b201069d1658824b608935a20a98fd686.tar.gz Tango-039ed91b201069d1658824b608935a20a98fd686.zip | |
Sort job rmls list on PPC.
Update all volumes on RML switch.
Backup/Restore validation using machine id instead of SN.
Fixed liquid quantities display string on color conversion hive.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index c05a7db2b..f458bab65 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -497,7 +497,7 @@ namespace Tango.PPC.Jobs.ViewModels //await SetSpoolTension(Job.Rml); LogManager.Log("Loading RMLS..."); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.Name).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); @@ -716,6 +716,8 @@ namespace Tango.PPC.Jobs.ViewModels { if (Job.Rml != rml || rml.Cct == null) { + bool updateVolumes = Job.Rml != rml; + Job.Rml = await new RmlBuilder(_db) .Set(rml.Guid) .WithActiveParametersGroup() @@ -732,6 +734,24 @@ namespace Tango.PPC.Jobs.ViewModels GetLubricationLevel(); await SetSpoolTension(rml); + + if (updateVolumes) + { + NotificationProvider.SetGlobalBusyMessage("Updating job liquid volumes..."); + foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB || x.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB).ToList()) + { + try + { + var output = await _converter.ConvertAsync(stop, false, false); + output.ApplyOnBrushStopVolumesOnly(stop); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error updating stop volumes after changing thread on segment {stop.Segment.SegmentIndex}, stop {stop.StopIndex}."); + } + } + NotificationProvider.ReleaseGlobalBusyMessage(); + } } } } |
