Fix: more consistent final step for step(...) schedule

This commit is contained in:
Mikhail Dyomin 2016-02-16 13:30:47 +03:00
parent c31fda723a
commit e4bdb4ea67

View File

@ -135,8 +135,12 @@ class Stairway(Composite):
Const(minrps + i * increment, duration)
for i in xrange(0, n_steps + 1)
]
if (n_steps + 1) * increment < maxrps:
steps.append(Const(maxrps, duration))
if increment > 0:
if (min_rps + n_steps * increment) < maxrps:
steps.append(Const(maxrps, duration))
elif increment < 0:
if (min_rps + n_steps * increment) > maxrps:
steps.append(Const(maxrps, duration))
logging.info(steps)
super(Stairway, self).__init__(steps)