From 07bf1b400cd3fa790d2227ff91313566368211cb Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Fri, 30 Aug 2019 09:42:26 +0300 Subject: [PATCH] Fix spool scale mode on the very final cycle with spoolup set --- eos/utils/spoolSupport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eos/utils/spoolSupport.py b/eos/utils/spoolSupport.py index dcbad807c..aa280c5c7 100644 --- a/eos/utils/spoolSupport.py +++ b/eos/utils/spoolSupport.py @@ -38,8 +38,9 @@ def calculateSpoolup(modMaxValue, modStepValue, modCycleTime, spoolType, spoolAm if not modMaxValue or not modStepValue: return 0, 0, 0 if spoolType == SpoolType.SPOOL_SCALE: - # For spool scale, round to closest cycle for scaled spool amount - cycles = round(spoolAmount * modMaxValue / modStepValue) + # Find out at which point of spoolup scale we're on, find out how many cycles + # is enough to reach it and recalculate spoolup value for that amount of cycles + cycles = math.ceil(floatUnerr(modMaxValue * spoolAmount / modStepValue)) spoolValue = min(modMaxValue, cycles * modStepValue) return spoolValue, cycles, cycles * modCycleTime elif spoolType == SpoolType.CYCLE_SCALE: