mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 03:04:23 +08:00
Rename to Universal Cura Project
CURA-11561
This commit is contained in:
parent
2ae9908334
commit
63c1eb8990
@ -48,13 +48,13 @@ class ThreeMFReader(MeshReader):
|
||||
)
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name="application/x-pcb",
|
||||
comment="PCB",
|
||||
suffixes=["pcb"]
|
||||
name="application/x-ucp",
|
||||
comment="UCP",
|
||||
suffixes=["ucp"]
|
||||
)
|
||||
)
|
||||
|
||||
self._supported_extensions = [".3mf", ".pcb"]
|
||||
self._supported_extensions = [".3mf", ".ucp"]
|
||||
self._root = None
|
||||
self._base_name = ""
|
||||
self._unit = None
|
||||
|
@ -113,7 +113,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._supported_extensions = [".3mf", ".pcb"]
|
||||
self._supported_extensions = [".3mf", ".ucp"]
|
||||
self._dialog = WorkspaceDialog()
|
||||
self._3mf_mesh_reader = None
|
||||
self._container_registry = ContainerRegistry.getInstance()
|
||||
@ -234,14 +234,14 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
self._resolve_strategies = {k: None for k in resolve_strategy_keys}
|
||||
containers_found_dict = {k: False for k in resolve_strategy_keys}
|
||||
|
||||
# Check whether the file is a PCB, which changes some import options
|
||||
is_pcb = file_name.endswith('.pcb')
|
||||
# Check whether the file is a UCP, which changes some import options
|
||||
is_ucp = file_name.endswith('.ucp')
|
||||
|
||||
#
|
||||
# Read definition containers
|
||||
#
|
||||
machine_definition_id = None
|
||||
updatable_machines = None if is_pcb else []
|
||||
updatable_machines = None if is_ucp else []
|
||||
machine_definition_container_count = 0
|
||||
extruder_definition_container_count = 0
|
||||
definition_container_files = [name for name in cura_file_names if name.endswith(self._definition_container_suffix)]
|
||||
@ -608,7 +608,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
|
||||
# Load the user specifically exported settings
|
||||
self._dialog.exportedSettingModel.clear()
|
||||
if is_pcb:
|
||||
if is_ucp:
|
||||
try:
|
||||
self._user_settings = json.loads(archive.open("Cura/user-settings.json").read().decode("utf-8"))
|
||||
any_extruder_stack = ExtruderManager.getInstance().getExtruderStack(0)
|
||||
@ -625,8 +625,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
"Extruder {0}", extruder_nr + 1),
|
||||
settings)
|
||||
except KeyError as e:
|
||||
# If there is no user settings file, it's not a PCB, so notify user of failure.
|
||||
Logger.log("w", "File %s is not a valid PCB.", file_name)
|
||||
# If there is no user settings file, it's not a UCP, so notify user of failure.
|
||||
Logger.log("w", "File %s is not a valid UCP.", file_name)
|
||||
message = Message(
|
||||
i18n_catalog.i18nc("@info:error Don't translate the XML tags <filename> or <message>!",
|
||||
"Project file <filename>{0}</filename> is corrupt: <message>{1}</message>.",
|
||||
@ -656,8 +656,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
self._dialog.setVariantType(variant_type_name)
|
||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
|
||||
self._dialog.setMissingPackagesMetadata(missing_package_metadata)
|
||||
self._dialog.setHasVisibleSelectSameProfileChanged(is_pcb)
|
||||
self._dialog.setAllowCreatemachine(not is_pcb)
|
||||
self._dialog.setHasVisibleSelectSameProfileChanged(is_ucp)
|
||||
self._dialog.setAllowCreatemachine(not is_ucp)
|
||||
self._dialog.show()
|
||||
|
||||
|
||||
@ -699,7 +699,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if self._dialog.getResult() == {}:
|
||||
return WorkspaceReader.PreReadResult.cancelled
|
||||
|
||||
self._load_profile = not is_pcb or (self._dialog.selectSameProfileChecked and self._dialog.isCompatibleMachine)
|
||||
self._load_profile = not is_ucp or (self._dialog.selectSameProfileChecked and self._dialog.isCompatibleMachine)
|
||||
|
||||
self._resolve_strategies = self._dialog.getResult()
|
||||
#
|
||||
|
@ -27,8 +27,8 @@ def getMetaData() -> Dict:
|
||||
"description": catalog.i18nc("@item:inlistbox", "3MF File")
|
||||
},
|
||||
{
|
||||
"extension": "pcb",
|
||||
"description": catalog.i18nc("@item:inlistbox", "PCB File")
|
||||
"extension": "ucp",
|
||||
"description": catalog.i18nc("@item:inlistbox", "UCP File")
|
||||
}
|
||||
]
|
||||
metaData["workspace_reader"] = [
|
||||
@ -37,8 +37,8 @@ def getMetaData() -> Dict:
|
||||
"description": catalog.i18nc("@item:inlistbox", "3MF File")
|
||||
},
|
||||
{
|
||||
"extension": "pcb",
|
||||
"description": catalog.i18nc("@item:inlistbox", "PCB File")
|
||||
"extension": "ucp",
|
||||
"description": catalog.i18nc("@item:inlistbox", "UCP File")
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "3MF Reader",
|
||||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Provides support for reading 3MF and PCB files.",
|
||||
"description": "Provides support for reading 3MF and UCP files.",
|
||||
"api": 8,
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ from UM.Workspace.WorkspaceWriter import WorkspaceWriter
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
from .PCBDialog import PCBDialog
|
||||
from .UCPDialog import UCPDialog
|
||||
from .ThreeMFWriter import ThreeMFWriter
|
||||
from .SettingsExportModel import SettingsExportModel
|
||||
from .SettingsExportGroup import SettingsExportGroup
|
||||
@ -35,19 +35,19 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
|
||||
self._config_dialog = None
|
||||
|
||||
def _preWrite(self):
|
||||
is_pcb = False
|
||||
is_ucp = False
|
||||
if hasattr(self._stream, 'name'):
|
||||
# This only works with local file, but we don't want remote PCB files yet
|
||||
is_pcb = self._stream.name.endswith('.pcb')
|
||||
# This only works with local file, but we don't want remote UCP files yet
|
||||
is_ucp = self._stream.name.endswith('.ucp')
|
||||
|
||||
if is_pcb:
|
||||
self._config_dialog = PCBDialog()
|
||||
self._config_dialog.finished.connect(self._onPCBConfigFinished)
|
||||
if is_ucp:
|
||||
self._config_dialog = UCPDialog()
|
||||
self._config_dialog.finished.connect(self._onUCPConfigFinished)
|
||||
self._config_dialog.show()
|
||||
else:
|
||||
self._doWrite()
|
||||
|
||||
def _onPCBConfigFinished(self, accepted: bool):
|
||||
def _onUCPConfigFinished(self, accepted: bool):
|
||||
if accepted:
|
||||
self._export_model = self._config_dialog.getModel()
|
||||
self._doWrite()
|
||||
|
@ -14,14 +14,14 @@ from .SettingsExportModel import SettingsExportModel
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
class PCBDialog(QObject):
|
||||
class UCPDialog(QObject):
|
||||
finished = pyqtSignal(bool)
|
||||
|
||||
def __init__(self, parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
plugin_path = os.path.dirname(__file__)
|
||||
dialog_path = os.path.join(plugin_path, 'PCBDialog.qml')
|
||||
dialog_path = os.path.join(plugin_path, 'UCPDialog.qml')
|
||||
self._model = SettingsExportModel()
|
||||
self._view = CuraApplication.getInstance().createQmlComponent(dialog_path,
|
||||
{"manager": self,
|
@ -12,7 +12,7 @@ import Cura 1.1 as Cura
|
||||
UM.Dialog
|
||||
{
|
||||
id: exportDialog
|
||||
title: catalog.i18nc("@title:window", "Export pre-configured build batch")
|
||||
title: catalog.i18nc("@title:window", "Export Universal Cura Project")
|
||||
|
||||
margin: UM.Theme.getSize("default_margin").width
|
||||
minimumWidth: UM.Theme.getSize("modal_window_minimum").width
|
||||
@ -39,14 +39,14 @@ UM.Dialog
|
||||
UM.Label
|
||||
{
|
||||
id: titleLabel
|
||||
text: catalog.i18nc("@action:title", "Summary - Pre-configured build batch")
|
||||
text: catalog.i18nc("@action:title", "Summary - Universal Cura Project")
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: descriptionLabel
|
||||
text: catalog.i18nc("@action:description", "When exporting a build batch, all the models present on the build plate will be included with their current position, orientation and scale. You can also select which per-extruder or per-model settings should be included to ensure a proper printing of the batch, even on different printers.")
|
||||
text: catalog.i18nc("@action:description", "When exporting a Universal Cura Project, all the models present on the build plate will be included with their current position, orientation and scale. You can also select which per-extruder or per-model settings should be included to ensure a proper printing of the batch, even on different printers.")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.Wrap
|
||||
Layout.maximumWidth: headerColumn.width
|
@ -34,9 +34,9 @@ def getMetaData():
|
||||
"mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode
|
||||
},
|
||||
{
|
||||
"extension": "pcb",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "PCB file"),
|
||||
"mime_type": "application/x-pcb",
|
||||
"extension": "ucp",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Universal Cura Project"),
|
||||
"mime_type": "application/x-ucp",
|
||||
"mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode
|
||||
}
|
||||
]
|
||||
@ -50,9 +50,9 @@ def getMetaData():
|
||||
"mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode
|
||||
},
|
||||
{
|
||||
"extension": "pcb",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Pre-Configured Batch file"),
|
||||
"mime_type": "application/x-pcb",
|
||||
"extension": "ucp",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Universal Cura Project"),
|
||||
"mime_type": "application/x-ucp",
|
||||
"mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode
|
||||
}
|
||||
]
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "3MF Writer",
|
||||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Provides support for writing 3MF and PCB files.",
|
||||
"description": "Provides support for writing 3MF and UCP files.",
|
||||
"api": 8,
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
@ -72,15 +72,15 @@ Cura.Menu
|
||||
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: savePCBMenu
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save PCB Project...")
|
||||
id: saveUCPMenu
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Universal Cura Project...")
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
onTriggered:
|
||||
{
|
||||
var args = { "filter_by_machine": false,
|
||||
"file_type": "workspace",
|
||||
"preferred_mimetypes": "application/x-pcb",
|
||||
"limit_mimetypes": "application/x-pcb"};
|
||||
"preferred_mimetypes": "application/x-ucp",
|
||||
"limit_mimetypes": "application/x-ucp"};
|
||||
UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user