Added ability for backend plugins to determine their usability

Modified BackendPlugin.py and StartSliceJob.py to allow plugins to decide when they should be used. The 'usePlugin'
method was added to enable a plugin to return a boolean indicating if it should be used or not, e.q.: start up and
connect to the services.

Contributes to CURA-11031
This commit is contained in:
Jelle Spijker 2023-09-13 07:15:59 +02:00
parent 3555073ee4
commit 45510d04ed
No known key found for this signature in database
GPG key ID: 034D1C0527888B65
2 changed files with 8 additions and 0 deletions

View file

@ -303,6 +303,8 @@ class StartSliceJob(Job):
self._buildExtruderMessage(extruder_stack)
for plugin in CuraApplication.getInstance().getBackendPlugins():
if not plugin.usePlugin():
continue
for slot in plugin.getSupportedSlots():
# Right now we just send the message for every slot that we support. A single plugin can support
# multiple slots