diff options
author | Ghostkeeper <ghost_keeper+github@hotmail.com> | 2016-03-17 17:24:00 +0300 |
---|---|---|
committer | Ghostkeeper <ghost_keeper+github@hotmail.com> | 2016-03-17 17:24:00 +0300 |
commit | de9a66e1f41a849990b148c7a33515f972b39749 (patch) | |
tree | 6063c46e88e081259f72c7fb26286b3fc8131da7 /plugins/USBPrinting/PrinterConnection.py | |
parent | 14f5d236b20df71438c31a20f932a75c0a955df7 (diff) | |
parent | 479c6c3319151c79725472874880ba2c5f6612ae (diff) |
Merge branch '2.1'
Conflicts:
plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py
plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py
plugins/USBPrinting/PrinterConnection.py
resources/machines/fdmprinter.json
resources/profiles/ultimaker2+/abs_0.4_high.curaprofile
Diffstat (limited to 'plugins/USBPrinting/PrinterConnection.py')
-rw-r--r-- | plugins/USBPrinting/PrinterConnection.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index 1e5aa89b42..8834e9f6f5 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -366,15 +366,33 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): Logger.log("d", "Setting bed temperature to %s", temperature) self._sendCommand("M140 S%s" % temperature) + @pyqtSlot() + def setMoveToRelative(self): + self._sendCommand("G91") + + @pyqtSlot() + def setMoveToAbsolute(self): + self._sendCommand("G90") + @pyqtSlot("long", "long","long") def moveHead(self, x, y, z): Logger.log("d","Moving head to %s, %s , %s", x, y, z) - self._sendCommand("G0 X%s Y%s Z%s"%(x,y,z)) + self._sendCommand("G0 X%s Y%s Z%s F3000" % (x, y, z)) + + @pyqtSlot("long", "long","long") + def moveHeadRelative(self, x, y, z): + self.setMoveToRelative() + self.moveHead(x,y,z) + self.setMoveToAbsolute() @pyqtSlot() def homeHead(self): self._sendCommand("G28") + @pyqtSlot() + def homeBed(self): + self._sendCommand("G28 Z") + ## Directly send the command, withouth checking connection state (eg; printing). # \param cmd string with g-code def _sendCommand(self, cmd): @@ -466,7 +484,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): self._bed_temperature = temperature self.bedTemperatureChanged.emit() - def requestWrite(self, node, file_name = None): + def requestWrite(self, node, file_name = None, filter_by_machine = False): self.showControlInterface() def _setEndstopState(self, endstop_key, value): |