kliment/Printrun — Issue #138: estimate_duration bails with ZeroDivisionError when moves have no feedrate
Author: sparr
Created: 2011-12-20 12:24:09+00:00
State: open

If the first two or more moves in a gcode file have no feed rate specified then this happens:

Estimated duration (pessimistic): .... estimating ....
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./pronterface.py", line 1358, in loadviz
print _("Estimated duration (pessimistic): "), pronsole.estimate_duration(self.f)
File "/home/sparr/src/printrun/git/Printrun/pronsole.py", line 141, in estimate_duration
moveduration = 2 * distance / ( lastf + f )
ZeroDivisionError: float division by zero