From a07075624af377fe855bbef95a7bf784963bcc73 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 21 Aug 2022 09:13:04 +0300 Subject: VFT - the numbering of the tests is incorrect. Save VFT trials during adding gradient color. Related Work Items: #7175 --- .../Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs | 13 +++++++------ .../PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs | 4 ++-- .../UndoRedoCommands/AddBrushStopCommand.cs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'Software/Visual_Studio') 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 f5cecd0c4..8a464d911 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 @@ -756,9 +756,9 @@ namespace Tango.PPC.Jobs.Dialogs { OnClose(); - if (TestColor != null && TrialsLogitems.Count > 1) + if (TestColor != null ) { - if (TrialsLogitems.Count > 1) + if (TrialsLogitems.Count > 0) { TestColor.L = TargetL; TestColor.A = TargetA; @@ -768,10 +768,10 @@ namespace Tango.PPC.Jobs.Dialogs TestColor.TrialslogList.AddRange(TrialsLogitems); TrialsLogEngine.Default.UpdateTest(TestColor); } - else - TrialsLogEngine.Default.Delete(TestColor); + //else + // TrialsLogEngine.Default.Delete(TestColor); } - else if(TrialsLogitems.Count > 1) + else if(TrialsLogitems.Count > 0) { TestColor = new TestColor(); TestColor.BrushStopGuid = BrushStopModel.Guid; @@ -874,7 +874,8 @@ namespace Tango.PPC.Jobs.Dialogs job.EnableLubrication = true; job.Designation = JobDesignations.FineTuning; job.Machine = await new MachineBuilder(db).Set(MachineProvider.Machine.Guid).WithConfiguration().WithSpools().WithCats().WithVersion().BuildAsync(); - job.Name = $"Manual color test #{ActiveLogModel.TrialNumber}"; + var trialNumber = ActiveLogModel.TrialNumber + 1; + job.Name = $"Manual color test #{trialNumber}"; job.Rml = await new RmlBuilder(db).Set(BrushStopModel.SegmentModel.Job.Rml.Guid).WithActiveParametersGroup().WithCAT(MachineProvider.Machine.Guid).WithCCT().WithLiquidFactors().WithSpools().BuildAsync(); job.SpoolType = db.SpoolTypes.FirstOrDefault(x => x.Guid == settings.SpoolTypeGuid); job.WindingMethod = db.WindingMethods.FirstOrDefault(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs index 1f1fe3034..b8b19b42b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs @@ -643,7 +643,7 @@ namespace Tango.PPC.Jobs.Models brushStop.IsOutOfGamut = false; BrushStops.Add(brushStop); - BrushStopModel colorbrushStop = firstBrush.Clone(); + BrushStopModel colorbrushStop = firstBrush; colorbrushStop.Position = BrushStopModel.PositionStatus.FirstColor; colorbrushStop.StopIndex = 2; colorbrushStop.OffsetPercent = 0; @@ -665,7 +665,7 @@ namespace Tango.PPC.Jobs.Models { RemoveSecondColorOfGradient(); - BrushStopModel secondbrushStop = secondBrush.Clone(); + BrushStopModel secondbrushStop = secondBrush; secondbrushStop.StopIndex = 4; secondbrushStop.Position = BrushStopModel.PositionStatus.SecondColor; secondbrushStop.OffsetPercent = 100; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/AddBrushStopCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/AddBrushStopCommand.cs index 1a9ee005b..1b07d9eac 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/AddBrushStopCommand.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/AddBrushStopCommand.cs @@ -48,7 +48,7 @@ namespace Tango.PPC.Jobs.UndoRedoCommands _createdNewSegment.Length = length; _segment.Length = length; _createdNewSegment.SegmentIndex = _segment.SegmentIndex + 1; - _createdNewSegment.CreateGradientBrushes(_brushStopModelToAdd, _segment.SecondBrushStop); + _createdNewSegment.CreateGradientBrushes(_brushStopModelToAdd.Clone(), _segment.SecondBrushStop); _createdNewSegment.RaiseSegmentBrushChanged(); _segment.AddOrReplaceSecondBrush(_brushStopModelToAdd); -- cgit v1.3.1