User Tools

Site Tools


modular-connection-nl

Het verbinden van de modules

Connection Definition

Module connection points: Compass points:

The compass points represent the none rotated module as drawn in Rocrail.
The point abbreviations are shortened to two letters, e.g.: ese → es

The Module Plan

A module can have a maximum of 4 connections. Each connection has its own line in the module plan.

Example:


modplan.xml

<modplan title="MGV Eurospoor 2008" locs="mgv-locs.xml" routes="eurospoor2008-routes.xml" occupation="occ.xml" 
         savemodplan="true" savemodules="false" initfield="false" modroutes="true">
  <module id="m12" title="De fabriek" filename="m12.xml" x="11" y="42" rotation="0" cx="12" cy="6">
    <connection side="point-w" modid="m2" id="m12"/>
  </module>
  <module id="m2" title="Keerlus 2" filename="m2.xml" x="1" y="42" rotation="180" cx="8" cy="4">
    <connection side="point-w" modid="m12" id="m2"/>
  </module>
</modplan>

http://www.rocrail.net/doc/rocrail-wrappers/wrapper-en.html#modplan

The module m2 is rotated by 180 degree so the west side of this module is now at the right!!!

Routes in Modules

The two example modules. Beside the routes all other information is stripped to get it to the point.


m2.xml

<plan rocrailversion="1.1.0 svn0" rocguiversion="1.1.0 svn3341">
  <zlevel title="Keerlus 2" z="12" active="true"/>
  <stlist>
    <st id="ws-2b1" bka="point-ws" bkb="2b1" bkc="" modid="" dir="true">
      <swcmd id="2t1" cmd="straight"/>
    </st>
    <st id="2b1-wn" prev_id="2b1-wn" bka="2b1" bkb="point-wn" bkc="" modid="" dir="true">
      <swcmd id="2t3" cmd="turnout"/>
    </st>
  </stlist>
</plan>


m12.xml

<plan rocrailversion="1.1.0 svn0" rocguiversion="1.1.0 svn3341">
  <zlevel title="De fabriek" z="11" active="true"/>
  <stlist>
    <st id="en-12b1" prev_id="NEW" bka="point-en" bkb="12b1" bkc="" modid="" dir="true"/>
    <st id="12b1-wn" prev_id="NEW" bka="12b1" bkb="point-wn" bkc="" modid="" dir="true"/>
    <st id="ws-12b2" prev_id="NEW" bka="point-ws" bkb="12b2" bkc="" modid="" dir="true">
      <swcmd id="12t1" cmd="straight"/>
    </st>
    <st id="12b2-es" prev_id="12b2-es" bka="12b2" bkb="point-es" bkc="" modid="" dir="true"/>
  </stlist>
</plan>
  • bka = from
  • bkb = to

Resolving Routes

The Rocrail server will make real routes from those who have bka and or bkb set to one of the compass points using the connection descriptions in the modplan file.

  • The route properties of the found end part¹ are used for the complete route.
  • All switch and output commands are merged in the new route.
  • All crossing blocks are merged in the new route.
  • Routes without a block will be used to search on to find one with a block, so routes like from point-ws to point-sw are legal.

¹) An end part of a route is the last part containing a real block in stead of a compass point.

Generated routes

…between module m2 and m12:

  <stlist>
    <st id="12b1-2b1" bka="12b1" bkb="2b1" bkc="" modid="auto-generated" dir="true" z="1">
      <swcmd id="2t1" cmd="straight"/>
    </st>
    <st id="2b1-12b2" prev_id="NEW" bka="2b1" bkb="12b2" bkc="" modid="auto-generated" dir="true" z="0">
      <swcmd id="12t1" cmd="straight"/>
      <swcmd id="2t3" cmd="turnout"/>
    </st>
  </stlist>

A connection can only match between a left and a right point:

Left points point-nw, point-en, point-se, point-ws
Right points point-ne, point-es, point-sw, point-wn


Single track modules should use the simple points:

Simple points point-n, point-e, point-s, point-w


The second compass point character is ignored if a single and a double track module are being connected.

Server trace

#  object   line message
-- -------- ---- -------------------- 
01 OModel   0283 parsePlan file: modplan.xml
02 OModel   0298 Module Plan [Modular Track Layout]
03 OModPlan 0115 parse file: m12.xml
04 OModPlan 0473 Module Plan [De fabriek] parsed for level [0]
05 OModPlan 0373 Module [De fabriek] has [4] routes defined.
06 OModPlan 0382 Unresolved internal route from [point-en] to [12b1]
07 OModPlan 0382 Unresolved internal route from [12b1] to [point-wn]
08 OModPlan 0382 Unresolved internal route from [point-ws] to [12b2]
09 OModPlan 0382 Unresolved internal route from [12b2] to [point-es]
10 OModPlan 0115 parse file: m2.xml
11 OModPlan 0473 Module Plan [Keerlus 2] parsed for level [1]
12 OModPlan 0373 Module [Keerlus 2] has [2] routes defined.
13 OModPlan 0382 Unresolved internal route from [point-ws] to [2b1]
14 OModPlan 0382 Unresolved internal route from [2b1] to [point-wn]
15 OModPlan 0335 Resolving [6] routes with [2] module connections...
16 OModPlan 0296 find a connection to=[point-wn] modid=[m12] in 2 connections
17 OModPlan 0248 find route from point=[point-w] modid=[m2] to=[point-wn]
18 OModPlan 0260 double track connection from=[point-wn] to=[point-ws]
19 OModPlan 0264 MATCHING route[1] from[point-ws]-to[2b1]
20 OModPlan 0155 creating the new route from[12b1] to[2b1]
21 OModPlan 0315 connection found: from[point-ws] - to[2b1]
22 OModPlan 0296 find a connection to=[point-es] modid=[m12] in 2 connections
23 OModPlan 0296 find a connection to=[point-wn] modid=[m2] in 2 connections
24 OModPlan 0248 find route from point=[point-w] modid=[m12] to=[point-wn]
25 OModPlan 0260 double track connection from=[point-wn] to=[point-ws]
26 OModPlan 0264 MATCHING route[1] from[point-ws]-to[12b2]
27 OModPlan 0155 creating the new route from[2b1] to[12b2]
28 OModPlan 0315 connection found: from[point-ws] - to[12b2]

Global Routes

Use the global modplan.routes file to define arrangement dependent routes.
Define only routes in the module files which can be used for all arrangement.

Restrictions

  • Block ID's are not allowed to be equal to one of the used compass points.
  • The module ID "auto-generated" will cause a conflict with generated routes; avoid using it.
  • A not set module ID will mess up the global routes file.


modular-connection-nl.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1