aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-02-22 14:41:25 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-02-22 14:41:25 +0200
commit28fa1ab91b3fb7970d9968c5cb1d018c2b44fd69 (patch)
tree040ebb961e0e991436571f11d8a189c92326e4b3 /Software
parent3681ab681f02bbb7cda89de4044fd69bc9d61ab8 (diff)
downloadTango-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')
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin22675456 -> 22675456 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml9
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs7
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/BrushStopModel.cs31
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs3
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ISegmentModel.cs6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs242
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentModel.cs7
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/SegmentsGroupModel.cs87
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/CopySegmentCommand.cs25
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs48
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/ReverseCommand.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs46
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml108
-rw-r--r--Software/Visual_Studio/Tango.BL/DTO/SegmentsGroupDTOBase.cs12
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/JobBase.cs38
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Segment.cs3
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/SegmentsGroup.cs4
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/SegmentsGroupBase.cs95
-rw-r--r--Software/Visual_Studio/Tango.BL/Interfaces/ISegment.cs13
-rw-r--r--Software/Visual_Studio/Tango.BL/Tango.BL.csproj3
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs3
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx51
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram175
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENTS_GROUPS.cs4
28 files changed, 731 insertions, 291 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index b6a2e6216..383d6a5ee 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index 3a7a3f0de..b8a3ccbfe 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index addc45b24..3ebaee794 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index ae5de9b06..9bf1349f2 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
index 7880e8639..34ed8cfb3 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionView.xaml
@@ -237,10 +237,12 @@
<Canvas Margin="200 50 100 0" Visibility="{Binding SaveMyColorMode, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}}" >
<Border x:Name="LABPopupGroups" Width="280" Background="Transparent" Height="Auto" MinHeight="100" MaxHeight="450">
<Grid MinWidth="260" >
- <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" Padding="10" MinHeight="100">
+ <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" MinHeight="100">
<Border.Effect>
<DropShadowEffect Opacity="0.5" ShadowDepth="6" Color="Silver" BlurRadius="10" Direction="270"/>
</Border.Effect>
+ <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="12" BorderThickness="0" Padding="10" MinHeight="100">
+
<StackPanel Orientation="Vertical">
<ListBox HorizontalAlignment="Stretch" MaxHeight="350" Margin="14 10 14 10" ItemsSource="{Binding Libraries}" Style="{StaticResource ListBoxVerticalScroll}"
ScrollViewer.VerticalScrollBarVisibility="Visible" >
@@ -265,6 +267,7 @@
</StackPanel>
</StackPanel>
</Border>
+ </Border>
</Grid>
</Border>
</Canvas>
@@ -497,12 +500,13 @@
<Border x:Name="MyColors" Visibility="{Binding MyColorsMode, Converter={StaticResource BooleanToVisibilityConverter}}" >
<Grid>
<Grid.Background>
- <SolidColorBrush Color="{StaticResource TangoDisabledBackgroundColor}" Opacity="0.9" />
+ <SolidColorBrush Color="{StaticResource TangoDisabledBackgroundColor}" Opacity="0.65" />
</Grid.Background>
<Border Margin="72 151 69 125" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Border.Effect>
<DropShadowEffect Opacity="0.5" ShadowDepth="6" Color="Silver" BlurRadius="10" Direction="270"/>
</Border.Effect>
+ <Border CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Grid>
<DockPanel >
<Grid DockPanel.Dock="Bottom" Height="137">
@@ -535,6 +539,7 @@
</DockPanel>
</Grid>
</Border>
+ </Border>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
index 399289eed..f23206815 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
@@ -503,6 +503,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (SelectedBrushStop != null)
{
SelectedBrushStop.ConvertColorToHSB();
+ OKCommand.RaiseCanExecuteChanged();
}
return;
@@ -512,6 +513,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (SelectedBrushStop != null)
{
SelectedBrushStop.ConvertColorToRGB();
+ OKCommand.RaiseCanExecuteChanged();
}
return;
}
@@ -520,6 +522,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (SelectedBrushStop != null)
{
SelectedBrushStop.ConvertColorToLAB();
+ OKCommand.RaiseCanExecuteChanged();
}
return;
}
@@ -528,6 +531,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (SelectedBrushStop != null)
{
SelectedBrushStop.ConvertColorToVolume();
+ OKCommand.RaiseCanExecuteChanged();
}
return;
}
@@ -536,6 +540,7 @@ namespace Tango.PPC.Jobs.Dialogs
if (SelectedBrushStop != null)
{
SelectedBrushStop.ConvertColorToCatalogs(DialogEditObject.Catalogs);
+ OKCommand.RaiseCanExecuteChanged();
}
return;
}
@@ -611,7 +616,7 @@ namespace Tango.PPC.Jobs.Dialogs
protected override bool CanOK()
{
- return SelectedBrushStop != null && !SelectedBrushStop.LiquidVolumesOutOfRange;
+ return SelectedBrushStop != null && !SelectedBrushStop.IsLiquidVolumesOutOfRange;
}
#endregion
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 8a071f126..12add3d2f 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
@@ -585,6 +585,8 @@ namespace Tango.PPC.Jobs.Models
}
}
}
+
+ protected bool RequiredMaxLiquidTest { get; set; }
#endregion
public BrushStopModel(SegmentModel segmentModel)
@@ -611,6 +613,7 @@ namespace Tango.PPC.Jobs.Models
ColorCatalogsItem = null;
PreventPropertyUpdate = false;
LiquidVolumesOutOfRange = false;
+ RequiredMaxLiquidTest = false;
}
public BrushStopModel(BrushStop brushStop, SegmentModel segmentModel, int version)
@@ -777,6 +780,7 @@ namespace Tango.PPC.Jobs.Models
cloned.LiquidVolumesOutOfRange = LiquidVolumesOutOfRange;
//this.MapPropertiesTo(cloned, MappingFlags.NoReferenceTypes);
cloned.PreventPropertyUpdate = false;
+ cloned.RequiredMaxLiquidTest = false;
return cloned;
}
@@ -830,6 +834,7 @@ namespace Tango.PPC.Jobs.Models
if (PreventPropertyUpdate)
return;
ColorSpace = ColorSpaces.Volume;
+ RequiredMaxLiquidTest = true;
RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
OnBrushStopFieldValueChanged();
@@ -972,6 +977,8 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(Saturation));
RaisePropertyChanged(nameof(Brightness));
}
+ RequiredMaxLiquidTest = false;
+ RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
}
}
@@ -1011,6 +1018,8 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(Red));
RaisePropertyChanged(nameof(Green));
RaisePropertyChanged(nameof(Blue));
+ RequiredMaxLiquidTest = false;
+ RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
}
}
@@ -1064,11 +1073,14 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(L));
RaisePropertyChanged(nameof(A));
RaisePropertyChanged(nameof(B));
+ RequiredMaxLiquidTest = false;
+ RaisePropertyChanged(nameof(IsLiquidVolumesOutOfRange));
}
}
public void ConvertColorToVolume()
{
+ RequiredMaxLiquidTest = true;
if (ColorSpace != ColorSpaces.Volume)
{
if (ColorSpace == ColorSpaces.Catalog)
@@ -1209,19 +1221,20 @@ namespace Tango.PPC.Jobs.Models
return 0.0;
}
+
public bool IsLiquidVolumesOutOfRange
{
get
{
- //if (ColorSpace == BL.Enumerations.ColorSpaces.Volume)
- // {
- var sum = GetColorNLPerCm(Cyan, LiquidTypes.Cyan) + GetColorNLPerCm(Magenta, LiquidTypes.Magenta) + GetColorNLPerCm(Yellow, LiquidTypes.Yellow) + GetColorNLPerCm(Black, LiquidTypes.Black);
- var maxLiq = GetTotalMaximumLiquidNlPerCMLimit();
- LiquidVolumesOutOfRange = sum > GetTotalMaximumLiquidNlPerCMLimit();
-
- return LiquidVolumesOutOfRange;
- // }
- // else return false;
+ if (RequiredMaxLiquidTest )
+ {
+ var sum = GetColorNLPerCm(Cyan, LiquidTypes.Cyan) + GetColorNLPerCm(Magenta, LiquidTypes.Magenta) + GetColorNLPerCm(Yellow, LiquidTypes.Yellow) + GetColorNLPerCm(Black, LiquidTypes.Black);
+ var maxLiq = GetTotalMaximumLiquidNlPerCMLimit();
+ LiquidVolumesOutOfRange = sum > GetTotalMaximumLiquidNlPerCMLimit();
+
+ return LiquidVolumesOutOfRange;
+ }
+ else return false;
}
}
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 511a90e15..502e19dfc 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
@@ -27,7 +27,8 @@ namespace Tango.PPC.Jobs.Models
public string Name
{
get { return _name; }
- set { _name = value; }
+ set { _name = value;
+ RaisePropertyChangedAuto(); }
}
private bool _editColorsGroupMode;
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 9bed7e849..37a8fc33b 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
@@ -9,11 +9,13 @@ namespace Tango.PPC.Jobs.Models
public interface ISegmentModel
{
String Name { get; set; }
- double Length { get; set; }
+ double Length { get; }
+ double LengthWithInterSegment { get; }
bool IsGroupSegment { get; }
bool IsSelected { get; set; }
bool IsLast { get; set; }
Int32 SegmentIndex { get; set; }
double InterSegmentLength { get; }
- }
+ bool EnableInterSegment { 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 3379149f6..dd8c88971 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
@@ -69,7 +69,8 @@ namespace Tango.PPC.Jobs.Models
{
if (Segments != null)
{
- return Segments.Sum(x => x.LengthWithInterSegment);
+ return GroupingSegments.Sum(x => x.LengthWithInterSegment);
+ //return Segments.Sum(x => x.LengthWithInterSegment);
// return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0);
}
else
@@ -142,8 +143,8 @@ namespace Tango.PPC.Jobs.Models
if (_intersegmentlength != value)
{
_intersegmentlength = value;
- OnInterSegmentlengthChanged();
RaisePropertyChangedAuto();
+ OnInterSegmentlengthChanged();
}
}
}
@@ -314,6 +315,7 @@ namespace Tango.PPC.Jobs.Models
}
}
}
+ public JobTypes JobType { get; set; }
protected SynchronizedObservableCollection<SegmentModel> _segments;
@@ -338,41 +340,39 @@ namespace Tango.PPC.Jobs.Models
}
}
- public ObservableCollection<SegmentModel> EffectiveSegments
+ private bool _enableintersegment;
+ public bool EnableInterSegment
{
get
{
- //if (EnableInterSegment && IsAllSegmentsPerSpool)
- if( IsAllSegmentsPerSpool)
- {
- int max = Segments.Max(x => x.SegmentIndex);
-
- ObservableCollection<SegmentModel> effectiveSegments = new ObservableCollection<SegmentModel>();
-
- foreach (var s in Segments.ToList().OrderBy(x => x.SegmentIndex))
- {
- effectiveSegments.Add(s);
-
- if (s.SegmentIndex != max && s.EnableInterSegment)
- {
- effectiveSegments.Add(CreateInterSegment(InterSegmentLength));
- }
- }
+ return _enableintersegment;
+ }
- return effectiveSegments;
- }
- else
+ set
+ {
+ if (_enableintersegment != value)
{
- return Segments.OrderBy(x => x.SegmentIndex).ToObservableCollection();
+ _enableintersegment = value;
+ RaisePropertyChangedAuto();
+ OnEnableInterSegmentChanged();
}
}
}
+
+ private ObservableCollection<SegmentModel> _effectiveSegments;
+ public ObservableCollection<SegmentModel> EffectiveSegments
+ {
+ get
+ {
+ return _effectiveSegments;
+ }
+ }
- protected ObservableCollection<ISegmentModel> _groupingSegments;
+ protected SynchronizedObservableCollection<ISegmentModel> _groupingSegments;
/// <summary>
/// Gets or sets the display segments.
/// </summary>
- public ObservableCollection<ISegmentModel> GroupingSegments
+ public SynchronizedObservableCollection<ISegmentModel> GroupingSegments
{
get
{
@@ -424,22 +424,32 @@ namespace Tango.PPC.Jobs.Models
}
}
- public int LastNewGroupID { get; set; }
-
+ public int LastGroupID
+ {
+ get
+ {
+ var groups = GroupingSegments.ToList().OfType<SegmentsGroupModel>().ToList();
+ return groups.Count() == 0 ? 0 : groups.Max(x => x.SegmentIndex);
+ }
+ }
+
#endregion
public JobModel(List<ColorSpace> list)
{
ColorSpacesList = list;
_segments = new SynchronizedObservableCollection<SegmentModel>();
- _groupingSegments = new ObservableCollection<ISegmentModel>();
+ _groupingSegments = new SynchronizedObservableCollection<ISegmentModel>();
SegmentsToCopy = new List<SegmentModel>();
+ _effectiveSegments = new ObservableCollection<SegmentModel>();
Segments.CollectionChanged -= Segments_CollectionChanged;
Segments.CollectionChanged += Segments_CollectionChanged;
+
+ GroupingSegments.CollectionChanged -= SegmentsGroup_CollectionChanged;
+ GroupingSegments.CollectionChanged += SegmentsGroup_CollectionChanged;
SelectAllSegments = false;
NumberOfUnits = 1;
- LastNewGroupID = 1;
}
#region modifications
@@ -453,16 +463,21 @@ namespace Tango.PPC.Jobs.Models
{
GroupingSegments.Clear();
var groupedList = Segments.Where(x => x.GroupID >0).Select(grp => grp.SegmentsGroupModel).Distinct().ToList();//List<SegmentsGroupModel>
+ int ID = 1;
+ groupedList.ForEach(x => x.SegmentIndex = ID++);
+
Dictionary<int, SegmentsGroupModel> groupIDToSegmentsGroup = new Dictionary<int, SegmentsGroupModel>();
foreach (var group in groupedList)
{
- var groupID = group.GroupID;
+ var groupID = group.SegmentIndex;
groupIDToSegmentsGroup[groupID] = group;
};
+ int currentIndex = 1;
foreach (var segment in Segments)
{
if (!segment.IsGroupSegment)
{
+ segment.SegmentIndex = currentIndex;
GroupingSegments.Add(segment);
}
else
@@ -471,10 +486,14 @@ namespace Tango.PPC.Jobs.Models
if (groupIDToSegmentsGroup.TryGetValue(segment.GroupID, out segmentsGroup))
{
GroupingSegments.Add(segmentsGroup);
+ segmentsGroup.SegmentIndex = currentIndex;
groupIDToSegmentsGroup.Remove(segment.GroupID);
}
}
+ currentIndex++;
}
+ if(GroupingSegments.Count > 0)
+ GroupingSegments.Last().IsLast = true;
RaisePropertyChanged(nameof(GroupingSegments));
}
public static SegmentModel CreateInterSegment(double length)
@@ -518,19 +537,102 @@ namespace Tango.PPC.Jobs.Models
#endregion
#region changes
+
+ private void OnEnableInterSegmentChanged()
+ {
+ GroupingSegments.ToList().ForEach(x => x.EnableInterSegment = EnableInterSegment);
+ UpdateEffectiveSegments();
+ }
+
+ private void UpdateEffectiveSegments()
+ {
+ if (IsAllSegmentsPerSpool)
+ {
+ int max = GroupingSegments.Count > 0 ? GroupingSegments.Max(x => x.SegmentIndex) : 0;
+
+ ObservableCollection<SegmentModel> effectiveSegments = new ObservableCollection<SegmentModel>();
+
+ foreach (var s in GroupingSegments.OrderBy(x => x.SegmentIndex))
+ {
+ if (s is SegmentModel)
+ {
+ SegmentModel segment = s as SegmentModel;
+ effectiveSegments.Add(segment);
+ if (segment.SegmentIndex != max && segment.EnableInterSegment)
+ {
+ effectiveSegments.Add(CreateInterSegment(InterSegmentLength));
+ }
+ }
+ else if (s is SegmentsGroupModel)
+ {
+ SegmentsGroupModel segmentsGroup = s as SegmentsGroupModel;
+ List<SegmentModel> segments = segmentsGroup.Segments.ToList();
+ for (int repeats = 0; repeats < segmentsGroup.Repeats; repeats++)
+ {
+ for (int i = 0; i < segments.Count; i++)
+ {
+ if (repeats > 0)
+ {
+ effectiveSegments.Add(segments[i].Clone());
+ }
+ else
+ effectiveSegments.Add(segments[i]);
+
+ }
+ }
+ if (EnableInterSegment &&
+ !(segmentsGroup.SegmentIndex == max && segmentsGroup.SegmentIndex != max))
+ {
+ effectiveSegments.Add(CreateInterSegment(InterSegmentLength));
+ }
+ }
+ }
+ _effectiveSegments = effectiveSegments;
+ }
+ else
+ {
+ foreach (var s in GroupingSegments.OrderBy(x => x.SegmentIndex))
+ {
+ if (s is SegmentModel)
+ {
+ SegmentModel segment = s as SegmentModel;
+ _effectiveSegments.Add(segment);
+ }
+ else if (s is SegmentsGroupModel)
+ {
+ SegmentsGroupModel segmentsGroup = s as SegmentsGroupModel;
+ List<SegmentModel> segments = segmentsGroup.Segments.ToList();
+ for (int repeats = 0; repeats < segmentsGroup.Repeats; repeats++)
+ {
+ for (int i = 0; i < segments.Count; i++)
+ {
+ if (repeats > 0)
+ {
+ _effectiveSegments.Add(segments[i].Clone());
+ }
+ else
+ _effectiveSegments.Add(segments[i]);
+ }
+ }
+ }
+ }
+ }
+ RaisePropertyChanged(nameof(EffectiveSegments));
+ }
+
/// <summary>
/// Handles the CollectionChanged event of the Segments collection.
/// </summary>
- private void Segments_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ private void Segments_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
foreach (var segment in Segments.ToList())
{
segment.PropertyChanged -= Segment_PropertyChanged;
segment.PropertyChanged += Segment_PropertyChanged;
}
-
- OnLengthChanged();
- RaisePropertyChanged(nameof(EffectiveSegments));
+
+ //OnLengthChanged();
+ //UpdateEffectiveSegments();
}
/// <summary>
@@ -544,13 +646,13 @@ namespace Tango.PPC.Jobs.Models
}
else if (e.PropertyName == nameof(SegmentModel.SegmentIndex))
{
- RaisePropertyChanged(nameof(EffectiveSegments));
- }
- else if(e.PropertyName == nameof(SegmentModel.EnableInterSegment))
- {
- OnLengthChanged();
- RaisePropertyChanged(nameof(EffectiveSegments));
+ UpdateEffectiveSegments();
}
+ //else if(e.PropertyName == nameof(SegmentModel.EnableInterSegment))
+ //{
+ // OnLengthChanged();
+ // RaisePropertyChanged(nameof(EffectiveSegments));
+ //}
else if(e.PropertyName == nameof(SegmentModel.IsSelected))
{
if (_preventChange) return;
@@ -566,7 +668,43 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChanged(nameof(HasSelectedItems));
}
}
-
+
+ private void SegmentsGroup_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ {
+ foreach (var group in GroupingSegments.ToList())
+ {
+ if (group is SegmentsGroupModel)
+ {
+ (group as SegmentsGroupModel).PropertyChanged -= SegmentsGroup_PropertyChanged;
+ (group as SegmentsGroupModel).PropertyChanged += SegmentsGroup_PropertyChanged;
+ }
+ }
+ OnLengthChanged();
+ UpdateEffectiveSegments();
+ }
+
+ private void SegmentsGroup_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == nameof(SegmentsGroupModel.Repeats))
+ {
+ OnLengthChanged();
+ UpdateEffectiveSegments();
+ }
+ else if (e.PropertyName == nameof(SegmentModel.IsSelected))
+ {
+ //if (_preventChange) return;
+ //if (Segments.ToList().TrueForAll(x => x.IsSelected))
+ //{
+ // _selectAllSegments = true;
+ //}
+ //else
+ //{
+ // _selectAllSegments = false;
+ //}
+ //RaisePropertyChanged(nameof(SelectAllSegments));
+ //RaisePropertyChanged(nameof(HasSelectedItems));
+ }
+ }
/// <summary>
/// Called when the <see cref="Length"/> property has been changed
@@ -586,7 +724,7 @@ namespace Tango.PPC.Jobs.Models
if (Segments != null )
{
_preventChange = true;
- Segments.ToList().ForEach(x => x.IsSelected = SelectAllSegments);
+ GroupingSegments.ToList().ForEach(x => x.IsSelected = SelectAllSegments);
_preventChange = false;
RaisePropertyChanged(nameof(HasSelectedItems));
}
@@ -595,10 +733,10 @@ namespace Tango.PPC.Jobs.Models
private void OnInterSegmentlengthChanged()
{
_preventChange = true;
- if (Segments.Count > 0)
+ if (GroupingSegments.Count > 0)
{
- int max = Segments.Max(x => x.SegmentIndex);
- Segments.Where(i => i.SegmentIndex != max).ToList().ForEach(x => x.EnableInterSegment = InterSegmentLength > 0);
+ int max = GroupingSegments.Max(x => x.SegmentIndex);
+ GroupingSegments.Where(i => i.SegmentIndex != max).ToList().ForEach(x => x.EnableInterSegment = InterSegmentLength > 0);
}
_preventChange = false;
}
@@ -612,19 +750,19 @@ namespace Tango.PPC.Jobs.Models
if (false == Segments.ToList().Any(x => x.IsSelected))
return;
LogManager.Log("Copy selected segments.");
- int max = Segments.Max(x => x.SegmentIndex);
- Segments.Where(i => i.IsSelected && i.SegmentIndex != max).ToList().ForEach(y => y.EnableInterSegment = true);
+ int max = GroupingSegments.Max(x => x.SegmentIndex);
+ GroupingSegments.Where(i => i.IsSelected && i.SegmentIndex != max).ToList().ForEach(y => y.EnableInterSegment = true);
}
public void SwapSegments(int index1, int index2)
{
- if (index1 < 0 || index1 >= Segments.Count)
+ if (index1 < 0 || index1 >= GroupingSegments.Count)
return;
- if (index2 < 0 || index2 >= Segments.Count)
+ if (index2 < 0 || index2 >= GroupingSegments.Count)
return;
- var tmpIndex = Segments[index2];
- Segments[index2] = Segments[index1];
- Segments[index1] = tmpIndex;
+ var tmpIndex = GroupingSegments[index2];
+ GroupingSegments[index2] = GroupingSegments[index1];
+ GroupingSegments[index1] = tmpIndex;
}
#endregion
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 0773abf19..e7282bf8d 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
@@ -31,7 +31,7 @@ namespace Tango.PPC.Jobs.Models
public int GroupID {
get
{
- return SegmentsGroupModel == null ? -1 : SegmentsGroupModel.GroupID;
+ return SegmentsGroupModel == null ? -1 : SegmentsGroupModel.SegmentIndex;
}
}
@@ -136,8 +136,9 @@ namespace Tango.PPC.Jobs.Models
_enableintersegment = value;
RaisePropertyChangedAuto();
RaisePropertyChanged(nameof(LengthWithInterSegment));
- RaisePropertyChanged(nameof(InterSegmentLength));
+
}
+ RaisePropertyChanged(nameof(InterSegmentLength));
}
}
@@ -450,7 +451,7 @@ namespace Tango.PPC.Jobs.Models
Job = jobModel;
GUID = guid;
IsLast = false;
- EnableInterSegment = jobModel.InterSegmentLength > 0;
+ EnableInterSegment = jobModel.EnableInterSegment;
}
public SegmentModel()
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 0c3863f78..7a2850684 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
@@ -12,9 +12,24 @@ namespace Tango.PPC.Jobs.Models
{
#region Properties
- public ObservableCollection<SegmentModel> Segments { get; set; }
-
- public int GroupID{ get; set; }
+ public SynchronizedObservableCollection<SegmentModel> Segments { get; set; }
+
+ private Int32 _segnmentIndex;
+ public Int32 SegmentIndex
+ {
+ get
+ {
+ return _segnmentIndex;
+ }
+ set
+ {
+ if(_segnmentIndex != value)
+ {
+ _segnmentIndex = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
private int _repeats;
@@ -23,6 +38,7 @@ namespace Tango.PPC.Jobs.Models
get { return _repeats; }
set { _repeats = value;
RaisePropertyChangedAuto();
+ RaisePropertyChanged(nameof(Length));
}
}
@@ -34,6 +50,8 @@ namespace Tango.PPC.Jobs.Models
RaisePropertyChangedAuto();
}
}
+ public JobModel Job { get; set; }
+
protected Double _length;
/// <summary>
/// Gets or sets the length.
@@ -44,13 +62,19 @@ namespace Tango.PPC.Jobs.Models
{
return Segments.Count == 0 ? 0 : Segments.ToList().Sum(x=>x.Length);
}
- set
+
+ }
+
+ public Double LengthWithInterSegment
+ {
+ get
{
- if (_length != value)
+ if (Job != null )
{
- _length = value;
- RaisePropertyChangedAuto();
+ return EnableInterSegment ? (Length + Job.InterSegmentLength) * Repeats : Length * Repeats;
}
+ return Length;
+ //return Segments.Count == 0 ? 0 : Segments.ToList().Sum(x => x.LengthWithInterSegment) * Repeats;
}
}
@@ -75,13 +99,19 @@ namespace Tango.PPC.Jobs.Models
}
}
- public bool IsLast { get; set; }
- public Int32 SegmentIndex {
- get {
- return Segments.Count == 0 ? 0 : Segments.ToList().OrderBy(x => x.SegmentIndex).Select(x => x.SegmentIndex).FirstOrDefault();
+ private bool _isLast;
+
+ public bool IsLast
+ {
+ get { return _isLast; }
+ set
+ {
+ _isLast = value;
+ RaisePropertyChangedAuto();
}
- set { }
}
+
+
public int FirstSegmentIndex {
get
{
@@ -108,22 +138,45 @@ namespace Tango.PPC.Jobs.Models
{
get
{
- return Segments.Count == 0 ? 0 : Segments.ToList().Select(x => x.InterSegmentLength).FirstOrDefault();
+ return Job == null ? 0 : Job.InterSegmentLength;
+ // return Segments.Count == 0 ? 0 : Segments.ToList().Select(x => x.InterSegmentLength).FirstOrDefault();
}
}
+ protected Boolean _enableintersegment;
+ public Boolean EnableInterSegment
+ {
+ get { return _enableintersegment; }
+ set
+ {
+ if (_enableintersegment != value)
+ {
+ _enableintersegment = value;
+ RaisePropertyChangedAuto();
+ RaisePropertyChanged(nameof(LengthWithInterSegment));
+ RaisePropertyChanged(nameof(InterSegmentLength));
+
+ }
+
+ }
+ }
+
#endregion
- public SegmentsGroupModel(List<SegmentModel> selectedSegments)
+ public SegmentsGroupModel(JobModel jobModel, List<SegmentModel> selectedSegments)
{
- Segments = selectedSegments.ToObservableCollection();
+ Job = jobModel;
+ Segments = selectedSegments.ToSynchronizedObservableCollection();
Repeats = 1;
+ EnableInterSegment = jobModel.EnableInterSegment;
}
- public SegmentsGroupModel()
+ public SegmentsGroupModel(JobModel jobModel)
{
- Segments = new ObservableCollection<SegmentModel>();
+ Job = jobModel;
+ Segments = new SynchronizedObservableCollection<SegmentModel>();
Repeats = 1;
+ EnableInterSegment = jobModel.EnableInterSegment;
}
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/CopySegmentCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/CopySegmentCommand.cs
index 059fd4bec..e82e10e49 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/CopySegmentCommand.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/CopySegmentCommand.cs
@@ -21,12 +21,27 @@ namespace Tango.PPC.Jobs.UndoRedoCommands
if (false == _jobModel.Segments.ToList().Any(x => x.IsSelected))
return;
//LogManager.Log("Copy selected segments.");
-
- foreach (var segment in _jobModel.Segments.Where(i => i.IsSelected).ToList())
+ int additionalGroupIndex = 1;
+ foreach (var segment in _jobModel.GroupingSegments.Where(i => i.IsSelected).ToList())
{
- SegmentModel newSegmentModel = segment.Clone();
- newSegmentModel.SegmentIndex = segment.SegmentIndex + 1;
- _jobModel.SegmentsToCopy.Add(newSegmentModel);
+ if (segment is SegmentModel)
+ {
+ SegmentModel newSegmentModel = ((SegmentModel)segment).Clone();
+ _jobModel.SegmentsToCopy.Add(newSegmentModel);
+ }
+ else if (segment is SegmentsGroupModel)
+ {
+ SegmentsGroupModel group = (SegmentsGroupModel)segment;
+ List<SegmentModel> copysegments = new List<SegmentModel>();
+ foreach (var segm in group.Segments)
+ {
+ SegmentModel newSegmentModel = segm.Clone();
+ copysegments.Add(newSegmentModel);
+ }
+ SegmentsGroupModel newgroup = new SegmentsGroupModel(_jobModel, copysegments) { SegmentIndex = (_jobModel.LastGroupID + additionalGroupIndex++) };
+ copysegments.ForEach(x => { x.SegmentsGroupModel = newgroup; x.IsSelected = false; });
+ _jobModel.SegmentsToCopy.AddRange(copysegments);
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs
index 6ad0f95cc..cdce7739a 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs
@@ -10,21 +10,20 @@ namespace Tango.PPC.Jobs.UndoRedoCommands
public class RepeatCommand : IUndoRedoCommand
{
private JobModel _jobModel;
- private List<SegmentModel> _selectedSegments;
-
+ private List<ISegmentModel> _selectedSegments;
+
public RepeatCommand(JobModel job)
{
_jobModel = job;
-
- _selectedSegments = new List<SegmentModel>();
- for (int index = 0; index < _jobModel.Segments.Count; index++)
+ _selectedSegments = new List<ISegmentModel>();
+ for (int index = 0; index < _jobModel.GroupingSegments.Count; index++)
{
- var segment = _jobModel.Segments[index];
- if (segment.IsSelected && false == segment.IsGroupSegment)
+ var segment = _jobModel.GroupingSegments[index];
+ if (segment.IsSelected )
{
_selectedSegments.Add(segment);
}
- else if (_selectedSegments.Count > 0)
+ else if (_selectedSegments.Count > 0)//selected items should be in turn
{
break;
}
@@ -35,10 +34,23 @@ namespace Tango.PPC.Jobs.UndoRedoCommands
{
if (_selectedSegments.Count == 0)
return;
- _jobModel.LastNewGroupID++;
- SegmentsGroupModel group = new SegmentsGroupModel(_selectedSegments) { GroupID = _jobModel.LastNewGroupID };
- _selectedSegments.ForEach(x => { x.SegmentsGroupModel = group; x.IsSelected = false; });
-
+
+ List<SegmentModel> selectedsegments = new List<SegmentModel>();
+ foreach (var segm in _selectedSegments)
+ {
+ if (segm is SegmentModel)
+ selectedsegments.Add((SegmentModel)segm);
+ else if (segm is SegmentsGroupModel)
+ {
+ selectedsegments.AddRange(((SegmentsGroupModel)segm).Segments);
+ }
+ }
+
+ SegmentsGroupModel group = new SegmentsGroupModel(_jobModel, selectedsegments) ;
+ group.SegmentIndex = group.FirstSegmentIndex;
+
+ selectedsegments.ForEach(x => { x.SegmentsGroupModel = group; x.IsSelected = false; });
+
_jobModel.LoadGroupingSegments();
}
@@ -46,8 +58,16 @@ namespace Tango.PPC.Jobs.UndoRedoCommands
{
if (_selectedSegments.Count == 0)
return;
- _selectedSegments.ForEach(x => { x.SegmentsGroupModel = null; });
- _jobModel.LastNewGroupID--;
+ foreach (var segm in _selectedSegments)
+ {
+ if (segm is SegmentModel)
+ ((SegmentModel)segm).SegmentsGroupModel = null;
+ else if (segm is SegmentsGroupModel)
+ {
+ SegmentsGroupModel group = (SegmentsGroupModel)segm;
+ group.Segments.ToList().ForEach(x => x.SegmentsGroupModel = group);
+ }
+ }
_jobModel.LoadGroupingSegments();
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/ReverseCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/ReverseCommand.cs
index 94527d236..f34a3eaf6 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/ReverseCommand.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/ReverseCommand.cs
@@ -15,7 +15,7 @@ namespace Tango.PPC.Jobs.UndoRedoCommands
public ReverseCommand(JobModel job)
{
_jobModel = job;
- _indexes = _jobModel.Segments.Select((segm, ind) => new { Index = ind, Segment = segm }).Where( x=>x.Segment.IsSelected).Select(t=> t.Index).ToList();
+ _indexes = _jobModel.GroupingSegments.Select((segm, ind) => new { Index = ind, Segment = segm }).Where( x=>x.Segment.IsSelected).Select(t=> t.Index).ToList();
}
public void Execute()
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
index 0ffc65fc0..f67c70bf4 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
@@ -281,6 +281,7 @@ namespace Tango.PPC.Jobs.ViewModels
public RelayCommand<SegmentsGroupModel> UngroupSegmentsCommand { get; set; }
public RelayCommand<SegmentsGroupModel> DeleteSegmentsGroupCommand { get; set; }
+ public RelayCommand<SegmentsGroupModel> RepeatSegmentsGroupCommand { get; set; }
#endregion
@@ -354,6 +355,7 @@ namespace Tango.PPC.Jobs.ViewModels
DeleteSegmentsGroupCommand = new RelayCommand<SegmentsGroupModel>(DeleteSegmentsGroup);
RepeateSegmentCommand = new RelayCommand(RepeateSegments);
UngroupSegmentsCommand = new RelayCommand<SegmentsGroupModel>(UngroupSegments);
+ RepeatSegmentsGroupCommand = new RelayCommand<SegmentsGroupModel>(RepeatSegmentsGroup);
PasteCommand = new RelayCommand(Paste);
CopyCommand = new RelayCommand(Copy);
UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); }
@@ -505,7 +507,10 @@ namespace Tango.PPC.Jobs.ViewModels
ColorSpace = Job.ColorSpace,
SpoolType = Job.SpoolType,
User = Job.User,
- Machine = Job.Machine
+ Machine = Job.Machine,
+ JobType = Job.JobType,
+ InterSegmentLength = Job.InterSegmentLength,
+ EnableInterSegment = Job.EnableInterSegment
};
Dictionary<string, SegmentsGroupModel> guidToGroup = new Dictionary<string, SegmentsGroupModel>();
foreach (var segm in Job.Segments)
@@ -560,7 +565,7 @@ namespace Tango.PPC.Jobs.ViewModels
}
else
{
- segmentsGroupModel = new SegmentsGroupModel() { GroupID = segm.SegmentsGroup.GroupIndex, Repeats = segm.SegmentsGroup.Repeats };
+ segmentsGroupModel = new SegmentsGroupModel(jobModel) { SegmentIndex = segm.SegmentsGroup.SegmentIndex, Repeats = segm.SegmentsGroup.Repeats };
guidToGroup[segm.SegmentsGroupGuid] = segmentsGroupModel;
segmentsGroupModel.Segments.Add(segmentModel);
segmentModel.SegmentsGroupModel = segmentsGroupModel;
@@ -579,20 +584,19 @@ namespace Tango.PPC.Jobs.ViewModels
jobModel.InterSegmentLength = Job.EnableInterSegment ? Job.InterSegmentLength : 0;
- jobModel.Segments.Last().IsLast = true;
jobModel.LoadGroupingSegments();
JobModel = jobModel;
//create grouping
SegmentsCollectionView = CollectionViewSource.GetDefaultView(JobModel.GroupingSegments);
SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(SegmentModel.SegmentIndex), ListSortDirection.Ascending));
UndoRedoManager.Instance.ClearAll();
+ ArrangeSegmentsIndixes();
}
private void Job_NameChanged(object sender, string e)
{
DyeCommand.RaiseCanExecuteChanged();
}
-
public override void OnBeforeNavigatedFrom()
{
base.OnBeforeNavigatedFrom();
@@ -668,11 +672,15 @@ namespace Tango.PPC.Jobs.ViewModels
Job.Name = vm.JobName;
JobModel.Name = vm.JobName;
- Job.EnableInterSegment = vm.WhiteGap > 0;
+
Job.InterSegmentLength = vm.WhiteGap;
+ Job.EnableInterSegment = vm.WhiteGap > 0;
JobModel.InterSegmentLength = vm.WhiteGap;
+ JobModel.EnableInterSegment = vm.WhiteGap > 0;
+
Job.SpoolType = vm.SelectedSpoolType;
JobModel.SpoolType = vm.SelectedSpoolType;//update length!!!!
+
SelectedRML = vm.SelectedRML;
if (vm.IsDuplicate)
@@ -809,17 +817,17 @@ namespace Tango.PPC.Jobs.ViewModels
private async void RepeatSegmentsGroup( SegmentsGroupModel group)
{
- var maxLength = 999;
- var maxRep = (maxLength == 0 ? 999 : (maxLength / JobModel.Length));
-
- var vm = await NotificationProvider.ShowDialog<RepeatJobViewVM>(new RepeatJobViewVM($"Edit \"Group {group.GroupID}\" Repeat", group.Repeats)
+ var maxLength = Job.SpoolType.Length == 0 ? 999 : Job.SpoolType.Length;
+ var maxRep = (maxLength - JobModel.Length)/ group.Length;
+
+ var vm = await NotificationProvider.ShowDialog<RepeatJobViewVM>(new RepeatJobViewVM($"Edit \"Group {group.SegmentIndex}\" Repeat", group.Repeats)
{
MaxRepeations = (int)maxRep
});
if (vm.DialogResult)
{
- JobModel.NumberOfUnits = vm.Repeats;
+ group.Repeats = vm.Repeats;
}
}
@@ -893,7 +901,8 @@ namespace Tango.PPC.Jobs.ViewModels
int index = 1;
int count = JobModel.Segments.Count();
- foreach (var segment in JobModel.Segments)
+ // foreach (var segment in JobModel.Segments)
+ foreach (var segment in JobModel.GroupingSegments)
{
segment.IsLast = ( index == count)? true : false;
segment.SegmentIndex = index++;
@@ -1176,7 +1185,7 @@ namespace Tango.PPC.Jobs.ViewModels
private void Reverse()
{
- if (false == JobModel.Segments.ToList().Any(x => x.IsSelected))
+ if (false == JobModel.GroupingSegments.ToList().Any(x => x.IsSelected))
return;
UndoRedoManager.Instance.InsertAndExecuteCommand(new ReverseCommand(JobModel));
@@ -1220,14 +1229,16 @@ namespace Tango.PPC.Jobs.ViewModels
private void RepeateSegments()
{
- if ( (JobModel.Segments.ToList().Where(x => x.IsSelected).Count()) < 2)
+ if ( (JobModel.GroupingSegments.ToList().Where(x => x.IsSelected).Count()) < 2)
return;
UndoRedoManager.Instance.InsertAndExecuteCommand(new RepeatCommand(JobModel));
+ ArrangeSegmentsIndixes();
}
private void UngroupSegments(SegmentsGroupModel segmentsGroup)
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new UnGroupSegmentsCommand(JobModel, segmentsGroup));
+ ArrangeSegmentsIndixes();
}
private void Paste()
@@ -1290,7 +1301,7 @@ namespace Tango.PPC.Jobs.ViewModels
Job.Segments.Clear();
- Dictionary<int, SegmentsGroup> groupIDToSegmentsGroupGuid = new Dictionary<int, SegmentsGroup>();
+ Dictionary<int, SegmentsGroup> segmentIndexToGroup = new Dictionary<int, SegmentsGroup>();
foreach (var segment in JobModel.Segments.OrderBy(x => x.SegmentIndex).ToList())
{
@@ -1304,15 +1315,16 @@ namespace Tango.PPC.Jobs.ViewModels
if(segment.IsGroupSegment)
{
SegmentsGroup dbSegmentsGroup;
- if (false == groupIDToSegmentsGroupGuid.TryGetValue(segment.SegmentsGroupModel.GroupID, out dbSegmentsGroup))
+ if (false == segmentIndexToGroup.TryGetValue(segment.SegmentsGroupModel.SegmentIndex, out dbSegmentsGroup))
{
dbSegmentsGroup = new SegmentsGroup();
dbSegmentsGroup.Guid = System.Guid.NewGuid().ToString();
dbSegmentsGroup.Repeats = segment.SegmentsGroupModel.Repeats;
- dbSegmentsGroup.GroupIndex = segment.SegmentsGroupModel.GroupID;
+ dbSegmentsGroup.SegmentIndex = segment.SegmentsGroupModel.SegmentIndex;
+ dbSegmentsGroup.Job = Job;
_db.SegmentsGroups.Add(dbSegmentsGroup);
dbSegment.SegmentsGroup = dbSegmentsGroup;
- groupIDToSegmentsGroupGuid[segment.SegmentsGroupModel.GroupID] = dbSegmentsGroup;
+ segmentIndexToGroup[segment.SegmentsGroupModel.SegmentIndex] = dbSegmentsGroup;
}
else
{
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml
index 2f3646f9f..d90828cce 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml
@@ -430,11 +430,11 @@
<StackPanel Grid.Row="0" DockPanel.Dock="Left">
<StackPanel Margin="0 0 0 0" Orientation="Horizontal" >
<TextBlock FontSize="{StaticResource TangoTitleFontSize}">
- <Run>Group </Run>
- <Run Text="{Binding GroupID, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
- <Run Text="{Binding DisplayIndexes, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
+ <Run>Group #</Run>
+ <Run Text="{Binding SegmentIndex, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
+
</TextBlock>
- <touch:TouchButton Background="Transparent" Width="Auto" EnableDropShadow="False">
+ <touch:TouchButton Background="Transparent" Width="Auto" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.RepeatSegmentsGroupCommand}" CommandParameter="{Binding}">
<TextBlock Margin="10 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" TextDecorations="Underline">
<Run>x</Run>
<Run Text="{Binding Repeats, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
@@ -443,7 +443,7 @@
</StackPanel>
<StackPanel Margin="0 0 0 0" Orientation="Horizontal">
<controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):" FontSize="18"></controls:FastTextBlock>
- <touch:TouchNumericTextBox Margin="20 0 0 0" Width="92" DockPanel.Dock="Right" Value="{Binding Length, UpdateSourceTrigger=LostFocus}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" FontSize="18" ValueChangedEnd="Length_ValueChanged" TextGotFocus="Length_BeforeChangeValue"/>
+ <controls:FastTextBlock Margin="20 0 0 0" Width="92" VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="{Binding Length}" FontSize="18"></controls:FastTextBlock>
</StackPanel>
</StackPanel>
</DockPanel>
@@ -460,33 +460,32 @@
</RectangleGeometry>
</Border.Clip>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.Width>
- <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
- <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="DataContext.Length"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
- <Binding Path="LengthWithInterSegment"></Binding>
- </MultiBinding>
- </Grid.Width>
- <Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
+ <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Grid>
+ <Grid.Width>
+ <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
+ <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="DataContext.Length"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
+ <Binding Path="LengthWithInterSegment"></Binding>
+ </MultiBinding>
+ </Grid.Width>
+ <Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
+ </Grid>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
<Border Height="40" Width="151" Opacity="1" Background="#32787880" HorizontalAlignment="Center" CornerRadius="8" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}"> Grouped</TextBlock>
</Border>
</Grid>
-
</Border>
<Grid Grid.Row="2" x:Name="add_new_segment_gap" HorizontalAlignment="Stretch" Margin="0 30 0 0" >
<Grid.RowDefinitions>
@@ -518,19 +517,19 @@
<DockPanel Margin="0 20 0 0" Grid.Row="1">
<!--<Grid DockPanel.Dock="Right" Visibility="{Binding IsLast, Converter={StaticResource BooleanToVisibilityInverseConverter}}">-->
- <Grid DockPanel.Dock="Right" Visibility="Collapsed">
- <touch:TouchButton x:Name="deletegap" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding DeleteGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityConverter}}">
+ <!--<Grid DockPanel.Dock="Right" Visibility="Collapsed">-->
+ <!--<touch:TouchButton x:Name="deletegap" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding DeleteGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Delete Gap</TextBlock>
- </touch:TouchButton>
- <touch:TouchButton x:Name="addGap" DockPanel.Dock="Right" HorizontalAlignment="Left" VerticalAlignment="Center" Command="{Binding AddGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ </touch:TouchButton>-->
+ <!--<touch:TouchButton x:Name="addGap" DockPanel.Dock="Right" HorizontalAlignment="Left" VerticalAlignment="Center" Command="{Binding AddGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<StackPanel Orientation="Horizontal">
<Border Height="35" Width="35" BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
<Image Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/add_gap.png"/>
</Border>
<TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Add Gap</TextBlock>
</StackPanel>
- </touch:TouchButton>
- </Grid>
+ </touch:TouchButton>-->
+ <!--</Grid>-->
<touch:TouchButton DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center" Command="{Binding DataContext.AddNewSegmentCommand, ElementName=listSegments}" CommandParameter="{Binding SegmentIndex}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" Background="Transparent" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Border Height="35" Width="35" BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
@@ -553,7 +552,6 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DockPanel>
<Rectangle DockPanel.Dock="Top" Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" Margin="0 0 0 10"/>
@@ -615,7 +613,6 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DockPanel>
<Rectangle DockPanel.Dock="Top" Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" Margin="0 0 0 10"/>
@@ -637,11 +634,10 @@
<StackPanel DockPanel.Dock="Left">
<StackPanel Margin="0 10 0 0" Orientation="Horizontal" >
<TextBlock FontSize="{StaticResource TangoTitleFontSize}">
- <Run>Group </Run>
- <Run Text="{Binding GroupID, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
- <Run Text="{Binding DisplayIndexes, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
+ <Run>Group #</Run>
+ <Run Text="{Binding SegmentIndex, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
</TextBlock>
- <touch:TouchButton Margin="10 0 0 0" Background="Transparent" Width="Auto" EnableDropShadow="False">
+ <touch:TouchButton Margin="10 0 0 0" Background="Transparent" Width="Auto" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.RepeatSegmentsGroupCommand}" CommandParameter="{Binding}">
<TextBlock Foreground="{StaticResource TangoPrimaryAccentBrush}" TextDecorations="Underline">
<Run>x</Run>
<Run Text="{Binding Repeats, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
@@ -653,18 +649,18 @@
<StackPanel Grid.Row="1" Orientation="Vertical">
<Border Height="50" x:Name="brush_border" Margin="0 10 0 0" CornerRadius="25" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}" ClipToBounds="False">
- <Border.Clip>
- <RectangleGeometry RadiusX="25" RadiusY="25">
- <RectangleGeometry.Rect>
- <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
- <Binding ElementName="brush_border" Path="ActualWidth" />
- <Binding ElementName="brush_border" Path="ActualHeight" />
- </MultiBinding>
- </RectangleGeometry.Rect>
- </RectangleGeometry>
- </Border.Clip>
- <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
+ <Border.Clip>
+ <RectangleGeometry RadiusX="25" RadiusY="25">
+ <RectangleGeometry.Rect>
+ <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
+ <Binding ElementName="brush_border" Path="ActualWidth" />
+ <Binding ElementName="brush_border" Path="ActualHeight" />
+ </MultiBinding>
+ </RectangleGeometry.Rect>
+ </RectangleGeometry>
+ </Border.Clip>
+ <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
+ <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
@@ -689,9 +685,9 @@
<Border Height="28" Width="150" BorderThickness="0" BorderBrush="Transparent" Opacity="20" Background="#32787880" HorizontalAlignment="Center" CornerRadius="8" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}"> Grouped</TextBlock>
</Border>
-
- </Grid>
-
+
+ </Grid>
+
</Border>
<Border x:Name="gapBorder" Margin="0 20 0 0" Height="24" ClipToBounds="False" CornerRadius="10" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityConverter}}">
<Border.Clip>
@@ -706,8 +702,8 @@
</Border.Clip>
<Grid>
<TextBlock FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4">
- <Run Text="5m"></Run>
- <Run Text=" Gap"></Run>
+ <Run Text="{Binding InterSegmentLength, Mode=OneWay}"></Run>
+ <Run Text="m Gap"></Run>
</TextBlock>
<Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="12" RadiusY="12" />
</Grid>
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
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs
index 6df51f067..b45dbe3b3 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs
@@ -17,6 +17,7 @@ namespace Tango.DAL.Remote.DB
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public JOB()
{
+ this.SEGMENTS_GROUPS = new HashSet<SEGMENTS_GROUPS>();
this.SEGMENTS = new HashSet<SEGMENT>();
}
@@ -69,6 +70,8 @@ namespace Tango.DAL.Remote.DB
public virtual USER USER { get; set; }
public virtual WINDING_METHODS WINDING_METHODS { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+ public virtual ICollection<SEGMENTS_GROUPS> SEGMENTS_GROUPS { get; set; }
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<SEGMENT> SEGMENTS { get; set; }
}
}
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
index 973d3f8b5..56d788903 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
@@ -1296,8 +1296,9 @@
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" />
<Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" />
- <Property Name="GROUP_INDEX" Type="int" Nullable="false" />
+ <Property Name="SEGMENT_INDEX" Type="int" Nullable="false" />
<Property Name="REPEATS" Type="int" Nullable="false" />
+ <Property Name="JOB_GUID" Type="varchar" MaxLength="36" Nullable="false" />
</EntityType>
<EntityType Name="SITES">
<Key>
@@ -2901,6 +2902,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
+ <Association Name="FK_SEGMENTS_GROUPS_JOBS">
+ <End Role="JOBS" Type="Self.JOBS" Multiplicity="1" />
+ <End Role="SEGMENTS_GROUPS" Type="Self.SEGMENTS_GROUPS" Multiplicity="*" />
+ <ReferentialConstraint>
+ <Principal Role="JOBS">
+ <PropertyRef Name="GUID" />
+ </Principal>
+ <Dependent Role="SEGMENTS_GROUPS">
+ <PropertyRef Name="JOB_GUID" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
<Association Name="FK_SEGMENTS_JOBS">
<End Role="JOBS" Type="Self.JOBS" Multiplicity="1">
<OnDelete Action="Cascade" />
@@ -2916,7 +2929,9 @@
</ReferentialConstraint>
</Association>
<Association Name="FK_SEGMENTS_SEGMENTS_GROUPS">
- <End Role="SEGMENTS_GROUPS" Type="Self.SEGMENTS_GROUPS" Multiplicity="0..1" />
+ <End Role="SEGMENTS_GROUPS" Type="Self.SEGMENTS_GROUPS" Multiplicity="0..1">
+ <OnDelete Action="Cascade" />
+ </End>
<End Role="SEGMENTS" Type="Self.SEGMENTS" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="SEGMENTS_GROUPS">
@@ -3644,6 +3659,10 @@
<End Role="RML_EXTENSION_TEST_RESULTS" EntitySet="RML_EXTENSION_TEST_RESULTS" />
<End Role="RUBBING_RESULTS" EntitySet="RUBBING_RESULTS" />
</AssociationSet>
+ <AssociationSet Name="FK_SEGMENTS_GROUPS_JOBS" Association="Self.FK_SEGMENTS_GROUPS_JOBS">
+ <End Role="JOBS" EntitySet="JOBS" />
+ <End Role="SEGMENTS_GROUPS" EntitySet="SEGMENTS_GROUPS" />
+ </AssociationSet>
<AssociationSet Name="FK_SEGMENTS_JOBS" Association="Self.FK_SEGMENTS_JOBS">
<End Role="JOBS" EntitySet="JOBS" />
<End Role="SEGMENTS" EntitySet="SEGMENTS" />
@@ -4148,6 +4167,10 @@
<End Role="WINDING_METHODS" EntitySet="WINDING_METHODS" />
<End Role="JOB" EntitySet="JOBS" />
</AssociationSet>
+ <AssociationSet Name="FK_SEGMENTS_GROUPS_JOBS" Association="RemoteModel.FK_SEGMENTS_GROUPS_JOBS">
+ <End Role="JOB" EntitySet="JOBS" />
+ <End Role="SEGMENTS_GROUPS" EntitySet="SEGMENTS_GROUPS" />
+ </AssociationSet>
<AssociationSet Name="FK_SEGMENTS_JOBS" Association="RemoteModel.FK_SEGMENTS_JOBS">
<End Role="JOB" EntitySet="JOBS" />
<End Role="SEGMENT" EntitySet="SEGMENTS" />
@@ -5623,6 +5646,7 @@
<NavigationProperty Name="SPOOL_TYPES" Relationship="RemoteModel.FK_JOBS_SPOOL_TYPES" FromRole="JOB" ToRole="SPOOL_TYPES" />
<NavigationProperty Name="USER" Relationship="RemoteModel.FK_JOBS_USERS" FromRole="JOB" ToRole="USER" />
<NavigationProperty Name="WINDING_METHODS" Relationship="RemoteModel.FK_JOBS_WINDING_METHODS" FromRole="JOB" ToRole="WINDING_METHODS" />
+ <NavigationProperty Name="SEGMENTS_GROUPS" Relationship="RemoteModel.FK_SEGMENTS_GROUPS_JOBS" FromRole="JOB" ToRole="SEGMENTS_GROUPS" />
<NavigationProperty Name="SEGMENTS" Relationship="RemoteModel.FK_SEGMENTS_JOBS" FromRole="JOB" ToRole="SEGMENT" />
</EntityType>
<EntityType Name="LINEAR_MASS_DENSITY_UNITS">
@@ -6094,8 +6118,10 @@
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
<Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" />
- <Property Name="GROUP_INDEX" Type="Int32" Nullable="false" />
+ <Property Name="SEGMENT_INDEX" Type="Int32" Nullable="false" />
<Property Name="REPEATS" Type="Int32" Nullable="false" />
+ <Property Name="JOB_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
+ <NavigationProperty Name="JOB" Relationship="RemoteModel.FK_SEGMENTS_GROUPS_JOBS" FromRole="SEGMENTS_GROUPS" ToRole="JOB" />
<NavigationProperty Name="SEGMENTS" Relationship="RemoteModel.FK_SEGMENTS_SEGMENTS_GROUPS" FromRole="SEGMENTS_GROUPS" ToRole="SEGMENT" />
</EntityType>
<EntityType Name="SITE">
@@ -7189,6 +7215,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
+ <Association Name="FK_SEGMENTS_GROUPS_JOBS">
+ <End Type="RemoteModel.JOB" Role="JOB" Multiplicity="1" />
+ <End Type="RemoteModel.SEGMENTS_GROUPS" Role="SEGMENTS_GROUPS" Multiplicity="*" />
+ <ReferentialConstraint>
+ <Principal Role="JOB">
+ <PropertyRef Name="GUID" />
+ </Principal>
+ <Dependent Role="SEGMENTS_GROUPS">
+ <PropertyRef Name="JOB_GUID" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
<Association Name="FK_SEGMENTS_JOBS">
<End Type="RemoteModel.JOB" Role="JOB" Multiplicity="1">
<OnDelete Action="Cascade" />
@@ -7562,7 +7600,9 @@
</ReferentialConstraint>
</Association>
<Association Name="FK_SEGMENTS_SEGMENTS_GROUPS">
- <End Type="RemoteModel.SEGMENTS_GROUPS" Role="SEGMENTS_GROUPS" Multiplicity="0..1" />
+ <End Type="RemoteModel.SEGMENTS_GROUPS" Role="SEGMENTS_GROUPS" Multiplicity="0..1">
+ <OnDelete Action="Cascade" />
+ </End>
<End Type="RemoteModel.SEGMENT" Role="SEGMENT" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="SEGMENTS_GROUPS">
@@ -9177,8 +9217,9 @@
<EntitySetMapping Name="SEGMENTS_GROUPS">
<EntityTypeMapping TypeName="RemoteModel.SEGMENTS_GROUPS">
<MappingFragment StoreEntitySet="SEGMENTS_GROUPS">
+ <ScalarProperty Name="JOB_GUID" ColumnName="JOB_GUID" />
<ScalarProperty Name="REPEATS" ColumnName="REPEATS" />
- <ScalarProperty Name="GROUP_INDEX" ColumnName="GROUP_INDEX" />
+ <ScalarProperty Name="SEGMENT_INDEX" ColumnName="SEGMENT_INDEX" />
<ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" />
<ScalarProperty Name="GUID" ColumnName="GUID" />
<ScalarProperty Name="ID" ColumnName="ID" />
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
index af6feda16..d270ec2e6 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
@@ -5,98 +5,98 @@
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1" ZoomLevel="87">
- <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="31.75" />
- <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="56.875" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="68.125" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="75.375" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="78.25" />
- <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="8.75" PointY="4.75" />
- <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="15.75" PointY="16.75" />
- <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="33.25" />
- <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="30.125" />
- <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6" PointY="38.375" />
- <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="20.375" />
- <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="13" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="40.125" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="0.75" PointY="4.625" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="3" PointY="3.375" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="5.25" PointY="16.25" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="8.75" PointY="8.75" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="30.5" />
- <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="73.75" />
- <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="61" />
- <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="34" />
- <EntityTypeShape EntityType="RemoteModel.DATA_STORE_ITEMS" Width="1.5" PointX="8.25" PointY="76.875" />
- <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="3.75" PointY="41.875" />
- <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="6" PointY="41.375" />
- <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="81.25" />
- <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="85.75" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="20.875" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="10.125" />
- <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="28.25" />
- <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="2.75" PointY="9.75" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="1.5" PointY="88.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="3.75" PointY="79.25" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="6.5" PointY="81.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="8.75" PointY="71.375" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="6.5" PointY="61.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="8.75" PointY="61.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="8.5" PointY="91.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="10.75" PointY="75.375" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="9.5" PointY="57.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="11.75" PointY="67.75" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="1.5" PointY="84.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="3.75" PointY="69.375" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="71.125" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="6.5" PointY="57.625" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="8.75" PointY="67.5" />
- <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6" PointY="35.125" />
- <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="8.25" PointY="39.5" />
+ <EntityTypeShape EntityType="RemoteModel.ACTION_LOGS" Width="1.5" PointX="11.25" PointY="41.125" />
+ <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="47.375" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="4.5" PointY="60.125" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="57.25" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="4.5" PointY="63.125" />
+ <EntityTypeShape EntityType="RemoteModel.BIT_TYPES" Width="1.5" PointX="0.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="18" PointY="16.875" />
+ <EntityTypeShape EntityType="RemoteModel.BTSR_APPLICATION_TYPES" Width="1.5" PointX="0.75" PointY="10.25" />
+ <EntityTypeShape EntityType="RemoteModel.BTSR_YARN_TYPES" Width="1.5" PointX="0.75" PointY="30.25" />
+ <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6.75" PointY="42.875" />
+ <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="24.5" />
+ <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="0.75" PointY="36.25" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="1.5" PointY="4.25" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_GROUPS" Width="1.5" PointX="3.75" PointY="4.75" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS" Width="1.5" PointX="6" PointY="3.5" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS_ITEMS_RECIPES" Width="1.5" PointX="8.25" PointY="15.375" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_PROCESS_INK_UPTAKE" Width="1.5" PointX="2.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="2.25" />
+ <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="6.75" PointY="62.75" />
+ <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="51.5" />
+ <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="25.375" />
+ <EntityTypeShape EntityType="RemoteModel.DATA_STORE_ITEMS" Width="1.5" PointX="11.25" PointY="73.25" />
+ <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="4.5" PointY="32.625" />
+ <EntityTypeShape EntityType="RemoteModel.DISPENSER" Width="1.5" PointX="6.75" PointY="32" />
+ <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="70.25" />
+ <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="41.875" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="13.375" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="21" />
+ <EntityTypeShape EntityType="RemoteModel.FSE_VERSIONS" Width="1.5" PointX="11.25" PointY="32.625" />
+ <EntityTypeShape EntityType="RemoteModel.GLOBAL_DATA_STORE_ITEMS" Width="1.5" PointX="5.75" PointY="9.75" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWER_TYPES" Width="1.5" PointX="11.5" PointY="81.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_BLOWERS" Width="1.5" PointX="13.75" PointY="71.25" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="73.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_BREAK_SENSORS" Width="1.5" PointX="6.75" PointY="68.25" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="9.5" PointY="77.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11.75" PointY="65.5" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="12.5" PointY="56.5" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="14.75" PointY="53.25" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="12.5" PointY="77.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="14.75" PointY="63.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="9.5" PointY="57.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="11.75" PointY="61.25" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="4.5" PointY="66" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="4.5" PointY="46.625" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="6.75" PointY="58.375" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6.75" PointY="39.625" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="9" PointY="36.375" />
<EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="16.75" PointY="0.75" />
<EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="16.75" />
- <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="24.25" />
- <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="5.5" />
- <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="20.5" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="10.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="35.5" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="64.875" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="6" PointY="65.125" />
- <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="48.125" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="27.25" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="36.375" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="16.375" />
- <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6" PointY="31.625" />
- <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="58.875" />
- <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="6" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="47.25" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="50.25" />
- <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="5.75" PointY="1" />
- <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="8" PointY="1.125" />
- <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="14.75" />
- <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="16.25" />
- <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="9.875" />
- <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="9" />
- <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="12.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="13.5" PointY="20.375" />
- <EntityTypeShape EntityType="RemoteModel.SEGMENTS_GROUPS" Width="1.5" PointX="11.25" PointY="13.875" />
- <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="30.5" />
- <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="5.25" PointY="27.875" />
- <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="24.75" />
- <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="14.25" PointY="12.75" />
- <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="10.625" />
- <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="11.25" PointY="40.25" />
- <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="16.75" PointY="9.75" />
- <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="17.75" PointY="12.75" />
- <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="44.25" />
- <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="17.75" PointY="17.75" />
+ <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="33.375" />
+ <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="10.125" />
+ <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="20.625" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE_PROTOTYPES" Width="1.5" PointX="11.75" PointY="4.75" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="28" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="6.75" PointY="73.25" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="9" PointY="61.5" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="48.25" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="24.25" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="27.125" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="16.25" />
+ <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6.75" PointY="36.25" />
+ <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="42.375" />
+ <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="8.75" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="47.5" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="50.5" />
+ <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS" Width="1.5" PointX="11.75" PointY="1" />
+ <EntityTypeShape EntityType="RemoteModel.PUBLISHED_PROCEDURE_PROJECTS_VERSIONS" Width="1.5" PointX="14" PointY="1.125" />
+ <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="14.875" />
+ <EntityTypeShape EntityType="RemoteModel.RMLS_SPOOLS" Width="1.5" PointX="8.25" PointY="20.375" />
+ <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="12.75" />
+ <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="12.75" />
+ <EntityTypeShape EntityType="RemoteModel.RUBBING_RESULTS" Width="1.5" PointX="13.75" PointY="4.75" />
+ <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="15.75" PointY="20.5" />
+ <EntityTypeShape EntityType="RemoteModel.SEGMENTS_GROUPS" Width="1.5" PointX="13.5" PointY="20.75" />
+ <EntityTypeShape EntityType="RemoteModel.SITE" Width="1.5" PointX="3" PointY="42.5" />
+ <EntityTypeShape EntityType="RemoteModel.SITES_CATALOGS" Width="1.5" PointX="5.25" PointY="28.75" />
+ <EntityTypeShape EntityType="RemoteModel.SITES_RMLS" Width="1.5" PointX="5.25" PointY="16.875" />
+ <EntityTypeShape EntityType="RemoteModel.SITES_SPOOL_TYPES" Width="1.5" PointX="14.25" PointY="24.5" />
+ <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="9" PointY="5.75" />
+ <EntityTypeShape EntityType="RemoteModel.SPOOL" Width="1.5" PointX="11.25" PointY="37" />
+ <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="4.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.TANGO_UPDATES" Width="1.5" PointX="16.75" PointY="9.75" />
+ <EntityTypeShape EntityType="RemoteModel.TANGO_VERSIONS" Width="1.5" PointX="14.25" PointY="48.375" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="13.75" PointY="16.75" />
<EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="18.75" PointY="0.75" />
<EntityTypeShape EntityType="RemoteModel.TECH_HEATERS" Width="1.5" PointX="18.75" PointY="3.75" />
<EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="18.75" PointY="6.75" />
- <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="19.75" PointY="11.75" />
- <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="19.75" PointY="16.75" />
- <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="24.625" />
- <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="28" />
- <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="12.5" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="18.75" PointY="11.75" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="20.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="28.5" />
+ <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="29.75" />
+ <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="11.25" />
<AssociationConnector Association="RemoteModel.FK_ACTION_LOGS_USERS" />
<AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" />
<AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" />
@@ -158,6 +158,7 @@
<AssociationConnector Association="RemoteModel.FK_JOBS_SPOOL_TYPES" />
<AssociationConnector Association="RemoteModel.FK_JOBS_USERS" />
<AssociationConnector Association="RemoteModel.FK_JOBS_WINDING_METHODS" />
+ <AssociationConnector Association="RemoteModel.FK_SEGMENTS_GROUPS_JOBS" />
<AssociationConnector Association="RemoteModel.FK_SEGMENTS_JOBS" />
<AssociationConnector Association="RemoteModel.FK_RML_LINEAR_MASS_DENSITY_UNITS" />
<AssociationConnector Association="RemoteModel.FK_LIQUID_TYPES_RMLS_LIQUID_TYPES" />
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENTS_GROUPS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENTS_GROUPS.cs
index 9da1ce490..8ac494917 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENTS_GROUPS.cs
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/SEGMENTS_GROUPS.cs
@@ -23,9 +23,11 @@ namespace Tango.DAL.Remote.DB
public int ID { get; set; }
public string GUID { get; set; }
public System.DateTime LAST_UPDATED { get; set; }
- public int GROUP_INDEX { get; set; }
+ public int SEGMENT_INDEX { get; set; }
public int REPEATS { get; set; }
+ public string JOB_GUID { get; set; }
+ public virtual JOB JOB { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<SEGMENT> SEGMENTS { get; set; }
}