Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.



Go to last post in this topic Go to first unread post in this topic
Offline Martti Mäntylä  
#1 Posted : 02 November 2021 23:36:38(UTC)
Martti Mäntylä

Joined: 15/11/2018(UTC)
Posts: 299
Location: Uusimaa, Helsinki
I have now used Rocrail to control my analog/digital setup for three years, and I am still happy with my choice. I like especially the possibility to tweak the system or add functionality by writing XML macros.

One area where Rocrail nevertheless does not shine brightly is documentation. The Rocrail wiki is essential, and mostly useful, but often information is hidden pretty deeply in it. I remember spending quite some time to find (again) the list of internal variables that can be used in XML macros; it was not obvious that it was included on the Wiki page on "Text" objects.

A feature that I have been missing is elementary arithmetic: sometimes it would be nice to calculate some simple things in XML macros. I thought the feature was not present, until recently I read once again the Wiki page on "General XML Script Examples" and suddenly saw that the section on "Variables" was clearly applying "+" to do summing.

So, I could finally write the macro I always wanted to have:
<?xml version="1.0" encoding="UTF-8"?>
    <vr id="thistime" value="&time - #prevtime"/>
    <tx id="tx1" format="Round trip time: #thistime s"/>
    <vr id="speed" value="2878 / #thistime"/>
    <tx id="tx2" format="Average speed: #speed km/h"/>
    <vr id="prevtime" value="&time"/>

that computes and displays the round trip time around the main loop and the (scaled) average speed.

So it appears that at least the four basic arithmetic operations are supported. Who knows what else XML can do with variables? The <tx ...> command hints that XML probably has a bunch of string operations as well. If they are documented somewhere on the Wiki, I at least have not yet found the spot.
- Martti M.
Era III analog & digital (Rocrail, CAN Digital Bahn, Gleisbox/MS2, K83/K84), C & M tracks, some Spur 1
thanks 6 users liked this useful post by Martti Mäntylä
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2022, Yet Another Forum.NET
This page was generated in 0.290 seconds.