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.
This commit is contained in:
James Leach 2019-02-11 17:43:22 -06:00
parent aaf045df55
commit a9edc04a47
1 changed files with 7 additions and 8 deletions

View File

@ -58,19 +58,18 @@ $(function() {
} }
*/ */
self.moveToPosition = function(x, y) { self.moveToPosition = function(x, y) {
OctoPrint.control.sendGcode( OctoPrint.control.sendGcode([
// Move Z up
"G1 Z" + (self.settings.settings.plugins.klipper.probe.height() * 1 + "G1 Z" + (self.settings.settings.plugins.klipper.probe.height() * 1 +
self.settings.settings.plugins.klipper.probe.lift()*1) + self.settings.settings.plugins.klipper.probe.lift()*1) +
" F" + self.settings.settings.plugins.klipper.probe.speed_z() " F" + self.settings.settings.plugins.klipper.probe.speed_z() ,
); // Move XY
OctoPrint.control.sendGcode(
"G1 X" + x + " Y" + y + "G1 X" + x + " Y" + y +
" F" + self.settings.settings.plugins.klipper.probe.speed_xy() " F" + self.settings.settings.plugins.klipper.probe.speed_xy() ,
); // Move Z down
OctoPrint.control.sendGcode(
"G1 Z" + self.settings.settings.plugins.klipper.probe.height() + "G1 Z" + self.settings.settings.plugins.klipper.probe.height() +
" F" + self.settings.settings.plugins.klipper.probe.speed_z() " F" + self.settings.settings.plugins.klipper.probe.speed_z()
); ]);
} }
self.moveToPoint = function(index) { self.moveToPoint = function(index) {