toolhead: Support M204 with P and T instead of S

Recent versions of Slic3r now send M204 with P and T instead of with
S, so support that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-09-02 12:22:43 -04:00
parent 5632cf6d77
commit 165317e33f
1 changed files with 7 additions and 1 deletions

View File

@ -448,6 +448,12 @@ class ToolHead:
gcode.respond_info(msg) gcode.respond_info(msg)
def cmd_M204(self, params): def cmd_M204(self, params):
gcode = self.printer.lookup_object('gcode') gcode = self.printer.lookup_object('gcode')
if 'P' in params and 'T' in params and 'S' not in params:
# Use minimum of P and T for accel
accel = min(gcode.get_float('P', params, above=0.),
gcode.get_float('T', params, above=0.))
else:
# Use S for accel
accel = gcode.get_float('S', params, above=0.) accel = gcode.get_float('S', params, above=0.)
self.max_accel = min(accel, self.config_max_accel) self.max_accel = min(accel, self.config_max_accel)
self._calc_junction_deviation() self._calc_junction_deviation()