Merge branch 'master' into feature_tree_support

This commit is contained in:
Ghostkeeper 2017-12-18 13:25:59 +01:00
commit eb1efc4928
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
31 changed files with 897 additions and 370 deletions

View file

@ -46,7 +46,7 @@
"default_value": "RepRap (Marlin/Sprinter)"
},
"machine_start_gcode": {
"default_value": "G28 ; Home extruder\nM107 ; Turn off fan\nG90 ; Absolute positioning\nM82 ; Extruder in absolute mode\nM190 S{material_bed_temperature}\nM104 T0 S{material_print_temperature}\nM109 T0 S{material_print_temperature}\nM104 T1 S{material_print_temperature}\nM109 T1 S{material_print_temperature}\nG32 S3 ; auto level\nG92 E0 ; Reset extruder position"
"default_value": "G28 ; Home extruder\nM107 ; Turn off fan\nG90 ; Absolute positioning\nM82 ; Extruder in absolute mode\nM190 S{material_bed_temperature}\nM104 T0 S{material_print_temperature}\nM109 T0 S{material_print_temperature}\nM104 T1 S{material_print_temperature}\nM109 T1 S{material_print_temperature}\n;G32 S3 ; auto level\nG92 E0 ; Reset extruder position"
},
"machine_end_gcode": {
"default_value": "M104 S0 ; turn off extruders\nM140 S0 ; heated bed heater off\nG91 ; relative positioning\nG1 E-2 F5000; retract 2mm\nG28 Z; move bed down\nG90 ; absolute positioning\nM84 ; disable motors"

View file

@ -18,6 +18,7 @@ Item
property alias redo: redoAction;
property alias homeCamera: homeCameraAction;
property alias expandSidebar: expandSidebarAction;
property alias deleteSelection: deleteSelectionAction;
property alias centerSelection: centerSelectionAction;
@ -389,4 +390,11 @@ Item
text: catalog.i18nc("@action:menu", "Installed plugins...");
iconName: "plugins_configure"
}
Action
{
id: expandSidebarAction;
text: catalog.i18nc("@action:inmenu menubar:view","Expand/Collapse Sidebar");
shortcut: "Ctrl+E";
}
}

View file

@ -34,6 +34,24 @@ UM.MainWindow
}
}
onWidthChanged:
{
// If slidebar is collapsed then it should be invisible
// otherwise after the main_window resize the sidebar will be fully re-drawn
if (sidebar.collapsed){
if (sidebar.visible == true){
sidebar.visible = false
sidebar.initialWidth = 0
}
}
else{
if (sidebar.visible == false){
sidebar.visible = true
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
}
}
}
Component.onCompleted:
{
CuraApplication.setMinimumWindowSize(UM.Theme.getSize("window_minimum_size"))
@ -369,16 +387,59 @@ UM.MainWindow
{
id: sidebar
anchors
{
top: topbar.bottom
bottom: parent.bottom
right: parent.right
property bool collapsed: false;
property var initialWidth: UM.Theme.getSize("sidebar").width;
function callExpandOrCollapse() {
if (collapsed) {
sidebar.visible = true;
sidebar.initialWidth = UM.Theme.getSize("sidebar").width;
viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0);
expandSidebarAnimation.start();
} else {
viewportRect = Qt.rect(0, 0, 1, 1.0);
collapseSidebarAnimation.start();
}
collapsed = !collapsed;
UM.Preferences.setValue("cura/sidebar_collapse", collapsed);
}
width: UM.Theme.getSize("sidebar").width
anchors
{
top: topbar.top
bottom: parent.bottom
}
width: initialWidth
x: base.width - sidebar.width
source: UM.Controller.activeStage.sidebarComponent
NumberAnimation {
id: collapseSidebarAnimation
target: sidebar
properties: "x"
to: base.width
duration: 100
}
NumberAnimation {
id: expandSidebarAnimation
target: sidebar
properties: "x"
to: base.width - sidebar.width
duration: 100
}
Component.onCompleted:
{
var sidebarCollapsed = UM.Preferences.getValue("cura/sidebar_collapse");
if (sidebarCollapsed) {
sidebar.collapsed = true;
viewportRect = Qt.rect(0, 0, 1, 1.0)
collapseSidebarAnimation.start();
}
}
}
Loader
@ -417,6 +478,13 @@ UM.MainWindow
}
}
// Expand or collapse sidebar
Connections
{
target: Cura.Actions.expandSidebar
onTriggered: sidebar.callExpandOrCollapse()
}
UM.PreferencesDialog
{
id: preferences

View file

@ -0,0 +1,71 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM
import Cura 1.0 as Cura
import "Menus"
ToolButton
{
text: Cura.MachineManager.activeMachineName
tooltip: Cura.MachineManager.activeMachineName
style: ButtonStyle
{
background: Rectangle
{
color:
{
if(control.pressed)
{
return UM.Theme.getColor("sidebar_header_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("sidebar_header_hover");
}
else
{
return UM.Theme.getColor("sidebar_header_bar");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
UM.RecolorImage
{
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.getColor("text_emphasis")
source: UM.Theme.getIcon("arrow_bottom")
}
Label
{
id: sidebarComboBoxLabel
color: UM.Theme.getColor("sidebar_header_text_active")
text: control.text;
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
anchors.right: downArrow.left;
anchors.rightMargin: control.rightMargin;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large")
}
}
label: Label {}
}
menu: PrinterMenu { }
}

View file

@ -32,4 +32,5 @@ Menu
MenuSeparator {}
MenuItem { action: Cura.Actions.homeCamera; }
MenuItem { action: Cura.Actions.expandSidebar; }
}

View file

@ -1171,4 +1171,4 @@ Column
}
}
}
}
}

