From a93521242f903e6153aea05bfb61ec3712846d39 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 7 Oct 2013 10:10:03 +0200 Subject: [PATCH] Add machine center is zero to machine settings. Properly handle depricated max_z_speed setting in start/end code. --- Cura/gui/preferencesDialog.py | 1 + Cura/gui/simpleMode.py | 1 - .../machine_profiles/MakerBotReplicator.ini | 2 +- Cura/util/profile.py | 21 ++++--------------- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Cura/gui/preferencesDialog.py b/Cura/gui/preferencesDialog.py index fe012cff..5d3b1501 100644 --- a/Cura/gui/preferencesDialog.py +++ b/Cura/gui/preferencesDialog.py @@ -82,6 +82,7 @@ class machineSettingsDialog(wx.Dialog): configBase.SettingRow(left, 'machine_height', index=idx) configBase.SettingRow(left, 'extruder_amount', index=idx) configBase.SettingRow(left, 'has_heated_bed', index=idx) + configBase.SettingRow(left, 'machine_center_is_zero', index=idx) configBase.SettingRow(left, 'gcode_flavor', index=idx) configBase.TitleRow(right, _("Printer head size")) diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index f34bf3bb..34aad5a8 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -93,7 +93,6 @@ class simpleModePanel(wx.Panel): put('retraction_amount', '4.5') put('retraction_extra', '0.0') put('travel_speed', '150') - put('max_z_speed', '3.0') put('bottom_layer_speed', '25') put('cool_min_layer_time', '5') put('fan_enabled', 'True') diff --git a/Cura/resources/machine_profiles/MakerBotReplicator.ini b/Cura/resources/machine_profiles/MakerBotReplicator.ini index 793011c9..17b2b639 100644 --- a/Cura/resources/machine_profiles/MakerBotReplicator.ini +++ b/Cura/resources/machine_profiles/MakerBotReplicator.ini @@ -25,7 +25,7 @@ start.gcode = ; -- START GCODE -- G162 X Y F2000(home XY axes maximum) G161 Z F900(home Z axis minimum) G92 X0 Y0 Z-5 A0 B0 (set Z to -5) - G1 Z0.0 F{max_z_speed}(move Z to '0') + G1 Z0.0 F{travel_speed}(move Z to '0') G161 Z F100(home Z axis minimum) M132 X Y Z A B (Recall stored home offsets for XYZAB axis) G92 X152 Y72 Z0 A0 B0 diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 878fe0ba..07703208 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -308,21 +308,6 @@ setting('cool_start.gcode', '', str, 'alteration', 'alteration') setting('cool_end.gcode', '', str, 'alteration', 'alteration') setting('replace.csv', '', str, 'alteration', 'alteration') ####################################################################################### -setting('nextobject.gcode', """;Move to next object on the platform. clear_z is the minimal z height we need to make sure we do not hit any objects. -G92 E0 - -G91 ;relative positioning -G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure -G1 Z+0.5 E-5 F{travel_speed} ;move Z up a bit and retract filament even more -G90 ;absolute positioning - -G1 Z{clear_z} F{max_z_speed} -G92 E0 -G1 X{object_center_x} Y{object_center_y} F{travel_speed} -G1 F200 E6 -G92 E0 -""", str, 'alteration', 'alteration') -####################################################################################### setting('switchExtruder.gcode', """;Switch between the current extruder and the next extruder, when printing with multiple extruders. G92 E0 G1 E-36 F5000 @@ -363,7 +348,7 @@ setting('machine_type', 'unknown', str, 'machine', 'hidden') #Ultimaker, Ultimak setting('machine_width', '205', float, 'machine', 'hidden').setLabel(_("Maximum width (mm)"), _("Size of the machine in mm")) setting('machine_depth', '205', float, 'machine', 'hidden').setLabel(_("Maximum depth (mm)"), _("Size of the machine in mm")) setting('machine_height', '200', float, 'machine', 'hidden').setLabel(_("Maximum height (mm)"), _("Size of the machine in mm")) -setting('machine_center_is_zero', 'False', bool, 'machine', 'hidden') +setting('machine_center_is_zero', 'False', bool, 'machine', 'hidden').setLabel(_("Machine center 0,0"), _("Machines firmware defines the center of the bed as 0,0 instead of the front left corner.")) setting('ultimaker_extruder_upgrade', 'False', bool, 'machine', 'hidden') setting('has_heated_bed', 'False', bool, 'machine', 'hidden').setLabel(_("Heated bed"), _("If you have an heated bed, this enabled heated bed settings (requires restart)")) setting('gcode_flavor', 'RepRap (Marlin/Sprinter)', ['RepRap (Marlin/Sprinter)', 'UltiGCode', 'MakerBot'], 'machine', 'hidden').setLabel(_("GCode Flavor"), _("Flavor of generated GCode.\nRepRap is normal 5D GCode which works on Marlin/Sprinter based firmwares.\nUltiGCode is a variation of the RepRap GCode which puts more settings in the machine instead of the slicer.\nMakerBot GCode has a few changes in the way GCode is generated, but still requires MakerWare to generate to X3G.")) @@ -888,7 +873,9 @@ def replaceTagMatch(m): return pre + '#F_WGHT#' if tag == 'filament_cost': return pre + '#F_COST#' - if pre == 'F' and tag in ['print_speed', 'retraction_speed', 'travel_speed', 'max_z_speed', 'bottom_layer_speed', 'cool_min_feedrate']: + if pre == 'F' and tag == 'max_z_speed': + f = getProfileSettingFloat('travel_speed') * 60 + if pre == 'F' and tag in ['print_speed', 'retraction_speed', 'travel_speed', 'bottom_layer_speed', 'cool_min_feedrate']: f = getProfileSettingFloat(tag) * 60 elif isProfileSetting(tag): f = getProfileSettingFloat(tag) -- 2.30.2