aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-22 13:54:49 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-22 13:56:23 +0300
commit648437dec6e56e32218d88b7a85e70ac00b6e98a (patch)
treead7a74e3d81246c701e6b59e9b26e063a6702417 /Software
parentb6745cf00a2aedae8da24a2477d1000f30e7e1d3 (diff)
downloadTango-648437dec6e56e32218d88b7a85e70ac00b6e98a.tar.gz
Tango-648437dec6e56e32218d88b7a85e70ac00b6e98a.zip
Changed Number of Spools in Converters and GUI PPC.
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs5
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml13
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Job.cs21
7 files changed, 38 insertions, 35 deletions
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 dffa9b241..8a01e07cc 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
@@ -632,8 +632,8 @@ namespace Tango.PPC.Jobs.ViewModels
JobType = Job.JobType,
InterSegmentLength = Job.InterSegmentLength,
EnableInterSegment = Job.EnableInterSegment,
- NumberSpools = (BuildProvider.IsEureka ? Job.Spools : 1),
- Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.Spools : Job.NumberOfUnits)
+ NumberSpools = (BuildProvider.IsEureka ? Job.NumberOfSpools : 1),
+ Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.NumberOfSpools : Job.NumberOfUnits)
};
Dictionary<string, SegmentsGroupModel> guidToGroup = new Dictionary<string, SegmentsGroupModel>();
if (Job.Version < 2)
@@ -1607,6 +1607,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
Job.SpoolType = _spoolTypes.FirstOrDefault(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool);
}
+ Job.NumberOfSpools = JobModel.NumberSpools;
var oldSegments = Job.Segments.ToList();
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
index b57619c8c..ec080ebed 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
@@ -285,7 +285,7 @@
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay">
<Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/>
<Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
- <Binding Path="Spools" Mode="OneWay"/>
+ <Binding Path="NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -408,7 +408,7 @@
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0'>
<Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/>
<Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
- <Binding Path="Spools" Mode="OneWay"/>
+ <Binding Path="NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
index 377d02d81..f43405085 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressLengthSpoolConverter.cs
@@ -15,11 +15,12 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 2)
+ if (values.Count() == 3)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
- var totalBy4Spools = (double)length*4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[2]);
+ var totalBy4Spools = (double)length* number_of_spools;
if (forOneSpool)
{
return (double)totalBy4Spools / 4;
@@ -27,14 +28,15 @@ namespace Tango.PPC.UI.Converters
return totalBy4Spools;
}
- if (values.Count() == 3)
+ if (values.Count() == 4)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double currentProgresslength = System.Convert.ToDouble(values[2]) ;
+ int number_of_spools = System.Convert.ToInt16(values[3]);
- var totalBy4Spools = (double)length * 4;
- var currentProgressBy4Spools = (double)currentProgresslength * 4 ;
+ var totalBy4Spools = (double)length * number_of_spools;
+ var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools;
int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools;
var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
index d0cc8284e..66303ab27 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressUnitSpoolConverter.cs
@@ -14,11 +14,11 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 1)//may be added count of spools
+ if (values.Count() == 2)//may be added count of spools
{
int CurrentUnit = System.Convert.ToInt16(values[0]);
-
- var totalBy4Spools = (double)CurrentUnit * 4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[1]);
+ var totalBy4Spools = (double)CurrentUnit * number_of_spools;
return totalBy4Spools.ToString();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
index f451fe0d9..7ffb1e8a7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/ProgressWeightSpoolConverter.cs
@@ -16,12 +16,13 @@ namespace Tango.PPC.UI.Converters
{
try
{
- if (values.Count() == 3)
+ if (values.Count() == 4)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double coef = System.Convert.ToDouble(values[2]);
- var totalBy4Spools = (double)length * 4;// spools ;
+ int number_of_spools = System.Convert.ToInt16(values[3]);
+ var totalBy4Spools = (double)length * number_of_spools;
var weight = ((double)totalBy4Spools * coef) / (1000);//(g)
if (forOneSpool)
@@ -31,15 +32,16 @@ namespace Tango.PPC.UI.Converters
return weight;
}
- if (values.Count() == 4)
+ if (values.Count() == 5)
{
double length = System.Convert.ToDouble(values[0]);
bool forOneSpool = System.Convert.ToBoolean(values[1]);
double currentProgresslength = System.Convert.ToDouble(values[2]);
double coef = System.Convert.ToDouble(values[3]);
+ int number_of_spools = System.Convert.ToInt16(values[4]);
- var totalBy4Spools = (double)length * 4;
- var currentProgressBy4Spools = (double)currentProgresslength * 4;
+ var totalBy4Spools = (double)length * number_of_spools;
+ var currentProgressBy4Spools = (double)currentProgresslength * number_of_spools;
int coeff = (int)currentProgressBy4Spools / (int)totalBy4Spools;
var progressCurrent = (coeff == 0 || coeff == 1) ? currentProgressBy4Spools : currentProgressBy4Spools % (coeff * totalBy4Spools);//show for progress
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 0436cdab6..f9338b813 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -558,7 +558,7 @@
<Image Source="../Images/Job Issues/spools.png" Stretch="None" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical" Margin="15 0 0 0">
<TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Spools</TextBlock>
- <TextBlock Text="{Binding Job.Spools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock>
+ <TextBlock Text="{Binding Job.NumberOfSpools, TargetNullValue='-', FallbackValue='-'}" FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"></TextBlock>
</StackPanel>
</StackPanel>
</UniformGrid>
@@ -650,6 +650,7 @@
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp" />
<Binding Path="IsSpoolView"/>
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" />
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -659,6 +660,7 @@
<MultiBinding Converter="{StaticResource ProgressLengthSpoolConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='0' Mode="OneWay">
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/>
<Binding Path="IsSpoolView"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -673,6 +675,7 @@
<Binding Path="IsSpoolView"/>
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" />
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -683,6 +686,7 @@
<Binding Path="RunningJobStatus.TotalProgressMinusSettingUp"/>
<Binding Path="IsSpoolView"/>
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -792,7 +796,7 @@
<TextBlock.Text>
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -807,7 +811,7 @@
<MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
<Binding Path="Job.GramPerLength" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
@@ -830,6 +834,7 @@
<Setter.Value>
<MultiBinding Converter="{StaticResource ProgressUnitSpoolConverter}" TargetNullValue='-' FallbackValue='-' >
<Binding Path="RunningJobStatus.CurrentUnit" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</Setter.Value>
</Setter>
@@ -1019,7 +1024,7 @@
<TextBlock.Text>
<MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay">
<Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/>
- <Binding Path="Job.Spools" Mode="OneWay"/>
+ <Binding Path="Job.NumberOfSpools" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
index 29f7e1054..328d74f0c 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
@@ -99,9 +99,9 @@ namespace Tango.BL.Entities
{
get
{
- if (Spools >= 4)
+ if (NumberOfSpools >= 4)
{
- return LengthIncludingNumberOfUnits * Spools;
+ return LengthIncludingNumberOfUnits * NumberOfSpools;
}
return LengthIncludingNumberOfUnits;
@@ -129,9 +129,9 @@ namespace Tango.BL.Entities
{
get
{
- if (Spools >= 4)
+ if (NumberOfSpools >= 4)
{
- return WeightIncludingNumberOfUnits * Spools;
+ return WeightIncludingNumberOfUnits * NumberOfSpools;
}
return WeightIncludingNumberOfUnits;
@@ -144,9 +144,9 @@ namespace Tango.BL.Entities
{
get
{
- if (Spools >= 4)
+ if (NumberOfSpools >= 4)
{
- return NumberOfUnits * Spools;
+ return NumberOfUnits * NumberOfSpools;
}
return NumberOfUnits;
}
@@ -218,14 +218,7 @@ namespace Tango.BL.Entities
RaisePropertyChangedAuto();
}
}
-
- [NotMapped]
- [JsonIgnore]
- public int Spools
- {
- get { return 4; }//headunits?
- }
-
+
/// <summary>
/// Gets or sets the effective segments.
/// </summary>