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:
Ghostkeeper 2017-02-16 11:44:21 +01:00
parent 9a5b355f2b
commit d2fa6dbae2
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
4 changed files with 11 additions and 4 deletions

View file

@ -652,6 +652,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
def preheatBed(self, temperature, duration):
Logger.log("i", "Pre-heating the bed to %i degrees.", temperature)
self._setTargetBedTemperature(temperature)
self.preheatBedRemainingTimeChanged.emit()
## Cancels pre-heating the heated bed of the printer.
#
@ -659,4 +660,5 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
@pyqtSlot()
def cancelPreheatBed(self):
Logger.log("i", "Cancelling pre-heating of the bed.")
self._setTargetBedTemperature(0)
self._setTargetBedTemperature(0)
self.preheatBedRemainingTimeChanged.emit()