diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
| commit | e89f04cbdda4e34baef11d43c9f812773911a33c (patch) | |
| tree | bc7d1a8684d7e7487b80c9ab3801b3bc988cbb65 /Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels | |
| parent | 2bb75ed18045f59ae694adf04439e0297f77a89f (diff) | |
| download | Tango-e89f04cbdda4e34baef11d43c9f812773911a33c.tar.gz Tango-e89f04cbdda4e34baef11d43c9f812773911a33c.zip | |
Implemented Waste Replace Handling.
Implemented Job Stop on Out Of Range on MachineOperator.
Implemented job upload error on Volumes out of range.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs index 38413b24c..6a1c830b5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs @@ -928,6 +928,8 @@ namespace Tango.PPC.Jobs.ViewModels rmlGuid = Settings.DefaultRmlGuid; } + var machine = await new MachineBuilder(db).SetFirst().WithConfiguration().BuildAsync(); + Job job = new Job(); job.LastUpdated = DateTime.UtcNow; job.JobSource = JobSource.Local; @@ -954,8 +956,11 @@ namespace Tango.PPC.Jobs.ViewModels IColorConverter converter = new DefaultColorConverter(); + int segmentIndex = 0; + foreach (var stop in segments.SelectMany(x => x.BrushStops).Where(x => x.BrushColorSpace != ColorSpaces.RGB)) { + segmentIndex++; var output = converter.Convert(stop, false); var suggestion = output.CreateSingleSuggestion(); stop.Red = suggestion.Color.R; @@ -964,13 +969,20 @@ namespace Tango.PPC.Jobs.ViewModels stop.BestMatchR = suggestion.Color.R; stop.BestMatchG = suggestion.Color.G; stop.BestMatchB = suggestion.Color.B; + + stop.SetLiquidVolumes(machine.Configuration, job.Rml, job.Rml.GetActiveProcessGroup().ProcessParametersTables[suggestion.ProcessParametersTableIndex]); + + if (stop.IsLiquidVolumesOutOfRange) + { + throw new InvalidOperationException($"Volumes out of range for thread '{job.Rml.FinalName}' at segment {segmentIndex}."); + } } db.Jobs.Add(job); await db.SaveChangesAsync(); } - LoadJobs(() => + LoadJobs(() => { NotificationProvider.PushNotification(new MessageNotificationItem($"Csv job '{e.Name}' received successfully.", "", MessageNotificationItem.MessageNotificationItemTypes.Success, () => { }, NotificationItem.NotificationPriority.Low)); e.Confirm(); |
