This page will explain how to get simple messages displayed on WiRocS with Standard I2C OLED displays.
The WiRocS display system is heavily based on Walter Sax's RocDisplay system, and should be largely compatible. The German forum has discussions about using Rocdisplay to show live scheduling |RocDisplay (Bahnsteiganzeige) Ansteuerung NEU
Peter (peter&basti) posted an example workspace to show how scheduling and automatic displays work |RocDisplay Scheduling Example and wrote a page on Scheduling with RocDisplay
In this space I will not try to explain Scheduling, or the (super!) XML to generate automatic messages from the Schedules, to understand these, please follow the Forum discussions.
But I will try to show how to put simple messages onto the displays. This should allow display of "pre-written" messages that can be updated either as a consequence of some RocRail action, OR by pressing a "button" on RocView.
The RocDisplay system is based on RocRail "Text" objects. You will need one Text object for each schedule or message. The original RocDisplay system used 128*16 displays, so for backwards compatibility my larger displays display two or four text objects. For a 128*64 display you will need four Text objects. Each Text object has an Interface setting that defines where the message will be sent. Their Interface settings are as follows:
Do not worry at this stage about putting any text in the "text" box in the 'General' tab when setting up the display, but Do Make sure you give the Text Object a name that you can recognize easily later. Incidentally, you can position the "text" on your RocView screen so it will show what will be sent. (Peter's example code uses this feature to show a timetable on the screen)
This illustration shows text object is "Node50_Display1" and has interface (50,60,01).
You will need four text objects (50,60,1), (50,60,2),(50,60,3) and (50,60,4) to be able to write to all of the 128*64 OLED1.
Text objects with interfaces (50,60,5), (50,60,6),(50,60,7) and (50,60,8) will be sent to "OLED2"
Text objects with interfaces (50,61,1), (50,61,2),(50,61,3) and (50,61,4) will be sent to "OLED3"
Text objects with interfaces (50,61,5), (50,61,6),(50,61,7) and (50,61,8) will be sent to "OLED4"
If switched to 128*32 mode, text objects (50,60,1), (50,60,2) go to "OLED1" (50,60,3) and (50,60,4) show on "OLED2". NOTE, in _32 mode, the (50,60,5-8) text objects are not shown anywhere.
The easiest way to actually "use" the system is to use ACTIONS, and to have these triggered by PushButtons on RocView.
To do this you must first create some ACTIONS. I have generated quite a few whilst programming and testing the code. A typical action example is this example "1 RocDisplay1"
You need to set the "type" to Text, and then in "ID" select the text object you will be modifying. Here I am using the text object "Node50_Display 1". In the Parameter field, write the text (RocDisplay formatted if you want), and this will be sent to the text object (and then to the OLED). You do not need to do anything in the Interface tab!
Now add a button to your RocView, and select "properties" and click on the "ACTIONS" box: Select the ID for the Action we just wrote: here it was "1 RocDisplay1", click on ADD, and it will appear in the list of actions that will happen when the button is pushed. (make sure the button is set to Push button).
Its as simple as that. Now, when you press the button, RocRail will send the message we defined in the Action "1 RocDisplay1" to text object "Node50_Display 1" (50,60,1), and it should appear on the top lines of OLED 1. You can add more actions to a single button to allow you to update a whole display with just a single button.
This code tries to keep RocDisplay compatible formatting
The original RocRisplay was based on 128*16 OLEDS, and so each Text Object was able to send text to TWO lines of these small OLEDS.
In WiRocS version of the system:
The WiRocS can also be used with smaller 128*32 displays.
RocDisplay Text Objects display on "two" lines of each OLED.
A 128*64 OLED1 with I2C Address 60 on the Main I2C bus of Rocnode has 8 physical lines of text.
Each display can therefore display 4 pairs of RocDisplay/'Text Object' 'lines'.
Text for the top two lines are sent using "text object" messages to (50,60,1)
Text for the next two lines are sent using text object (50,60,2), etc.
Allowing direct writing to all 8 line pairs, and retaining compatibility with existing Rocdisplay systems.
Assuming the following (formatted) text examples
The OLED will show something like this:
Text_Object"1" Line 'L0' Text_Object"1" Line 'L1' Text_Object"2" Line 'L0' Text_Object"2" Line 'L1' Text_Object"3" Line 'L0' Text_Object"3" Line 'L1' Text_Object"4" Line 'L0' Text_Object"4" Line 'L1
When you send short, "UNFORMATTED" text, you have just 4 lines showing (although unformatted text will be allowed to wrap.. see later)
Text_Object "1" Unformatted Text (space) Text_Object "2" Unformatted Text (space) Text_Object "3" Unformatted Text (space) Text_Object "4" Unformatted Text (space)
When using "unformatted" messages, the displays will wrap long messages. This example shows two long messages sent to two text objects. The first text was sent to object"Node50_Display 1"(50,60,1) described earlier. The second text was sent to a text object called "Node 50 -3"(50,60,3). Note that the message to (50,60,1) actually goes down to line3 of the display, so any text sent by sent to (50,60,2) could be overwritten or corrupted.
If the Clock has been set in RocDisplay messages, AND a RocDisplay formatted message, (like a standard platform message), is being shown, then the Word wrapping will "tighten up" so as not to overwrite the clock. Here the message to text object (50,60,1) has been changed, but the message to text object (50,60,3) remains the same as in the previous photo.
RocDisplay formatted messages are NOT allowed to Wrap. It is assumed that they will be properly sized to show on the display. IF a very long RocDisplay formatted message is sent, the end of the message can reappear on the left of the display and overwrite any text on the left. This will produce a mess on the screen. The answer to this is to keep RocDisplay messages short!