From c8de272ec445023c467767336be043284514e99f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 23 May 2016 16:45:43 +0200 Subject: [PATCH] Document old functions I was reading through these to check if they'd still work. They should still work, but since I went through them I went ahead and documented them too. Contributes to issues CURA-1278 and CURA-1588. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 1f7d34556e..d7c4d6bd8b 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -153,6 +153,7 @@ class CuraEngineBackend(Backend): job.finished.connect(self._onStartSliceCompleted) job.start() + ## Terminate the engine process. def _terminate(self): self._slicing = False self._restart = True @@ -172,7 +173,14 @@ class CuraEngineBackend(Backend): self._message.hide() self._message = None - + ## Event handler to call when the job to initiate the slicing process is + # completed. + # + # When the start slice job is successfully completed, it will be happily + # slicing. This function handles any errors that may occur during the + # bootstrapping of a slice job. + # + # \param job The start slice job that was just finished. def _onStartSliceCompleted(self, job): if job.getError() or job.getResult() != True: if self._message: @@ -180,6 +188,11 @@ class CuraEngineBackend(Backend): self._message = None return + ## Listener for when the scene has changed. + # + # This should start a slice if the scene is now ready to slice. + # + # \param source The scene node that was changed. def _onSceneChanged(self, source): if type(source) is not SceneNode: return @@ -195,6 +208,9 @@ class CuraEngineBackend(Backend): self._onChanged() + ## Called when an error occurs in the socket connection towards the engine. + # + # \param error The exception that occurred. def _onSocketError(self, error): if Application.getInstance().isShuttingDown(): return