Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Ultimaker/Cura
Browse files Browse the repository at this point in the history
  • Loading branch information
nallath committed Apr 19, 2017
2 parents c20542b + 2cd3565 commit 0e381f3
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 13 deletions.
4 changes: 4 additions & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion resources/definitions/imade3d_jellybox.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -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;_______________________________________"
Expand Down
130 changes: 130 additions & 0 deletions resources/definitions/rigid3d_zero2.def.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Binary file added resources/meshes/rigid3d_zero2_platform.stl
Binary file not shown.
93 changes: 82 additions & 11 deletions resources/qml/Sidebar.qml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}

Expand Down Expand Up @@ -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;
}
}

Expand All @@ -567,4 +638,4 @@ Rectangle
watchedProperties: [ "value" ]
storeIndex: 0
}
}
}
38 changes: 38 additions & 0 deletions resources/themes/cura/styles.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion resources/themes/cura/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

0 comments on commit 0e381f3

Please sign in to comment.