From a9edc04a47ca8530192d7f6f356c05f6dd51a2d3 Mon Sep 17 00:00:00 2001 From: James Leach Date: Mon, 11 Feb 2019 17:43:22 -0600 Subject: [PATCH] Fix for Issue #31: Send the three GCode commands with one OctoPrintClient.control.sendGcode command by sending an array of strings instead of three separate commands with individual strings. --- octoprint_klipper/static/js/klipper_leveling.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/octoprint_klipper/static/js/klipper_leveling.js b/octoprint_klipper/static/js/klipper_leveling.js index 35dced0..418ac64 100644 --- a/octoprint_klipper/static/js/klipper_leveling.js +++ b/octoprint_klipper/static/js/klipper_leveling.js @@ -58,19 +58,18 @@ $(function() { } */ self.moveToPosition = function(x, y) { - OctoPrint.control.sendGcode( + OctoPrint.control.sendGcode([ + // Move Z up "G1 Z" + (self.settings.settings.plugins.klipper.probe.height() * 1 + self.settings.settings.plugins.klipper.probe.lift()*1) + - " F" + self.settings.settings.plugins.klipper.probe.speed_z() - ); - OctoPrint.control.sendGcode( + " F" + self.settings.settings.plugins.klipper.probe.speed_z() , + // Move XY "G1 X" + x + " Y" + y + - " F" + self.settings.settings.plugins.klipper.probe.speed_xy() - ); - OctoPrint.control.sendGcode( + " F" + self.settings.settings.plugins.klipper.probe.speed_xy() , + // Move Z down "G1 Z" + self.settings.settings.plugins.klipper.probe.height() + " F" + self.settings.settings.plugins.klipper.probe.speed_z() - ); + ]); } self.moveToPoint = function(index) {