User Tools

Site Tools


users:dagnall53:rdtextalign

Index

WiRocS "RocDisplay" compatibility and formatting

WiRocS uses the following "RocDisplay Compatible" Text Alignment and formatting codes:

  • {T} The node recognises two Tab positions: T0 is 10 Pixels from the left and T1 is 102 pixels from the left.
    • {T0} Special conditions: If Text has been written before the {T0} that is wider than the T0 position, a T0 has no effect. (it will not "move backwards" to the 10 pixel position.)
  • {W} The position of the T1 tab can be altered with a {Wnnn} command. This is volatile and only affects this RocMessage.
  • {L} Text following a {Ln} will be printed n lines lower than the starting point.
    • Unlike a standard RocDisplay, the WiRocS code can choose to display on more than just 2 lines,
    • BUT the Starting Line is always defined by the "text object" 'display' interface number used to send the message.
      • So messages to text object at interface (RN,xx,1) starts at the top of the display, "line 0"
      • those to (RN,xx,2) starts at line 2 (16 pixels down),
      • and those to (RN,xx,3) 3 start at line 4 (32 pixels down)
    • Messages to Text objects (RN,xx,5) to (RN,xx,8) will display on OLED2 (if fitted).
  • {F} The code can select one of 5 fonts. These are copies of Walter Sax's original fonts. F0 is a 7*5 font and si used as a default.
    • F4 is a very large (upper case characters only) Font. F3 is an inverted (5*5) font. F2 is a (6*5) 'narrow' font and F1 is a 6*5 'wide' font
  • {B} Bitmaps. The code has copies of Walter's original bitmaps.
  • {J} (Flashing) Text or bitmaps following a {J1} will only be shown every other second. A {J2} or {J0} reverts to normal non flashing operation
    • Text or bitmaps between a {J2} and the {J0} will flash alternately with the message between the {J1} and {J2}.
    • Flashing ONLY operates at 1 second intervals and is not adjustable.
  • {S} (SETUP) This code is used to set and save an Overall Setup format for each OLED.
    • The Setup Clock commands affect only the OLED to which they are sent.
    • To set the Small analog clock, it accepts {S0} {S1} {SL} and {SR} Codes
    • These set the clock on the OLED displaying Off, On, Left, Right.
    • Commands have been added to control the "_32" mode.
    • {S6} and {S3} Commands resets{S6} or sets{S3} "_32" mode, and affect the whole node.
      • (BUT No effect will be seen until power on/off, so a {SE} command must be sent as well to save to EEPROM).
    • All {S} Settings are Volatile until a {SE} command is sent, which saves to EEPROM.
  • COMMAND SEQUENCING The format parsing needs to know the line to write on Before any TAB command.
    • But I have included code so that if the Line Command IMMEDIATELY follows the T command, it is correctly interpreted.
  • WordWrap (Formatted Messages). Formatted messages are assumed to be correctly sized, so no WORD wrap is applied, to avoid overwriting.
  • WordWrap (Unformatted Messages). Unformatted messages (ie ones that contain no '{' or '}' will be word wrapped.
  • Message Length The Length of text that can be sent via Rocnet is limited to circa 110 characters.

WordWrap Example

Word wrapping of unformatted text tries to take account of any clock that may be display by other messages sharing the OLED. (In the right photo, text object (50,60,1) is showing some time-table information (using RocDisplay formatting)and (50,60,3) was sent some unformatted text.) In the Left photo, both text objects (50,60,1) and (50,60,3) were sent unformatted text.



Font and Bitmap example

This is an example of very nearly the longest message that can be sent with RocNet, and shows how multiple fonts, bitmaps etc can be displayed on multiple lines. The message was sent to "text object" with interface (50,60,1) so starts at the top of the OLED. Clock is displayed because I set this earlier and this format was saved in the EEprom.

   {B0B2B2B3B4B5B6B7B8L1B9B10B11B12L2B13B14B15B16B17F0L6}Font 0  {F1}Font1{F2L7}Font 2   {F3L7}Font 3{F4L5T1}4{P}

The fonts were edited with GlyphEditor2 . The font files are here


Saving OLED Settings to EEPROM

My new code can to select between 64 or 32 pixel high displays and decide if the small clock will be Left or right. All this is saved in EEPROM..

As an example: The way to change the Pixel size of the displays is:

  • Unordered List ItemSet up a push button on Rocview that has a "Display" message and a "clear" message (like you already have?)
  • It does not matter which OLED you send this to, but it must be one that you can see the displays messages work.
  • In the display message, change the message to add {S6SE}.
  • Send this to the display.
  • Then clear the display. (this saves sending extra {SE} that might wear out the EEPROM
  • Reboot the board
  • As a general rule, try to only send the {SE} command as the last message and sent only once you have the settings right. I do try to avoid too many EEPROM writes to the ESP to save wearing out the EEPROM.

The next time the board boots it should change to -64 high displays.

To use -32 pixel displays, send {S3SE} The same method works for the Clock Left/Right etc, but you do not need to reboot unless you change the Pixel setting.

users/dagnall53/rdtextalign.txt · Last modified: 2019/04/18 11:43 by dagnall53