From cdb235740d52045accff835f01c7f6c021046270 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 11 Apr 2016 12:58:57 +0200 Subject: [PATCH] Use fdmprinter.json If we have no active machine instead of returning None This prevents issues where backend creation would end up in an infinite loop while there was no active machine. Contributes to CURA-1376 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index b163386867..f61e3fde81 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -94,10 +94,13 @@ class CuraEngineBackend(Backend): # \return list of commands and args / parameters. def getEngineCommand(self): active_machine = Application.getInstance().getMachineManager().getActiveMachineInstance() + json_path = "" if not active_machine: - return None + json_path = Resources.getPath(Resources.MachineDefinitions, "fdmprinter.json") + else: + json_path = active_machine.getMachineDefinition().getPath() - return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", active_machine.getMachineDefinition().getPath(), "-vv"] + return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", json_path, "-vv"] ## Emitted when we get a message containing print duration and material amount. This also implies the slicing has finished. # \param time The amount of time the print will take.