aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2025-08-18 10:33:28 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2025-08-18 10:33:28 +0300
commit3c7fe666b10d131da99076d81a50c7887a4caed6 (patch)
tree4aad07d2c8e9c5fa2ff515ae7742336262dff301 /Software/Visual_Studio
parentb62a71753c9e132a4281a4c47de2c0326a232eda (diff)
downloadTango-3c7fe666b10d131da99076d81a50c7887a4caed6.tar.gz
Tango-3c7fe666b10d131da99076d81a50c7887a4caed6.zip
Critical fix on machine operator number of segments duplication on job ticket.
Removed number of spools references on X1 UI.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Job.cs55
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs11
5 files changed, 39 insertions, 37 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
index b14b7f155..c0b5d58f1 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
@@ -868,8 +868,8 @@
</Border>
</DockPanel>
</StackPanel>
- <DockPanel HorizontalAlignment="Stretch" Margin="60 20 60 20">
- <StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
+ <DockPanel HorizontalAlignment="Stretch" Margin="60 20 60 20">
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Visibility="{Binding Converter={StaticResource IsX1ToVisibilityInverseConverter}}">
<TextBlock HorizontalAlignment="Left" Margin="20 10 0 0" Text="Divided By Spools" FontSize="{StaticResource TangoButtonFontSize}" Width="Auto"/>
<Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120" DockPanel.Dock="Right">
<touch:TouchNumericTextBox BorderBrush="Transparent" Margin="0 0 0 0" HasDecimalPoint="False" Minimum="{Binding CopiesStep,Mode=OneWay}" Step="{Binding CopiesStep,Mode=OneWay}" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.NumberSpools}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>
@@ -1286,7 +1286,7 @@
<Run Text="g" FontWeight="Bold"></Run>
</TextBlock>
</UniformGrid>
- <UniformGrid Grid.Row="2" Margin="0 40 0 0" Columns="4" Rows="1" HorizontalAlignment="Stretch">
+ <UniformGrid Grid.Row="2" Margin="0 40 0 0" Columns="4" Rows="1" HorizontalAlignment="Stretch" Visibility="{Binding Converter={StaticResource IsX1ToVisibilityInverseConverter}}">
<TextBlock Text="Per Spool:" FontWeight="Bold" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
<TextBlock FontSize="{StaticResource TangoTitleFontSize}">
<Run Text="Spools:" FontWeight="Normal"></Run>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 0acd1d7e5..7093308c1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -510,7 +510,7 @@
<DockPanel DockPanel.Dock="Top">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Top" Width="200" MinHeight="30" HorizontalAlignment="Right" Margin="0 0 0 0">
<StackPanel Orientation="Vertical">
- <touch:TouchToggleSlider Style="{StaticResource TouchToggleButtonSlider}" Background="{StaticResource TangoMidBackgroundBrush}" CheckedBackground="{StaticResource TangoMidBackgroundBrush}" UncheckedBackground="{StaticResource TangoMidBackgroundBrush}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20 0 20 0" CornerRadius="17" Height="38" Width="164" ThumbWidth="80" LeftText="1 Set" RightText="1 Spool" ThumbCornerRadius="13" IsChecked="{Binding IsSpoolView}" FontSize="{StaticResource TangoDefaultFontSize}"></touch:TouchToggleSlider>
+ <touch:TouchToggleSlider Visibility="{Binding Converter={StaticResource IsX1ToVisibilityInverseConverter}}" Style="{StaticResource TouchToggleButtonSlider}" Background="{StaticResource TangoMidBackgroundBrush}" CheckedBackground="{StaticResource TangoMidBackgroundBrush}" UncheckedBackground="{StaticResource TangoMidBackgroundBrush}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20 0 20 0" CornerRadius="17" Height="38" Width="164" ThumbWidth="80" LeftText="1 Set" RightText="1 Spool" ThumbCornerRadius="13" IsChecked="{Binding IsSpoolView}" FontSize="{StaticResource TangoDefaultFontSize}"></touch:TouchToggleSlider>
<touch:TouchToggleSlider Style="{StaticResource TouchToggleButtonSlider}" Background="{StaticResource TangoMidBackgroundBrush}" CheckedBackground="{StaticResource TangoMidBackgroundBrush}" UncheckedBackground="{StaticResource TangoMidBackgroundBrush}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20 18 20 0" CornerRadius="17" Height="38" Width="164" ThumbWidth="80" LeftText="Length" RightText="Weight" ThumbCornerRadius="13" IsChecked="{Binding IsWeghtView}" FontSize="{StaticResource TangoDefaultFontSize}"></touch:TouchToggleSlider>
</StackPanel>
</StackPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
index ba38d429c..54510a0f4 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
@@ -119,9 +119,9 @@ namespace Tango.BL.Entities
{
if (Rml == null)
return 0;
-
+
var gramPerlength = Rml.GetGramPer1000mLength;
- var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000 );//(g)
+ var weight = (LengthIncludingNumberOfUnits * gramPerlength) / (1000);//(g)
return weight;
}
}
@@ -157,7 +157,8 @@ namespace Tango.BL.Entities
return NumberOfUnits * NumberOfSpools;
}
}
- return NumberOfUnits;
+
+ return NumberOfUnits;
}
}
@@ -227,7 +228,7 @@ namespace Tango.BL.Entities
RaisePropertyChangedAuto();
}
}
-
+
/// <summary>
/// Gets or sets the effective segments.
/// </summary>
@@ -407,13 +408,13 @@ namespace Tango.BL.Entities
[NotMapped]
[JsonIgnore]
- public double GramPerLength { get; set;}
+ public double GramPerLength { get; set; }
[NotMapped]
[JsonIgnore]
public String ThreadName
{
- get { return Rml == null ? "" : Rml.DisplayName;}
+ get { return Rml == null ? "" : Rml.DisplayName; }
}
#endregion
@@ -486,7 +487,7 @@ namespace Tango.BL.Entities
protected override void OnRmlChanged(Rml rml)
{
base.OnRmlChanged(rml);
- if(rml != null)
+ if (rml != null)
{
GramPerLength = Rml.GetGramPer1000mLength;
}
@@ -561,12 +562,12 @@ namespace Tango.BL.Entities
if (this.Name.Contains(copy))
{
int last = this.Name.LastIndexOf(copy);
- baseName = this.Name.Substring(0,last);
- string index_str = this.Name.Substring(last+ copy.Length);
- if(!String.IsNullOrEmpty(index_str))
+ baseName = this.Name.Substring(0, last);
+ string index_str = this.Name.Substring(last + copy.Length);
+ if (!String.IsNullOrEmpty(index_str))
{
int result;
- if(int.TryParse(index_str, out result))
+ if (int.TryParse(index_str, out result))
index = result + 1;
}
}
@@ -581,7 +582,7 @@ namespace Tango.BL.Entities
cloned.WindingMethod = WindingMethod;
cloned.JobStatus = JobStatuses.Draft;
-
+
cloned.Segments = Segments.Where(x => x.SegmentsGroupGuid == null).Select(x => x.Clone(cloned)).ToSynchronizedObservableCollection();
cloned.SegmentsGroups = SegmentsGroups.Select(x => x.Clone(cloned)).ToSynchronizedObservableCollection();
@@ -590,7 +591,7 @@ namespace Tango.BL.Entities
segment.JobGuid = cloned.Guid;
segment.Job = cloned;
}
-
+
return cloned;
}
@@ -609,7 +610,7 @@ namespace Tango.BL.Entities
{
if (s is Segment segment)
{
- length += segment.LengthWithFactor + ((EnableInterSegment && IsAllSegmentsPerSpool && segment.SegmentIndex != max) ? InterSegmentLength : 0);
+ length += segment.LengthWithFactor + ((EnableInterSegment && IsAllSegmentsPerSpool && segment.SegmentIndex != max) ? InterSegmentLength : 0);
}
else if (s is SegmentsGroup segmentsGroup)
{
@@ -645,12 +646,12 @@ namespace Tango.BL.Entities
private double GetWeigth()
{
- if(Rml == null)
+ if (Rml == null)
return 0;
double length = GetLength();
-
- var weight = (length * GramPerLength) / (1000 );//length in m, return value in g
+
+ var weight = (length * GramPerLength) / (1000);//length in m, return value in g
return weight;
}
@@ -673,22 +674,22 @@ namespace Tango.BL.Entities
int fromAngle = -90;
double totalLength = 0;//Segments.Sum(x => x.Length); //Excluding inter segment.
- foreach(var isegm in OrderedSegmentsWithGroups)
+ foreach (var isegm in OrderedSegmentsWithGroups)
{
if (isegm is SegmentsGroup group)
{
foreach (var innerSegment in group.Segments)
{
- totalLength += innerSegment.Length*group.Repeats;
+ totalLength += innerSegment.Length * group.Repeats;
}
}
- else if(isegm is Segment segment)
+ else if (isegm is Segment segment)
{
totalLength += segment.Length;
}
}
-
-
+
+
foreach (var segm in OrderedSegmentsWithGroups)
{
if (segm is SegmentsGroup group)
@@ -708,7 +709,7 @@ namespace Tango.BL.Entities
}
}
}
- else if(segm is Segment segment)
+ else if (segm is Segment segment)
{
int toAngle = (int)((segment.Length / totalLength) * 360d);
Rectangle rect = new Rectangle(0, 0, bmp.Width - 2, bmp.Height - 2);
@@ -956,14 +957,14 @@ namespace Tango.BL.Entities
jobFile.ColorCatalogGuid = job.ColorCatalogGuid.ToStringOrEmpty();
jobFile.NumberOfSpools = job.NumberOfSpools;
jobFile.Version = job.Version;
-
+
foreach (var segm in job.OrderedSegmentsWithGroups)
{
JobFileSegment s = new JobFileSegment();
if (segm is SegmentsGroup group)
{
s.Repeats = group.Repeats;
- foreach(var innerSegment in group.Segments)
+ foreach (var innerSegment in group.Segments)
{
JobFileSegment innerFileSegment = new JobFileSegment();
innerFileSegment.Length = innerSegment.Length;
@@ -1009,7 +1010,7 @@ namespace Tango.BL.Entities
catch (Exception ex)
{
throw new InvalidOperationException($"Error extracting liquid volume from ids pack {idsPack.PackIndex}", ex);
- }
+ }
}
s.BrushStops.Add(st);
}
@@ -1187,7 +1188,7 @@ namespace Tango.BL.Entities
}
s.UpdateMiddleColorBrush();
}
-
+
/// <summary>
/// Removes this entity and all dependent entities from the specified db context.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 4e959548e..f77ea978c 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -4553,21 +4553,22 @@ namespace Tango.Integration.Operation
{
return Task.Run(() =>
{
- foreach (var segment in context.Job.OrderedSegmentsWithGroups.ToList())
+ // Use the ORIGINAL job's segment list, so ticket segments aren't pre-multiplied
+ foreach (var segment in context.OriginalJob.OrderedSegmentsWithGroups.ToList())
{
if (segment is Segment simpleSegment)
{
- context.JobTicket.Segments.Add(CreatePMRJobSegment(simpleSegment, context.OriginalJob, processParameters));
+ context.JobTicket.Segments.Add(
+ CreatePMRJobSegment(simpleSegment, context.OriginalJob, processParameters));
}
else if (segment is SegmentsGroup group)
{
List<JobSegment> groupSegments = new List<JobSegment>();
-
foreach (var innerSegment in group.OrderedSegments)
{
- groupSegments.Add(CreatePMRJobSegment(innerSegment, context.OriginalJob, processParameters));
+ groupSegments.Add(
+ CreatePMRJobSegment(innerSegment, context.OriginalJob, processParameters));
}
-
for (int i = 0; i < group.Repeats; i++)
{
context.JobTicket.Segments.AddRange(groupSegments.ToList());