View file

@ -12,11 +12,9 @@ Item {
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property real progress: UM.Backend.progress;
property int backendState: UM.Backend.state;
property var backend: CuraApplication.getBackend();
property bool activity: CuraApplication.platformActivity;
property real progress: UM.Backend.progress
property int backendState: UM.Backend.state
property bool activity: CuraApplication.platformActivity
property alias buttonRowWidth: saveRow.width
@ -50,10 +48,14 @@ Item {
}
function sliceOrStopSlicing() {
if (backend != "undefined" && [1, 5].indexOf(UM.Backend.state) != -1) {
backend.forceSlice();
} else {
backend.stopSlicing();
try {
if ([1, 5].indexOf(base.backendState) != -1) {
CuraApplication.backend.forceSlice();
} else {
CuraApplication.backend.stopSlicing();
}
} catch (e) {
console.log('Could not start or stop slicing', e)
}
}
@ -166,7 +168,7 @@ Item {
Button {
id: prepareButton
tooltip: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
// 1 = not started, 2 = Processing
enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true
visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true
@ -178,7 +180,7 @@ Item {
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
// 1 = not started, 5 = disabled
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
text: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
onClicked:
{
sliceOrStopSlicing();

View file

@ -14,11 +14,13 @@ import "."
Item {
id: base;
height: UM.Theme.getSize("section").height;
height: UM.Theme.getSize("section").height
property alias contents: controlContainer.children;
property alias contents: controlContainer.children
property alias hovered: mouse.containsMouse
property var resetHandler: false
property var showRevertButton: true
property var showInheritButton: true
property var showLinkedSettingIcon: true
@ -179,8 +181,13 @@ Item {
iconSource: UM.Theme.getIcon("reset")
onClicked: {
revertButton.focus = true;
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key);
revertButton.focus = true
if (resetHandler) {
resetHandler(propertyProvider.key)
} else {
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key)
}
}
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile.")) }

View file

@ -22,7 +22,6 @@ Rectangle
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
property int backendState: UM.Backend.state
property bool monitoringPrint: UM.Controller.activeStage.stageId == "MonitorStage"
@ -87,10 +86,19 @@ Rectangle
}
}
MachineSelection {
id: machineSelection
width: base.width
height: UM.Theme.getSize("sidebar_header").height
anchors.top: base.top
anchors.right: parent.right
}
SidebarHeader {
id: header
width: parent.width
visible: machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants
anchors.top: machineSelection.bottom
onShowTooltip: base.showTooltip(item, location, text)
onHideTooltip: base.hideTooltip()
@ -263,7 +271,7 @@ Rectangle
{
id: controlItem
anchors.bottom: footerSeparator.top
anchors.top: monitoringPrint ? base.top : headerSeparator.bottom
anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
anchors.left: base.left
anchors.right: base.right
sourceComponent:
@ -282,7 +290,7 @@ Rectangle
Loader
{
anchors.bottom: footerSeparator.top
anchors.top: monitoringPrint ? base.top : headerSeparator.bottom
anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
anchors.left: base.left
anchors.right: base.right
source:

View file

@ -21,6 +21,22 @@ Rectangle
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property int rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
property int allItemsWidth: 0;
function updateMarginsAndSizes() {
if (UM.Preferences.getValue("cura/sidebar_collapse")) {
rightMargin = UM.Theme.getSize("default_margin").width;
} else {
rightMargin = UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
}
allItemsWidth = (
logo.width + UM.Theme.getSize("topbar_logo_right_margin").width +
UM.Theme.getSize("topbar_logo_right_margin").width + stagesMenuContainer.width +
UM.Theme.getSize("default_margin").width + viewModeButton.width +
rightMargin);
}
UM.I18nCatalog
{
id: catalog
@ -44,10 +60,9 @@ Rectangle
Row
{
id: stagesMenuContainer
anchors.left: logo.right
anchors.leftMargin: UM.Theme.getSize("topbar_logo_right_margin").width
anchors.right: machineSelection.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
// The topbar is dynamically filled with all available stages
@ -76,71 +91,6 @@ Rectangle
ExclusiveGroup { id: topbarMenuGroup }
}
ToolButton
{
id: machineSelection
text: Cura.MachineManager.activeMachineName
width: UM.Theme.getSize("sidebar").width
height: UM.Theme.getSize("sidebar_header").height
tooltip: Cura.MachineManager.activeMachineName
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
style: ButtonStyle
{
background: Rectangle
{
color:
{
if(control.pressed)
{
return UM.Theme.getColor("sidebar_header_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("sidebar_header_hover");
}
else
{
return UM.Theme.getColor("sidebar_header_bar");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
UM.RecolorImage
{
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.getColor("text_emphasis")
source: UM.Theme.getIcon("arrow_bottom")
}
Label
{
id: sidebarComboBoxLabel
color: UM.Theme.getColor("sidebar_header_text_active")
text: control.text;
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
anchors.right: downArrow.left;
anchors.rightMargin: control.rightMargin;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large")
}
}
label: Label {}
}
menu: PrinterMenu { }
}
// View orientation Item
Row
{
@ -152,8 +102,8 @@ Rectangle
anchors
{
verticalCenter: base.verticalCenter
right: viewModeButton.right
rightMargin: UM.Theme.getSize("default_margin").width + viewModeButton.width
right: viewModeButton.left
rightMargin: UM.Theme.getSize("default_margin").width
}
// #1 3d view
@ -165,7 +115,7 @@ Rectangle
onClicked:{
UM.Controller.rotateView("3d", 0);
}
visible: base.width > 1100
visible: base.width - allItemsWidth - 4 * this.width > 0;
}
// #2 Front view
@ -177,7 +127,7 @@ Rectangle
onClicked:{
UM.Controller.rotateView("home", 0);
}
visible: base.width > 1130
visible: base.width - allItemsWidth - 3 * this.width > 0;
}
// #3 Top view
@ -189,7 +139,7 @@ Rectangle
onClicked:{
UM.Controller.rotateView("y", 90);
}
visible: base.width > 1160
visible: base.width - allItemsWidth - 2 * this.width > 0;
}
// #4 Left view
@ -201,7 +151,7 @@ Rectangle
onClicked:{
UM.Controller.rotateView("x", 90);
}
visible: base.width > 1190
visible: base.width - allItemsWidth - 1 * this.width > 0;
}
// #5 Left view
@ -213,7 +163,7 @@ Rectangle
onClicked:{
UM.Controller.rotateView("x", -90);
}
visible: base.width > 1210
visible: base.width - allItemsWidth > 0;
}
}
@ -224,7 +174,7 @@ Rectangle
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width
rightMargin: rightMargin
}
style: UM.Theme.styles.combobox
@ -284,4 +234,16 @@ Rectangle
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
}
// Expand or collapse sidebar
Connections
{
target: Cura.Actions.expandSidebar
onTriggered: updateMarginsAndSizes()
}
Component.onCompleted:
{
updateMarginsAndSizes();
}
}

View file

@ -0,0 +1,34 @@
[general]
version = 2
name = Fine
definition = ultimaker3
[metadata]
type = quality
quality_type = normal
material = generic_bam_ultimaker3_AA_0.4
weight = 0
setting_version = 4
[values]
cool_fan_full_at_height = =layer_height_0 + 2 * layer_height
cool_fan_speed_max = =cool_fan_speed
cool_min_speed = 7
machine_nozzle_cool_down_speed = 0.75
machine_nozzle_heat_up_speed = 1.6
material_print_temperature = =default_material_print_temperature - 10
prime_tower_enable = =min(extruderValues('material_surface_energy')) < 100
skin_overlap = 10
speed_layer_0 = 20
support_interface_enable = True
support_interface_density = =min(extruderValues('material_surface_energy'))
support_interface_pattern = ='lines' if support_interface_density < 100 else 'concentric'
support_top_distance = =math.ceil(min(extruderValues('material_adhesion_tendency')) / 1) * layer_height
support_bottom_distance = =math.ceil(min(extruderValues('material_adhesion_tendency')) / 2) * layer_height
support_angle = 45
support_join_distance = 5
support_offset = 2
support_pattern = triangles
support_infill_rate = 10
top_bottom_thickness = 1
wall_thickness = 1