mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Bed should no longer be damaged when leveling
CURA-1102
This commit is contained in:
parent
762f964221
commit
9a6615213c
2 changed files with 32 additions and 6 deletions
|
@ -368,10 +368,24 @@ 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):
|
||||
|
|
|
@ -19,7 +19,11 @@ Item
|
|||
property int platform_height: UM.MachineManager.getSettingValue("machine_depth")
|
||||
anchors.fill: parent;
|
||||
property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
|
||||
Component.onCompleted: printer_connection.homeHead()
|
||||
Component.onCompleted:
|
||||
{
|
||||
printer_connection.
|
||||
printer_connection.homeHead()
|
||||
}
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
property variant wizard: null;
|
||||
|
||||
|
@ -79,15 +83,23 @@ Item
|
|||
{
|
||||
if(wizardPage.leveling_state == 0)
|
||||
{
|
||||
printer_connection.moveHead(platform_width, 0 ,0)
|
||||
printer_connection.moveHeadRelative(0, 0, 3)
|
||||
printer_connection.homeHead()
|
||||
printer_connection.moveHeadRelative(0, 0, 3)
|
||||
printer_connection.moveHeadRelative(platform_width - 10, 0, 0)
|
||||
printer_connection.moveHeadRelative(0, 0, -3)
|
||||
}
|
||||
if(wizardPage.leveling_state == 1)
|
||||
{
|
||||
printer_connection.moveHead(platform_width/2, platform_height, 0)
|
||||
printer_connection.moveHeadRelative(0, 0, 3)
|
||||
printer_connection.moveHeadRelative(-platform_width/2, platform_height - 10, 0)
|
||||
printer_connection.moveHeadRelative(0, 0, -3)
|
||||
}
|
||||
if(wizardPage.leveling_state == 2)
|
||||
{
|
||||
printer_connection.moveHead(0, 0, 0)
|
||||
printer_connection.moveHeadRelative(0, 0, 3)
|
||||
printer_connection.moveHeadRelative(-platform_width/2 + 10, -(platform_height + 10), 0)
|
||||
printer_connection.moveHeadRelative(0, 0, -3)
|
||||
}
|
||||
wizardPage.leveling_state++
|
||||
if (wizardPage.leveling_state >= 3){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue