From 9379b0a97ba85bcf9aa4bb73f8d6be790799995c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 12 Feb 2016 17:07:35 +0100 Subject: [PATCH] Update translation from machine name to hex file There was an incongruence in the translation from the machine name to hex file. Sometimes the machine name was wrong. Sometimes the hex file was wrong. Contributes to issue CURA-440. --- plugins/USBPrinting/USBPrinterManager.py | 20 +++++++++++-------- .../machines/ultimaker2_extended_plus.json | 2 +- resources/machines/ultimaker2plus.json | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterManager.py b/plugins/USBPrinting/USBPrinterManager.py index 88c696c2c9..5982196cb8 100644 --- a/plugins/USBPrinting/USBPrinterManager.py +++ b/plugins/USBPrinting/USBPrinterManager.py @@ -133,30 +133,34 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension): def _getDefaultFirmwareName(self): machine_type = Application.getInstance().getMachineManager().getActiveMachineInstance().getMachineDefinition().getId() - firmware_name = "" baudrate = 250000 if sys.platform.startswith("linux"): baudrate = 115200 if machine_type == "ultimaker_original": firmware_name = "MarlinUltimaker" firmware_name += "-%d" % (baudrate) + return firmware_name + ".hex" elif machine_type == "ultimaker_original_plus": firmware_name = "MarlinUltimaker-UMOP-%d" % (baudrate) - elif machine_type == "Witbox": + return firmware_name + ".hex" + elif machine_type == "bq_witbox": return "MarlinWitbox.hex" - elif machine_type == "ultimaker2go": + elif machine_type == "ultimaker2_go": return "MarlinUltimaker2go.hex" - elif machine_type == "ultimaker2extended": + elif machine_type == "ultimaker2_extended": return "MarlinUltimaker2extended.hex" elif machine_type == "ultimaker2": return "MarlinUltimaker2.hex" + elif machine_type == "ultimaker2plus": + return "MarlinUltimaker2plus.hex" + elif machine_type == "ultimaker2_extended_plus": + return "MarlinUltimaker2extended-plus.hex" + else: + Logger.log("e", "I don't know of any firmware for machine %s.", machine_type) + raise FileNotFoundError() ##TODO: Add check for multiple extruders - if firmware_name != "": - firmware_name += ".hex" - return firmware_name - def _addRemovePorts(self, serial_ports): # First, find and add all new or changed keys for serial_port in list(serial_ports): diff --git a/resources/machines/ultimaker2_extended_plus.json b/resources/machines/ultimaker2_extended_plus.json index 5f74df23c7..403340cbe3 100644 --- a/resources/machines/ultimaker2_extended_plus.json +++ b/resources/machines/ultimaker2_extended_plus.json @@ -1,5 +1,5 @@ { - "id": "ultimaker2_extended_plus_base", + "id": "ultimaker2_extended_plus", "version": 1, "name": "Ultimaker 2 Extended+", "manufacturer": "Ultimaker", diff --git a/resources/machines/ultimaker2plus.json b/resources/machines/ultimaker2plus.json index b75e66122d..8c1c24663f 100644 --- a/resources/machines/ultimaker2plus.json +++ b/resources/machines/ultimaker2plus.json @@ -1,5 +1,5 @@ { - "id": "ultimaker2plus_base", + "id": "ultimaker2plus", "version": 1, "name": "Ultimaker 2+", "manufacturer": "Ultimaker",