mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Move pre-heat timer into PrinterOutputDevice
If it's held inside the device that has two advantages: It's being held per-device, so switching connection doesn't stop the timer. And also, the logic is no longer in the GUI. Contributes to issue CURA-3161.
This commit is contained in:
parent
2f89a1cff4
commit
75a50b73c2
3 changed files with 28 additions and 22 deletions
|
@ -262,6 +262,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
put_request = QNetworkRequest(url)
|
||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self._manager.put(put_request, data.encode())
|
||||
self._preheat_bed_timer.start(self._preheat_bed_timeout * 1000) #Times 1000 because it needs to be provided as milliseconds.
|
||||
|
||||
## Cancels pre-heating the heated bed of the printer.
|
||||
#
|
||||
|
@ -269,6 +270,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
@pyqtSlot()
|
||||
def cancelPreheatBed(self):
|
||||
self.preheatBed(temperature = 0, duration = 0)
|
||||
self._preheat_bed_timer.stop()
|
||||
self._preheat_bed_timer.setInterval(0)
|
||||
|
||||
## Changes the target bed temperature on the printer.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue