Skip to main content

Site Navigation

Your Account

Choose Language

Help

Revision to Duet 2 Maestro 12864 display menu system

David Crocker

[title|Duet 2 Maestro 12864 display menu system]
 
 
 
The Duet 2 Maestro supports a dynamically-configured menu system to use on a 12864 display + encoder.
 
Duet electronics is capable of being used in many different configurations, and OEMs have differing requirements. So a fixed menu system is not suitable. Therefore the menu structure isdefined in SD card files. Folder /menu is used for this purpose.
 
Each file in /menu defines one page on the display. There must be a file called “main” in /menus, which is the initial file loaded at startup
 
Generally, each line in a menu file describes one display element.
 
Each element has the following syntax:
 
command parameter1 parameter2 parameter3 ...
 
The command must be one of the recognised keywords. Each parameter is similar to a parameter in G- or M-code, i.e. a letter followed by a number or a string, or a colon-separated sequence of numbers. String parameters must always be enclosed in double-quote characters. Parameters may be optional (depending on the command), in which case default values are assumed.
 
Parameters common to several commands have the following meanings:
 
* R is the row number in pixels counting down from the top of the display, with R0 being the top row. The default is the same row as used for the previous element. The default at the start of the file is 0.
* C is the column number in pixels counting from the left, with C0 being the leftmost column. The default is just after the previous element ends. The default at the start of the file is 0. The specified RC coordinates give the position of the top left of the display element.
* G is the name of a command to execute, either a Gcode command or a menu command
* F is a font to select. There are currently two fonts, 0 (small, the default) and 1.
* D is a number of decimal places to show when displaying numbers. If zero (which is the default), no decimal point is shown.
 
The following commands will be supported:
 
{table
|! Parameters
|! Action
|--
| image
| Rnn Cnn P"filename" [X"command"]
| Display the bitmap image read from the specified file. If a command is provided, allow the image to be selected and run the specified command if it is clicked.
|--
| text
| Rnn Cnn [Fnn] P"text" [X"command"]
| Display the specified text using the specified font. If a command is provided, allow the image to be selected and run the specified command if it is clicked.
|--
| number
| Rnn Cnn [Fnn] [Dnn] P"identifier"
| Display the specified value in the specified font to the specified number of decimal places
|--
| adjust
| Rnn Cnn [Fnn] [Dnn] [Snn] P"identifier"
| Display the specified value in the specified font to the specified number of decimal places and allow it to be adjusted in steps of nn (default 1)
|--
| page
| Rnn Cnn [Fnn] P"pagename"
| Display a link to the specified menu and allow it to be selected. "pagename" is both the text to display and the filename.
|--
| macro
| P"name" [S"file"]
| Show the specified macro and allow it to be selected and run. If the S parameter is missing it defaults to /macros/<name>.
|--
| cd
| P"folder"
| Set current directory to specified folder
|--
| execute
| P"command-string"
| Execute the specified command string
|--
| popup
| Hnn Wnn P"file"
|
|--
| files
| Rnn Cnn Hnn Fnn
| Display a list of files and allow one of the files to be selected
}
 
=== Example menu files ===
 
File "main":
 
[code]
text R0 C0 F1 P"My Super 3D Printer "
image P”reprapimg.bin”
macro R40 C0 P"Preheat PLA"
macro R60 C0 P"Preheat ABS"
menu R80 C0 P"Select file to print"
[/code]
 
File "Select file to print"
 
[code]
text R0 C0 F0 "Select file"
cd P"/gcodes"
files R20 C0 H100 A2
popup P"filepopup" S"#0"
cd P"#0"
[/code]
 
File "filepopup":
 
[code]text R0 C0 "File " "#1"[/code]