diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs | 19 |
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; |
