mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Move backend plugin logic to Cura from Uranium
I was running into abstraction issues when it was defined in Uranium. Instead of trying to fight those, it's just easier to move it to Cura CURA-10717
This commit is contained in:
parent
26bf00ccc0
commit
f3bc7bf28a
3 changed files with 98 additions and 1 deletions
|
@ -70,7 +70,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||
os.path.join(CuraApplication.getInstallPrefix(), "bin"),
|
||||
os.path.dirname(os.path.abspath(sys.executable)),
|
||||
]
|
||||
|
||||
self._last_backend_plugin_port = self._port + 1000
|
||||
for path in search_path:
|
||||
engine_path = os.path.join(path, executable_name)
|
||||
if os.path.isfile(engine_path):
|
||||
|
@ -176,6 +176,20 @@ class CuraEngineBackend(QObject, Backend):
|
|||
|
||||
application.initializationFinished.connect(self.initialize)
|
||||
|
||||
def startPlugins(self) -> None:
|
||||
"""
|
||||
Ensure that all backend plugins are started
|
||||
:return:
|
||||
"""
|
||||
backend_plugins = CuraApplication.getInstance().getBackendPlugins()
|
||||
for backend_plugin in backend_plugins:
|
||||
if backend_plugin.isRunning():
|
||||
continue
|
||||
# Set the port to prevent plugins from using the same one.
|
||||
backend_plugin.setPort(self._last_backend_plugin_port)
|
||||
self.__last_backend_plugin_port += 1
|
||||
backend_plugin.start()
|
||||
|
||||
def _resetLastSliceTimeStats(self) -> None:
|
||||
self._time_start_process = None
|
||||
self._time_send_message = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue