This repository has been archived by the owner on Jan 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The variable 'printspeed' didn't exist. Looking at the original code in LegacyCura, we should load that value from the setting.
- Loading branch information
1 parent
3ba8b8e
commit a4f1687
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
# Modified by Ricardo Gomez, [email protected], to add Bed Temperature and make it work with Cura_13.06.04+ | ||
# Modified by Stefan Heule, [email protected] since V3.0 (see changelog below) | ||
# Modified by Jaime van Kessel (Ultimaker), [email protected] to make it work for 15.10 / 2.x | ||
# Modified by Ruben Dulek (Ultimaker), [email protected], to debug. | ||
|
||
##history / changelog: | ||
##V3.0.1: TweakAtZ-state default 1 (i.e. the plugin works without any TweakAtZ comment) | ||
|
@@ -46,7 +47,7 @@ | |
import re | ||
|
||
class TweakAtZ(Script): | ||
version = "5.1" | ||
version = "5.1.1" | ||
def __init__(self): | ||
super().__init__() | ||
|
||
|
@@ -321,13 +322,14 @@ def execute(self, data): | |
"extruderTwo": "M104 S%f T1\n", | ||
"fanSpeed": "M106 S%d\n"} | ||
target_values = {"speed": self.getSettingValueByKey("e2_speed"), | ||
"flowrate": self.getSettingValueByKey("g2_flowrate"), | ||
"flowrateOne": self.getSettingValueByKey("g4_flowrateOne"), | ||
"flowrateTwo": self.getSettingValueByKey("g6_flowrateTwo"), | ||
"bedTemp": self.getSettingValueByKey("h2_bedTemp"), | ||
"extruderOne": self.getSettingValueByKey("i2_extruderOne"), | ||
"extruderTwo": self.getSettingValueByKey("i4_extruderTwo"), | ||
"fanSpeed": self.getSettingValueByKey("j2_fanSpeed")} | ||
"printspeed": self.getSettingValueByKey("f2_printspeed"), | ||
"flowrate": self.getSettingValueByKey("g2_flowrate"), | ||
"flowrateOne": self.getSettingValueByKey("g4_flowrateOne"), | ||
"flowrateTwo": self.getSettingValueByKey("g6_flowrateTwo"), | ||
"bedTemp": self.getSettingValueByKey("h2_bedTemp"), | ||
"extruderOne": self.getSettingValueByKey("i2_extruderOne"), | ||
"extruderTwo": self.getSettingValueByKey("i4_extruderTwo"), | ||
"fanSpeed": self.getSettingValueByKey("j2_fanSpeed")} | ||
old = {"speed": -1, "flowrate": -1, "flowrateOne": -1, "flowrateTwo": -1, "platformTemp": -1, "extruderOne": -1, | ||
"extruderTwo": -1, "bedTemp": -1, "fanSpeed": -1, "state": -1} | ||
twLayers = self.getSettingValueByKey("d_twLayers") | ||
|
@@ -426,8 +428,8 @@ def execute(self, data): | |
if 'G1' in line and TweakPrintSpeed and (state==3 or state==4): | ||
# check for pure print movement in target range: | ||
if x != None and y != None and f != None and e != None and newZ==z: | ||
modified_gcode += "G1 F%d X%1.3f Y%1.3f E%1.5f\n" % (int(f/100.0*float(printspeed)),self.getValue(line,"X"), | ||
self.getValue(line,"Y"),self.getValue(line,"E")) | ||
modified_gcode += "G1 F%d X%1.3f Y%1.3f E%1.5f\n" % (int(f / 100.0 * float(target_values["printspeed"])), self.getValue(line, "X"), | ||
self.getValue(line, "Y"), self.getValue(line, "E")) | ||
else: #G1 command but not a print movement | ||
modified_gcode += line + "\n" | ||
# no tweaking on retraction hops which have no x and y coordinate: | ||
|