A unique ID, which is used by Rocrail to address the element. This ID is usually assigned by Rocrail.
This attribute stores the string, which should be displayed in the track plan and can be changed here.
Select the path to an image using this button, to show an image instead of a simple text.
Image refresh time in ms which can be used for WebCam pictures.
This option must be greater the 99 to be activated.
Tooltip for this element.
Is the field empty, the ID will shown as tooltip.
You can change with this attribute the font size of the text.
0 (default) means the standard value of the operating system.
The raster width and height of the text object.
Background color. Is only shown if the attribute transparent is not set.
Default is horizontal.
Reset the saved text content at startup; Useful for dynamic text.
Pop up an text entry dialog, on left mouse click, to modify the text.
Text values can be used as condition in actions.
Draws a border around the text field.
Enables the fast clock popup in some clients:
In case the text points to an image it will be mirrored horizontally.
If dynamic text starts with the new line char it will be appended to the existing text.
If the text ends with .png the text object will try to find the matching image in the Imagepath.
The image will be scaled, with respect to the image aspect, to fit the text size as defined on the Position Tab.
An action can be used to let the text be spoken by a program like espeak on the server.
To have textfields updated by a block be spoken on the client, read Speak command.
This action will only be executed when this text object is update by a Text action. (See Dynamic text).
| Example for an action to speak the updated |
text could look like this.
| In the 'properties' of the text-element this action needs to be
linked to this text object using the actioncontrol dialog like this.
Dynamic text is text that is updated or changed through an action.
A text object needs to be created in the track plan to contain the dynamic text. It is not important what text is written in the field as this will be changed through the action that controls the text object and therefore can be left blank.
It is important that the width of the text object (Cx in the Position tab) be wide enough to contain all the text that will be written here by the action. Also make a note of the ID of the text object. This will be needed when the action that will change the text will be defined.
From the Tables menu, choose the Actions table and create a new action by clicking on New.
In the field Type choose Text, in the field ID choose the ID of the text object you have just created above and in the Command field choose Update (it is the only option).
The Parameter field will contain the text that will appear in the associated text object. E.g. The train in %bkid% is the %lcid%. The text between the % are the variables that will be updated every time the action is carried out.
|%hour%||Rocrail hour part of time|
|%min%||Rocrail minute part of time|
|%sec%||Rocrail seconds part of time: Only available if Action timer 60sec is disabled.|
|%callerid%||The ID of the object which called this action.|
|%callerdesc%||The description of the object which called this action.|
|%calleruserdata%||The user data of the object which called this action.|
|%state%||The state of the calling object.|
|%substate%||The sub state of the calling object.|
|Loco & Car|
|%lcshortid%||Loco short ID|
| ||Loco code (RFID, Railcom, Lissy, Barcode…)|
|%lccur%||Loco current block|
|%lccurtrack%||Loco current track in the block (StagingBlock, Turntable, FiddleYard)|
|%lchome%||Loco home location|
|%lcdir%||Loco direction: “fwd”/“rev”|
|%lcplacing%||Loco placing: “norm”/“swap”|
|%lccargo%||Loco or train cargo(type): Train types|
|%lcengine%||Loco engine: “diesel”, “electric”, “steam”, “automobile”|
|%lclen%||Loco or train length|
|%lcweight%||Loco or train weight|
|%operatorid%||Operator ID in case the loco has an assigned train|
|%cartype%||Car type: goods, passenger|
|%carsubtype%||Car subtype: boxcar, gondola, flatcar, reefer, stockcar, tankcar, wellcar, hopper, caboose, autorack, autocarrier, logdumpcar, coilcar, coach, lounge, dome, express, dinner, sleeper, baggage, postoffice|
|%operatorid%||Operator ID in case the car is part of the train|
|%waybill%||The waybill ID assigned to this car.|
|%waybilldest%||The destination of the assigned waybill to this car.|
|%swid%||Switch ID||XmlScript foreach|
|%swtype%||Switch type||XmlScript foreach|
|%swdesc%||Switch description||XmlScript foreach|
|%bidicode%||Loco or car code scanned by a sensor.|
|%bidicode2id%||Loco or car ID which match the scanned code by a sensor.|
|%bidicode2img%|| Loco or car code scanned by a sensor.
If a loco or car is found with this code the image name, if set, will replace the code text.
|%lcscbk%||Schedule block ID|
|%lcscbkloc%||Schedule block location|
|%lcschour%||Schedule departure hour|
|%lcscmin%||Schedule departure minute|
|%lcscnextbk%||Schedule next block ID|
|%lcscnextbkloc%||Schedule next block location|
|%lcscprevbk%||Schedule previous block ID|
|%lcscprevbkloc%||Schedule previous block location|
|%callertext%||Content of the 'Text' field|
|%bkloc%||Block location name|
|%frombkid%||Coming from block|
|%frombkloc%||From block location name|
|%frombkdesc%||Coming from block description|
|%bkmvspeed%||Speed measured in block (use it with state 'free'¹)|
|%counter%||Number of state ON events.|
|%load%||Load in mA|
|%volt%||Voltage in mV|
|%temp%||Temperature in °C|
|%mvspeed%||Measured speed in KM/H|
|#varID or with Sub-ID #varID%lcid%||The integer value|
|@varID||The text value of a variable or text object|
|@@nvarID||The indexed, n=0…9, text value of a variable. The text value must be a comma separated list.|
|##nvarID||The indexed, n=0…9, text value of a variable converted in an integer. (atoi) The text value must be a comma separated list.|
|$txtID||The text of a text object|
|~varID||A pointer to the variable text or value; Depends from XMLScript command: value="~varID" or text="~varID"|
¹) Hint: %bkmvspeed% will be updated on the in-event. The next event which can be used to trigger the update of the text is the change to status 'free'. If you trigger the update on other stati, you will get the last measured speed (which might differ from the actual one.)
All defined environment variables can also be used:
“Good morning %USER%.”
(consider in Windows: %USERNAME%)
will be evaluated like this:
“Good morning rob.”
The next step is to choose the object that will be associated with the action.
In the example above it would be the block for which the dynamic text will be updating with the loco ID. Therefore if the block that is being associated with the action is block LP1 and the next train to enter the block is 3MT, the text object would read “The train in LP1 is the 3MT”.
Following the example the Properties of block LP1 are chosen. In the Actions submenu the action that changes the dynamic text is chosen from the list in the ID field. The State field should read enter so that the action is initiated when a train enters the block.
espeaking the updated text
There are two options to have the updated text read e.g. by espeak:
- Use the speakcommand –> this will be executed on the client computer.
- Configure an extra action as shown here –> this will be executed on the server computer.
Examples with sound files and espeak
A Linux script with the content:
mplayer jingle.wav; espeak -vde+f2 " $* ";
will play a jingle before the dynamic text is spoken.
A Windows batch could look like this:
c:\playwav ns.wav c:\espeak -vnl+m3 %1% exit
Just put the code in a .bat file, like sound.bat. Just call that .bat file from an action connected with a text object in Rocrail.
The %1% will be replaced by the dynamic text that comes from Rocrail
sndrec32 /play /close /embedding c:\sound\gong.wav C:\Programme\eSpeak\command_line\espeak.exe -v de+f2 %*
In some Windows versions for “
sndrec32.exe” other folders are necessary. Please look here
The examples of commands in scripts or batch files with sounds and “espeak” can also be used individually.
If only a single command line should be done, it can be even without a script or batch file entered directly in the
command field of the action.
The Microsoft Speech Platform offers better quality voices in various languages including English, German, Dutch and Italian.
To install on your computer follow these instructions:
1. Download and install the Speech Platform Runtime http://www.microsoft.com/download/en/details.aspx?id=27225 (the file 'x86_SpeechPlatformRuntime\SpeechPlatformRuntime.msi').
2. Download and install Runtime Languages for use with the Speech Platform http://www.microsoft.com/download/en/details.aspx?id=27224 (files with names starting with 'MSSpeech_TTS_').
However these languages cannot be run from command line espeak. Balabolka is a free to use program that can be used to run Microsoft Speech Platform as default. It can be downloaded from here http://www.cross-plus-a.com/balabolka.htm
Choose the tab Microsoft Speech Platform and you will find the language you have downloaded. Closing the program now and this set this voice as your default. Balabolka can be run in command line mode too.
playwav ns.wav c:\Balabolka\balabolka.exe -rmnq %1% exit
With the above parameters Balabolka reads your dynamic text in a minimized form and then quits after the text is read. It is important that for this to work, the Action that calls up the batch file comes from the cell that contains the dynamic text.
Other voices such as those produced by AT&T can be bought if you wish even more better sounding voices.
Balabolka can also save the read text in the program into .WAV or MP3. format. These can be used to create batch files that can be called up from Rocrail upon specific events as explained in the note above for espeak. e.g. A specific station announcement is played only when a specified locomotive enters a specific block http://youtu.be/t1Zffyg4FOQ
Mac OS X: Use the “say” command.
cmdr0A40 OText 0281 send text [Good morning rob] cmdr0A40 OCBUS 1638 translate: tx cmdr0A40 OCBUS 2028 set display 5600:1 to "Good morning rob" cbwriter OCBUS 0170 OPC_ACDAT(0xF6) address=5600 display=1 line=0 nr=0 text=[Good] cbwriter OCBUS 0170 OPC_ACDAT(0xF6) address=5600 display=1 line=0 nr=1 text=[ mor] cbwriter OCBUS 0170 OPC_ACDAT(0xF6) address=5600 display=1 line=0 nr=2 text=[ning] cbwriter OCBUS 0170 OPC_ACDAT(0xF6) address=5600 display=1 line=0 nr=3 text=[ rob]
If you have more than one Command Station you can use this field to link this output with the CS you actually wired it with. Leave blank in case you have only one CS or when it is wired to the default CS. (First digint in the rocrail.ini)
Address of the Display module.
The display number on the module. Range from 1 to 8.
The RocNetNode, 11.204+, can also be used to let the text speak instead of showing it on a display.
To use this feature the Bus must be greater than zero. (RocNetNode ID)