diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c3e5390736c..ce2d029ae4d 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -109,6 +109,10 @@ class ResourceTypes: Q_ENUMS(ResourceTypes) def __init__(self): + # this list of dir names will be used by UM to detect an old cura directory + for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "user", "variants"]: + Resources.addExpectedDirNameInData(dir_name) + Resources.addSearchPath(os.path.join(QtApplication.getInstallPrefix(), "share", "cura", "resources")) if not hasattr(sys, "frozen"): Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources")) diff --git a/resources/definitions/imade3d_jellybox.def.json b/resources/definitions/imade3d_jellybox.def.json index f8077f2e952..86b34bfd5c8 100644 --- a/resources/definitions/imade3d_jellybox.def.json +++ b/resources/definitions/imade3d_jellybox.def.json @@ -32,7 +32,7 @@ "machine_center_is_zero": { "default_value": false }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default_value": ";---------------------------------------\n; ; ; Jellybox Start Script Begin ; ; ;\n;_______________________________________\n; M92 E140 ;optionally adjust steps per mm for your filament\n\n; Print Settings Summary\n; (leave these alone: this is only a list of the slicing settings)\n; (overwriting these values will NOT change your printer's behavior)\n; sliced for : {machine_name}\n; nozzle diameter : {machine_nozzle_size}\n; filament diameter : {material_diameter}\n; layer height : {layer_height}\n; 1st layer height : {layer_height_0}\n; line width : {line_width}\n; outer wall wipe dist. : {wall_0_wipe_dist}\n; infill line width : {infill_line_width}\n; wall thickness : {wall_thickness}\n; top thickness : {top_thickness}\n; bottom thickness : {bottom_thickness}\n; infill density : {infill_sparse_density}\n; infill pattern : {infill_pattern}\n; print temperature : {material_print_temperature}\n; 1st layer print temp. : {material_print_temperature_layer_0}\n; heated bed temperature : {material_bed_temperature}\n; 1st layer bed temp. : {material_bed_temperature_layer_0}\n; regular fan speed : {cool_fan_speed_min}\n; max fan speed : {cool_fan_speed_max}\n; retraction amount : {retraction_amount}\n; retr. retract speed : {retraction_retract_speed}\n; retr. prime speed : {retraction_prime_speed}\n; build plate adhesion : {adhesion_type}\n; support ? {support_enable}\n; spiralized ? {magic_spiralize}\n\nM117 Preparing ;write Preparing\nM140 S{material_bed_temperature_layer_0} ;set bed temperature and move on\nM104 S{material_print_temperature_layer_0} ;set extruder temperature and move on\nM206 X10.0 Y0.0 ;set x homing offset for default bed leveling\nG21 ;metric values\nG90 ;absolute positioning\nM107 ;start with the fan off\nM82 ;set extruder to absolute mode\nG28 ;home all axes\nM203 Z4 ;slow Z speed down for greater accuracy when probing\nG29 ;auto bed leveling procedure\nM203 Z7 ;pick up z speed again for printing\nM190 S{material_bed_temperature_layer_0} ;wait for the bed to reach desired temperature\nM109 S{material_print_temperature_layer_0} ;wait for the extruder to reach desired temperature\nG92 E0 ;reset the extruder position\nG1 F1500 E15 ;extrude 15mm of feed stock\nG92 E0 ;reset the extruder position again\nM117 Print starting ;write Print starting\n;---------------------------------------------\n; ; ; Jellybox Printer Start Script End ; ; ;\n;_____________________________________________\n" + "default_value": ";---------------------------------------\n; ; ; Jellybox Start Script Begin ; ; ;\n;_______________________________________\n; M92 E140 ;optionally adjust steps per mm for your filament\n\n; Print Settings Summary\n; (leave these alone: this is only a list of the slicing settings)\n; (overwriting these values will NOT change your printer's behavior)\n; sliced for : {machine_name}\n; nozzle diameter : {machine_nozzle_size}\n; filament diameter : {material_diameter}\n; layer height : {layer_height}\n; 1st layer height : {layer_height_0}\n; line width : {line_width}\n; outer wall wipe dist. : {wall_0_wipe_dist}\n; infill line width : {infill_line_width}\n; wall thickness : {wall_thickness}\n; top thickness : {top_thickness}\n; bottom thickness : {bottom_thickness}\n; infill density : {infill_sparse_density}\n; infill pattern : {infill_pattern}\n; print temperature : {material_print_temperature}\n; 1st layer print temp. : {material_print_temperature_layer_0}\n; heated bed temperature : {material_bed_temperature}\n; 1st layer bed temp. : {material_bed_temperature_layer_0}\n; regular fan speed : {cool_fan_speed_min}\n; max fan speed : {cool_fan_speed_max}\n; retraction amount : {retraction_amount}\n; retr. retract speed : {retraction_retract_speed}\n; retr. prime speed : {retraction_prime_speed}\n; build plate adhesion : {adhesion_type}\n; support ? {support_enable}\n; spiralized ? {magic_spiralize}\n\nM117 Preparing ;write Preparing\nM140 S{material_bed_temperature_layer_0} ;set bed temperature and move on\nM109 S{material_print_temperature} ; wait for the extruder to reach desired temperature\nM206 X10.0 Y0.0 ;set x homing offset for default bed leveling\nG21 ;metric values\nG90 ;absolute positioning\nM107 ;start with the fan off\nM82 ;set extruder to absolute mode\nG28 ;home all axes\nM203 Z4 ;slow Z speed down for greater accuracy when probing\nG29 ;auto bed leveling procedure\nM203 Z7 ;pick up z speed again for printing\nM190 S{material_bed_temperature_layer_0} ;wait for the bed to reach desired temperature\nM109 S{material_print_temperature_layer_0} ;wait for the extruder to reach desired temperature\nG92 E0 ;reset the extruder position\nG1 F1500 E15 ;extrude 15mm of feed stock\nG92 E0 ;reset the extruder position again\nM117 Print starting ;write Print starting\n;---------------------------------------------\n; ; ; Jellybox Printer Start Script End ; ; ;\n;_____________________________________________\n" }, "machine_end_gcode": { "default_value": "\n;---------------------------------\n;;; Jellybox End Script Begin ;;;\n;_________________________________\nM117 Finishing Up ;write Finishing Up\n\nM104 S0 ;extruder heater off\nM140 S0 ;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\nG90 ;absolute positioning\nG28 X ;home x, so the head is out of the way\nG1 Y100 ;move Y forward, so the print is more accessible\nM84 ;steppers off\n\nM117 Print finished ;write Print finished\n;---------------------------------------\n;;; Jellybox End Script End ;;;\n;_______________________________________" diff --git a/resources/definitions/rigid3d_zero2.def.json b/resources/definitions/rigid3d_zero2.def.json new file mode 100644 index 00000000000..73b50f09503 --- /dev/null +++ b/resources/definitions/rigid3d_zero2.def.json @@ -0,0 +1,130 @@ +{ + "id": "rigid3d_zero2", + "name": "Rigid3D Zero2", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Rigid3D", + "manufacturer": "Rigid3D", + "category": "Other", + "has_materials": false, + "file_formats": "text/x-gcode", + "platform": "rigid3d_zero2_platform.stl", + "platform_offset": [ 5, 0, -35] + }, + "overrides": { + "machine_name": { "default_value": "Rigid3D Zero2" }, + "machine_head_with_fans_polygon": { + "default_value": [[ 30, 30], [ 30, 70], [ 30, 70], [ 30, 30]] + }, + "z_seam_type": { + "default_value": "random" + }, + "machine_heated_bed": { + "default_value": true + }, + "layer_height": { + "default_value": 0.2 + }, + "layer_height_0": { + "default_value": 0.2 + }, + "wall_thickness": { + "default_value": 0.8 + }, + "top_bottom_thickness": { + "default_value": 0.8 + }, + "xy_offset": { + "default_value": -0.2 + }, + "material_print_temperature": { + "value": 235 + }, + "material_bed_temperature": { + "default_value": 100 + }, + "material_diameter": { + "default_value": 1.75 + }, + "speed_print": { + "default_value": 40 + }, + "speed_layer_0": { + "value": 15 + }, + "speed_tarvel": { + "value": 100 + }, + "support_enable": { + "default_value": false + }, + "infill_sparse_density": { + "default_value": 15 + }, + "infill_pattern": { + "default_value": "lines", + "value": "lines" + }, + "retraction_amount": { + "default_value": 1 + }, + "machine_width": { + "default_value": 200 + }, + "machine_height": { + "default_value": 200 + }, + "machine_depth": { + "default_value": 200 + }, + "machine_center_is_zero": { + "default_value": false + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "gantry_height": { + "default_value": 25 + }, + "machine_gcode_flavor": { + "default_value": "RepRap" + }, + "cool_fan_enabled": { + "default_value": false + }, + "cool_fan_speed": { + "default_value": 50, + "value": 50 + }, + "cool_fan_speed_min": { + "default_value": 0 + }, + "cool_fan_full_at_height": { + "default_value": 1.0, + "value": 1.0 + }, + "support_z_distance": { + "default_value": 0.2 + }, + "support_interface_enable": { + "default_value": true + }, + "support_interface_height": { + "default_value": 0.8 + }, + "support_interface_density": { + "default_value": 70 + }, + "support_interface_pattern": { + "default_value": "grid" + }, + "machine_start_gcode": { + "default_value": "G21\nG28 ; Home extruder\nM107 ; Turn off fan\nG91 ; Relative positioning\nG1 Z5 F180;\nG1 X100 Y100 F3000;\nG1 Z-5 F180;\nG90 ; Absolute positioning\nM82 ; Extruder in absolute mode\nG92 E0 ; Reset extruder position\n" + }, + "machine_end_gcode": { + "default_value": "G1 X0 Y180 ; Get extruder out of way.\nM107 ; Turn off fan\nG91 ; Relative positioning\nG0 Z20 ; Lift extruder up\nT0\nG1 E-1 ; Reduce filament pressure\nM104 T0 S0 ; Turn extruder heater off\nG90 ; Absolute positioning\nG92 E0 ; Reset extruder position\nM140 S0 ; Disable heated bed\nM84 ; Turn steppers off\n" + } + } +} diff --git a/resources/meshes/rigid3d_zero2_platform.stl b/resources/meshes/rigid3d_zero2_platform.stl new file mode 100644 index 00000000000..ef81aaf9ec4 Binary files /dev/null and b/resources/meshes/rigid3d_zero2_platform.stl differ diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml old mode 100644 new mode 100755 index f4f439439fc..ba5106c7674 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -407,14 +407,81 @@ Rectangle } } ExclusiveGroup { id: modeMenuGroup; } - ListView{ - id: modesList - property var index: 0 - model: modesListModel - delegate: wizardDelegate - anchors.top: parent.top - anchors.left: parent.left - width: parent.width + + Text + { + id: toggleLeftText + anchors.right: modeToggleSwitch.left + anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width + anchors.verticalCenter: parent.verticalCenter + text: "" + color: UM.Theme.getColor("toggle_active_text") + font: UM.Theme.getFont("default") + + MouseArea + { + anchors.fill: parent + onClicked: + { + modeToggleSwitch.checked = false; + } + + Component.onCompleted: + { + clicked.connect(modeToggleSwitch.clicked) + } + } + } + + Switch + { + id: modeToggleSwitch + checked: false + anchors.right: toggleRightText.left + anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width + anchors.verticalCenter: parent.verticalCenter + + onClicked: + { + var index = 0; + if (checked) + { + index = 1; + } + updateActiveMode(index); + } + + function updateActiveMode(index) + { + base.currentModeIndex = index; + UM.Preferences.setValue("cura/active_mode", index); + } + + style: UM.Theme.styles.toggle_button + } + + Text + { + id: toggleRightText + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + text: "" + color: UM.Theme.getColor("toggle_active_text") + font: UM.Theme.getFont("default") + + MouseArea + { + anchors.fill: parent + onClicked: + { + modeToggleSwitch.checked = true; + } + + Component.onCompleted: + { + clicked.connect(modeToggleSwitch.clicked) + } + } } } @@ -541,10 +608,14 @@ Rectangle }) sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "immediate": true }); - var index = parseInt(UM.Preferences.getValue("cura/active_mode")) - if(index) + toggleLeftText.text = modesListModel.get(0).text; + toggleRightText.text = modesListModel.get(1).text; + + var index = parseInt(UM.Preferences.getValue("cura/active_mode")); + if (index) { currentModeIndex = index; + modeToggleSwitch.checked = index > 0; } } @@ -567,4 +638,4 @@ Rectangle watchedProperties: [ "value" ] storeIndex: 0 } -} \ No newline at end of file +} diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 64b4436622b..a7c7dcb6cd8 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -8,6 +8,44 @@ import QtQuick.Controls.Styles 1.1 import UM 1.1 as UM QtObject { + property Component toggle_button: Component { + SwitchStyle { + groove: Rectangle { + implicitWidth: UM.Theme.getSize("toggle_button_background_implicit_size").width + implicitHeight: UM.Theme.getSize("toggle_button_background_implicit_size").height + radius: UM.Theme.getSize("toggle_button_radius").width + border.color: { + if (control.pressed || (control.checkable && control.checked)) { + 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 border.color { ColorAnimation { duration: 50; } } + border.width: 1 + } + + handle: Rectangle { + implicitWidth: UM.Theme.getSize("toggle_button_knob_implicit_size").width + implicitHeight: UM.Theme.getSize("toggle_button_knob_implicit_size").height + radius: UM.Theme.getSize("toggle_button_radius").width + + color: { + if (control.pressed || (control.checkable && control.checked)) { + 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; } } + } + } + } + property Component sidebar_header_button: Component { ButtonStyle { background: Rectangle { diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index fa4bf2ee92a..084ee27bb25 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -319,6 +319,11 @@ "infill_button_margin": [0.5, 0.5], - "jobspecs_line": [2.0, 2.0] + "jobspecs_line": [2.0, 2.0], + + "toggle_button_text_anchoring_margin": [1.0, 1.0], + "toggle_button_radius": [1.0, 1.0], + "toggle_button_background_implicit_size": [2.0, 1.0], + "toggle_button_knob_implicit_size": [1.0, 1.0] } }