Xml Code for Default Placement

Moderator: dadolphs

Post Reply
Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Xml Code for Default Placement

Post by Joalbach » 28.07.2016, 20:16

I have programmed a java client for the rocrail server.

How can I set the placing to default with an xml command?
Or how can I check, whether the placing is default or not?

Sending something like
<lc id="10" placing="true" invdir="false" />
seems not to have any effect.

The problem is, that if placing is not default, when I send a command <lc id="10" v="8" dir="true" /> the train runs backwards, which is unintended.

I don't want to start Rocview each time to control manually, whether placing is default or not for each loco. I never stop the server, so it might be that placing has been change some time earlier.

Joal

Pirat-Kapitan
Moderator
Posts: 5039
Joined: 06.02.2010, 15:46
Location: Rösrath bei Köln / Germany

Re: Xml Code for Default Placement

Post by Pirat-Kapitan » 28.07.2016, 20:39

Hi Joal,
did You use the loco setting "reset placing and direction"?
http://wiki.rocrail.net/doku.php?id=loc-details-de

best Regards
Johannes

smitt48
Moderator
Posts: 6112
Joined: 04.04.2014, 01:07
Location: Kralendijk, Bonaire - Dutch Caribbean

Re: Xml Code for Default Placement

Post by smitt48 » 28.07.2016, 20:49

Hi Joal,

Here is the English wiki that Johannes provided.

http://wiki.rocrail.net/doku.php?id=loc ... _direction
or some XML variables
http://wiki.rocrail.net/doku.php?id=xml ... g:xmldb-en

Tom
Last edited by smitt48 on 28.07.2016, 20:51, edited 1 time in total.

Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Re: Xml Code for Default Placement

Post by Joalbach » 28.07.2016, 20:51

"Reset placing and direction" is not available in my version.

But I think it would not help, because this resets placing only on server restart, as I understood it.
I never restart the server. It runs continuously on a RaspberryPi.

Joachim

Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Re: Xml Code for Default Placement

Post by Joalbach » 28.07.2016, 21:03

smitt48 wrote:Hi Joal,

Here is the English wiki that Johannes provided.

http://wiki.rocrail.net/doku.php?id=loc ... _direction
or some XML variables
http://wiki.rocrail.net/doku.php?id=xml ... g:xmldb-en

Tom

There is no XML information on the Loco - Interface - Placing=default setting, so I am not sure whether placing="true" or placing="default" or placing="0" is the correct way to use this setting in xml.

Joachim

rjversluis
Site Admin
Posts: 42361
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Xml Code for Default Placement

Post by rjversluis » 28.07.2016, 21:09

the default values are documented.
For the **lc** object see:
http://rocrail.net/software/rocrail-sna ... en.html#lc

Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Re: Xml Code for Default Placement

Post by Joalbach » 28.07.2016, 21:19

Ok, I will do some tests...

Thank you!

Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Re: Xml Code for Default Placement - no success

Post by Joalbach » 28.07.2016, 22:09

The code
<xmlh><xml size="34"/></xmlh><lc id="218 (20)" placing="true"/>
does nothing.

When placing is false, it stays false, and when it is true it stays true.
The same, when I combine it with some v or dir commands.

Joachim

rjversluis
Site Admin
Posts: 42361
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Xml Code for Default Placement

Post by rjversluis » 29.07.2016, 06:18

Hi Joachim,

just try:

Code: Select all

<lc id="x" cmd="swap" placing="true"/>
BTW: Can you show us some screenshots of your Client?

Joalbach
Posts: 6
Joined: 07.02.2015, 11:27
Location: Gießen, Germany

Re: Xml Code for Default Placement, solved

Post by Joalbach » 29.07.2016, 20:29

Thank you, it works!

My client has no GUI yet. It is very specific to my layout.
It is programmed in Java and uses the pi4j libraries to read the gpio pins.
I use only 4 track contacts outside of the switches of the 2 stations (read in parallel by an S88 decoder and the gpio pins).
The advantage is, that I can perfectly use the falling edge of the track contacts, because I programmed a reluctance time of 1 second before the falling edge is acknowledged. So short losses of wheel contacts do not fire the track free signal.

I have made around 15 driving programs which are called on the command line, followed by the locs involved.

Here is a kind of "screenshot".

Joachim

Code: Select all

root@lunetta:/home/pi# java -jar TrainAuto.jar ProgramKr1B 20r 23
Bahnsteuerung gestartet.
trainc.ProgramKr1B
<xmlh><xml size="45"/></xmlh><lc id="218 (20)" cmd="swap" placing="true"/>
<xmlh><xml size="45"/></xmlh><lc id="223 (23)" cmd="swap" placing="true"/>
Runden mit einem Kreuzungsbahnhof. 1. Lok rückwärts auf Einfahrt, 2. Lok wartet auf Nebengleis und fährt vorwärts.
xxR: Lok rückwärts
P2: Minstop
p2=15
P2 now: 15
Minstop now: 15.0
Rupt 4
Rupt 2
Rupt 2 aus
Rupt 1
20 bremsen LS 1
<xmlh><xml size="56"/></xmlh><lc id="218 (20)" V="62" dir="true" usesecaddr="false"/>
<xmlh><xml size="56"/></xmlh><lc id="218 (20)" V="46" dir="true" usesecaddr="false"/>
Rupt 1 aus
20 stoppen LS 1
23 anfahren LS 1
<xmlh><xml size="43"/></xmlh><sw id="1" cmd="turnout" manualcmd="true"/>
<xmlh><xml size="43"/></xmlh><sw id="2" cmd="turnout" manualcmd="true"/>
<xmlh><xml size="55"/></xmlh><lc id="218 (20)" V="0" dir="true" usesecaddr="false"/>
neuer Stage: 1 mit Lok 23
<xmlh><xml size="56"/></xmlh><lc id="223 (23)" V="22" dir="true" usesecaddr="false"/>
<xmlh><xml size="56"/></xmlh><lc id="223 (23)" V="45" dir="true" usesecaddr="false"/>
<xmlh><xml size="56"/></xmlh><lc id="223 (23)" V="68" dir="true" usesecaddr="false"/>
Rupt 1
Rupt 1 aus
q
Ende
root@lunetta:/home/pi# 

Post Reply

Return to “Basic topics”