Add button to start bedleveling wizard

Prevents the printer from homing unexpectedly
This commit is contained in:
fieldOfView 2016-07-29 14:29:35 +02:00
parent 6f46ed35fc
commit c1d9c1ea12
2 changed files with 24 additions and 2 deletions

View file

@ -18,6 +18,11 @@ class BedLevelMachineAction(MachineAction):
pass pass
def _reset(self): def _reset(self):
self._bed_level_position = 0
pass
@pyqtSlot()
def startBedLeveling(self):
self._bed_level_position = 0 self._bed_level_position = 0
printer_output_devices = self._getPrinterOutputDevices() printer_output_devices = self._getPrinterOutputDevices()
if printer_output_devices: if printer_output_devices:
@ -52,4 +57,5 @@ class BedLevelMachineAction(MachineAction):
output_device.moveHead(0, 0, -3) output_device.moveHead(0, 0, -3)
self._bed_level_position += 1 self._bed_level_position += 1
elif self._bed_level_position >= 3: elif self._bed_level_position >= 3:
output_device.sendCommand("M18") # Turn off all motors so the user can move the axes
self.setFinished() self.setFinished()

View file

@ -55,13 +55,29 @@ Cura.MachineAction
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: childrenRect.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Button
{
id: startBedLevelingButton
text: catalog.i18nc("@action:button","Start Bed Leveling")
onClicked:
{
startBedLevelingButton.visible = false;
bedlevelingButton.visible = true;
checkupMachineAction.heatupHotendStarted = false;
checkupMachineAction.heatupBedStarted = false;
manager.startCheck();
}
}
Button Button
{ {
id: bedlevelingButton id: bedlevelingButton
text: catalog.i18nc("@action:button","Move to Next Position"); text: catalog.i18nc("@action:button","Move to Next Position")
visible: false
onClicked: onClicked:
{ {
manager.moveToNextLevelPosition() manager.moveToNextLevelPosition();
} }
} }
} }