klippy: Allow any stats producer to determine when stats are needed

Instead of using the toolhead class to determine if stats should be
reported, allow every printer object with a stats() callback to
determine if stats are needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-02-05 13:52:05 -05:00
parent 08874b9c91
commit 0a5b07f9da
5 changed files with 12 additions and 20 deletions

View file

@ -747,8 +747,8 @@ class MCU:
msg = "%s: mcu_awake=%.03f mcu_task_avg=%.06f mcu_task_stddev=%.06f" % (
self._name, self._mcu_tick_awake, self._mcu_tick_avg,
self._mcu_tick_stddev)
return ' '.join([msg, self._serial.stats(eventtime),
self._clocksync.stats(eventtime)])
return False, ' '.join([msg, self._serial.stats(eventtime),
self._clocksync.stats(eventtime)])
def printer_state(self, state):
if state == 'connect':
self._connect()