diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-02-22 14:41:25 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-02-22 14:41:25 +0200 |
| commit | 28fa1ab91b3fb7970d9968c5cb1d018c2b44fd69 (patch) | |
| tree | 040ebb961e0e991436571f11d8a189c92326e4b3 /Software/Visual_Studio/Tango.BL | |
| parent | 3681ab681f02bbb7cda89de4044fd69bc9d61ab8 (diff) | |
| download | Tango-28fa1ab91b3fb7970d9968c5cb1d018c2b44fd69.tar.gz Tango-28fa1ab91b3fb7970d9968c5cb1d018c2b44fd69.zip | |
Implement grouping of segments. Changes in GUI and database. Not in Dying process.
Related Work Items: #4558
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
7 files changed, 150 insertions, 18 deletions
diff --git a/Software/Visual_Studio/Tango.BL/DTO/SegmentsGroupDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/SegmentsGroupDTOBase.cs index adbf8a2a0..3b98f3042 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/SegmentsGroupDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/SegmentsGroupDTOBase.cs @@ -22,9 +22,9 @@ namespace Tango.BL.DTO { /// <summary> - /// group index + /// segment index /// </summary> - public Int32 GroupIndex + public Int32 SegmentIndex { get; set; } @@ -37,5 +37,13 @@ namespace Tango.BL.DTO get; set; } + /// <summary> + /// job guid + /// </summary> + public String JobGuid + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index 4d0ac20fb..f37848b5e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -99,6 +99,8 @@ namespace Tango.BL.Entities public event EventHandler<WindingMethod> WindingMethodChanged; + public event EventHandler<SynchronizedObservableCollection<SegmentsGroup>> SegmentsGroupsChanged; + public event EventHandler<SynchronizedObservableCollection<Segment>> SegmentsChanged; protected DateTime _creationdate; @@ -1333,6 +1335,31 @@ namespace Tango.BL.Entities } } + protected SynchronizedObservableCollection<SegmentsGroup> _segmentsgroups; + + /// <summary> + /// Gets or sets the jobbase segments groups. + /// </summary> + + public virtual SynchronizedObservableCollection<SegmentsGroup> SegmentsGroups + { + get + { + return _segmentsgroups; + } + + set + { + if (_segmentsgroups != value) + { + _segmentsgroups = value; + + OnSegmentsGroupsChanged(value); + + } + } + } + protected SynchronizedObservableCollection<Segment> _segments; /// <summary> @@ -1683,6 +1710,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the SegmentsGroups has changed. + /// </summary> + protected virtual void OnSegmentsGroupsChanged(SynchronizedObservableCollection<SegmentsGroup> segmentsgroups) + { + SegmentsGroupsChanged?.Invoke(this, segmentsgroups); + RaisePropertyChanged(nameof(SegmentsGroups)); + } + + /// <summary> /// Called when the Segments has changed. /// </summary> protected virtual void OnSegmentsChanged(SynchronizedObservableCollection<Segment> segments) @@ -1697,6 +1733,8 @@ namespace Tango.BL.Entities public JobBase() : base() { + SegmentsGroups = new SynchronizedObservableCollection<SegmentsGroup>(); + Segments = new SynchronizedObservableCollection<Segment>(); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs index b8e2105b0..d6ff44428 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs @@ -9,12 +9,13 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media; +using Tango.BL.Interfaces; using Tango.Core; using Tango.Core.Threading; namespace Tango.BL.Entities { - public partial class Segment : SegmentBase + public partial class Segment : SegmentBase, ISegment { private double _lastLength; private LinearGradientBrush _brush; diff --git a/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroup.cs b/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroup.cs index 9da3d36ed..3115c2eeb 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroup.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroup.cs @@ -8,9 +8,11 @@ // </auto-generated> //------------------------------------------------------------------------------ +using Tango.BL.Interfaces; + namespace Tango.BL.Entities { - public class SegmentsGroup: SegmentsGroupBase + public class SegmentsGroup: SegmentsGroupBase, ISegment { } }
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroupBase.cs index 4879643f2..5b3491e40 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SegmentsGroupBase.cs @@ -27,34 +27,36 @@ namespace Tango.BL.Entities public abstract class SegmentsGroupBase : ObservableEntity<SegmentsGroup> { - public event EventHandler<Int32> GroupIndexChanged; + public event EventHandler<Int32> SegmentIndexChanged; public event EventHandler<Int32> RepeatsChanged; + public event EventHandler<Job> JobChanged; + public event EventHandler<SynchronizedObservableCollection<Segment>> SegmentsChanged; - protected Int32 _groupindex; + protected Int32 _segmentindex; /// <summary> - /// Gets or sets the segmentsgroupbase group index. + /// Gets or sets the segmentsgroupbase segment index. /// </summary> - [Column("GROUP_INDEX")] + [Column("SEGMENT_INDEX")] - public Int32 GroupIndex + public Int32 SegmentIndex { get { - return _groupindex; + return _segmentindex; } set { - if (_groupindex != value) + if (_segmentindex != value) { - _groupindex = value; + _segmentindex = value; - OnGroupIndexChanged(value); + OnSegmentIndexChanged(value); } } @@ -87,6 +89,64 @@ namespace Tango.BL.Entities } } + protected String _jobguid; + + /// <summary> + /// Gets or sets the segmentsgroupbase job guid. + /// </summary> + + [Column("JOB_GUID")] + [ForeignKey("Job")] + + public String JobGuid + { + get + { + return _jobguid; + } + + set + { + if (_jobguid != value) + { + _jobguid = value; + + } + } + } + + protected Job _job; + + /// <summary> + /// Gets or sets the segmentsgroupbase job. + /// </summary> + + [XmlIgnore] + [JsonIgnore] + public virtual Job Job + { + get + { + return _job; + } + + set + { + if (_job != value) + { + _job = value; + + if (Job != null) + { + JobGuid = Job.Guid; + } + + OnJobChanged(value); + + } + } + } + protected SynchronizedObservableCollection<Segment> _segments; /// <summary> @@ -113,12 +173,12 @@ namespace Tango.BL.Entities } /// <summary> - /// Called when the GroupIndex has changed. + /// Called when the SegmentIndex has changed. /// </summary> - protected virtual void OnGroupIndexChanged(Int32 groupindex) + protected virtual void OnSegmentIndexChanged(Int32 segmentindex) { - GroupIndexChanged?.Invoke(this, groupindex); - RaisePropertyChanged(nameof(GroupIndex)); + SegmentIndexChanged?.Invoke(this, segmentindex); + RaisePropertyChanged(nameof(SegmentIndex)); } /// <summary> @@ -131,6 +191,15 @@ namespace Tango.BL.Entities } /// <summary> + /// Called when the Job has changed. + /// </summary> + protected virtual void OnJobChanged(Job job) + { + JobChanged?.Invoke(this, job); + RaisePropertyChanged(nameof(Job)); + } + + /// <summary> /// Called when the Segments has changed. /// </summary> protected virtual void OnSegmentsChanged(SynchronizedObservableCollection<Segment> segments) diff --git a/Software/Visual_Studio/Tango.BL/Interfaces/ISegment.cs b/Software/Visual_Studio/Tango.BL/Interfaces/ISegment.cs new file mode 100644 index 000000000..db291c832 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Interfaces/ISegment.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Interfaces +{ + interface ISegment + { + Int32 SegmentIndex { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 2500c3370..3d6dd34b9 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -549,6 +549,7 @@ <Compile Include="ExtensionMethods\ColorMineExtensions.cs" /> <Compile Include="Helpers\EventTypeTextConverter.cs" /> <Compile Include="Helpers\SegmentsCsvHelper.cs" /> + <Compile Include="Interfaces\ISegment.cs" /> <Compile Include="IObservableEntityDTO.cs" /> <Compile Include="ObservableDTOPropertyAttribute.cs" /> <Compile Include="ObservableEntityDTO.cs" /> @@ -775,7 +776,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
