mirror of
https://github.com/Ultimaker/Cura.git
synced 2026-03-10 05:16:58 -06:00
Use new option feature comment:multiline
Updated descriptions for G-code inputs and modified handling of multiline G-code.
This commit is contained in:
parent
f55fad4ecb
commit
5eb7f228f8
1 changed files with 8 additions and 6 deletions
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
# Modification 06.09.2020
|
||||
# add checkbox, now you can choose and use configuration from the firmware itself.
|
||||
# Modification 10.01.2026
|
||||
# add multiline in custom G-code, using '\n'.
|
||||
# Modification 01.13.2026
|
||||
# convert G-code Before and G-Code After inputs to textareas (#21298).
|
||||
|
||||
from typing import List
|
||||
from ..Script import Script
|
||||
|
|
@ -137,9 +137,10 @@ class FilamentChange(Script):
|
|||
"before_macro":
|
||||
{
|
||||
"label": "G-code Before",
|
||||
"description": "Any custom G-code to run before the filament change happens, for example, M300 S1000 P10000 for a long beep. Use \\\\n to separate lines.",
|
||||
"description": "Any custom G-code to run before the filament change happens, for example, M300 S1000 P10000 for a long beep.",
|
||||
"unit": "",
|
||||
"type": "str",
|
||||
"comments": "multiline",
|
||||
"default_value": "M300 S1000 P10000",
|
||||
"enabled": "enabled and enable_before_macro"
|
||||
},
|
||||
|
|
@ -154,9 +155,10 @@ class FilamentChange(Script):
|
|||
"after_macro":
|
||||
{
|
||||
"label": "G-code After",
|
||||
"description": "Any custom G-code to run after the filament has been changed right before continuing the print, for example, you can add a sequence to purge filament and wipe the nozzle. Use \\\\n to separate lines.",
|
||||
"description": "Any custom G-code to run after the filament has been changed right before continuing the print, for example, you can add a sequence to purge filament and wipe the nozzle.",
|
||||
"unit": "",
|
||||
"type": "str",
|
||||
"comments": "multiline",
|
||||
"default_value": "M300 S440 P500",
|
||||
"enabled": "enabled and enable_after_macro"
|
||||
}
|
||||
|
|
@ -199,7 +201,7 @@ class FilamentChange(Script):
|
|||
color_change = ";BEGIN FilamentChange plugin\n"
|
||||
|
||||
if enable_before_macro:
|
||||
color_change = color_change + before_macro.replace("\\n", "\n") + "\n"
|
||||
color_change = color_change + before_macro + "\n"
|
||||
|
||||
color_change = color_change + "M600"
|
||||
|
||||
|
|
@ -225,7 +227,7 @@ class FilamentChange(Script):
|
|||
color_change = color_change + "\n"
|
||||
|
||||
if enable_after_macro:
|
||||
color_change = color_change + after_macro.replace("\\n", "\n") + "\n"
|
||||
color_change = color_change + after_macro + "\n"
|
||||
|
||||
color_change = color_change + ";END FilamentChange plugin\n"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue