mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:16:04 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
1608f06c6c
@ -135,35 +135,44 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
|
|||||||
def _getDefaultFirmwareName(self):
|
def _getDefaultFirmwareName(self):
|
||||||
machine_instance = Application.getInstance().getMachineManager().getActiveMachineInstance()
|
machine_instance = Application.getInstance().getMachineManager().getActiveMachineInstance()
|
||||||
machine_type = machine_instance.getMachineDefinition().getId()
|
machine_type = machine_instance.getMachineDefinition().getId()
|
||||||
baudrate = 250000
|
if platform.system() == "Linux":
|
||||||
if sys.platform.startswith("linux"):
|
|
||||||
baudrate = 115200
|
baudrate = 115200
|
||||||
if machine_type == "ultimaker_original":
|
|
||||||
firmware_name = "MarlinUltimaker"
|
|
||||||
if machine_instance.getMachineSettingValue("machine_heated_bed"): #Has heated bed upgrade kit?
|
|
||||||
firmware_name += "-HBK"
|
|
||||||
firmware_name += "-%d" % (baudrate)
|
|
||||||
return firmware_name + ".hex"
|
|
||||||
elif machine_type == "ultimaker_original_plus":
|
|
||||||
firmware_name = "MarlinUltimaker-UMOP-%d" % (baudrate)
|
|
||||||
return firmware_name + ".hex"
|
|
||||||
elif machine_type == "bq_witbox":
|
|
||||||
return "MarlinWitbox.hex"
|
|
||||||
elif machine_type == "ultimaker2_go":
|
|
||||||
return "MarlinUltimaker2go.hex"
|
|
||||||
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:
|
else:
|
||||||
Logger.log("e", "I don't know of any firmware for machine %s.", machine_type)
|
baudrate = 250000
|
||||||
raise FileNotFoundError()
|
|
||||||
|
# NOTE: The keyword used here is the id of the machine. You can find the id of your machine in the *.json file, eg.
|
||||||
|
# https://github.com/Ultimaker/Cura/blob/master/resources/machines/ultimaker_original.json#L2
|
||||||
|
# The *.hex files are stored at a seperate repository:
|
||||||
|
# https://github.com/Ultimaker/cura-binary-data/tree/master/cura/resources/firmware
|
||||||
|
machine_without_extras = {"bq_witbox" : "MarlinWitbox.hex",
|
||||||
|
"ultimaker_original" : "MarlinUltimaker-{baudrate}.hex",
|
||||||
|
"ultimaker_original_plus" : "MarlinUltimaker-UMOP-{baudrate}.hex",
|
||||||
|
"ultimaker2" : "MarlinUltimaker2.hex",
|
||||||
|
"ultimaker2_go" : "MarlinUltimaker2go.hex",
|
||||||
|
"ultimaker2plus" : "MarlinUltimaker2plus.hex",
|
||||||
|
"ultimaker2_extended" : "MarlinUltimaker2extended.hex",
|
||||||
|
"ultimaker2_extended_plus" : "MarlinUltimaker2extended-plus.hex",
|
||||||
|
}
|
||||||
|
machine_with_heated_bed = {"ultimaker_original" : "MarlinUltimaker-HBK-{baudrate}.hex",
|
||||||
|
}
|
||||||
|
|
||||||
##TODO: Add check for multiple extruders
|
##TODO: Add check for multiple extruders
|
||||||
|
hex_file = None
|
||||||
|
if machine_type in machine_without_extras.keys(): # The machine needs to be defined here!
|
||||||
|
if machine_type in machine_with_heated_bed.keys() and machine_instance.getMachineSettingValue("machine_heated_bed"):
|
||||||
|
Logger.log("d", "Choosing firmware with heated bed enabled for machine %s.", machine_type)
|
||||||
|
hex_file = machine_with_heated_bed[machine_type] # Return firmware with heated bed enabled
|
||||||
|
else:
|
||||||
|
Logger.log("d", "Choosing basic firmware for machine %s.", machine_type)
|
||||||
|
hex_file = machine_without_extras[machine_type] # Return "basic" firmware
|
||||||
|
else:
|
||||||
|
Logger.log("e", "There is no firmware for machine %s.", machine_type)
|
||||||
|
|
||||||
|
if hex_file:
|
||||||
|
return hex_file.format(baudrate=baudrate)
|
||||||
|
else:
|
||||||
|
Logger.log("e", "Could not find any firmware for machine %s.", machine_type)
|
||||||
|
raise FileNotFoundError()
|
||||||
|
|
||||||
def _addRemovePorts(self, serial_ports):
|
def _addRemovePorts(self, serial_ports):
|
||||||
# First, find and add all new or changed keys
|
# First, find and add all new or changed keys
|
||||||
|
@ -74,9 +74,9 @@ Item{
|
|||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
id: item
|
id: item
|
||||||
text: model_data.name
|
text: model_data ? model_data.name : ""
|
||||||
checkable: true;
|
checkable: true;
|
||||||
checked: model_data.active;
|
checked: model_data ? model_data.active : false;
|
||||||
exclusiveGroup: profileSelectionMenuGroup;
|
exclusiveGroup: profileSelectionMenuGroup;
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
|
@ -295,6 +295,9 @@ QtObject {
|
|||||||
controlBorderHighlightColor: Theme.getColor("setting_control_border_highlight");
|
controlBorderHighlightColor: Theme.getColor("setting_control_border_highlight");
|
||||||
controlTextColor: Theme.getColor("setting_control_text");
|
controlTextColor: Theme.getColor("setting_control_text");
|
||||||
controlBorderWidth: Theme.getSize("default_lining").width;
|
controlBorderWidth: Theme.getSize("default_lining").width;
|
||||||
|
controlDisabledColor: Theme.getColor("setting_control_disabled");
|
||||||
|
controlDisabledTextColor: Theme.getColor("setting_control_disabled_text");
|
||||||
|
controlDisabledBorderColor: Theme.getColor("setting_control_disabled_border");
|
||||||
controlFont: Theme.getFont("default");
|
controlFont: Theme.getFont("default");
|
||||||
|
|
||||||
validationErrorColor: Theme.getColor("setting_validation_error");
|
validationErrorColor: Theme.getColor("setting_validation_error");
|
||||||
|
@ -138,6 +138,9 @@
|
|||||||
"setting_control_depth_line": [127, 127, 127, 255],
|
"setting_control_depth_line": [127, 127, 127, 255],
|
||||||
"setting_control_button": [127, 127, 127, 255],
|
"setting_control_button": [127, 127, 127, 255],
|
||||||
"setting_control_button_hover": [70, 84, 113, 255],
|
"setting_control_button_hover": [70, 84, 113, 255],
|
||||||
|
"setting_control_disabled": [245, 245, 245, 255],
|
||||||
|
"setting_control_disabled_text": [127, 127, 127, 255],
|
||||||
|
"setting_control_disabled_border": [127, 127, 127, 255],
|
||||||
"setting_unit": [127, 127, 127, 255],
|
"setting_unit": [127, 127, 127, 255],
|
||||||
"setting_validation_error": [255, 57, 14, 255],
|
"setting_validation_error": [255, 57, 14, 255],
|
||||||
"setting_validation_warning": [255, 186, 15, 255],
|
"setting_validation_warning": [255, 186, 15, 255],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user