mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-02 05:05:12 +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,18 +98,21 @@ 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:
|
||||||
|
{
|
||||||
|
if(printer_connection != null)
|
||||||
{
|
{
|
||||||
heater_status_label.text = catalog.i18nc("@label","Checking")
|
heater_status_label.text = catalog.i18nc("@label","Checking")
|
||||||
printer_connection.heatupNozzle(190)
|
printer_connection.heatupNozzle(190)
|
||||||
wizardPage.extruder_target_temp = 190
|
wizardPage.extruder_target_temp = 190
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: heater_status_label
|
id: heater_status_label
|
||||||
@ -117,18 +128,21 @@ 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:
|
||||||
|
{
|
||||||
|
if(printer_connection != null)
|
||||||
{
|
{
|
||||||
bed_status_label.text = catalog.i18nc("@label","Checking")
|
bed_status_label.text = catalog.i18nc("@label","Checking")
|
||||||
printer_connection.printer.heatupBed(60)
|
printer_connection.printer.heatupBed(60)
|
||||||
wizardPage.bed_target_temp = 60
|
wizardPage.bed_target_temp = 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: bed_status_label
|
id: bed_status_label
|
||||||
@ -158,11 +172,14 @@ Column
|
|||||||
onExtruderTemperatureChanged:
|
onExtruderTemperatureChanged:
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
{
|
||||||
|
if(printer_connection != null)
|
||||||
{
|
{
|
||||||
heater_status_label.text = catalog.i18nc("@label","Works")
|
heater_status_label.text = catalog.i18nc("@label","Works")
|
||||||
printer_connection.heatupNozzle(0)
|
printer_connection.heatupNozzle(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onBedTemperatureChanged:
|
onBedTemperatureChanged:
|
||||||
{
|
{
|
||||||
if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5)
|
if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user