mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-10 00:59:02 +08:00
Added extra checks to ultimaker checkup to prevent error messages
This commit is contained in:
parent
58c8157fbc
commit
3f85b4aafd
@ -19,10 +19,18 @@ Column
|
|||||||
property bool heater_works: false
|
property bool heater_works: false
|
||||||
property int extruder_target_temp: 0
|
property int extruder_target_temp: 0
|
||||||
property int bed_target_temp: 0
|
property int bed_target_temp: 0
|
||||||
property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer
|
property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.rowCount() != 0 ? UM.USBPrinterManager.connectedPrinterList.getItem(0).printer: null
|
||||||
|
|
||||||
Component.onCompleted: printer_connection.startPollEndstop()
|
Component.onCompleted:
|
||||||
Component.onDestruction: printer_connection.stopPollEndstop()
|
{
|
||||||
|
if (printer_connection != null)
|
||||||
|
printer_connection.startPollEndstop()
|
||||||
|
}
|
||||||
|
Component.onDestruction:
|
||||||
|
{
|
||||||
|
if (printer_connection != null)
|
||||||
|
printer_connection.stopPollEndstop()
|
||||||
|
}
|
||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -90,16 +98,19 @@ Column
|
|||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: printer_connection.extruderTemperature
|
text: printer_connection != null ? printer_connection.extruderTemperature : "0"
|
||||||
}
|
}
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:button","Start heating")
|
text: catalog.i18nc("@action:button","Start heating")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
heater_status_label.text = catalog.i18nc("@label","Checking")
|
if(printer_connection != null)
|
||||||
printer_connection.heatupNozzle(190)
|
{
|
||||||
wizardPage.extruder_target_temp = 190
|
heater_status_label.text = catalog.i18nc("@label","Checking")
|
||||||
|
printer_connection.heatupNozzle(190)
|
||||||
|
wizardPage.extruder_target_temp = 190
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
@ -117,16 +128,19 @@ Column
|
|||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: printer_connection.bedTemperature
|
text: printer_connection != null ? printer_connection.bedTemperature : "0"
|
||||||
}
|
}
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:button","Start heating")
|
text: catalog.i18nc("@action:button","Start heating")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
bed_status_label.text = catalog.i18nc("@label","Checking")
|
if(printer_connection != null)
|
||||||
printer_connection.printer.heatupBed(60)
|
{
|
||||||
wizardPage.bed_target_temp = 60
|
bed_status_label.text = catalog.i18nc("@label","Checking")
|
||||||
|
printer_connection.printer.heatupBed(60)
|
||||||
|
wizardPage.bed_target_temp = 60
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
@ -159,8 +173,11 @@ Column
|
|||||||
{
|
{
|
||||||
if(printer_connection.extruderTemperature > wizardPage.extruder_target_temp - 10 && printer_connection.extruderTemperature < wizardPage.extruder_target_temp + 10)
|
if(printer_connection.extruderTemperature > wizardPage.extruder_target_temp - 10 && printer_connection.extruderTemperature < wizardPage.extruder_target_temp + 10)
|
||||||
{
|
{
|
||||||
heater_status_label.text = catalog.i18nc("@label","Works")
|
if(printer_connection != null)
|
||||||
printer_connection.heatupNozzle(0)
|
{
|
||||||
|
heater_status_label.text = catalog.i18nc("@label","Works")
|
||||||
|
printer_connection.heatupNozzle(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onBedTemperatureChanged:
|
onBedTemperatureChanged:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user