mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
Emit backend errors so we can process them differently than through a qml notification
This commit is contained in:
parent
52735fb9a9
commit
cd01b096b5
3 changed files with 20 additions and 6 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.git
|
||||||
|
.github
|
||||||
|
resources/materials
|
||||||
|
CuraEngine
|
13
Dockerfile
13
Dockerfile
|
@ -24,21 +24,22 @@ ENV URANIUM_BRANCH=master
|
||||||
WORKDIR $CURA_APP_DIR
|
WORKDIR $CURA_APP_DIR
|
||||||
RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium
|
RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium
|
||||||
|
|
||||||
# Setup Cura
|
|
||||||
ENV CURA_BRANCH=docker
|
|
||||||
WORKDIR $CURA_APP_DIR
|
|
||||||
RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura
|
|
||||||
|
|
||||||
# Setup materials
|
# Setup materials
|
||||||
ENV MATERIALS_BRANCH=master
|
ENV MATERIALS_BRANCH=master
|
||||||
WORKDIR $CURA_APP_DIR/Cura/resources
|
WORKDIR $CURA_APP_DIR
|
||||||
RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials
|
RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials
|
||||||
|
|
||||||
|
# Setup Cura
|
||||||
|
WORKDIR $CURA_APP_DIR/Cura
|
||||||
|
ADD . .
|
||||||
|
RUN mv $CURA_APP_DIR/materials resources/materials
|
||||||
|
|
||||||
# Make sure Cura can find CuraEngine
|
# Make sure Cura can find CuraEngine
|
||||||
RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura
|
RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura
|
||||||
|
|
||||||
# Run Cura
|
# Run Cura
|
||||||
WORKDIR $CURA_APP_DIR/Cura
|
WORKDIR $CURA_APP_DIR/Cura
|
||||||
ENV PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium
|
ENV PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium
|
||||||
|
RUN chmod +x ./CuraEngine
|
||||||
RUN chmod +x ./run_in_docker.sh
|
RUN chmod +x ./run_in_docker.sh
|
||||||
CMD "./run_in_docker.sh"
|
CMD "./run_in_docker.sh"
|
||||||
|
|
|
@ -33,6 +33,9 @@ from UM.i18n import i18nCatalog
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
class CuraEngineBackend(QObject, Backend):
|
class CuraEngineBackend(QObject, Backend):
|
||||||
|
|
||||||
|
backendError = Signal()
|
||||||
|
|
||||||
## Starts the back-end plug-in.
|
## Starts the back-end plug-in.
|
||||||
#
|
#
|
||||||
# This registers all the signal listeners and prepares for communication
|
# This registers all the signal listeners and prepares for communication
|
||||||
|
@ -289,6 +292,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
|
|
||||||
if job.isCancelled() or job.getError() or job.getResult() == StartSliceJob.StartJobResult.Error:
|
if job.isCancelled() or job.getError() or job.getResult() == StartSliceJob.StartJobResult.Error:
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
return
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
|
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
|
||||||
|
@ -297,6 +301,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
"Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice"))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
else:
|
else:
|
||||||
self.backendStateChange.emit(BackendState.NotStarted)
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
return
|
return
|
||||||
|
@ -325,6 +330,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
title = catalog.i18nc("@info:title", "Unable to slice"))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
else:
|
else:
|
||||||
self.backendStateChange.emit(BackendState.NotStarted)
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
return
|
return
|
||||||
|
@ -347,6 +353,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
title = catalog.i18nc("@info:title", "Unable to slice"))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
return
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError:
|
if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError:
|
||||||
|
@ -355,6 +362,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
title = catalog.i18nc("@info:title", "Unable to slice"))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
else:
|
else:
|
||||||
self.backendStateChange.emit(BackendState.NotStarted)
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
|
|
||||||
|
@ -364,6 +372,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
title = catalog.i18nc("@info:title", "Unable to slice"))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
self.backendError.emit(job)
|
||||||
else:
|
else:
|
||||||
self.backendStateChange.emit(BackendState.NotStarted)
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
self._invokeSlice()
|
self._invokeSlice()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue