Skip to content

Commit

Permalink
Merge pull request Ultimaker#16722 from Ultimaker/CURA-11031_only_sta…
Browse files Browse the repository at this point in the history
…rt_services_when_required

CURA 11031 only start services when required
  • Loading branch information
rburema authored Sep 13, 2023
2 parents 70873ff + 62074ca commit 75fac58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cura/BackendPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def __init__(self) -> None:
self._process = None
self._is_running = False
self._supported_slots: List[int] = []
self._use_plugin = True

def usePlugin(self) -> bool:
return self._use_plugin

def getSupportedSlots(self) -> List[int]:
return self._supported_slots
Expand Down Expand Up @@ -55,6 +59,8 @@ def start(self) -> bool:
:return: True if the plugin process started successfully, False otherwise.
"""
if not self.usePlugin():
return False
try:
# STDIN needs to be None because we provide no input, but communicate via a local socket instead.
# The NUL device sometimes doesn't exist on some computers.
Expand Down
2 changes: 2 additions & 0 deletions plugins/CuraEngineBackend/StartSliceJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ def run(self) -> None:
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
Expand Down

0 comments on commit 75fac58

Please sign in to comment.