diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models')
3 files changed, 41 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs index 62dc7ec1b..284b2c787 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs @@ -16,6 +16,7 @@ namespace Tango.PPC.Jobs.Models { public class ColorLibrary: ExtendedObject { + #region Properties private ObservableCollection<FavoriteColor> _colorList; public ObservableCollection<FavoriteColor> ColorList { @@ -51,7 +52,23 @@ namespace Tango.PPC.Jobs.Models OnEditGroupModeChanged(); RaisePropertyChangedAuto(); } } - + + private bool _isSelected; + [BsonIgnore] + public bool IsSelected + { + get { + return _isSelected; + } + set { + _isSelected = value; + RaisePropertyChangedAuto(); + } + } + + + #endregion + public ColorLibrary() { _colorList = new ObservableCollection<FavoriteColor>(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs index 00c8293bd..1d7b7c7c2 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/FavoriteColor.cs @@ -10,6 +10,7 @@ using System.Windows; using ColorMine.ColorSpaces; using Tango.Core; using LiteDB; +using Newtonsoft.Json; namespace Tango.PPC.Jobs.Models { @@ -86,14 +87,18 @@ namespace Tango.PPC.Jobs.Models } [BsonIgnore] + [JsonIgnore] public SolidColorBrush Brush { get { return new SolidColorBrush(Color); } } [BsonIgnore] + [JsonIgnore] private bool _isSelected; + [BsonIgnore] + [JsonIgnore] public bool IsSelected { get { return _isSelected; } @@ -117,5 +122,17 @@ namespace Tango.PPC.Jobs.Models ColorSpace = ColorSpaces.Volume; IsSelected = false; } + + public bool Equals(FavoriteColor color) + { + if(color == null) + return false; + + return (ColorSpace == color.ColorSpace + && Cyan == color.Cyan && Magenta == color.Magenta && Yellow == color.Yellow && Black ==color.Black + && Red == color.Red && Green == color.Green && Blue == color.Blue + && L == color.L && A == color.A && B == color.B + && Hue == color.Hue && Saturation == color.Saturation && Brightness == color.Brightness); + } } } 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 d8a71fc78..983719e57 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 @@ -79,7 +79,7 @@ namespace Tango.PPC.Jobs.Models if (Segments != null) { if((EnableInterSegment && IsAllSegmentsPerSpool)) - return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) - InterSegmentLength) : 0; + return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) ) : 0; 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); @@ -1097,8 +1097,9 @@ namespace Tango.PPC.Jobs.Models // NumberOfUnits = (int)maxRep; //} } - RaisePropertyChanged(nameof(Length)); + OnUpdateLengthhWeight(); + RaisePropertyChanged(nameof(Length)); } RaisePropertyChanged(nameof(GetEstimatedDuration)); @@ -1131,8 +1132,11 @@ namespace Tango.PPC.Jobs.Models int max = GroupingSegments.Max(x => x.SegmentIndex); GroupingSegments.Where(i => i.SegmentIndex != max).ToList().ForEach(x => x.EnableInterSegment = InterSegmentLength > 0); } + _enableintersegment = InterSegmentLength > 0; _preventChange = false; + OnLengthChanged(); + UpdateEffectiveSegments(); } private void OnNumberOfSpoolsChanged() |
