mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
D6: Refactoring
This commit is contained in:
parent
60eb83d920
commit
ba372f69a7
3 changed files with 41 additions and 45 deletions
|
@ -116,7 +116,6 @@ class CuraEngineBackend(Backend):
|
|||
|
||||
self.backendQuit.connect(self._onBackendQuit)
|
||||
self.backendConnected.connect(self._onBackendConnected)
|
||||
self.backendStateChange.connect(self._onBackendStateChanged)
|
||||
|
||||
# When a tool operation is in progress, don't slice. So we need to listen for tool operations.
|
||||
Application.getInstance().getController().toolOperationStarted.connect(self._onToolOperationStarted)
|
||||
|
@ -188,22 +187,16 @@ class CuraEngineBackend(Backend):
|
|||
self._start_slice_job.start()
|
||||
self._start_slice_job.finished.connect(self._onStartSliceCompleted)
|
||||
|
||||
_last_state = BackendState.NotStarted
|
||||
|
||||
def pauseSlicing(self):
|
||||
self.close()
|
||||
self._pause_slicing = True
|
||||
self.backendStateChange.emit(BackendState.SlicingDisabled)
|
||||
|
||||
def continueSlicing(self):
|
||||
if self._last_state == BackendState.SlicingDisabled:
|
||||
self.backendStateChange.emit(BackendState.NotStarted)
|
||||
|
||||
def _onBackendStateChanged(self, state):
|
||||
self._last_state = state
|
||||
if state == BackendState.SlicingDisabled:
|
||||
self._pause_slicing = True
|
||||
else:
|
||||
if self._pause_slicing:
|
||||
self._pause_slicing = False
|
||||
self.backendStateChange.emit(BackendState.NotStarted)
|
||||
|
||||
## Terminate the engine process.
|
||||
def _terminate(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue