User Tools

Site Tools


manual-routes-fr

Itinéraires avec des actions

Le plan brut

Le premier plan avec un aiguillage et deux itinéraires définis. Les trois boutons servent à fixer les itinéraires.

<plan title="plan.xml" rocguiversion="1.4.999 revision 924" rocrailversion="1.4.999 revision 924">
  <zlevel title="example" z="0" active="true"/>
  <tklist>
    <tk type="straight" id="tk20091025102741245" x="3" y="2" z="0"/>
    <tk type="straight" id="tk20091025102741717" x="4" y="2" z="0"/>
    <tk type="straight" id="tk20091025102801615" x="6" y="1" z="0"/>
    <tk type="straight" id="tk20091025102802741" x="7" y="1" z="0"/>
    <tk type="straight" id="tk20091025102803693" x="6" y="2" z="0"/>
    <tk type="straight" id="tk20091025102804102" x="7" y="2" z="0"/>
    <tk type="straight" id="tk20091025102808046" x="8" y="1" z="0"/>
    <tk type="straight" id="tk20091025102808510" x="8" y="2" z="0"/>
    <tk type="curve" id="tk20091025102842839" x="5" y="1" z="0" ori="north"/>
    <tk type="straight" id="tk20091025102848135" x="10" y="1" z="0"/>
    <tk type="straight" id="tk20091025102848975" x="10" y="2" z="0"/>
    <tk type="straight" id="tk20091025102850567" x="1" y="2" z="0"/>
  </tklist>
  <swlist>
    <sw type="left" id="w1" x="5" y="2" z="0" switched="9" ori="east" prev_id="w1" blockid="" accnr="1" savepos="none" dir="false" swtype="default" road="false" iid="" bus="0" addr1="0" port1="999" gate1="0" inv="false" singlegate="false" addr2="0" port2="0" inv2="false" actdelay="false" delay="0" prot="D" fbRinv="false" fbGinv="false" fb2Rinv="false" fb2Ginv="false" state="turnout">
      <accessoryctrl active="false" interval="0" delay="0" lockroutes=""/>
    </sw>
  </swlist>
  <colist>
    <co id="a1" x="9" y="1" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west"/>
    <co id="a2" x="9" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west"/>
    <co id="a3" x="2" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off"/>
  </colist>
  <stlist>
    <st id="w_b1" prev_id="w_b1" bka="" bkb="" bkc="" modid="" dir="true" lcdir="true" speed="none" reduceV="true" swap="false" swappost="false" crossingblocksignals="false" typeperm="all" maxlen="0">
      <swcmd id="w1" cmd="straight" lock="true"/>
    </st>
    <st id="w_b2" prev_id="w_b2" bka="" bkb="" bkc="" modid="" dir="true" lcdir="true" speed="none" reduceV="true" swap="false" swappost="false" crossingblocksignals="false" typeperm="all" maxlen="0">
      <swcmd id="w1" cmd="turnout" lock="true"/>
    </st>
  </stlist>
</plan>

Les Actions

Maintenant nous avons besoin de deux actions pour déclencher les itinéraires. Cela peut être fait en utilisant la boite de dialogue actions.

Dans le plan.xml les lignes suivantes sont ajoutées:

<aclist>
    <ac id="ac_b1" timed="false" hour="0" min="0" cmd="" oid="w_b1" actiontime="0" param="" timer="0" type="st"/>
    <ac id="ac_b2" timed="false" hour="0" min="0" cmd="" oid="w_b2" actiontime="0" param="" timer="0" type="st"/>
</aclist>

Les Boutons

Maintenant, ce que nous voulons c'est que si un quelqu'un appuie sur le bouton démarrer et après cela, un bouton dans l'une des voies indique l'itinéraire correspondant. Donc nous avons besoin de la condition que l'action soit exécutée si le bouton 1 est activé.

<co id="a2" x="9" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west">
    <actionctrl id="ac_b1">
        <actioncond id="a1" state="on" type="co"/>
    </actionctrl>
</co>
<co id="a3" x="2" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off">
    <actionctrl id="ac_b2">
        <actioncond id="a1" state="on" type="co"/>
    </actionctrl>
</co>

mais maintenant les boutons restent activés après que l'itinéraire est défini. Donc nous devons définir une autre action pour les désactiver.

Donc nous élargissons la aclist à:

  <aclist>
    <ac id="ac_b1" timed="false" hour="0" min="0" cmd="" oid="w_b1" actiontime="0" param="" timer="0" type="st"/>
    <ac id="ac_b2" timed="false" hour="0" min="0" cmd="" oid="w_b2" actiontime="0" param="" timer="0" type="st"/>
    <ac id="a1_off" timed="false" hour="0" min="0" cmd="off" oid="a1" actiontime="0" param="" timer="0" type="co"/>
    <ac id="a2_off" timed="false" hour="0" min="0" cmd="off" oid="a2" actiontime="0" param="" timer="0" type="co"/>
    <ac id="aw_off" timed="false" hour="0" min="0" cmd="off" oid="aw" actiontime="0" param="" timer="0" type="co"/>
  </aclist>

et ajoutons les actions aux boutons:

  <colist>
    <co id="a1" x="9" y="1" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off">
      <actionctrl id="ac_b1">
        <actioncond id="aW" state="on" type="co"/>
      </actionctrl>
      <actionctrl id="aw_off"/>
      <actionctrl id="a1_off"/>
      <actionctrl id="a2_off"/>
    </co>
    <co id="aw" x="2" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off"/>
    <co id="a2" x="9" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off">
      <actionctrl id="ac_b2">
        <actioncond id="aW" state="on" type="co"/>
      </actionctrl>
      <actionctrl id="aw_off"/>
      <actionctrl id="a1_off"/>
      <actionctrl id="a2_off"/>
    </co>
  </colist>

Le fichier plan final

ressemble à ça:

<plan title="plan.xml" rocguiversion="1.4.999 revision 924" rocrailversion="1.4.999 revision 924">
  <zlevel title="example" z="0" active="true"/>
  <tklist>
    <tk type="straight" id="tk20091025102741245" x="3" y="2" z="0"/>
    <tk type="straight" id="tk20091025102741717" x="4" y="2" z="0"/>
    <tk type="straight" id="tk20091025102801615" x="6" y="1" z="0"/>
    <tk type="straight" id="tk20091025102802741" x="7" y="1" z="0"/>
    <tk type="straight" id="tk20091025102803693" x="6" y="2" z="0"/>
    <tk type="straight" id="tk20091025102804102" x="7" y="2" z="0"/>
    <tk type="straight" id="tk20091025102808046" x="8" y="1" z="0"/>
    <tk type="straight" id="tk20091025102808510" x="8" y="2" z="0"/>
    <tk type="curve" id="tk20091025102842839" x="5" y="1" z="0" ori="north"/>
    <tk type="straight" id="tk20091025102848135" x="10" y="1" z="0"/>
    <tk type="straight" id="tk20091025102848975" x="10" y="2" z="0"/>
    <tk type="straight" id="tk20091025102850567" x="1" y="2" z="0"/>
  </tklist>
  <swlist>
    <sw type="left" id="w1" x="5" y="2" z="0" switched="29" ori="east" prev_id="w1" blockid="" accnr="1" savepos="none" dir="false" swtype="default" road="false" iid="" bus="0" addr1="0" port1="999" gate1="0" inv="false" singlegate="false" addr2="0" port2="0" inv2="false" actdelay="false" delay="0" prot="D" fbRinv="false" fbGinv="false" fb2Rinv="false" fb2Ginv="false" state="turnout">
      <accessoryctrl active="false" interval="0" delay="0" lockroutes=""/>
    </sw>
  </swlist>
  <colist>
    <co id="a1" x="9" y="1" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off">
      <actionctrl id="ac_b1">
        <actioncond id="aw" state="on" type="co"/>
      </actionctrl>
      <actionctrl id="aw_off"/>
      <actionctrl id="a1_off"/>
      <actionctrl id="a2_off"/>
    </co>
    <co id="aw" x="2" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off"/>
    <co id="a2" x="9" y="2" z="0" desc="" show="true" svgtype="3" blockid="" routeids="" iid="" bus="0" addr="0" port="0" gate="0" prot="D" ori="west" state="off">
      <actionctrl id="ac_b2">
        <actioncond id="aw" state="on" type="co"/>
      </actionctrl>
      <actionctrl id="aw_off"/>
      <actionctrl id="a1_off"/>
      <actionctrl id="a2_off"/>
    </co>
  </colist>
  <stlist>
    <st id="w_b1" prev_id="w_b1" bka="" bkb="" bkc="" modid="" dir="true" lcdir="true" speed="none" reduceV="true" swap="false" swappost="false" crossingblocksignals="false" typeperm="all" maxlen="0">
      <swcmd id="w1" cmd="turnout" lock="true"/>
    </st>
    <st id="w_b2" prev_id="w_b2" bka="" bkb="" bkc="" modid="" dir="true" lcdir="true" speed="none" reduceV="true" swap="false" swappost="false" crossingblocksignals="false" typeperm="all" maxlen="0">
      <swcmd id="w1" cmd="straight" lock="true"/>
    </st>
  </stlist>
  <aclist>
    <ac id="ac_b1" timed="false" hour="0" min="0" cmd="" oid="w_b1" actiontime="0" param="" timer="0" type="st"/>
    <ac id="ac_b2" timed="false" hour="0" min="0" cmd="" oid="w_b2" actiontime="0" param="" timer="0" type="st"/>
    <ac id="a1_off" timed="false" hour="0" min="0" cmd="off" oid="a1" actiontime="0" param="" timer="0" type="co"/>
    <ac id="a2_off" timed="false" hour="0" min="0" cmd="off" oid="a2" actiontime="0" param="" timer="0" type="co"/>
    <ac id="aw_off" timed="false" hour="0" min="0" cmd="off" oid="aw" actiontime="0" param="" timer="0" type="co"/>
  </aclist>
</plan>

Tous ceci peut être fait en utilisant l'interface. Mais c'est plus facile d'éditer les fichiers xml directement.

manual-routes-fr.txt · Last modified: 2019/02/21 15:34 by phil45