mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Merge branch '15.10'
* 15.10: Remove full screen from menu and disable the shortcut key Properly default infill_sparse_thickness to layer_height` Changes the color of the 'C' in one iconfile moves the changelog from on-startup to the extensions menu Fix firmware update to properly report progress Use a decorator to track Z offset Remove infill_sparse_combine setting Update for BQ printers profiles Bump version Properly position groups and nodes once ungrouped
This commit is contained in:
commit
936c2f9365
13 changed files with 74 additions and 47 deletions
|
@ -44,6 +44,7 @@ from . import CameraAnimation
|
||||||
from . import PrintInformation
|
from . import PrintInformation
|
||||||
from . import CuraActions
|
from . import CuraActions
|
||||||
from . import MultiMaterialDecorator
|
from . import MultiMaterialDecorator
|
||||||
|
from . import ZOffsetDecorator
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
|
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
|
||||||
from PyQt5.QtGui import QColor, QIcon
|
from PyQt5.QtGui import QColor, QIcon
|
||||||
|
@ -349,14 +350,12 @@ class CuraApplication(QtApplication):
|
||||||
continue #Grouped nodes don't need resetting as their parent (the group) is resetted)
|
continue #Grouped nodes don't need resetting as their parent (the group) is resetted)
|
||||||
|
|
||||||
nodes.append(node)
|
nodes.append(node)
|
||||||
|
|
||||||
if nodes:
|
if nodes:
|
||||||
op = GroupedOperation()
|
op = GroupedOperation()
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
# Ensure that the object is above the build platform
|
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
||||||
move_distance = node.getBoundingBox().center.y
|
op.addOperation(SetTransformOperation(node, Vector(0,0,0)))
|
||||||
if move_distance <= 0:
|
|
||||||
move_distance = -node.getBoundingBox().bottom
|
|
||||||
op.addOperation(SetTransformOperation(node, Vector(0,move_distance,0)))
|
|
||||||
|
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
|
@ -378,10 +377,8 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
# Ensure that the object is above the build platform
|
# Ensure that the object is above the build platform
|
||||||
move_distance = node.getBoundingBox().center.y
|
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
||||||
if move_distance <= 0:
|
op.addOperation(SetTransformOperation(node, Vector(0,0,0), Quaternion(), Vector(1, 1, 1)))
|
||||||
move_distance = -node.getBoundingBox().bottom
|
|
||||||
op.addOperation(SetTransformOperation(node, Vector(0,move_distance,0), Quaternion(), Vector(1, 1, 1)))
|
|
||||||
|
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
|
@ -478,17 +475,20 @@ class CuraApplication(QtApplication):
|
||||||
group_decorator = GroupDecorator()
|
group_decorator = GroupDecorator()
|
||||||
group_node.addDecorator(group_decorator)
|
group_node.addDecorator(group_decorator)
|
||||||
group_node.setParent(self.getController().getScene().getRoot())
|
group_node.setParent(self.getController().getScene().getRoot())
|
||||||
|
center = Selection.getSelectionCenter()
|
||||||
|
group_node.setPosition(center)
|
||||||
|
group_node.setCenterPosition(center)
|
||||||
|
|
||||||
for node in Selection.getAllSelectedObjects():
|
for node in Selection.getAllSelectedObjects():
|
||||||
|
world = node.getWorldPosition()
|
||||||
node.setParent(group_node)
|
node.setParent(group_node)
|
||||||
group_node.setCenterPosition(group_node.getBoundingBox().center)
|
node.setPosition(world - center)
|
||||||
#group_node.translate(Vector(0,group_node.getBoundingBox().center.y,0))
|
|
||||||
group_node.translate(group_node.getBoundingBox().center)
|
|
||||||
for node in group_node.getChildren():
|
for node in group_node.getChildren():
|
||||||
Selection.remove(node)
|
Selection.remove(node)
|
||||||
|
|
||||||
Selection.add(group_node)
|
Selection.add(group_node)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def ungroupSelected(self):
|
def ungroupSelected(self):
|
||||||
ungrouped_nodes = []
|
ungrouped_nodes = []
|
||||||
|
@ -499,12 +499,11 @@ class CuraApplication(QtApplication):
|
||||||
for child in node.getChildren():
|
for child in node.getChildren():
|
||||||
if type(child) is SceneNode:
|
if type(child) is SceneNode:
|
||||||
children_to_move.append(child)
|
children_to_move.append(child)
|
||||||
|
|
||||||
for child in children_to_move:
|
for child in children_to_move:
|
||||||
|
position = child.getWorldPosition()
|
||||||
child.setParent(node.getParent())
|
child.setParent(node.getParent())
|
||||||
print(node.getPosition())
|
child.setPosition(position - node.getParent().getWorldPosition())
|
||||||
child.translate(node.getPosition())
|
|
||||||
child.setPosition(child.getPosition().scale(node.getScale()))
|
|
||||||
child.scale(node.getScale())
|
child.scale(node.getScale())
|
||||||
child.rotate(node.getOrientation())
|
child.rotate(node.getOrientation())
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ from cura.ConvexHullDecorator import ConvexHullDecorator
|
||||||
|
|
||||||
from . import PlatformPhysicsOperation
|
from . import PlatformPhysicsOperation
|
||||||
from . import ConvexHullJob
|
from . import ConvexHullJob
|
||||||
|
from . import ZOffsetDecorator
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
@ -69,8 +70,12 @@ class PlatformPhysics:
|
||||||
# Move it downwards if bottom is above platform
|
# Move it downwards if bottom is above platform
|
||||||
move_vector = Vector()
|
move_vector = Vector()
|
||||||
if not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down
|
if not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down
|
||||||
|
z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0
|
||||||
if bbox.bottom > 0:
|
if bbox.bottom > 0:
|
||||||
move_vector.setY(-bbox.bottom)
|
move_vector.setY(-bbox.bottom + z_offset)
|
||||||
|
elif bbox.bottom < z_offset:
|
||||||
|
move_vector.setY((-bbox.bottom) - z_offset)
|
||||||
|
|
||||||
#if not Float.fuzzyCompare(bbox.bottom, 0.0):
|
#if not Float.fuzzyCompare(bbox.bottom, 0.0):
|
||||||
# pass#move_vector.setY(-bbox.bottom)
|
# pass#move_vector.setY(-bbox.bottom)
|
||||||
|
|
||||||
|
@ -149,5 +154,16 @@ class PlatformPhysics:
|
||||||
self._enabled = False
|
self._enabled = False
|
||||||
|
|
||||||
def _onToolOperationStopped(self, tool):
|
def _onToolOperationStopped(self, tool):
|
||||||
|
if tool.getPluginId() == "TranslateTool":
|
||||||
|
for node in Selection.getAllSelectedObjects():
|
||||||
|
if node.getBoundingBox().bottom < 0:
|
||||||
|
if not node.getDecorator(ZOffsetDecorator.ZOffsetDecorator):
|
||||||
|
node.addDecorator(ZOffsetDecorator.ZOffsetDecorator())
|
||||||
|
|
||||||
|
node.callDecoration("setZOffset", node.getBoundingBox().bottom)
|
||||||
|
else:
|
||||||
|
if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator):
|
||||||
|
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
||||||
|
|
||||||
self._enabled = True
|
self._enabled = True
|
||||||
self._onChangeTimerFinished()
|
self._onChangeTimerFinished()
|
||||||
|
|
13
cura/ZOffsetDecorator.py
Normal file
13
cura/ZOffsetDecorator.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
||||||
|
|
||||||
|
## A decorator that stores the amount an object has been moved below the platform.
|
||||||
|
class ZOffsetDecorator(SceneNodeDecorator):
|
||||||
|
def __init__(self):
|
||||||
|
self._z_offset = 0
|
||||||
|
|
||||||
|
def setZOffset(self, offset):
|
||||||
|
print("setZOffset", offset)
|
||||||
|
self._z_offset = offset
|
||||||
|
|
||||||
|
def getZOffset(self):
|
||||||
|
return self._z_offset
|
|
@ -31,6 +31,7 @@ class ChangeLog(Extension, QObject,):
|
||||||
self._change_logs = None
|
self._change_logs = None
|
||||||
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
||||||
Preferences.getInstance().addPreference("general/latest_version_changelog_shown", "15.05.90") #First version of CURA with uranium
|
Preferences.getInstance().addPreference("general/latest_version_changelog_shown", "15.05.90") #First version of CURA with uranium
|
||||||
|
self.addMenuItem(catalog.i18nc("@item:inmenu", "Show Changelog"), self.showChangelog)
|
||||||
#self.showChangelog()
|
#self.showChangelog()
|
||||||
|
|
||||||
def getChangeLogs(self):
|
def getChangeLogs(self):
|
||||||
|
@ -77,8 +78,8 @@ class ChangeLog(Extension, QObject,):
|
||||||
def _onEngineCreated(self):
|
def _onEngineCreated(self):
|
||||||
if not self._version:
|
if not self._version:
|
||||||
return #We're on dev branch.
|
return #We're on dev branch.
|
||||||
if self._version > Preferences.getInstance().getValue("general/latest_version_changelog_shown"):
|
#if self._version > Preferences.getInstance().getValue("general/latest_version_changelog_shown"):
|
||||||
self.showChangelog()
|
#self.showChangelog()
|
||||||
|
|
||||||
def showChangelog(self):
|
def showChangelog(self):
|
||||||
if not self._changelog_window:
|
if not self._changelog_window:
|
||||||
|
|
|
@ -9,7 +9,7 @@ catalog = i18nCatalog("cura")
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
return {
|
return {
|
||||||
"plugin": {
|
"plugin": {
|
||||||
"name": catalog.i18nc("@label", "Change Log"),
|
"name": catalog.i18nc("@label", "Changelog"),
|
||||||
"author": "Ultimaker",
|
"author": "Ultimaker",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"),
|
"description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"),
|
||||||
|
|
|
@ -123,6 +123,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
|
||||||
progressChanged = pyqtSignal()
|
progressChanged = pyqtSignal()
|
||||||
extruderTemperatureChanged = pyqtSignal()
|
extruderTemperatureChanged = pyqtSignal()
|
||||||
bedTemperatureChanged = pyqtSignal()
|
bedTemperatureChanged = pyqtSignal()
|
||||||
|
firmwareUpdateComplete = pyqtSignal()
|
||||||
|
|
||||||
endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"])
|
endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"])
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,15 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
|
||||||
addConnectionSignal = Signal()
|
addConnectionSignal = Signal()
|
||||||
printerConnectionStateChanged = pyqtSignal()
|
printerConnectionStateChanged = pyqtSignal()
|
||||||
|
|
||||||
|
progressChanged = pyqtSignal()
|
||||||
|
@pyqtProperty(float, notify = progressChanged)
|
||||||
|
def progress(self):
|
||||||
|
progress = 0
|
||||||
|
for name, connection in self._printer_connections.items():
|
||||||
|
progress += connection.progress
|
||||||
|
|
||||||
|
return progress / len(self._printer_connections)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self._check_updates = True
|
self._check_updates = True
|
||||||
self._update_thread.start()
|
self._update_thread.start()
|
||||||
|
@ -91,6 +100,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
|
||||||
try:
|
try:
|
||||||
self._printer_connections[printer_connection].updateFirmware(Resources.getPath(CuraApplication.ResourceTypes.Firmware, self._getDefaultFirmwareName()))
|
self._printer_connections[printer_connection].updateFirmware(Resources.getPath(CuraApplication.ResourceTypes.Firmware, self._getDefaultFirmwareName()))
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
Logger.log("w", "No firmware found for printer %s", printer_connection)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
|
@ -154,6 +164,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
|
||||||
connection = PrinterConnection.PrinterConnection(serial_port)
|
connection = PrinterConnection.PrinterConnection(serial_port)
|
||||||
connection.connect()
|
connection.connect()
|
||||||
connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
||||||
|
connection.progressChanged.connect(self.progressChanged)
|
||||||
self._printer_connections[serial_port] = connection
|
self._printer_connections[serial_port] = connection
|
||||||
|
|
||||||
def _onPrinterConnectionStateChanged(self, serial_port):
|
def _onPrinterConnectionStateChanged(self, serial_port):
|
||||||
|
@ -197,4 +208,4 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
|
||||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
|
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
|
||||||
return list(base_list)
|
return list(base_list)
|
||||||
|
|
||||||
_instance = None
|
_instance = None
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.6 KiB |
|
@ -39,7 +39,7 @@
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"bottom_thickness": { "default": 1.2, "visible": true },
|
"bottom_thickness": { "default": 1.2, "visible": true },
|
||||||
"cool_fan_full_at_height": { "default": 0.8, "visible": false },
|
"cool_fan_full_at_height": { "default": 0.8, "visible": false },
|
||||||
"speed_wall_0": { "default": 35.0, "visible": false },
|
"speed_wall_0": { "default": 30.0, "visible": false },
|
||||||
"material_diameter": { "default": 1.75 },
|
"material_diameter": { "default": 1.75 },
|
||||||
"layer_height_0": { "default": 0.2, "visible": true },
|
"layer_height_0": { "default": 0.2, "visible": true },
|
||||||
"speed_layer_0": { "default": 35.0, "visible": true },
|
"speed_layer_0": { "default": 35.0, "visible": true },
|
||||||
|
@ -53,8 +53,8 @@
|
||||||
"retraction_speed": { "default": 45.0, "visible": false },
|
"retraction_speed": { "default": 45.0, "visible": false },
|
||||||
"skirt_gap": { "default": 7.0 },
|
"skirt_gap": { "default": 7.0 },
|
||||||
"skirt_line_count": { "default": 4 },
|
"skirt_line_count": { "default": 4 },
|
||||||
"speed_infill": { "default": 50.0, "visible": true },
|
"speed_infill": { "default": 60.0, "visible": true },
|
||||||
"material_print_temperature": { "default": 220.0, "visible": true },
|
"material_print_temperature": { "default": 210.0, "visible": true },
|
||||||
"speed_topbottom": { "default": 35.0, "visible": false },
|
"speed_topbottom": { "default": 35.0, "visible": false },
|
||||||
"top_thickness": { "default": 1.2, "visible": false },
|
"top_thickness": { "default": 1.2, "visible": false },
|
||||||
"top_layers": { "default": 6, "visible": false },
|
"top_layers": { "default": 6, "visible": false },
|
||||||
|
@ -66,6 +66,6 @@
|
||||||
"support_enable": { "default": false },
|
"support_enable": { "default": false },
|
||||||
"speed_print": { "default": 50.0 },
|
"speed_print": { "default": 50.0 },
|
||||||
"skirt_speed": { "default": 35.0, "visible": false },
|
"skirt_speed": { "default": 35.0, "visible": false },
|
||||||
"skirt_minimal_length": { "default": 300.0, "visible": false }
|
"skirt_minimal_length": { "default": 30.0, "visible": false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"bottom_thickness": { "default": 1.2, "visible": true },
|
"bottom_thickness": { "default": 1.2, "visible": true },
|
||||||
"cool_fan_full_at_height": { "default": 0.8, "visible": false },
|
"cool_fan_full_at_height": { "default": 0.8, "visible": false },
|
||||||
"speed_wall_0": { "default": 35.0, "visible": false },
|
"speed_wall_0": { "default": 30.0, "visible": false },
|
||||||
"material_diameter": { "default": 1.75 },
|
"material_diameter": { "default": 1.75 },
|
||||||
"layer_height_0": { "default": 0.2, "visible": true },
|
"layer_height_0": { "default": 0.2, "visible": true },
|
||||||
"speed_layer_0": { "default": 35.0, "visible": true },
|
"speed_layer_0": { "default": 35.0, "visible": true },
|
||||||
|
@ -53,8 +53,8 @@
|
||||||
"retraction_speed": { "default": 45.0, "visible": false },
|
"retraction_speed": { "default": 45.0, "visible": false },
|
||||||
"skirt_gap": { "default": 7.0 },
|
"skirt_gap": { "default": 7.0 },
|
||||||
"skirt_line_count": { "default": 4 },
|
"skirt_line_count": { "default": 4 },
|
||||||
"speed_infill": { "default": 50.0, "visible": true },
|
"speed_infill": { "default": 60.0, "visible": true },
|
||||||
"material_print_temperature": { "default": 220.0, "visible": true },
|
"material_print_temperature": { "default": 210.0, "visible": true },
|
||||||
"speed_topbottom": { "default": 35.0, "visible": false },
|
"speed_topbottom": { "default": 35.0, "visible": false },
|
||||||
"top_thickness": { "default": 1.2, "visible": false },
|
"top_thickness": { "default": 1.2, "visible": false },
|
||||||
"top_layers": { "default": 6, "visible": false },
|
"top_layers": { "default": 6, "visible": false },
|
||||||
|
@ -66,6 +66,6 @@
|
||||||
"support_enable": { "default": false },
|
"support_enable": { "default": false },
|
||||||
"speed_print": { "default": 50.0 },
|
"speed_print": { "default": 50.0 },
|
||||||
"skirt_speed": { "default": 35.0, "visible": false },
|
"skirt_speed": { "default": 35.0, "visible": false },
|
||||||
"skirt_minimal_length": { "default": 300.0, "visible": false }
|
"skirt_minimal_length": { "default": 30.0, "visible": false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -497,16 +497,7 @@
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"default": 0.1,
|
"default": 0.1,
|
||||||
"visible": false,
|
"visible": false,
|
||||||
"children": {
|
"inherit_function": "layer_height"
|
||||||
"infill_sparse_combine": {
|
|
||||||
"label": "Infill Layers",
|
|
||||||
"description": "Amount of layers that are combined together to form sparse infill.",
|
|
||||||
"type": "int",
|
|
||||||
"default": 1,
|
|
||||||
"visible": false,
|
|
||||||
"inherit_function": "math.floor(( parent_value + 0.001) / layer_height)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"infill_before_walls": {
|
"infill_before_walls": {
|
||||||
"label": "Infill Before Walls",
|
"label": "Infill Before Walls",
|
||||||
|
|
|
@ -47,7 +47,6 @@ Item
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id:toggleFullScreenAction
|
id:toggleFullScreenAction
|
||||||
shortcut: StandardKey.FullScreen;
|
|
||||||
text: catalog.i18nc("@action:inmenu","Toggle Fu&ll Screen");
|
text: catalog.i18nc("@action:inmenu","Toggle Fu&ll Screen");
|
||||||
iconName: "view-fullscreen";
|
iconName: "view-fullscreen";
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,10 +152,6 @@ UM.MainWindow
|
||||||
onObjectRemoved: top_view_menu.removeItem(object)
|
onObjectRemoved: top_view_menu.removeItem(object)
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: view_menu_top_group; }
|
ExclusiveGroup { id: view_menu_top_group; }
|
||||||
|
|
||||||
MenuSeparator { }
|
|
||||||
|
|
||||||
MenuItem { action: actions.toggleFullScreen; }
|
|
||||||
}
|
}
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue