Merge branch '15.10' of https://github.com/Ultimaker/Cura into 15.10

This commit is contained in:
Tim Kuipers 2015-10-07 09:39:40 +02:00
commit 152406cd44
11 changed files with 77 additions and 40 deletions

View File

@ -8,9 +8,16 @@ from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTex
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura") catalog = i18nCatalog("cura")
def show(type, value, tb): debug_mode = False
if not hasattr(sys, "frozen"):
traceback.print_exception(type, value, tb) def show(exception_type, value, tb):
if QCoreApplication.instance() and QCoreApplication.instance().getCommandLineOption("debug-mode", False):
debug_mode = True
traceback.print_exception(exception_type, value, tb)
if not debug_mode:
return
application = QCoreApplication.instance() application = QCoreApplication.instance()
if not application: if not application:
@ -34,7 +41,7 @@ def show(type, value, tb):
except: except:
version = "Unknown" version = "Unknown"
trace = "".join(traceback.format_exception(type, value, tb)) trace = "".join(traceback.format_exception(exception_type, value, tb))
crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}" crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}"
crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace) crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace)
@ -44,7 +51,7 @@ def show(type, value, tb):
buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog) buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog)
layout.addWidget(buttons) layout.addWidget(buttons)
buttons.addButton(catalog.i18nc("@action:button", "Open Web Page"), QDialogButtonBox.HelpRole) buttons.addButton(catalog.i18nc("@action:button", "Open Web Page"), QDialogButtonBox.HelpRole)
buttons.rejected.connect(lambda: dialog.close()) buttons.rejected.connect(dialog.close)
buttons.helpRequested.connect(lambda: webbrowser.open("http://github.com/Ultimaker/Cura/issues")) buttons.helpRequested.connect(lambda: webbrowser.open("http://github.com/Ultimaker/Cura/issues"))
dialog.exec_() dialog.exec_()

View File

@ -61,7 +61,7 @@ class CuraApplication(QtApplication):
if not hasattr(sys, "frozen"): if not hasattr(sys, "frozen"):
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
super().__init__(name = "cura", version = "15.09.85") super().__init__(name = "cura", version = "15.09.90")
self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png"))) self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
@ -125,6 +125,7 @@ class CuraApplication(QtApplication):
def addCommandLineOptions(self, parser): def addCommandLineOptions(self, parser):
super().addCommandLineOptions(parser) super().addCommandLineOptions(parser)
parser.add_argument("file", nargs="*", help="Files to load after starting the application.") parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
parser.add_argument("--debug", dest="debug-mode", action="store_true", default=False, help="Enable detailed crash reports.")
def run(self): def run(self):
self._i18n_catalog = i18nCatalog("cura"); self._i18n_catalog = i18nCatalog("cura");
@ -159,15 +160,16 @@ class CuraApplication(QtApplication):
self._physics = PlatformPhysics.PlatformPhysics(controller, self._volume) self._physics = PlatformPhysics.PlatformPhysics(controller, self._volume)
camera = Camera("3d", root) camera = Camera("3d", root)
camera.setPosition(Vector(-150, 150, 300)) camera.setPosition(Vector(0, 250, 900))
camera.setPerspective(True) camera.setPerspective(True)
camera.lookAt(Vector(0, 0, 0)) camera.lookAt(Vector(0, 0, 0))
controller.getScene().setActiveCamera("3d")
self.getController().getTool("CameraTool").setOrigin(Vector(0, 100, 0))
self._camera_animation = CameraAnimation.CameraAnimation() self._camera_animation = CameraAnimation.CameraAnimation()
self._camera_animation.setCameraTool(self.getController().getTool("CameraTool")) self._camera_animation.setCameraTool(self.getController().getTool("CameraTool"))
controller.getScene().setActiveCamera("3d")
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface...")) self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface..."))
self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml")) self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml"))
@ -251,16 +253,16 @@ class CuraApplication(QtApplication):
## Remove an object from the scene ## Remove an object from the scene
@pyqtSlot("quint64") @pyqtSlot("quint64")
def deleteObject(self, object_id): def deleteObject(self, object_id):
object = self.getController().getScene().findObject(object_id) node = self.getController().getScene().findObject(object_id)
if not object and object_id != 0: #Workaround for tool handles overlapping the selected object if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
object = Selection.getSelectedObject(0) node = Selection.getSelectedObject(0)
if object: if node:
if object.getParent(): if node.getParent():
group_node = object.getParent() group_node = node.getParent()
if not group_node.callDecoration("isGroup"): if not group_node.callDecoration("isGroup"):
op = RemoveSceneNodeOperation(object) op = RemoveSceneNodeOperation(node)
else: else:
while group_node.getParent().callDecoration("isGroup"): while group_node.getParent().callDecoration("isGroup"):
group_node = group_node.getParent() group_node = group_node.getParent()
@ -294,10 +296,15 @@ class CuraApplication(QtApplication):
@pyqtSlot("quint64") @pyqtSlot("quint64")
def centerObject(self, object_id): def centerObject(self, object_id):
node = self.getController().getScene().findObject(object_id) node = self.getController().getScene().findObject(object_id)
if node.getParent() and node.getParent().callDecoration("isGroup"):
node = node.getParent()
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
node = Selection.getSelectedObject(0) node = Selection.getSelectedObject(0)
if not node:
return
if node.getParent() and node.getParent().callDecoration("isGroup"):
node = node.getParent()
if node: if node:
op = SetTransformOperation(node, Vector()) op = SetTransformOperation(node, Vector())
op.push() op.push()

View File

@ -14,9 +14,11 @@ sys.excepthook = exceptHook
import cura.CuraApplication import cura.CuraApplication
if sys.platform == "win32" and hasattr(sys, "frozen"): if sys.platform == "win32" and hasattr(sys, "frozen"):
from UM.Resources import Resources import os
sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w") dirpath = os.path.expanduser("~/AppData/Local/cura/")
sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w") os.makedirs(dirpath, exist_ok = True)
sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w")
sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w")
app = cura.CuraApplication.CuraApplication.getInstance() app = cura.CuraApplication.CuraApplication.getInstance()
app.run() app.run()

View File

@ -335,6 +335,7 @@ class CuraEngineBackend(Backend):
if self._stored_layer_data: if self._stored_layer_data:
job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data) job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data)
job.start() job.start()
self._stored_layer_data = None
else: else:
self._layer_view_active = False self._layer_view_active = False

View File

@ -107,7 +107,7 @@ class Layer():
def build(self, offset, vertices, colors, indices): def build(self, offset, vertices, colors, indices):
result = offset result = offset
for polygon in self._polygons: for polygon in self._polygons:
if polygon._type == Polygon.InfillType or polygon._type == Polygon.SupportInfillType: if polygon._type == Polygon.InfillType:
continue continue
polygon.build(result, vertices, colors, indices) polygon.build(result, vertices, colors, indices)

View File

@ -71,10 +71,8 @@
}, },
"machine_end_gcode": { "machine_end_gcode": {
"default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" "default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning"
} },
},
"overrides": { "machine_extruder_drive_upgrade": { "default": false }
"material_bed_temperature": { "visible": false }
} }
} }

View File

@ -1,6 +1,6 @@
[general] [general]
version = 1 version = 1
name = High Quality name = Low Quality
[settings] [settings]
layer_height = 0.15 layer_height = 0.15

View File

@ -373,9 +373,7 @@ UM.MainWindow
{ {
id: viewModeButton id: viewModeButton
property bool verticalTooltip: true property bool verticalTooltip: true
property bool activity: Printer.getPlatformActivity;
enabled: viewModeButton.activity
anchors anchors
{ {
top: parent.top; top: parent.top;
@ -467,14 +465,27 @@ UM.MainWindow
{ {
//; Remove & re-add the general page as we want to use our own instead of uranium standard. //; Remove & re-add the general page as we want to use our own instead of uranium standard.
removePage(0); removePage(0);
insertPage(0, catalog.i18nc("@title:tab","General") , "" , Qt.resolvedUrl("./GeneralPage.qml")); insertPage(0, catalog.i18nc("@title:tab","General"), generalPage);
//: View preferences page title //: View preferences page title
insertPage(1, catalog.i18nc("@title:tab","View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml")); insertPage(1, catalog.i18nc("@title:tab","View"), viewPage);
//Force refresh //Force refresh
setPage(0) setPage(0)
} }
Item {
visible: false
GeneralPage
{
id: generalPage
}
ViewPage
{
id: viewPage
}
}
} }
Actions Actions

View File

@ -245,12 +245,22 @@ Rectangle {
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: UM.Theme.sizes.default_margin.width
width: UM.Theme.sizes.save_button_save_to_button.height width: UM.Theme.sizes.save_button_save_to_button.height
height: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.sizes.save_button_save_to_button.height
enabled: base.progress > 0.99 && base.activity == true
//iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName]; //iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName];
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background: Rectangle {
id: deviceSelectionIcon id: deviceSelectionIcon
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button color: {
if(!control.enabled){
return UM.Theme.colors.button;
}
else if(control.enabled && control.hovered) {
return UM.Theme.colors.load_save_button_hover
} else {
return UM.Theme.colors.load_save_button
}
}
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2; anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2;

View File

@ -14,7 +14,6 @@ Item {
width: buttons.width; width: buttons.width;
height: buttons.height height: buttons.height
property int activeY property int activeY
property bool activity: Printer.getPlatformActivity;
ColumnLayout { ColumnLayout {
id: buttons; id: buttons;
@ -34,7 +33,7 @@ Item {
checkable: true; checkable: true;
checked: model.active; checked: model.active;
enabled: base.activity enabled: UM.Selection.hasSelection;
style: UM.Theme.styles.tool_button; style: UM.Theme.styles.tool_button;
@ -43,10 +42,8 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent; anchors.fill: parent;
onClicked: { onClicked: {
if (base.activity){ parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id);
parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); base.activeY = parent.y
base.activeY = parent.y
}
} }
} }
} }

View File

@ -46,21 +46,25 @@ Item
id: checkBox id: checkBox
text: catalog.i18nc("@option:check","Extruder driver ugrades") text: catalog.i18nc("@option:check","Extruder driver ugrades")
checked: true checked: true
onClicked: UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true);
} }
CheckBox CheckBox
{ {
text: catalog.i18nc("@option:check","Heated printer bed (standard kit)") text: catalog.i18nc("@option:check","Heated printer bed (standard kit)")
y: checkBox.height * 1 y: checkBox.height * 1
onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
} }
CheckBox CheckBox
{ {
text: catalog.i18nc("@option:check","Heated printer bed (self built)") text: catalog.i18nc("@option:check","Heated printer bed (self built)")
y: checkBox.height * 2 y: checkBox.height * 2
onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
} }
CheckBox CheckBox
{ {
text: catalog.i18nc("@option:check","Dual extrusion (experimental)") text: catalog.i18nc("@option:check","Dual extrusion (experimental)")
y: checkBox.height * 3 y: checkBox.height * 3
enabled: false;
} }
} }
@ -74,4 +78,4 @@ Item
} }
ExclusiveGroup { id: printerGroup; } ExclusiveGroup { id: printerGroup; }
} }