mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 10:15:54 +08:00
Cancel the running timer when receiving another change notification in CuraEngineBackend
This commit is contained in:
parent
800faf6bcf
commit
c03a368a0d
@ -35,6 +35,8 @@ class CuraEngineBackend(Backend):
|
|||||||
|
|
||||||
self._center = None
|
self._center = None
|
||||||
|
|
||||||
|
self._slice_interval = 0.5
|
||||||
|
|
||||||
def getEngineCommand(self):
|
def getEngineCommand(self):
|
||||||
return [Preferences.getInstance().getValue("backend/location"), '--connect', "127.0.0.1:{0}".format(self._port)]
|
return [Preferences.getInstance().getValue("backend/location"), '--connect', "127.0.0.1:{0}".format(self._port)]
|
||||||
|
|
||||||
@ -85,9 +87,9 @@ class CuraEngineBackend(Backend):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self._changeTimer:
|
if self._changeTimer:
|
||||||
return
|
self._changeTimer.cancel()
|
||||||
|
|
||||||
self._changeTimer = threading.Timer(1, self._onChangeTimerFinished)
|
self._changeTimer = threading.Timer(self._slice_interval, self._onChangeTimerFinished)
|
||||||
self._changeTimer.start()
|
self._changeTimer.start()
|
||||||
|
|
||||||
def _onChangeTimerFinished(self):
|
def _onChangeTimerFinished(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user