diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-30 14:53:18 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-30 14:53:18 +0300 |
| commit | ed58cf7cef3ff2df02a535df5f45bb51369d338e (patch) | |
| tree | 5b719b15c208462b1c855ff48c5d11c11ce0bfc6 /Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs | |
| parent | 19c3ce7f77cd4a78c5438db2d4385e5daaad4624 (diff) | |
| download | Tango-ed58cf7cef3ff2df02a535df5f45bb51369d338e.tar.gz Tango-ed58cf7cef3ff2df02a535df5f45bb51369d338e.zip | |
Add new job.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs | 56 |
1 files changed, 33 insertions, 23 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 ebc396a39..fa78430bd 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 @@ -433,37 +433,47 @@ namespace Tango.PPC.Jobs.ViewModels await Task.Delay(200); } var selectedRmlGuid = Settings.DefaultRmlGuid; - JobCreationViewVM vm = new JobCreationViewVM(_spoolTypes.ToList(), _rmls.ToList(), selectedRmlGuid, 0, false); - - var selectedSpoolTypeGuid = Settings.SpoolTypeGuid; - vm.SelectedSpoolType = false == String.IsNullOrEmpty(selectedSpoolTypeGuid) ? _spoolTypes.FirstOrDefault(x => x.Guid == selectedSpoolTypeGuid) : _spoolTypes.FirstOrDefault(x => x.Type == SpoolTypes.StandardSpool); - if (twnFile == null) - { - vm = await NotificationProvider.ShowDialog<JobCreationViewVM>(vm); - if (!vm.DialogResult) return; - - if (vm.SelectedRML != null) - { - selectedRmlGuid = vm.SelectedRML.Guid; - } - if (vm.SelectedSpoolType != null) - { - selectedSpoolTypeGuid = vm.SelectedSpoolType.Guid; - } - - } - Job job = new Job(); job.LastUpdated = DateTime.UtcNow; job.JobSource = JobSource.Local; - job.Name = vm.JobName; job.NumberOfHeads = 1; job.NumberOfUnits = 1; job.SampleUnitsOrMeters = 1; job.CreationDate = DateTime.UtcNow; job.JobStatus = JobStatuses.Draft; - job.EnableInterSegment = vm.WhiteGap > 0; - job.InterSegmentLength = vm.WhiteGap; + + var selectedSpoolTypeGuid = Settings.SpoolTypeGuid; + + if (BuildProvider.IsEureka) + { + job.Name = "Unnamed"; + job.EnableInterSegment = false; + job.InterSegmentLength = 0; + } + else + { + JobCreationViewVM vm = new JobCreationViewVM(_spoolTypes.ToList(), _rmls.ToList(), selectedRmlGuid, 0, false); + vm.SelectedSpoolType = false == String.IsNullOrEmpty(selectedSpoolTypeGuid) ? _spoolTypes.FirstOrDefault(x => x.Guid == selectedSpoolTypeGuid) : _spoolTypes.FirstOrDefault(x => x.Type == SpoolTypes.StandardSpool); + if (twnFile == null) + { + vm = await NotificationProvider.ShowDialog<JobCreationViewVM>(vm); + if (!vm.DialogResult) + return; + + if (vm.SelectedRML != null) + { + selectedRmlGuid = vm.SelectedRML.Guid; + } + if (vm.SelectedSpoolType != null) + { + selectedSpoolTypeGuid = vm.SelectedSpoolType.Guid; + } + job.Name = vm.JobName; + job.EnableInterSegment = vm.WhiteGap > 0; + job.InterSegmentLength = vm.WhiteGap; + } + } + //job.JobType = vm.SelectedJobType; job.EnableLubrication = true; //job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == vm.SelectedColorSpace.ToInt32()).Guid; |
