aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-15 17:24:24 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-15 17:25:28 +0300
commit6633cb47da2bd14a5bbe356a7c4602c6d09462d1 (patch)
treea2f14629598abdf8e691a04aaa7ff3c906f6c2f3 /Software/Visual_Studio
parent765986922827db6d0f92ce1de6f53519c0674344 (diff)
downloadTango-6633cb47da2bd14a5bbe356a7c4602c6d09462d1.tar.gz
Tango-6633cb47da2bd14a5bbe356a7c4602c6d09462d1.zip
pressing "resume" the dyed amount is doubled
Related Work Items: #9046
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs9
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs4
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs17
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs11
4 files changed, 24 insertions, 17 deletions
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 bcf35a741..983719e57 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs
@@ -79,7 +79,7 @@ namespace Tango.PPC.Jobs.Models
if (Segments != null)
{
if((EnableInterSegment && IsAllSegmentsPerSpool))
- return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) - InterSegmentLength) : 0;
+ return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) ) : 0;
return GroupingSegments.Sum(x => x.FullLength);
//return Segments.Sum(x => x.LengthWithInterSegment);
// return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0);
@@ -1097,8 +1097,9 @@ namespace Tango.PPC.Jobs.Models
// NumberOfUnits = (int)maxRep;
//}
}
- RaisePropertyChanged(nameof(Length));
+
OnUpdateLengthhWeight();
+ RaisePropertyChanged(nameof(Length));
}
RaisePropertyChanged(nameof(GetEstimatedDuration));
@@ -1131,9 +1132,11 @@ namespace Tango.PPC.Jobs.Models
int max = GroupingSegments.Max(x => x.SegmentIndex);
GroupingSegments.Where(i => i.SegmentIndex != max).ToList().ForEach(x => x.EnableInterSegment = InterSegmentLength > 0);
}
+ _enableintersegment = InterSegmentLength > 0;
_preventChange = false;
- EnableInterSegment = InterSegmentLength > 0;
+
OnLengthChanged();
+ UpdateEffectiveSegments();
}
private void OnNumberOfSpoolsChanged()
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index ea45fbedd..bacce5f5e 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -847,7 +847,7 @@ namespace Tango.Emulations.Emulators
double firstUnitStartPosition = request.Message.FirstUnitStartPosition;
bool addedResume = firstUnitStartPosition <= 0;
- bool bIsResumeProcess = firstUnitStartPosition > 0;
+ //bool bIsResumeProcess = firstUnitStartPosition > 0;
for (int i = 0; i < units; i++)
{
@@ -892,7 +892,7 @@ namespace Tango.Emulations.Emulators
addedResume = true;
progress = firstUnitStartPosition;
}
- //LogManager.Log($" Emulator Progress = {progress}, units = {units}");
+ //LogManager.Log($" EMULATOR PROGRESS Progress = {progress}, units = {units}");
double currentPosition = 0;
double nextStopPosition = unit_length;
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
index 5d62f4269..630bda866 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
@@ -371,32 +371,33 @@ namespace Tango.Integration.Operation
{
LogManager.Log($"Invalid job progress received '{s.Progress}' while last progress was '{_last_progress}'.");
}
-
+
_last_progress = s.Progress;
-
+
List<Segment> unit_segments = new List<Segment>();
Status.Progress = s.Progress;
Status.RemainingTime = Status.TotalTime - Job.TranslateProgressToTime(Status.Progress, ProcessParameters);
Status.RemainingProgress = Status.TotalProgress - Status.Progress;
- if (s.Progress < Status.SettingUpTotalProgress || Status.SettingUpProgress < Status.SettingUpTotalProgress)
+ if((s.Progress < Status.SettingUpTotalProgress) || (Status.SettingUpProgress < Status.SettingUpTotalProgress))
{
Status.SettingUpProgress = Math.Min(s.Progress, this.Status.SettingUpTotalProgress);
Status.IsSettingUp = true;
+ //LogManager.Log($" Status.IsSettingUp = true , Status.SettingUpProgress = {Status.SettingUpProgress}' Status.SettingUpTotalProgress = {Status.SettingUpTotalProgress}.");
}
- if (s.Progress >= Status.SettingUpTotalProgress)
+ if (s.Progress >= ProcessParameters.DryerBufferLengthMeters)//Status.SettingUpTotalProgress)
{
if (Status.IsSettingUp && Status.Progress > 0)
{
Status.IsSettingUp = false;
+ //LogManager.Log($" Status.IsSettingUp = false , Status.SettingUpProgress = {Status.SettingUpProgress}'.");
}
if (ResumeConfig != null && ResumeConfig.GlobalStartPosition > 0)
{
Status.ProgressMinusSettingUp = s.Progress - ProcessParameters.DryerBufferLengthMeters;
- //LogManager.Log($" Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}");
-
+ //LogManager.Log($" JOB HANDLER Status.ProgressMinusSettingUp {Status.ProgressMinusSettingUp} progress = {s.Progress}");
}
else
{
@@ -434,7 +435,7 @@ namespace Tango.Integration.Operation
if (!Status.IsSettingUp && s.Progress <= previousUnitsLengthWithoutThis + unitLength + ProcessParameters.DryerBufferLengthMeters)
{
currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - ProcessParameters.DryerBufferLengthMeters;
- //LogManager.Log($"currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}");
+ //LogManager.Log($" JOB HANDLER currentUnitProgress before ={currentUnitProgress} progress = {s.Progress}");
break;
}
}
@@ -452,7 +453,7 @@ namespace Tango.Integration.Operation
Status.CurrentUnit = currentUnit;
Status.CurrentUnitProgress = currentUnitProgress;
- //LogManager.Log($"CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} ");
+ //LogManager.Log($" JOB HANDLER CurrentUnit {Status.CurrentUnit} currentUnitProgress {Status.CurrentUnitProgress} ");
Status.RemainingUnits = this.Job.NumberOfUnits - this.Status.CurrentUnit;
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index df320527e..a33ee3165 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -3254,10 +3254,10 @@ namespace Tango.Integration.Operation
}
double resumePreProgress = 0;
-
+
if (config.ResumeConfig != null)
{
- resumePreProgress = config.ResumeConfig.GlobalStartPosition - processParameters.DryerBufferLengthMeters;
+ resumePreProgress = config.ResumeConfig.GlobalStartPosition - config.ResumeConfig.FirstUnitStartPosition;//- processParameters.DryerBufferLengthMeters;
request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition;
//LogManager.Log($" resumePreProgress = {resumePreProgress}, GlobalStartPosition {config.ResumeConfig.GlobalStartPosition} FirstUnitStartPosition {request.FirstUnitStartPosition}");
request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) * (int)Math.Max(config.ResumeConfig.RemainingUnits, 1);
@@ -3268,8 +3268,11 @@ namespace Tango.Integration.Operation
{
if (!completed)
{
- response.Message.Status.Progress += resumePreProgress;
-
+ if(resumePreProgress > 0 )
+ {
+ response.Message.Status.Progress += resumePreProgress;//LogManager.Log($" MACHINE OPERATOR Added Progress = {response.Message.Status.Progress}");
+ }
+
handler.RaiseStatusReceived(response.Message.Status);
_last_job_status = handler.Status;