mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Only allow prepend settings to be disabled
When the printer settings say they should be disabled, they could previously be enabled if the start GCode didn't contain temperature commands. Now we can only enable them if initially enabled. CURA-11967
This commit is contained in:
parent
046c9a5a52
commit
8e32672016
1 changed files with 10 additions and 6 deletions
|
@ -554,9 +554,13 @@ class StartSliceJob(Job):
|
|||
start_gcode = settings["machine_start_gcode"]
|
||||
# Remove all the comments from the start g-code
|
||||
start_gcode = re.sub(r";.+?(\n|$)", "\n", start_gcode)
|
||||
|
||||
if settings["material_bed_temp_prepend"]:
|
||||
bed_temperature_settings = ["material_bed_temperature", "material_bed_temperature_layer_0"]
|
||||
pattern = r"\{(%s)(,\s?\w+)?\}" % "|".join(bed_temperature_settings) # match {setting} as well as {setting, extruder_nr}
|
||||
settings["material_bed_temp_prepend"] = re.search(pattern, start_gcode) == None
|
||||
|
||||
if settings["material_print_temp_prepend"]:
|
||||
print_temperature_settings = ["material_print_temperature", "material_print_temperature_layer_0", "default_material_print_temperature", "material_initial_print_temperature", "material_final_print_temperature", "material_standby_temperature", "print_temperature"]
|
||||
pattern = r"\{(%s)(,\s?\w+)?\}" % "|".join(print_temperature_settings) # match {setting} as well as {setting, extruder_nr}
|
||||
settings["material_print_temp_prepend"] = re.search(pattern, start_gcode) is None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue