Difference between revisions of "PRO Display"
Line 77: | Line 77: | ||
==Examples== | ==Examples== | ||
− | # Logo Screen shown on boot of Meteobridge PRO: | + | # Logo Screen shown on boot of Meteobridge PRO:<pre>#clear\n#sblogo 0 0\n#font helvR10\n#string 6 44 meteobridge PRO\n*startfbar 4 56 116 6 right 4\n#show</pre> |
</translate> | </translate> |
Revision as of 17:52, 6 December 2015
<languages /><translate>
This page explains how to control the Meteobridge PRO display.
Contents
Display Commands
Display commands are lined up in sequence, where each command is terminated by a "\n" (quoted line feed). Commands are executed from left to right. Each Display command starts with a "#".
Control Commands
The control flow when using the display is to
- Clear the previously used data structures and to prepare the display driver for a new screen.
- build the new screen with a set of drawing/writing commands in the background (framebuffer)
- when done show the content prepared in the background
This is done by these commands:
- #new prepares the display frame buffer collect new content.
- #show makes the content prepared in the framebuffer visible.
Draw Commands
Between these commands a lot of drawing commands can be used to design the screen. The screen has size 128 x 64. Origin is located in the upper left. Items are drawn upright at the given coordinates. The commands are mostly 1:1 mappings to the list of u8g drawing commands ([1] u8g command reference). With Meteobridge PRO you can use these commands:
- #sblogo x y draws the smartbedded logo (shown when unit starts) at position x,y.
- #clear sets complete screen area to background color.
- #clearall does as #clear does but also clears active progress bars (if any).
- #box x y w h draws a solid box at position x,y with width w and height h in foreground color.
- #rbox x y w h r draws a rounded box with radius r at the corners
- #circle x y r s draws a circle at x,y with radius r. s is optional parameter that can define which segment of the circle to draw: ur = upper right, ul = upper left, lr = lower right, ll = lower left
- #disc x y r s draws a circle filled with foreground color, parameters are as with #circle.
- #ellipse x y rx ry s draws an ellipse at position x,y with vertical radius ry and horizontal radius rx. s has same meaning as with #circle.
- #filledellipse x y rx ry s draws an elllipse filled with foreground color, parameters are as with #ellipse.
- #frame x y w h draws a rectangular frame. Meaning of parameters is as with #box.
- #rframe x y w h r draws a rounded frame, r defined the radius of the corner.
- #hline x y w draws a horizontal line beginning from position x,y with length w.
- #vline x y h draws a vertical line beginning at position x,y with length h.
- #line x1 y1 x2 y2 draws a straight line from position x1,y1 to position x2,y2.
- #pixel x y sets pixel at position x,y to foreground color.
- #string x y text prints text starting at position x,y.
- #string90 x y text prints text starting at position x,y 90 degrees counter-clockwise oriented.
- #string180 x y text prints text starting at position x,y 180 degrees counter-clockwise oriented.
- #string270 x y text prints text starting at position x,y 270 degrees counter-clockwise oriented.
- #triangle x1 y1 x2 y2 x3 y3 prints a triangle through positions x1,y1 and x2,y2 and x3,y3.
- #color c sets color c as foreground color, c = 0 is black, c = 1 is white.
- #font name defined font "name" to be used for string commands. List of fonts sorted by size and also providing information about the supported character sets can be found here. Fonts supported by Meteobridge PRO are:
- generic: u8glib_4, m2icon_5, m2icon_7, m2icon_9, cursor, micro
- X11 types: 4x6, 5x7, 5x8, 6x10, 6x12, 6x12_67_75, 6x12_78_79, 6x13, 6x13B, 7x13, 7x13B, 7x13O, 7x13_67_75, 7x14, 7x14B, 8x13, 8x13B, 8x13O, 8x13_67_75, 9x15, 9x15B, 9x15_67_75, 9x15_78_79, 9x18, 9x18B, 9x18_67_75, 9x18_78_79, 10x20, 10x20_67_75, 10x20_78_79
- cursor types: cu12_67_75, cu12
- free universal bold: fub11, fub14, fub17, fub20, fub25, fub30
- free universal regular: fur11, fur14, fur17, fur20, fur25, fur30
- gentium bold: gdb11, gdb12, gdb14, gdb17, gdb20, gdb25, gdb30
- gentium regular: gdr9, gdr10, gdr11, gdr12, gdr14, gdr17, gdr20, gdr25, gdr30
- old standard bold: osb18, osb21, osb26, osb29, osb35
- old standard regular: osr18, osr21, osr26, osr29, osr35
- gnu unifont: unifont_18_89, unifont_72_73, unifont_67_75, unifont_76, unifont_77, unifont_78_79, unifont_86, unifont, unifont_0_8, unifont_2_3, unifont_4_5, unifont_8_9, unifont_12_13
- orgdot fonts: orgv01, fixed_v0, tpssb, tpss
- contributed: freedoomr25n, freedoomr10r
- Adobe X11: courB08, courB10, courB12, courB14, courB18, courB24, courR08, courR10, courR12, courR14, courR18, courR24, helvB08, helvB10, helvB12, helvB14, helvB18, helvB24, helvR08, helvR10, helvR12, helvR14, helvR18, helvR24, ncenB08, ncenB10, ncenB12, ncenB14, ncenB18, ncenB24, ncenR08, ncenR10, ncenR12, ncenR14, ncenR18, ncenR24, symb08, symb10, symb12, symb14, symb18, symb24, timB08, timB10, timB12, timB14, timB18, timB24, timR08, timR10, timR12, timR14, timR18, timR24
- fontstruct: p01type, Lucasfont_alternate, chikita, pixelle_micro, trixel_square, robot_de_niro, baby, blipfest_07
- profont: profont10, profont11, profont12, profont15, profont17, profont22, profont29
- #linespacing s defines line spacing, default is 1.0.
- #flip n rotates text 180 degrees, if n = 1. no rotation is n = 0.
Progress Bar Commands
Apart from constructing a screen and displaying it with the "#show" command, Meteobridge PRO also supports progress bars, which automatically increase while time is passing by. Progress bar definitions start with a "*" instead of the "#" used with direct draw commands.
- *startfbar x1 y1 x2 y2 d s c defines a progress bar that has lower left corner x1,y1 and upper right corner x2,y2 and fills up in direction d, where valid values are "up", "down", "left", "right". s defines the speed of the progress bar in terms of percent of the bar that should be passed each second. Example: A progress bar with a speed of 5 will approximately need 20 seconds to run through. optional parameter c can depict a shell script or program to start when progress bar has finished.
- *stopfbar terminates progress bar processing and removes the progress bar from the display.
===Display Loop Commands Another type of commands are so called loop commands, that allow to automatically run through a sequence of screens to be displayed. These commands also start with "*".
- *clearloop erases the current loop definitions completely.
- *addloop n d lt cmds adds a screen with name n and display duration of d seconds and an overall lifetime of lt seconds to the display loop. Commands that make up the screen follows as a command list "cmds". Draw commands in the command list are separated by double quoted line feeds "\\n" in order to be distinguished from the quote line feed "\n" that indicates the end of the current display loop command. If a screen with name n is already defined, the new deinition will replace the old one.
- *remloop n removes screen with name n from loop.
- *startloop starts endless playback of the defined screens, where each screen rests for the duration defined for the screen. A screen is removed from the loop list, when the lifetime of the screen has been reached.
- *stoploop stops playing the loop of screens.
Loop command "*addloop" tends to look a bit complicated as it includes draw command definitions.
Inserting Weather Data
Inserting sensor data into the screen sis easy, as the same template replacement mechanism is used on display definitions as with all the other functions in Meteobridge.
Examples
- Logo Screen shown on boot of Meteobridge PRO:
#clear\n#sblogo 0 0\n#font helvR10\n#string 6 44 meteobridge PRO\n*startfbar 4 56 116 6 right 4\n#show
</translate>