hu
Bejelentkezés

← Vissza az API-referenciához

Turnout A turnout

A named turnout in the diagram. You can set it as a click does, ask how it is reported, and hear when it is reported, whoever threw it.

Mire: For a turnout lamp or a signal that follows the turnout, or to set a turnout when something happens. Setting goes through the interlocking: a locked turnout stays put.

turnouts.W5.onReported { String position ->
   log "W5 is ${position}"
}
turnouts.W5.diverging()

Tulajdonságok

name → String

Its name.

The turnout's name in the diagram.

log turnouts.W5.name

Metódusok

straight

Sets it straight, as a click does.

Sets the turnout straight, as a click does. Refused (exception) when a route locks it, it is worked by hand, or the scripts lack the right.

turnouts.W5.straight()

diverging

Sets it diverging, as a click does.

Sets the turnout diverging, as a click does; the same conditions as straight().

turnouts.W5.diverging()

isStraight → boolean

Whether it is reported straight now.

Whether the turnout is reported straight now. false may also mean its position is not known.

if (!turnouts.W5.isStraight()) {
   log "W5 is not straight"
}

Események

onReported → String

When it is reported set: "straight" or "diverging".

Fires when the command station reports the turnout's position, whoever threw it. Gives "straight" or "diverging".

turnouts.W5.onReported { String position ->
   log "W5 is ${position}"
}