Add time-based spoolup calculation

This commit is contained in:
DarkPhoenix
2018-12-10 14:42:22 +03:00
parent 5b03d01d32
commit aa80a4812d

View File

@@ -34,10 +34,10 @@ def calculateSpoolup(modMaxValue, modStepValue, modCycleTime, spoolType, spoolAm
if spoolType == SpoolType.SCALE:
return int(floatUnerr(spoolAmount * modMaxValue / modStepValue)) * modStepValue
elif spoolType == SpoolType.TIME:
# Stub
return 0
cycles = int(floatUnerr(spoolAmount / modCycleTime))
return min(modMaxValue, cycles * modStepValue)
elif spoolType == SpoolType.CYCLES:
cycles = round(spoolAmount)
cycles = int(spoolAmount)
return min(modMaxValue, cycles * modStepValue)
else:
return 0