From 6ad6e39ad227a6d782946501e95627a6843beb04 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 21 Jun 2022 12:39:00 -0400 Subject: [PATCH] docs: add SET_DISPLAY_TEXT documentation Signed-off-by: Eric Callahan --- docs/Command_Templates.md | 9 +++++++-- docs/G-Codes.md | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/Command_Templates.md b/docs/Command_Templates.md index 3aa68c13..c89d85bc 100644 --- a/docs/Command_Templates.md +++ b/docs/Command_Templates.md @@ -138,8 +138,13 @@ This is quite useful if you want to change the behavior of certain commands like [gcode_macro M117] rename_existing: M117.1 gcode: - M117.1 { rawparams } - M118 { rawparams } + {% if rawparams %} + {% set escaped_msg = rawparams|replace('"', '\\"') %} + SET_DISPLAY_TEXT MSG="{escaped_msg}" + RESPOND TYPE=command MSG="{escaped_msg}" + {% else %} + SET_DISPLAY_TEXT + {% endif %} ``` ### The "printer" Variable diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 74757a48..78949980 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -295,6 +295,11 @@ provides the following standard G-Code commands: - Display Message: `M117 ` - Set build percentage: `M73 P` +Also provided is the following extended G-Code command: +- `SET_DISPLAY_TEXT MSG=`: Performs the equivalent of M117, + setting the supplied `MSG` as the current display message. If + `MSG` is omitted the display will be cleared. + ### [dual_carriage] The following command is available when the