mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 14:35:56 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
915ab8f897
@ -187,9 +187,11 @@ class ThreeMFReader(MeshReader):
|
|||||||
build_item_node = self._createNodeFromObject(object, self._base_name + "_" + str(id))
|
build_item_node = self._createNodeFromObject(object, self._base_name + "_" + str(id))
|
||||||
|
|
||||||
# compensate for original center position, if object(s) is/are not around its zero position
|
# compensate for original center position, if object(s) is/are not around its zero position
|
||||||
extents = build_item_node.getMeshData().getExtents()
|
|
||||||
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
|
|
||||||
transform_matrix = Matrix()
|
transform_matrix = Matrix()
|
||||||
|
mesh_data = build_item_node.getMeshData()
|
||||||
|
if mesh_data is not None:
|
||||||
|
extents = mesh_data.getExtents()
|
||||||
|
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
|
||||||
transform_matrix.setByTranslation(center_vector)
|
transform_matrix.setByTranslation(center_vector)
|
||||||
|
|
||||||
# offset with transform from 3mf
|
# offset with transform from 3mf
|
||||||
|
@ -17,41 +17,60 @@ class OSXRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
|
|||||||
drives = {}
|
drives = {}
|
||||||
p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout = subprocess.PIPE)
|
p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout = subprocess.PIPE)
|
||||||
plist = plistlib.loads(p.communicate()[0])
|
plist = plistlib.loads(p.communicate()[0])
|
||||||
p.wait()
|
|
||||||
|
|
||||||
for entry in plist:
|
result = self._recursiveSearch(plist, "removable_media")
|
||||||
if "_items" in entry:
|
|
||||||
for item in entry["_items"]:
|
|
||||||
for dev in item["_items"]:
|
|
||||||
if "removable_media" in dev and dev["removable_media"] == "yes" and "volumes" in dev and len(dev["volumes"]) > 0:
|
|
||||||
for vol in dev["volumes"]:
|
|
||||||
if "mount_point" in vol:
|
|
||||||
volume = vol["mount_point"]
|
|
||||||
drives[volume] = os.path.basename(volume)
|
|
||||||
|
|
||||||
p = subprocess.Popen(["system_profiler", "SPCardReaderDataType", "-xml"], stdout=subprocess.PIPE)
|
p = subprocess.Popen(["system_profiler", "SPCardReaderDataType", "-xml"], stdout=subprocess.PIPE)
|
||||||
plist = plistlib.loads(p.communicate()[0])
|
plist = plistlib.loads(p.communicate()[0])
|
||||||
p.wait()
|
|
||||||
|
|
||||||
for entry in plist:
|
result.extend(self._recursiveSearch(plist, "removable_media"))
|
||||||
if "_items" in entry:
|
|
||||||
for item in entry["_items"]:
|
for drive in result:
|
||||||
for dev in item["_items"]:
|
# Ignore everything not explicitly marked as removable
|
||||||
if "removable_media" in dev and dev["removable_media"] == "yes" and "volumes" in dev and len(dev["volumes"]) > 0:
|
if drive["removable_media"] != "yes":
|
||||||
for vol in dev["volumes"]:
|
continue
|
||||||
if "mount_point" in vol:
|
|
||||||
volume = vol["mount_point"]
|
# Ignore any removable device that does not have an actual volume
|
||||||
drives[volume] = os.path.basename(volume)
|
if "volumes" not in drive or not drive["volumes"]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
for volume in drive["volumes"]:
|
||||||
|
if not "mount_point" in volume:
|
||||||
|
continue
|
||||||
|
|
||||||
|
mount_point = volume["mount_point"]
|
||||||
|
|
||||||
|
if "_name" in volume:
|
||||||
|
drive_name = volume["_name"]
|
||||||
|
else:
|
||||||
|
drive_name = os.path.basename(mount_point)
|
||||||
|
|
||||||
|
drives[mount_point] = drive_name
|
||||||
|
|
||||||
return drives
|
return drives
|
||||||
|
|
||||||
def performEjectDevice(self, device):
|
def performEjectDevice(self, device):
|
||||||
p = subprocess.Popen(["diskutil", "eject", device.getId()], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
p = subprocess.Popen(["diskutil", "eject", device.getId()], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
||||||
output = p.communicate()
|
output = p.communicate()
|
||||||
Logger.log("d", "umount returned: %s.", repr(output))
|
|
||||||
|
|
||||||
return_code = p.wait()
|
return_code = p.wait()
|
||||||
if return_code != 0:
|
if return_code != 0:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Recursively search for key in a plist parsed by plistlib
|
||||||
|
def _recursiveSearch(self, plist, key):
|
||||||
|
result = []
|
||||||
|
for entry in plist:
|
||||||
|
if key in entry:
|
||||||
|
result.append(entry)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if "_items" in entry:
|
||||||
|
result.extend(self._recursiveSearch(entry["_items"], key))
|
||||||
|
|
||||||
|
if "Media" in entry:
|
||||||
|
result.extend(self._recursiveSearch(entry["Media"], key))
|
||||||
|
|
||||||
|
return result
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
import configparser #To get version numbers from config files.
|
import configparser #To get version numbers from config files.
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import io
|
import io
|
||||||
|
|
||||||
@ -19,6 +20,12 @@ class VersionUpgrade22to24(VersionUpgrade):
|
|||||||
config = configparser.ConfigParser(interpolation = None)
|
config = configparser.ConfigParser(interpolation = None)
|
||||||
config.read_string(serialised) # Read the input string as config file.
|
config.read_string(serialised) # Read the input string as config file.
|
||||||
config.set("general", "version", "3")
|
config.set("general", "version", "3")
|
||||||
|
|
||||||
|
container_list = []
|
||||||
|
if config.has_section("containers"):
|
||||||
|
for index, container_id in config.items("containers"):
|
||||||
|
container_list.append(container_id)
|
||||||
|
elif config.has_option("general", "containers"):
|
||||||
containers = config.get("general", "containers")
|
containers = config.get("general", "containers")
|
||||||
container_list = containers.split(",")
|
container_list = containers.split(",")
|
||||||
|
|
||||||
@ -45,7 +52,13 @@ class VersionUpgrade22to24(VersionUpgrade):
|
|||||||
|
|
||||||
container_list = new_container_list
|
container_list = new_container_list
|
||||||
|
|
||||||
config.set("general", "containers", ",".join(container_list))
|
if not config.has_section("containers"):
|
||||||
|
config.add_section("containers")
|
||||||
|
|
||||||
|
config.remove_option("general", "containers")
|
||||||
|
|
||||||
|
for index in range(len(container_list)):
|
||||||
|
config.set("containers", index, container_list[index])
|
||||||
|
|
||||||
output = io.StringIO()
|
output = io.StringIO()
|
||||||
config.write(output)
|
config.write(output)
|
||||||
|
@ -106,6 +106,8 @@
|
|||||||
"line_width": { "value": "machine_nozzle_size * 0.875" },
|
"line_width": { "value": "machine_nozzle_size * 0.875" },
|
||||||
"machine_min_cool_heat_time_window": { "value": "15" },
|
"machine_min_cool_heat_time_window": { "value": "15" },
|
||||||
"default_material_print_temperature": { "value": "200" },
|
"default_material_print_temperature": { "value": "200" },
|
||||||
|
"material_bed_temperature": { "maximum_value": "115" },
|
||||||
|
"material_bed_temperature_layer_0": { "maximum_value": "115" },
|
||||||
"material_standby_temperature": { "value": "100" },
|
"material_standby_temperature": { "value": "100" },
|
||||||
"multiple_mesh_overlap": { "value": "0" },
|
"multiple_mesh_overlap": { "value": "0" },
|
||||||
"prime_tower_enable": { "value": "True" },
|
"prime_tower_enable": { "value": "True" },
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "ultimaker_original_dual_1st",
|
"id": "ultimaker_original_dual_1st",
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"name": "1st Extruder",
|
"name": "Extruder 1",
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker_original_dual",
|
"machine": "ultimaker_original_dual",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "ultimaker_original_dual_2nd",
|
"id": "ultimaker_original_dual_2nd",
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"name": "2nd Extruder",
|
"name": "Extruder 2",
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker_original_dual",
|
"machine": "ultimaker_original_dual",
|
||||||
|
@ -84,7 +84,7 @@ Item
|
|||||||
|
|
||||||
onTextChanged:
|
onTextChanged:
|
||||||
{
|
{
|
||||||
definitionsModel.filter = {"label": "*" + text};
|
definitionsModel.filter = {"i18n_label": "*" + text};
|
||||||
findingSettings = (text.length > 0);
|
findingSettings = (text.length > 0);
|
||||||
if(findingSettings != lastFindingSettings)
|
if(findingSettings != lastFindingSettings)
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,7 @@ Rectangle
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: control.hovered ? UM.Theme.getColor("button_hover") :
|
color: control.hovered ? UM.Theme.getColor("button_hover") :
|
||||||
control.pressed ? UM.Theme.getColor("button_hover") : UM.Theme.getColor("sidebar_header_bar")
|
control.pressed ? UM.Theme.getColor("button_hover") : UM.Theme.getColor("sidebar_header_bar")
|
||||||
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
UM.RecolorImage {
|
UM.RecolorImage {
|
||||||
id: downArrow
|
id: downArrow
|
||||||
|
Loading…
x
Reference in New Issue
Block a user