Table of Contents
Loco image in block
Introduction
This documentation was created as of 09.01.2025
Update 06.02.2025 Chapter "Block with no image"
Area | Details | Remarks |
---|---|---|
Control | Rocrail | Version 2.1.5394+ (macOS "Sonoma" on Apple M2 CPU) |
Computer | MacBook Pro (M2) | macOS 14.5 (Sonoma) |
SVG | dynthemes | SpDrS60 |
Track | Track N (1:160) | … |
Locomotive | Track N (1:160) | some digital locomotives |
(WIP) The work is still in progress.
quick link to the Test Workspace
Design details for loco images
At first here is a list of important links:
Rocview General Properties / Show loco image in block | general Rocview property to enable the visibility of the loco image in a block |
Block General Properties / Image | individual Block property to enable the visibility of the loco image in a certain block |
General / Image path | location of the images; some "image requirements" |
Locomotives / General / Image | Supported formats |
In summary:
Design hints for loco images
With some parameters from the real world the loco image may look like this:
Object | Reference [cm] | 80 pixel image [pixels] | Example |
---|---|---|---|
Overhead line | 535 | 80 | |
Electric locomotive roof height | 384 | 57 | ![]() |
Passanger car roof height | 405 | 61 | ![]() |
Buffer height above rail | 100 | 15 | |
Rail height | 2 |
To show the opposite side of the locomotive the image will be mirrored horizontally - which will look bad for readable content.
Two loco images
With Rocrail version 2.1.4641+ two images for locomotives and cars can be defined:
To use two images this is required: Rocview property / General / View / Loco image & 2
The two images can than be configured at Locomotive properties / General / Image
- the left entry defines the locomotive image with the locomotive driving to the left;
- the second entry defines the locomotive image with the locomotive driving to the right;
- the third entry defines the locomotive image used optionally to be displayed in a block.
Two images per locomotive/car were introduced to show the different designs of the left side and the right side of the locomotive/car.
Block image
With Rocrail version 2.1.5372+ a third image for locomotives can be defined to be displayed in blocks:
Properties
To show loco images in a block these properties are used:
Rocview properties
Rocview Properties / General / Plan | Show loco image in block |
Rocview Properties / General / Plan | Mirror image |
Block properties
Locomotive properties
Locomotive placing
The standard direction of driving is assumed to be forwards; loco property dir="true".
Put a locomotive on a peace of track and drive the locomotive forwards.
Placing is defined as "true" if the locomotive drives forwards from left to right.
Placing is defined as "false" if the locomotive drives forwards from right to left.
dir="true" | placing | driving directions | image | physical real movement direction of the loco |
---|---|---|---|---|
![]() | true | loco drives forwards to the right | ![]() | ![]() |
![]() | false | loco drives forwards to the left | ![]() | ![]() |
The real locomotive has to be configured in a way that the locomotive does move as shown on the Rocrail display.
Locomotive blockenterside
To display an image of a locomotive in a block may have the following variations (with dir="true"):
Attention: Rocview Properties / General / Plan / Show loco image in block = ON
Attention: Rocview Properties / General / Plan / Mirror image = ON
Usage
Locomotives Tab
An image of the locomotive may be shown in some places:
a) the "Locomotives Tab" displays one or two images depending on how the locomotive images are configured.
b) the "Locomotives Tab" displays the calculated train image in case of "Rocview Properties / General / View / Train image" = ON.
- The train is shown driving from right to left.
- The configuration of the train is controlled by the train attributes "Swap train image" (swaptrainimage) and "Shift loco image" (swaplocoimage).
- The configuration of the train is explained at https://wiki.rocrail.net/doku.php?id=operator-index-en#loco_details
"Swap train image" | "Shift loco image" | ||
---|---|---|---|
swaptrainimage | swaplocoimage | Display | Remark |
false | false | ![]() | |
true | false | ![]() | this is used in this documentation |
false | true | ![]() | |
true | true | ![]() |
c) Column "image" of the list of locomotives displays the first image of the properties of this locomotive.
In all cases the images are shown in its normal way - no rotation, no mirroring.
-
- for details see https://wiki.rocrail.net/doku.php?id=loc-tab-en
Some additional explanations:
column | attribute | |
---|---|---|
block | blockenterside | Remark |
bk81 | true | the locomotive has entered the block from its plus side |
-bk81 | false | the locomotive has entered the block from its minus side |
V__ | placing | Remark |
0% | true | no prefix: normal placing of the locomotive |
-0% and red background | false | minus prefix: swapped placing of the locomotive |
Throttle
The throttle shows the first image of the properties of the locomotive. The image is shown in its normal way - no rotation, no mirroring.
Examples can be seen below.
-
- for details see https://wiki.rocrail.net/doku.php?id=loc-tab-en#throttle
Block
There are a lot of parameters that influence the appearance of an image of a locomotive or car in a block:
Attribute | Value | |
---|---|---|
Rocview Properties / General / Plan | Show loco image in block; see Properties | ON |
Mirror image | ON | |
Block Properties / General | Image | ON |
Locomotive | blockenterside | true / false |
placing | true / false | |
number of images | none, one, two, block | |
Car | number of images | none, one, two |
Operator (train) | list of cars | none, one or more |
Block | orientation | west, east, north, south |
Some examples of the display result will be shown below.
Text
The only supported orientation of a text object to display locomotives and/or trains is: west
To display a locomotive and/or train in a text object:
Attribute | Value | |
---|---|---|
Text Properties / General / Type | Train image | ON |
Mirror image | OFF | |
Action Properties / Definition | Type | Text |
ID | a valid ID | |
Command | Update | |
Block Properties / Action control | ID | the ID of the text update action |
State | occupied AND free |
Some examples of the display result will be shown below.
Block / Text Results
To display the number of combinations will result in a very high number (16x16x4x4x8= 32768):
- loco image: none, one, two, block
- block orientation: west, east, north, south
- loco: blockenterside, placing
- train: no cars, cars
- car image: none, one, two
Therefore only some examples will be shown here:
All combinations can be configured by the user using the following Rocrail workspace.
Block with no image
added 06.02.2025
These screenshots have been taken with:
Rocview properties / General / | Value |
---|---|
View / Loco image | YES |
View / 2 | YES |
View / Train image | YES |
View / Car image | YES |
Plan / Block ID | YES |
Plan / Show loco image in block | YES |
Plan / Mirror image | YES |
screenshot block open | screenshot block closed | block content | loco bes 1) | loco dir | remark | ||||
---|---|---|---|---|---|---|---|---|---|
![]() | ![]() | block ID | - | - | empty block | ||||
![]() | ![]() | block ID | space | loco ID | true | true ![]() | loco in block | ||
![]() | ![]() | block ID | space | loco ID | underlined text | false | true ![]() | loco in block | |
![]() | ![]() | block ID | space | loco ID | uparrow | true | false ![]() | loco in block | |
![]() | ![]() | block ID | space | loco ID | uparrow | underlined text | false | false ![]() | loco in block |
![]() | ![]() | block ID | number sign | value | - | - | one car in block | ||
![]() | ![]() | block ID | number sign | value | - | - | three cars in block | ||
![]() | ![]() | loco ID | underline | train ID | true | true ![]() | train in block | ||
![]() | ![]() | block ID | - | - | train in block (ID is not shown) |
The direction is controlled by the attribute "dir" of the locomotive.
![]() | In automatic mode the direction should always be forwards - double arrows showing to the right in the throttle dialog. |
Test Workspace
The test workspace does include a set of four blocks that represent all four combinations of the attributes "blockenterside" and "placing" of locomotives.
Other parameters can be setup by text or buttons.
With "execute" an XMLScript is launched that modifies all required attributes of the locomotives, trains, cars, …
The result will become visible after some seconds of execution.
The workspace contains the following files:
File | Content |
---|---|
plan.xml | the Rocrail plan file |
ac_lti_execute.xml ac_lti_ori.xml ac_lti_out_of_sync.xml ac_lti_serverrev.xml ac_lti_update.xml | some XMLScripts |
lti_images | a folder with images to be stored in the Rocrail images folder |
lti_test_plan.png | a screenshot of the Rocrail plan |
To get the results of this documentation these properties have to be used:
Area | Property | Value |
---|---|---|
Rocview Properties / General / Plan | Show loco image in block | ON |
Rocview Properties / General / Plan | Mirror image | ON |
Block Properties / General | Image | ON |
Download and use this workspace lti_loco_train_images at your own risk.
The real locomotive has to be configured in a way that the locomotive does move as shown on the Rocrail display.
back to Introduction
to be done
Rocview:
- Plan:
– Show train ID in block