Remove leftover debug code from ChangeAtZ.py

CURA-7146
This commit is contained in:
Nino van Hooff 2020-04-23 11:48:50 +02:00
parent 0bf862f9a9
commit 971d8cd8e2

View file

@ -1429,93 +1429,3 @@ class ChangeAtZProcessor:
# move to the next command
return
def debug():
# get our input file
file = r"C:\Users\Wes\Desktop\Archive\gcode test\emit + single layer\AC_Retraction.gcode"
# read the whole thing
f = open(file, "r")
gcode = f.read()
f.close()
# boot up change
caz_instance = ChangeAtZProcessor()
caz_instance.IsTargetByLayer = False
caz_instance.TargetZ = 5
caz_instance.TargetValues["printspeed"] = 100
caz_instance.TargetValues["retractfeedrate"] = 60
# process gcode
gcode = debug_iteration(gcode, caz_instance)
# write our file
debug_write(gcode, file + ".1.modified")
caz_instance.reset()
caz_instance.IsTargetByLayer = False
caz_instance.IsDisplayingChangesToLcd = True
caz_instance.IsApplyToSingleLayer = False
caz_instance.TargetZ = 10.6
caz_instance.TargetValues["bedTemp"] = 75.111
caz_instance.TargetValues["printspeed"] = 150
caz_instance.TargetValues["retractfeedrate"] = 40.555
caz_instance.TargetValues["retractlength"] = 10.3333
# and again
gcode = debug_iteration(gcode, caz_instance)
# write our file
debug_write(gcode, file + ".2.modified")
caz_instance.reset()
caz_instance.IsTargetByLayer = False
caz_instance.TargetZ = 15
caz_instance.IsApplyToSingleLayer = True
caz_instance.TargetValues["bedTemp"] = 80
caz_instance.TargetValues["printspeed"] = 100
caz_instance.TargetValues["retractfeedrate"] = 10
caz_instance.TargetValues["retractlength"] = 0
caz_instance.TargetValues["extruderOne"] = 100
caz_instance.TargetValues["extruderTwo"] = 200
# and again
gcode = debug_iteration(gcode, caz_instance)
# write our file
debug_write(gcode, file + ".3.modified")
def debug_write(gcode, file):
# write our file
f = open(file, "w")
f.write(gcode)
f.close()
def debug_iteration(gcode, caz_instance):
index = 0
# break apart the GCODE like cura
layers = re.split(r"^;LAYER:\d+\n", gcode)
# add the layer numbers back
for layer in layers:
# if this is the first layer, skip it, basically
if index == 0:
# leave our first layer as is
layers[index] = layer
# move the cursor
index += 1
# skip to the next layer
continue
layers[index] = ";LAYER:" + str(index - 1) + ";\n" + layer
return "".join(caz_instance.execute(layers))
# debug()