mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Notify to update remaining time when it drastically changes
When the time passes normally it doesn't trigger this signal but just go on counting, but when the pre-heat starts or cancels it updates via this signal. This is handy for the future, when we want to update the remaining time from the printer information. However for now it is also nice because we can make the pre-heat timer dependent on this signal so we know when to have it running. This fixes the problem that the pre-heat seems to have been cancelled in the GUI when you switch away the tab, because the timer running is now dependent on the property rather than always false. Contributes to issue CURA-3161.
This commit is contained in:
parent
9a5b355f2b
commit
d2fa6dbae2
4 changed files with 11 additions and 4 deletions
|
@ -264,6 +264,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
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.
|
||||
self.preheatBedRemainingTimeChanged.emit()
|
||||
|
||||
## Cancels pre-heating the heated bed of the printer.
|
||||
#
|
||||
|
@ -274,6 +275,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
self.preheatBed(temperature = 0, duration = 0)
|
||||
self._preheat_bed_timer.stop()
|
||||
self._preheat_bed_timer.setInterval(0)
|
||||
self.preheatBedRemainingTimeChanged.emit()
|
||||
|
||||
## Changes the target bed temperature on the printer.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue