mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Merge branch 'PurgeLines' of https://github.com/GregValiant/Cura into PurgeLines
This commit is contained in:
commit
a2214f0e73
132 changed files with 2676 additions and 237 deletions
|
@ -214,7 +214,7 @@ Item
|
|||
|
||||
settingStoreIndex: propertyStoreIndex
|
||||
|
||||
labelText: catalog.i18nc("@label", "Y min")
|
||||
labelText: catalog.i18nc("@label", "Y min ( '-' towards back)")
|
||||
labelFont: base.labelFont
|
||||
labelWidth: base.labelWidth
|
||||
controlWidth: base.controlWidth
|
||||
|
@ -254,7 +254,7 @@ Item
|
|||
settingKey: "machine_head_with_fans_polygon"
|
||||
settingStoreIndex: propertyStoreIndex
|
||||
|
||||
labelText: catalog.i18nc("@label", "Y max")
|
||||
labelText: catalog.i18nc("@label", "Y max ( '+' towards front)")
|
||||
labelFont: base.labelFont
|
||||
labelWidth: base.labelWidth
|
||||
controlWidth: base.controlWidth
|
||||
|
|
|
@ -46,6 +46,13 @@ class MakerbotWriter(MeshWriter):
|
|||
suffixes=["makerbot"]
|
||||
)
|
||||
)
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name="application/x-makerbot-replicator_plus",
|
||||
comment="Makerbot Toolpath Package",
|
||||
suffixes=["makerbot"]
|
||||
)
|
||||
)
|
||||
|
||||
_PNG_FORMAT = [
|
||||
{"prefix": "isometric_thumbnail", "width": 120, "height": 120},
|
||||
|
@ -114,6 +121,8 @@ class MakerbotWriter(MeshWriter):
|
|||
filename, filedata = "print.gcode", gcode_text_io.getvalue()
|
||||
case "application/x-makerbot":
|
||||
filename, filedata = "print.jsontoolpath", du.gcode_2_miracle_jtp(gcode_text_io.getvalue())
|
||||
case "application/x-makerbot-replicator_plus":
|
||||
filename, filedata = "print.jsontoolpath", du.gcode_2_miracle_jtp(gcode_text_io.getvalue(), nb_extruders=1)
|
||||
case _:
|
||||
raise Exception("Unsupported Mime type")
|
||||
|
||||
|
@ -249,11 +258,87 @@ class MakerbotWriter(MeshWriter):
|
|||
|
||||
meta["preferences"] = dict()
|
||||
bounds = application.getBuildVolume().getBoundingBox()
|
||||
intent = CuraApplication.getInstance().getIntentManager().currentIntentCategory
|
||||
meta["preferences"]["instance0"] = {
|
||||
"machineBounds": [bounds.right, bounds.front, bounds.left, bounds.back] if bounds is not None else None,
|
||||
"printMode": CuraApplication.getInstance().getIntentManager().currentIntentCategory,
|
||||
"printMode": intent
|
||||
}
|
||||
|
||||
if file_format == "application/x-makerbot":
|
||||
accel_overrides = meta["accel_overrides"] = {}
|
||||
if intent in ['highspeed', 'highspeedsolid']:
|
||||
accel_overrides['do_input_shaping'] = True
|
||||
accel_overrides['do_corner_rounding'] = True
|
||||
bead_mode_overrides = accel_overrides["bead_mode"] = {}
|
||||
|
||||
accel_enabled = global_stack.getProperty('acceleration_enabled', 'value')
|
||||
|
||||
if accel_enabled:
|
||||
global_accel_setting = global_stack.getProperty('acceleration_print', 'value')
|
||||
accel_overrides["rate_mm_per_s_sq"] = {
|
||||
"x": global_accel_setting,
|
||||
"y": global_accel_setting
|
||||
}
|
||||
|
||||
if global_stack.getProperty('acceleration_travel_enabled', 'value'):
|
||||
travel_accel_setting = global_stack.getProperty('acceleration_travel', 'value')
|
||||
bead_mode_overrides['Travel Move'] = {
|
||||
"rate_mm_per_s_sq": {
|
||||
"x": travel_accel_setting,
|
||||
"y": travel_accel_setting
|
||||
}
|
||||
}
|
||||
|
||||
jerk_enabled = global_stack.getProperty('jerk_enabled', 'value')
|
||||
if jerk_enabled:
|
||||
global_jerk_setting = global_stack.getProperty('jerk_print', 'value')
|
||||
accel_overrides["max_speed_change_mm_per_s"] = {
|
||||
"x": global_jerk_setting,
|
||||
"y": global_jerk_setting
|
||||
}
|
||||
|
||||
if global_stack.getProperty('jerk_travel_enabled', 'value'):
|
||||
travel_jerk_setting = global_stack.getProperty('jerk_travel', 'value')
|
||||
if 'Travel Move' not in bead_mode_overrides:
|
||||
bead_mode_overrides['Travel Move' ] = {}
|
||||
bead_mode_overrides['Travel Move'].update({
|
||||
"max_speed_change_mm_per_s": {
|
||||
"x": travel_jerk_setting,
|
||||
"y": travel_jerk_setting
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
# Get bead mode settings per extruder
|
||||
available_bead_modes = {
|
||||
"infill": "FILL",
|
||||
"prime_tower": "PRIME_TOWER",
|
||||
"roofing": "TOP_SURFACE",
|
||||
"support_infill": "SUPPORT",
|
||||
"support_interface": "SUPPORT_INTERFACE",
|
||||
"wall_0": "WALL_OUTER",
|
||||
"wall_x": "WALL_INNER",
|
||||
"skirt_brim": "SKIRT"
|
||||
}
|
||||
for idx, extruder in enumerate(extruders):
|
||||
for bead_mode_setting, bead_mode_tag in available_bead_modes.items():
|
||||
ext_specific_tag = "%s_%s" % (bead_mode_tag, idx)
|
||||
if accel_enabled or jerk_enabled:
|
||||
bead_mode_overrides[ext_specific_tag] = {}
|
||||
|
||||
if accel_enabled:
|
||||
accel_val = extruder.getProperty('acceleration_%s' % bead_mode_setting, 'value')
|
||||
bead_mode_overrides[ext_specific_tag]["rate_mm_per_s_sq"] = {
|
||||
"x": accel_val,
|
||||
"y": accel_val
|
||||
}
|
||||
if jerk_enabled:
|
||||
jerk_val = extruder.getProperty('jerk_%s' % bead_mode_setting, 'value')
|
||||
bead_mode_overrides[ext_specific_tag][ "max_speed_change_mm_per_s"] = {
|
||||
"x": jerk_val,
|
||||
"y": jerk_val
|
||||
}
|
||||
|
||||
meta["miracle_config"] = {"gaggles": {"instance0": {}}}
|
||||
|
||||
version_info = dict()
|
||||
|
|
|
@ -25,6 +25,12 @@ def getMetaData():
|
|||
"description": catalog.i18nc("@item:inlistbox", "Makerbot Sketch Printfile"),
|
||||
"mime_type": "application/x-makerbot-sketch",
|
||||
"mode": MakerbotWriter.MakerbotWriter.OutputMode.BinaryMode,
|
||||
},
|
||||
{
|
||||
"extension": file_extension,
|
||||
"description": catalog.i18nc("@item:inlistbox", "Makerbot Replicator+ Printfile"),
|
||||
"mime_type": "application/x-makerbot-replicator_plus",
|
||||
"mode": MakerbotWriter.MakerbotWriter.OutputMode.BinaryMode,
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -331,7 +331,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
|||
return False
|
||||
|
||||
[printer, *_] = self._printers
|
||||
return printer.type in ("MakerBot Method X", "MakerBot Method XL", "MakerBot Sketch")
|
||||
return printer.type in ("MakerBot Method", "MakerBot Method X", "MakerBot Method XL", "MakerBot Sketch", "MakerBot Sketch Large", "MakerBot Sketch Sprint")
|
||||
|
||||
@pyqtProperty(bool, notify=_cloudClusterPrintersChanged)
|
||||
def supportsPrintJobActions(self) -> bool:
|
||||
|
|
|
@ -3,5 +3,7 @@
|
|||
"ultimaker_methodx": "MakerBot Method X",
|
||||
"ultimaker_methodxl": "MakerBot Method XL",
|
||||
"ultimaker_factor4": "Ultimaker Factor 4",
|
||||
"ultimaker_sketch": "MakerBot Sketch"
|
||||
"ultimaker_sketch": "MakerBot Sketch",
|
||||
"ultimaker_sketch_large": "MakerBot Sketch Large",
|
||||
"ultimaker_sketch_sprint": "MakerBot Sketch Sprint"
|
||||
}
|
||||
|
|
|
@ -97,6 +97,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
CuraApplication.getInstance().getOnExitCallbackManager().addCallback(self._checkActivePrintingUponAppExit)
|
||||
|
||||
CuraApplication.getInstance().getPreferences().addPreference("usb_printing/enabled", False)
|
||||
|
||||
# This is a callback function that checks if there is any printing in progress via USB when the application tries
|
||||
# to exit. If so, it will show a confirmation before
|
||||
def _checkActivePrintingUponAppExit(self) -> None:
|
||||
|
@ -144,6 +146,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
CuraApplication.getInstance().getController().setActiveStage("MonitorStage")
|
||||
|
||||
CuraApplication.getInstance().getPreferences().setValue("usb_printing/enabled", True)
|
||||
|
||||
#Find the g-code to print.
|
||||
gcode_textio = StringIO()
|
||||
gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter"))
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
import configparser
|
||||
import io
|
||||
from typing import Dict, Tuple, List
|
||||
|
||||
from UM.VersionUpgrade import VersionUpgrade
|
||||
|
||||
_RENAMED_SETTINGS = {
|
||||
"wall_overhang_speed_factor": "wall_overhang_speed_factors"
|
||||
} # type: Dict[str, str]
|
||||
|
||||
_NEW_SETTING_VERSION = "25"
|
||||
|
||||
|
||||
class VersionUpgrade59to510(VersionUpgrade):
|
||||
def upgradePreferences(self, serialized: str, filename: str):
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Fix 'renamed'(ish) settings for visibility
|
||||
if "visible_settings" in parser["general"]:
|
||||
all_setting_keys = parser["general"]["visible_settings"].strip().split(";")
|
||||
if all_setting_keys:
|
||||
for idx, key in enumerate(all_setting_keys):
|
||||
if key in _RENAMED_SETTINGS:
|
||||
all_setting_keys[idx] = _RENAMED_SETTINGS[key]
|
||||
parser["general"]["visible_settings"] = ";".join(all_setting_keys)
|
||||
|
||||
# Update version number.
|
||||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
||||
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update version number.
|
||||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION
|
||||
|
||||
if "values" in parser:
|
||||
for old_name, new_name in _RENAMED_SETTINGS.items():
|
||||
if old_name in parser["values"]:
|
||||
parser["values"][new_name] = parser["values"][old_name]
|
||||
del parser["values"][old_name]
|
||||
if "wall_overhang_speed_factors" in parser["values"]:
|
||||
old_value = float(parser["values"]["wall_overhang_speed_factors"])
|
||||
new_value = [max(1, int(round(old_value)))]
|
||||
parser["values"]["wall_overhang_speed_factor"] = str(new_value)
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
||||
def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update version number.
|
||||
if "metadata" not in parser:
|
||||
parser["metadata"] = {}
|
||||
|
||||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
60
plugins/VersionUpgrade/VersionUpgrade59to510/__init__.py
Normal file
60
plugins/VersionUpgrade/VersionUpgrade59to510/__init__.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
# Copyright (c) 2024 UltiMaker
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import Any, Dict, TYPE_CHECKING
|
||||
|
||||
from . import VersionUpgrade59to510
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from UM.Application import Application
|
||||
|
||||
upgrade = VersionUpgrade59to510.VersionUpgrade59to510()
|
||||
|
||||
def getMetaData() -> Dict[str, Any]:
|
||||
return {
|
||||
"version_upgrade": {
|
||||
# From To Upgrade function
|
||||
("preferences", 7000024): ("preferences", 7000025, upgrade.upgradePreferences),
|
||||
("machine_stack", 6000024): ("machine_stack", 6000025, upgrade.upgradeStack),
|
||||
("extruder_train", 6000024): ("extruder_train", 6000025, upgrade.upgradeStack),
|
||||
("definition_changes", 4000024): ("definition_changes", 4000025, upgrade.upgradeInstanceContainer),
|
||||
("quality_changes", 4000024): ("quality_changes", 4000025, upgrade.upgradeInstanceContainer),
|
||||
("quality", 4000024): ("quality", 4000025, upgrade.upgradeInstanceContainer),
|
||||
("user", 4000024): ("user", 4000025, upgrade.upgradeInstanceContainer),
|
||||
("intent", 4000024): ("intent", 4000025, upgrade.upgradeInstanceContainer),
|
||||
},
|
||||
"sources": {
|
||||
"preferences": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"."}
|
||||
},
|
||||
"machine_stack": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./machine_instances"}
|
||||
},
|
||||
"extruder_train": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./extruders"}
|
||||
},
|
||||
"definition_changes": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./definition_changes"}
|
||||
},
|
||||
"quality_changes": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./quality_changes"}
|
||||
},
|
||||
"quality": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./quality"}
|
||||
},
|
||||
"user": {
|
||||
"get_version": upgrade.getCfgVersion,
|
||||
"location": {"./user"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def register(app: "Application") -> Dict[str, Any]:
|
||||
return {"version_upgrade": upgrade}
|
8
plugins/VersionUpgrade/VersionUpgrade59to510/plugin.json
Normal file
8
plugins/VersionUpgrade/VersionUpgrade59to510/plugin.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "Version Upgrade 5.9 to 5.10",
|
||||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 5.9 to Cura 5.10",
|
||||
"api": 8,
|
||||
"i18n-catalog": "cura"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue