Inhibit (lock) Switches with xml script.

Moderator: dadolphs

ron&bram
Posts: 2460
Joined: 11.06.2008, 19:34
Location: Heemskerk, Netherlands

Re: Inhibit (lock) Switches !

Post by ron&bram » 02.11.2015, 09:46

Hi Christophe,
For the locid you don't need te create a virual loco. You can just use any text that you like, but the text used for unlocking must be identical to the text used for locking.

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches !

Post by Blackpixel83 » 02.11.2015, 17:11

Hi,

After a quick test it seems to work.
I will set it for all the network this Wednesday and i'll let you know the result.
Once again thank you Rob for your work.

Just a thing, in the edit windows for script in action definition, the lock and unlock are not in the command drop down list.

Christophe.

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches !

Post by Blackpixel83 » 02.11.2015, 17:48

Hi Rob,

Oups, speaking too fast :)
<xmlscript>
<sw id="SW-425-CTC" cmd="lock" locid="CTC"/>
<sw id="SW-415-CTC" cmd="lock" locid="CTC"/>
</xmlscript>

Is working well but :
<xmlscript>
<sw id="SW-425-CTC" cmd="unlock" locid="CTC"/>
<sw id="SW-415-CTC" cmd="unlock" locid="CTC"/>
</xmlscript>

give the message :

11:33:55 switch [SW-415-CTC] is locked by [CTC]: reject any commands from others
11:33:55 switch [SW-425-CTC] is locked by [CTC]: reject any commands from others

have I done something wrong ?

Thank you.

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

Re: Inhibit (lock) Switches !

Post by rjversluis » 02.11.2015, 17:54

Blackpixel83 wrote:have I done something wrong ?
no, that is a bug. ;)
Tomorrow I will correct this.

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches !

Post by Blackpixel83 » 02.11.2015, 18:12

Cool, thank you !

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

Re: Inhibit (lock) Switches !

Post by rjversluis » 03.11.2015, 07:04

Hi Christophe,

its fixed in revision 10096.

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches !

Post by Blackpixel83 » 03.11.2015, 16:34

Nice, as soon it is on the dowload page i'll test it !

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches !

Post by Blackpixel83 » 04.11.2015, 05:28

Thank you Rob, it work fine.

Ok so can I use something like that :

<foreach table="lclist" condition="desc # MAIN">
<sw id=%oid% cmd="lock" locid="mylock"/>
</foreach>

to lock all turnout with MAIN in the description field ?

Christophe.

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

Re: Inhibit (lock) Switches with xml script.

Post by rjversluis » 04.11.2015, 07:17

Hi Christophe,

with revision 10100+ you can do something like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xmlscript>
  <foreach table="swlist" condition="%swdesc% # MAIN">
    <sw id=%oid% cmd="lock" locid="mylock"/>
  </foreach>
</xmlscript>

Blackpixel83
Posts: 131
Joined: 21.02.2013, 15:43
Location: Montreal
Contact:

Re: Inhibit (lock) Switches with xml script.

Post by Blackpixel83 » 04.11.2015, 15:03

Great it work very well !

Thank you Rob !


Christophe.

Thagu
Posts: 176
Joined: 31.12.2016, 00:28

Re: Inhibit (lock) Switches with xml script.

Post by Thagu » 09.10.2018, 09:00

Hallo Rob

Code: Select all

  <foreach table="swlist" condition="%swdesc% # MAIN">
ich würde das gerne für Ausgange machen. %codesc% statt %swdesc% scheint nicht zu funktionieren.

Wäre diese Umsetzung auch noch möglich?
Danke und Gruss
Guido

Thagu
Posts: 176
Joined: 31.12.2016, 00:28

Re: Inhibit (lock) Switches with xml script.

Post by Thagu » 09.10.2018, 09:11

… und übrigens auch für Signale.

Ich brauche das Feld als Klassifizierung resp. Gruppierung der Objekte.

Aktuell mache ich es über ein Get und fülle eine Variable damit:

Code: Select all

		<foreach table="colist" >
			<query vr="%oid%_desc" table="colist" id="%oid%" get="desc"/>
				<if condition="@%oid%_desc = %callerdesc%">

Code: Select all

		<foreach table="sglist" >
			<query vr="%oid%_desc" table="sglist" id="%oid%" get="desc"/>
				<if condition="@%oid%_desc = %callerdesc%">
Das hat aber den Nachteil, dass ich immer die ganze Liste durchlaufen muss --> wird wohl ein Performance Problem

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

Re: Inhibit (lock) Switches with xml script.

Post by rjversluis » 09.10.2018, 09:19

Hi Guido,

soeben hinzugefügt.

Thagu
Posts: 176
Joined: 31.12.2016, 00:28

Re: Inhibit (lock) Switches with xml script.

Post by Thagu » 09.10.2018, 09:24

Fantastic!

und guten Morgen :-)

Thagu
Posts: 176
Joined: 31.12.2016, 00:28

Re: Inhibit (lock) Switches with xml script.

Post by Thagu » 09.10.2018, 09:30

Noch was:
für die Textvariablen: könnten wir analog %bkid% auch eine %sbid% für den Aufruf eines Staging Blocks zur Verfügung haben?
wie hier beschrieben für Blöcke:

https://wiki.rocrail.net/doku.php?id=te ... #variables

und ev. die anderen Eigenschaften auch? Die brauch ich aber jetzt nicht gerade.


… und wenn ich dich schon am Haken habe ;-) Ich habe in einem anderen Thread angefragt, was der ungleich Operator für text ist:
Für Zahlen ist "!" das Gegenteil von "="
für Text ist das ??? das Gegenteil von "#"

Post Reply

Return to “Basic topics”