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.
This commit is contained in:
Ghostkeeper 2016-02-12 17:07:35 +01:00
parent 6d27c26260
commit 9379b0a97b
3 changed files with 14 additions and 10 deletions

View file

@ -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):