aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Emulations
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-07-27 04:09:45 +0300
committerRoy <Roy.mail.net@gmail.com>2023-07-27 04:09:45 +0300
commitd9d009df1da8630ec6726ed506865ca9818d1eff (patch)
tree46db9f8310e8525e51f6ac1865fe622da61b966b /Software/Visual_Studio/Tango.Emulations
parent3038323fb9bb7f37bf0cb35f3b7e08adae075b99 (diff)
downloadTango-d9d009df1da8630ec6726ed506865ca9818d1eff.tar.gz
Tango-d9d009df1da8630ec6726ed506865ca9818d1eff.zip
More advanced job resume.
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations')
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index 01a32b2b7..9464b37ec 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -846,15 +846,10 @@ namespace Tango.Emulations.Emulators
//TODO Handle First Unit Length Decrease In Emulator!
double firstUnitStartPosition = request.Message.FirstUnitStartPosition;
+ bool addedResume = firstUnitStartPosition <= 0;
+
for (int i = 0; i < units; i++)
{
- //double unit_length = job.Length;
-
- if (i == 0 && firstUnitStartPosition > 0)
- {
- unit_length = unit_length - firstUnitStartPosition;
- }
-
while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob)
{
var status = new PMR.Printing.JobStatus();
@@ -886,7 +881,15 @@ namespace Tango.Emulations.Emulators
}
}
- progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress);
+ if (addedResume)
+ {
+ progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress);
+ }
+ else
+ {
+ addedResume = true;
+ progress = firstUnitStartPosition;
+ }
double currentPosition = 0;
double nextStopPosition = unit_length;