mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Functionality properties (canPause, canPreHeatBed, etc) are now in the Controller.
It's actually up to the controller to say something about this, so this location makes more sense CL-541
This commit is contained in:
parent
0fe91db636
commit
f987e6d977
3 changed files with 20 additions and 11 deletions
|
@ -9,7 +9,10 @@ if MYPY:
|
||||||
|
|
||||||
class PrinterOutputController:
|
class PrinterOutputController:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
self.can_pause = True
|
||||||
|
self.can_abort = True
|
||||||
|
self.can_pre_heat_bed = True
|
||||||
|
self.can_control_manually = True
|
||||||
|
|
||||||
def setTargetHotendTemperature(self, printer: "PrinterOutputModel", extruder: "ExtruderOuputModel", temperature: int):
|
def setTargetHotendTemperature(self, printer: "PrinterOutputModel", extruder: "ExtruderOuputModel", temperature: int):
|
||||||
# TODO: implement
|
# TODO: implement
|
||||||
|
|
|
@ -35,12 +35,6 @@ class PrinterOutputModel(QObject):
|
||||||
|
|
||||||
self._printer_state = "unknown"
|
self._printer_state = "unknown"
|
||||||
|
|
||||||
# Features of the printer;
|
|
||||||
self._can_pause = True
|
|
||||||
self._can_abort = True
|
|
||||||
self._can_pre_heat_bed = True
|
|
||||||
self._can_control_manually = True
|
|
||||||
|
|
||||||
@pyqtProperty(str, notify=keyChanged)
|
@pyqtProperty(str, notify=keyChanged)
|
||||||
def key(self):
|
def key(self):
|
||||||
return self._key
|
return self._key
|
||||||
|
@ -175,19 +169,27 @@ class PrinterOutputModel(QObject):
|
||||||
# Does the printer support pre-heating the bed at all
|
# Does the printer support pre-heating the bed at all
|
||||||
@pyqtProperty(bool, constant=True)
|
@pyqtProperty(bool, constant=True)
|
||||||
def canPreHeatBed(self):
|
def canPreHeatBed(self):
|
||||||
return self._can_pre_heat_bed
|
if self._controller:
|
||||||
|
return self._controller.can_pre_heat_bed
|
||||||
|
return False
|
||||||
|
|
||||||
# Does the printer support pause at all
|
# Does the printer support pause at all
|
||||||
@pyqtProperty(bool, constant=True)
|
@pyqtProperty(bool, constant=True)
|
||||||
def canPause(self):
|
def canPause(self):
|
||||||
return self._can_pause
|
if self._controller:
|
||||||
|
return self.can_pause
|
||||||
|
return False
|
||||||
|
|
||||||
# Does the printer support abort at all
|
# Does the printer support abort at all
|
||||||
@pyqtProperty(bool, constant=True)
|
@pyqtProperty(bool, constant=True)
|
||||||
def canAbort(self):
|
def canAbort(self):
|
||||||
return self._can_abort
|
if self._controller:
|
||||||
|
return self.can_abort
|
||||||
|
return False
|
||||||
|
|
||||||
# Does the printer support manual control at all
|
# Does the printer support manual control at all
|
||||||
@pyqtProperty(bool, constant=True)
|
@pyqtProperty(bool, constant=True)
|
||||||
def canControlManually(self):
|
def canControlManually(self):
|
||||||
return self._can_control_manually
|
if self._controller:
|
||||||
|
return self.can_control_manually
|
||||||
|
return False
|
||||||
|
|
|
@ -229,6 +229,10 @@ Item
|
||||||
property var endTime: new Date() //Set initial endTime to be the current date, so that the endTime has initially already passed and the timer text becomes invisible if you were to update.
|
property var endTime: new Date() //Set initial endTime to be the current date, so that the endTime has initially already passed and the timer text becomes invisible if you were to update.
|
||||||
function update()
|
function update()
|
||||||
{
|
{
|
||||||
|
if(printerModel != null && !printerModel.canPreHeatBed)
|
||||||
|
{
|
||||||
|
return // Nothing to do, printer cant preheat at all!
|
||||||
|
}
|
||||||
preheatCountdown.text = ""
|
preheatCountdown.text = ""
|
||||||
if (printerModel != null)
|
if (printerModel != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue