If prime tower or prime position has an invalid position, we now give a specifc error message to indicate this

CURA-2481
This commit is contained in:
Jaime van Kessel 2016-11-18 14:24:32 +01:00
parent c007c1fc4c
commit 782a02661c
2 changed files with 13 additions and 1 deletions

View file

@ -220,6 +220,9 @@ class CuraEngineBackend(Backend):
# #
# \param job The start slice job that was just finished. # \param job The start slice job that was just finished.
def _onStartSliceCompleted(self, job): def _onStartSliceCompleted(self, job):
if self._error_message:
self._error_message.hide()
# Note that cancelled slice jobs can still call this method. # Note that cancelled slice jobs can still call this method.
if self._start_slice_job is job: if self._start_slice_job is job:
self._start_slice_job = None self._start_slice_job = None
@ -258,6 +261,14 @@ class CuraEngineBackend(Backend):
self.backendStateChange.emit(BackendState.NotStarted) self.backendStateChange.emit(BackendState.NotStarted)
return return
if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError:
if Application.getInstance().getPlatformActivity:
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."))
self._error_message.show()
self.backendStateChange.emit(BackendState.Error)
else:
self.backendStateChange.emit(BackendState.NotStarted)
if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice: if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice:
if Application.getInstance().getPlatformActivity: if Application.getInstance().getPlatformActivity:
self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit.")) self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."))

View file

@ -25,6 +25,7 @@ class StartJobResult(IntEnum):
SettingError = 3 SettingError = 3
NothingToSlice = 4 NothingToSlice = 4
MaterialIncompatible = 5 MaterialIncompatible = 5
BuildPlateError = 6
## Formatter class that handles token expansion in start/end gcod ## Formatter class that handles token expansion in start/end gcod
@ -80,7 +81,7 @@ class StartSliceJob(Job):
return return
if Application.getInstance().getBuildVolume().hasErrors(): if Application.getInstance().getBuildVolume().hasErrors():
self.setResult(StartJobResult.SettingError) self.setResult(StartJobResult.BuildPlateError)
return return
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()): for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):