diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-10-18 18:40:02 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-10-18 18:40:02 +0300 |
| commit | 4993565a88aec490a79ea3038b32cb06a4fe2713 (patch) | |
| tree | 532daaeebd6fa09fd3197209b9aa7b9bd8df3b9a /Software/Visual_Studio/PPC/Modules | |
| parent | 7e0877f955307204957c78aa7ad1cfd60e3d9004 (diff) | |
| download | Tango-4993565a88aec490a79ea3038b32cb06a4fe2713.tar.gz Tango-4993565a88aec490a79ea3038b32cb06a4fe2713.zip | |
PPC. Show job Total length with grouping segments repeats.
Related Work Items: #7474
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
7 files changed, 112 insertions, 89 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 b742a0881..596eb9316 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 @@ -1176,7 +1176,7 @@ namespace Tango.PPC.Jobs.Dialogs } } } - if (TrialsLogitems.Count >= 2) + if (TrialsLogitems.Count > 2) { var item = TrialsLogitems.FirstOrDefault(x => x.TrialNumber == currentTrialNumber - 1); var item1 = ActiveLogModel; 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 cbd1290d5..f4a239c98 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 @@ -847,13 +847,13 @@ namespace Tango.PPC.Jobs.Models s.Green = this.Green; s.Blue = this.Blue; } - else if (s.ColorSpace.Space == ColorSpaces.HSB) - { - s.ColorSpace.Space = BL.Enumerations.ColorSpaces.RGB; - s.Red = this.Red; - s.Green = this.Green; - s.Blue = this.Blue; - } + //else if (s.ColorSpace.Space == ColorSpaces.HSB) + //{ + // s.ColorSpace.Space = BL.Enumerations.ColorSpaces.RGB; + // s.Red = this.Red; + // s.Green = this.Green; + // s.Blue = this.Blue; + //} return s; } @@ -1022,7 +1022,7 @@ namespace Tango.PPC.Jobs.Models { if (PreventPropertyUpdate) return; - ColorSpace = ColorSpaces.HSB; + // ColorSpace = ColorSpaces.HSB; Rgb rgb = GetRGBColor(); _red = (int)rgb.R; _green = (int)rgb.G; @@ -1084,12 +1084,12 @@ namespace Tango.PPC.Jobs.Models Rgb rgb = new Rgb(lab.ToRgb()); return rgb; } - if (ColorSpace == ColorSpaces.HSB) - { - Hsb hsb = new Hsb(Hue, Saturation / 100, Brightness / 100); - Rgb rgb = new Rgb(hsb.ToRgb()); - return rgb; - } + //if (ColorSpace == ColorSpaces.HSB) + //{ + // Hsb hsb = new Hsb(Hue, Saturation / 100, Brightness / 100); + // Rgb rgb = new Rgb(hsb.ToRgb()); + // return rgb; + //} if (ColorSpace == ColorSpaces.Catalog && ColorCatalogsItem != null) { return new Rgb(ColorCatalogsItem.Red, ColorCatalogsItem.Green, ColorCatalogsItem.Blue); @@ -1099,63 +1099,63 @@ namespace Tango.PPC.Jobs.Models public void ConvertColorToHSB() { - if (ColorSpace != ColorSpaces.HSB) - { - if ( LastChangedColorSpace != ColorSpaces.HSB) - { - Hsb hsb = null; - if (LastChangedColorSpace == ColorSpaces.Volume) - { - BrushStop stop = CreateBrushStop(ColorSpaces.Volume); - try - { - IsBusy = true; - var output = _converter.Convert(stop, SegmentModel.Job.Machine.Configuration, SegmentModel.Job.Rml, false, false, false); - _red = output.SingleCoordinates.Red; - _green = output.SingleCoordinates.Green; - _blue = output.SingleCoordinates.Blue; - IsOutOfGamut = false;//output.OutOfGamut; - Rgb rgb = new Rgb(Red, Green, Blue); - hsb = new Hsb(rgb.To<Hsb>()); - } - catch (Exception ex) - { - LogManager.Log(ex, "An error occurred while trying to get volume => RGB from conversion engine."); - } - finally - { - IsBusy = false; - } - } - else if (LastChangedColorSpace == ColorSpaces.LAB) - { - Lab lab = new Lab(L, A, B); - hsb = new Hsb(lab.To<Hsb>()); - } - else if (LastChangedColorSpace == ColorSpaces.RGB) - { - Rgb rgb = new Rgb(Red, Green, Blue); - hsb = new Hsb(rgb.To<Hsb>()); - } - else if (LastChangedColorSpace == ColorSpaces.Catalog && ColorCatalogsItem != null) - { - Rgb rgb = new Rgb(ColorCatalogsItem.Red, ColorCatalogsItem.Green, ColorCatalogsItem.Blue); - hsb = new Hsb(rgb.To<Hsb>()); - } - if (hsb != null) - { - _hue = hsb.H; - _saturation = hsb.S * 100; ; - _brightness = hsb.B * 100; ; - RaisePropertyChanged(nameof(Hue)); - RaisePropertyChanged(nameof(Saturation)); - RaisePropertyChanged(nameof(Brightness)); - } - } - ColorSpace = ColorSpaces.HSB; - RequiredMaxLiquidTest = false; - RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange)); - } + //if (ColorSpace != ColorSpaces.HSB) + //{ + // if ( LastChangedColorSpace != ColorSpaces.HSB) + // { + // Hsb hsb = null; + // if (LastChangedColorSpace == ColorSpaces.Volume) + // { + // BrushStop stop = CreateBrushStop(ColorSpaces.Volume); + // try + // { + // IsBusy = true; + // var output = _converter.Convert(stop, SegmentModel.Job.Machine.Configuration, SegmentModel.Job.Rml, false, false, false); + // _red = output.SingleCoordinates.Red; + // _green = output.SingleCoordinates.Green; + // _blue = output.SingleCoordinates.Blue; + // IsOutOfGamut = false;//output.OutOfGamut; + // Rgb rgb = new Rgb(Red, Green, Blue); + // hsb = new Hsb(rgb.To<Hsb>()); + // } + // catch (Exception ex) + // { + // LogManager.Log(ex, "An error occurred while trying to get volume => RGB from conversion engine."); + // } + // finally + // { + // IsBusy = false; + // } + // } + // else if (LastChangedColorSpace == ColorSpaces.LAB) + // { + // Lab lab = new Lab(L, A, B); + // hsb = new Hsb(lab.To<Hsb>()); + // } + // else if (LastChangedColorSpace == ColorSpaces.RGB) + // { + // Rgb rgb = new Rgb(Red, Green, Blue); + // hsb = new Hsb(rgb.To<Hsb>()); + // } + // else if (LastChangedColorSpace == ColorSpaces.Catalog && ColorCatalogsItem != null) + // { + // Rgb rgb = new Rgb(ColorCatalogsItem.Red, ColorCatalogsItem.Green, ColorCatalogsItem.Blue); + // hsb = new Hsb(rgb.To<Hsb>()); + // } + // if (hsb != null) + // { + // _hue = hsb.H; + // _saturation = hsb.S * 100; ; + // _brightness = hsb.B * 100; ; + // RaisePropertyChanged(nameof(Hue)); + // RaisePropertyChanged(nameof(Saturation)); + // RaisePropertyChanged(nameof(Brightness)); + // } + // } + // ColorSpace = ColorSpaces.HSB; + // RequiredMaxLiquidTest = false; + // RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange)); + //} } public void ConvertColorToRGB() @@ -1267,11 +1267,11 @@ namespace Tango.PPC.Jobs.Models IsBusy = false; } } - else if (LastChangedColorSpace == ColorSpaces.HSB) - { - Hsb hsb = new Hsb(Hue, Saturation / 100, Brightness / 100); - lab = new Lab(hsb.To<Lab>()); - } + //else if (LastChangedColorSpace == ColorSpaces.HSB) + //{ + // Hsb hsb = new Hsb(Hue, Saturation / 100, Brightness / 100); + // lab = new Lab(hsb.To<Lab>()); + //} else if (LastChangedColorSpace == ColorSpaces.RGB) { Rgb rgb = new Rgb(Red, Green, Blue); @@ -1326,11 +1326,12 @@ namespace Tango.PPC.Jobs.Models return; } ColorSpaces colorSpace = LastChangedColorSpace; - if (colorSpace == ColorSpaces.HSB) - { - colorSpace = ColorSpaces.RGB; - } - else if (colorSpace == ColorSpaces.CMYK ) + //if (colorSpace == ColorSpaces.HSB) + //{ + // colorSpace = ColorSpaces.RGB; + //} + //else + if (colorSpace == ColorSpaces.CMYK ) { colorSpace = ColorSpaces. Volume; } @@ -1588,11 +1589,11 @@ namespace Tango.PPC.Jobs.Models IsOutOfGamut = _converter.IsOutOfGamut(stop, configuration, rml); BestMatchColor = Color.FromRgb((byte)output.SingleCoordinates.Red, (byte)output.SingleCoordinates.Green, (byte)output.SingleCoordinates.Blue); } - else if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.HSB) - { - IsOutOfGamut = _converter.IsOutOfGamut(stop, configuration, rml); - BestMatchColor = Color.FromRgb((byte)output.SingleCoordinates.Red, (byte)output.SingleCoordinates.Green, (byte)output.SingleCoordinates.Blue); - } + //else if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.HSB) + //{ + // IsOutOfGamut = _converter.IsOutOfGamut(stop, configuration, rml); + // BestMatchColor = Color.FromRgb((byte)output.SingleCoordinates.Red, (byte)output.SingleCoordinates.Green, (byte)output.SingleCoordinates.Blue); + //} } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ISegmentModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ISegmentModel.cs index e97d1342c..d3142aa06 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ISegmentModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ISegmentModel.cs @@ -10,6 +10,7 @@ namespace Tango.PPC.Jobs.Models { String Name { get; set; } double Length { get; } + double FullLength { get; } double LengthWithInterSegment { get; } bool IsGroupSegment { get; } bool IsSelected { get; set; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index 81e4bfa5f..84c61045d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -74,7 +74,7 @@ namespace Tango.PPC.Jobs.Models { if((EnableInterSegment && IsAllSegmentsPerSpool)) return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) - InterSegmentLength) : 0; - return GroupingSegments.Sum(x => x.Length); + return GroupingSegments.Sum(x => x.FullLength); //return Segments.Sum(x => x.LengthWithInterSegment); // return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0); } 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 b8b19b42b..40450c001 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 @@ -70,6 +70,14 @@ namespace Tango.PPC.Jobs.Models } } + public double FullLength + { + get + { + return _length; + } + } + public bool IsGroupSegment { get diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentsGroupModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentsGroupModel.cs index 76a9bfdd2..ab679c073 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentsGroupModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentsGroupModel.cs @@ -68,6 +68,19 @@ namespace Tango.PPC.Jobs.Models } + + /// <summary> + /// Gets or sets the length. + /// </summary> + public Double FullLength + { + get + { + return Segments.Count == 0 ? 0 : Segments.ToList().Sum(x => x.Length) * Repeats; + } + + } + public Double LengthWithInterSegment { get diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index fbce06296..49afbe63b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -549,7 +549,7 @@ namespace Tango.PPC.MachineSettings.ViewModels SelectedJobTypes = new SelectedObjectCollection<JobTypes>(Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToObservableCollection(), Settings.SupportedJobTypes.ToObservableCollection()); SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection()); - TabsColorSpaces = new ObservableCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x!= ColorSpaces.Volume && x!= ColorSpaces.HSB).ToObservableCollection()); + TabsColorSpaces = new ObservableCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x!= ColorSpaces.Volume /*&& x!= ColorSpaces.HSB*/).ToObservableCollection()); DefaultTabColorSpace = Settings.DefaultTabColorSpace == null? ColorSpaces.CMYK : TabsColorSpaces.SingleOrDefault(x => x == Settings.DefaultTabColorSpace); DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid); |
