Route A route
A route from one block to another as TRAX Control finds it: the first way that keeps its direction and needs no turnout by hand. You make it with route(from, to).
用途: To set a route when something happens, for instance at a push button. set() goes through the interlocking: if another route lies there or a train stands in the way, it is not set.
route(blocks.B1, blocks.B4).set()メソッド
set
Sets it through the interlocking.
Sets the route through the interlocking: turnouts locked, track held. When that cannot be done (no way, track occupied, held by another route), an exception with the reason.
try {
route(blocks.B1, blocks.B4).set()
} catch (Exception e) {
log "not set: ${e.message}"
}