Same filament printing is allowed now

This commit is contained in:
workinghard
2018-12-30 23:04:42 -08:00
parent 2227ac8847
commit e1e179ba00

15
mmuGcodeParser.py Normal file → Executable file
View File

@@ -203,6 +203,7 @@ def none_handler(p_tool_change, p_line_number):
# Just in case we need to do something at the end
lv_output = ""
lv_insert = 0 # 0 = don't insert, +1 = after the line, -1 before the line, -9 = comment out
if CURR_TEMP in p_tool_change:
if p_tool_change[p_line_number] == UNLOAD_START_LINE:
if ram_temp_diff > 0: # Only if set
# Add temp drop for better tip
@@ -271,6 +272,8 @@ for line in infile:
targetTemp_match = target_temp_detect.search(line)
if targetTemp_match is not None:
if len(myToolChanges) > 0: # we found at least the start tool change
# print(myToolChanges[toolChangeID])
if DEST_TEMP_LINE not in myToolChanges[toolChangeID]:
# determine the temperature value
tempMatch = re.search(r"S[0-9]*", line)
@@ -312,6 +315,15 @@ for line in infile:
# increment the line number
line_number = line_number + 1
"""
for toolChange in myToolChanges:
if DEST_TEMP in myToolChanges[toolChange]:
print(myToolChanges[toolChange])
else:
print("Key is missing")
print(myToolChanges[toolChange])
"""
""" -------------------------
### Determine the transitions
"""
@@ -321,6 +333,7 @@ lastTemp = initTemp
for toolChange in myToolChanges:
# Last tool change is unloading only
# Special handler required in case we need to do something there
if DEST_TEMP in myToolChanges[toolChange]:
if myToolChanges[toolChange][DEST_TEMP] == "0":
myToolChanges[toolChange][TRANSITION] = NOTRANSITION
else:
@@ -339,6 +352,8 @@ for toolChange in myToolChanges:
myToolChanges[toolChange][CURR_TEMP] = lastTemp
# Remember the last temperature
lastTemp = myToolChanges[toolChange][DEST_TEMP]
else:
myToolChanges[toolChange][TRANSITION] = NOTRANSITION
""" ----------------------
### Update the gcode file