mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Added rudementary 3 point bed leveling
This commit is contained in:
parent
18497329db
commit
07c19498f1
2 changed files with 43 additions and 49 deletions
|
@ -354,6 +354,15 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
|
||||||
def heatupBed(self, temperature):
|
def heatupBed(self, temperature):
|
||||||
self._sendCommand("M140 S%s" % temperature)
|
self._sendCommand("M140 S%s" % temperature)
|
||||||
|
|
||||||
|
@pyqtSlot("long", "long","long")
|
||||||
|
def moveHead(self, x, y, z):
|
||||||
|
print("Moving head" , x , " ", y , " " , z)
|
||||||
|
self._sendCommand("G0 X%s Y%s Z%s"%(x,y,z))
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def homeHead(self):
|
||||||
|
self._sendCommand("G28")
|
||||||
|
|
||||||
## Directly send the command, withouth checking connection state (eg; printing).
|
## Directly send the command, withouth checking connection state (eg; printing).
|
||||||
# \param cmd string with g-code
|
# \param cmd string with g-code
|
||||||
def _sendCommand(self, cmd):
|
def _sendCommand(self, cmd):
|
||||||
|
|
|
@ -8,62 +8,47 @@ import QtQuick.Window 2.1
|
||||||
|
|
||||||
import UM 1.0 as UM
|
import UM 1.0 as UM
|
||||||
|
|
||||||
ColumnLayout {
|
Column
|
||||||
|
{
|
||||||
id: wizardPage
|
id: wizardPage
|
||||||
property string title
|
property int leveling_state: 0
|
||||||
property int pageWidth
|
property bool three_point_leveling: true
|
||||||
property int pageHeight
|
property int platform_width: UM.Models.settingsModel.getMachineSetting("machine_width")
|
||||||
|
property int platform_height: UM.Models.settingsModel.getMachineSetting("machine_depth")
|
||||||
SystemPalette{id: palette}
|
anchors.fill: parent;
|
||||||
//signal openFile(string fileName)
|
property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
|
||||||
//signal closeWizard()
|
Component.onCompleted: printer_connection.homeHead()
|
||||||
|
Label
|
||||||
width: wizardPage.pageWidth
|
{
|
||||||
height: wizardPage.pageHeight
|
text: UM.Models.settingsModel.getItem(UM.Models.settingsModel.find("key", "machine_width")).toString()
|
||||||
|
//Component.onCompleted:console.log(UM.Models.settingsModel.getMachineSetting("machine_width"))
|
||||||
Connections {
|
|
||||||
target: elementRoot
|
|
||||||
onResize: {
|
|
||||||
wizardPage.width = pageWidth
|
|
||||||
wizardPage.height = pageHeight
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Button
|
||||||
Label {
|
{
|
||||||
text: parent.title
|
text: "Move to next position"
|
||||||
font.pointSize: 18;
|
onClicked:
|
||||||
}
|
{
|
||||||
|
if(wizardPage.leveling_state == 0)
|
||||||
Label {
|
{
|
||||||
//: Add Printer wizard page description
|
printer_connection.moveHead(platform_width /2 , platform_height,0)
|
||||||
text: qsTr("Please select the type of printer:");
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollView {
|
|
||||||
Layout.fillWidth: true;
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
id: machineList;
|
|
||||||
model: UM.Models.availableMachinesModel
|
|
||||||
delegate: RadioButton {
|
|
||||||
exclusiveGroup: printerGroup;
|
|
||||||
text: model.name;
|
|
||||||
onClicked: {
|
|
||||||
ListView.view.currentIndex = index;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if(wizardPage.leveling_state == 1)
|
||||||
|
{
|
||||||
|
printer_connection.moveHead(platform_width , 0,0)
|
||||||
|
}
|
||||||
|
if(wizardPage.leveling_state == 2)
|
||||||
|
{
|
||||||
|
printer_connection.moveHead(0, 0 ,0)
|
||||||
|
}
|
||||||
|
|
||||||
|
wizardPage.leveling_state++
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
function threePointLeveling(width, height)
|
||||||
//: Add Printer wizard field label
|
{
|
||||||
text: qsTr("Printer Name:");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name }
|
|
||||||
|
|
||||||
Item { Layout.fillWidth: true; Layout.fillHeight: true; }
|
|
||||||
|
|
||||||
ExclusiveGroup { id: printerGroup; }
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue