mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Added more specific error message when trying to slice with incompatible material
CURA-2271
This commit is contained in:
parent
b707c8d806
commit
76e57c940d
2 changed files with 12 additions and 1 deletions
|
@ -227,6 +227,16 @@ class CuraEngineBackend(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:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
|
||||||
|
if Application.getInstance().getPlatformActivity:
|
||||||
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
|
"The selected material is imcompatible with the selected machine or configuration."))
|
||||||
|
self._error_message.show()
|
||||||
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
else:
|
||||||
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.SettingError:
|
if job.getResult() == StartSliceJob.StartJobResult.SettingError:
|
||||||
if Application.getInstance().getPlatformActivity:
|
if Application.getInstance().getPlatformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. Please check your settings for errors."))
|
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. Please check your settings for errors."))
|
||||||
|
|
|
@ -24,6 +24,7 @@ class StartJobResult(IntEnum):
|
||||||
Error = 2
|
Error = 2
|
||||||
SettingError = 3
|
SettingError = 3
|
||||||
NothingToSlice = 4
|
NothingToSlice = 4
|
||||||
|
MaterialIncompatible = 5
|
||||||
|
|
||||||
|
|
||||||
## Formatter class that handles token expansion in start/end gcod
|
## Formatter class that handles token expansion in start/end gcod
|
||||||
|
@ -86,7 +87,7 @@ class StartSliceJob(Job):
|
||||||
material = extruder_stack.findContainer({"type": "material"})
|
material = extruder_stack.findContainer({"type": "material"})
|
||||||
if material:
|
if material:
|
||||||
if material.getMetaDataEntry("compatible") == False:
|
if material.getMetaDataEntry("compatible") == False:
|
||||||
self.setResult(StartJobResult.SettingError)
|
self.setResult(StartJobResult.MaterialIncompatible)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Don't slice if there is a per object setting with an error value.
|
# Don't slice if there is a per object setting with an error value.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue