From 6c6e05bf0608fb6e17541e05cba8d0408fadbcc4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Aug 2018 17:22:04 +0200 Subject: [PATCH 1/3] Don't send JSON file to back-end any more They are no longer using it. The back-end now just takes all settings that come in via setting messages. It doesn't need to set its defaults any more because all settings are set at the beginning. Only when slicing via command line does it need a JSON file. Contributes to issue CURA-4410. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 56763a6632..bc0b275bb7 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -178,8 +178,7 @@ class CuraEngineBackend(QObject, Backend): # This is useful for debugging and used to actually start the engine. # \return list of commands and args / parameters. def getEngineCommand(self) -> List[str]: - json_path = Resources.getPath(Resources.DefinitionContainers, "fdmprinter.def.json") - return [self._application.getPreferences().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", json_path, ""] + return [self._application.getPreferences().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), ""] ## Emitted when we get a message containing print duration and material amount. # This also implies the slicing has finished. From 1fbf9c973145c202ecc6773d18e70234ca6af8d4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 29 Aug 2018 17:21:47 +0200 Subject: [PATCH 2/3] Add default value to extruders_enabled_count Otherwise CuraEngine can't parse this setting from the JSON file in command line slicing. Contributes to issue CURA-4410. --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 3eb7cb1c32..f00fecbaab 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -216,6 +216,7 @@ "label": "Number of Extruders that are enabled", "description": "Number of extruder trains that are enabled; automatically set in software", "value": "machine_extruder_count", + "default_value": 1, "minimum_value": "1", "maximum_value": "16", "type": "int", From 1717281d2b84f2f60d3695c61a8a6d3f18a75165 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 27 Sep 2018 11:20:24 +0200 Subject: [PATCH 3/3] Always provide extruder_nr for all models Even if you only have one extruder in your printer. This is more consistent, and probably also faster because executing one set-addition in Python is probably still slower than sending those 20 extra bytes over the socket and parsing them in C++... Contributes to issue CURA-4410. --- plugins/CuraEngineBackend/StartSliceJob.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 28e442033b..dd0d9db0a2 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -440,8 +440,7 @@ class StartSliceJob(Job): Job.yieldThread() # Ensure that the engine is aware what the build extruder is. - if stack.getProperty("machine_extruder_count", "value") > 1: - changed_setting_keys.add("extruder_nr") + changed_setting_keys.add("extruder_nr") # Get values for all changed settings for key in changed_setting_keys: