Basic 2-Way Turnout – step 0030 – December 2009
SrrBasicTurnout2Way orchestrates 3 track nodes, 2 track edges, 2 track geometry nodes and one switch node to become a basic 2-way turnout.
SrrBasicTurnout2Way is an external prototype that is available at the directory srr/.
<ProtoDeclare name='SrrBasicTurnout2Way'>
<ProtoInterface>
<field accessType='inputOutput' name='objType' type='SFString' value='SrrBasicTurnout2Way'/>
<field accessType='inputOutput' name='version' type='SFFloat' value='0.0022'/>
<field accessType='inputOutput' name='objId' type='SFString'/>
<field accessType='inputOutput' name='trackNodeA' type='SFNode'/>
<field accessType='inputOutput' name='trackNodeB0' type='SFNode'/>
<field accessType='inputOutput' name='trackNodeB1' type='SFNode'/>
<field accessType='inputOutput' name='trackEdge0' type='SFNode'/>
<field accessType='inputOutput' name='trackEdge1' type='SFNode'/>
<field accessType='inputOutput' name='modParam' type='SFNode'/>
<field accessType='outputOnly' name='initialized' type='SFNode'/>
</ProtoInterface>
objId
is a string unique within the module that is used to identify track edges and track nodes. It will be taken as base for the composite object-IDs of the contained objects.
trackNodeA, trackNodeB0 and trackNodeB1
are references to SrrTrackNode nodes.
Some fields of these nodes have to be set by the user (see description of the user interface of SrrTrackNode), but the overall initialization is orchestrated by SrrBasicTurnout2Way.
trackNodeA has to contain an SrrSwitchB object in the turnoutSwitch field. SrrBasicTurnout2Way will care for the initialization of the SrrSwitchB object.
trackNodeA will get the object ID <objId>.A,
trackNodeA.turnoutSwitch will get the object ID <objId>.Switch,
trackNodeB0 will get the object ID <objId>.B0,
trackNodeB1 will get the object ID <objId>.B1.
trackEdge0, trackEdge1
are references to an SrrTrackEdge nodes.
Some fields of these nodes have to be set by the user (see description of the user interface of SrrTrackEdge), but the overall initialization is orchestrated by SrrBasicTurnout2Way.
trackEdge0 will get the object ID <objId>.0,
trackEdge1 will get the object ID <objId>.1.
modParam, initialized
After having set the objId and the references to the contained objects, the user reports the module parameters modParam to start the initialization (he got them from the module via the miMod(Model) interface). SrrBasicTurnout2Way will return initialized!=null after successful initialization. In case of failure, null will be returned.