API リファレンス
スクリプトで使えるものすべてを、オブジェクトごとにまとめています。各オブジェクトには、それが何か、何に使うか、例があり、続いて プロパティ(括弧なし:blocks.B3.occupied)、メソッド(括弧付き:turnouts.W5.diverging())、イベント(closure としてのハンドラー:stations.South.onArrival { Train train -> … })が並びます。仕組みは オブジェクト、コレクション、イベント にあります。
「戻り値」は型です。プロパティやメソッドが返すもの、またはイベントがハンドラーに渡すものです。オブジェクトの名前をクリックするとそのオブジェクトに移動します。検索欄に入力すると、オブジェクト、名前、説明で絞り込めます。
これはスクリプトから見えるもののバージョン 2 です。追加だけが行われ、既存の名前は変わりません。
Script.trainsプロパティ Every train on the layout by its name.Script.blocksプロパティ Every block by its name.Script.placesプロパティ Every station, yard, staging yard, siding and depot.Script.stationsプロパティ The stations.Script.yardsプロパティ The shunting yards.Script.stagingプロパティ The staging yards.Script.turnoutsプロパティ Every turnout with a name.Script.dutiesプロパティ Every duty.Script.signalsプロパティ Every signal placed on the layout.Script.devicesプロパティ Every tablet, phone or other computer registered with TRAX Control.Script.atメソッド Every day at this time of this computer's clock.Script.layoutプロパティ The layout itself: start, shutdown, messages, power.Script.clockプロパティ The model clock: its time, and every model day at a time.Script.inputメソッド A feedback address: a detector's or a push button's.Script.outputメソッド An accessory address: a light, a signal, an uncoupler.Script.flagメソッド A flag, which rules can ask too.Script.routeメソッド The first way from one block to another.Script.everyメソッド Again and again, every so many seconds.Script.betweenメソッド Whether this computer's clock is between two times.Script.sayメソッド A message on every screen.Script.announceメソッド An announcement: shown and spoken on every screen.Script.logメソッド A line in this script's log.Script.powerメソッド The track power on or off.Script.stopAllメソッド The emergency stop: every train, at once.Things.findメソッド The thing with this name, or null.Things.eachメソッド Every one of them.Things.valuesメソッド All of them.Things.findAllメソッド Those that match.Things.containsKeyメソッド Whether one has this name.Layout.onStartイベント Once every script has run its own lines.Layout.onRouteSetイベント When a route is set: its turnouts sent.Layout.onRouteReadyイベント When every turnout of a route is reported in place.Layout.onRouteDisturbedイベント When a turnout of a route is reported the other way.Layout.onRouteReleasedイベント When a route is released.Layout.onStationConnectedイベント When the command station is connected again.Layout.onStationLostイベント When the command station is lost.Layout.onPowerOnイベント When the track power goes on.Layout.onPowerOffイベント When the track power goes off.Layout.onEmergencyStopイベント When every train is stopped at once.Layout.onDeviceCameイベント When a device opens TRAX Control while it had none open.Layout.onDeviceWentイベント When a device has had TRAX Control closed for a little while.Layout.onDeviceAsksイベント When a new device registers and asks to be admitted.Layout.onShutdownイベント When the scripts stop: a few seconds at most.Layout.sayメソッド A message on every screen.Layout.announceメソッド An announcement: shown and spoken on every screen.Layout.powerメソッド The track power on or off.Layout.stopAllメソッド The emergency stop.Layout.betweenメソッド Whether the clock is between two times.Train.nameプロパティ Its name.Train.onArrivalイベント When it comes into a station or yard.Train.onDepartureイベント When it has left a station or yard altogether.Train.onEnteredイベント When its front comes into a block.Train.onLeftイベント When it has left a block altogether.Train.onWaitingイベント When its agent waits for its way to its next stop: at once and every half minute.Train.onTrackChosenイベント When its agent chose its track in a station or yard.Train.onDelayedイベント When it runs late on its timetable's service: at the threshold, and again at every as many more.Train.onNotThereイベント When it is not where its circulation expects it: not at the first stop of its run when due, or not ready to join another train.Train.arriveAtメソッド The track its agent is to take at the stop it goes to now; tried at once when it waits.Train.isInメソッド Whether it stands in a block or a place now.Train.startAgentメソッド Starts its agent, on its own duty or the one given.Train.stopAgentメソッド Stops its agent where it is.Block.nameプロパティ Its name.Block.occupiedプロパティ Whether it is occupied now.Block.placeプロパティ The station or yard it belongs to, or null.Block.onOccupiedイベント When it becomes occupied.Block.onFreeイベント When it becomes free.Block.onEnteredイベント When a train's front comes into it.Block.onLeftイベント When a train has left it altogether.Place.nameプロパティ Its name.Place.kindプロパティ station, yard, staging, siding, industrialSiding or depot.Place.blocksプロパティ Its tracks.Place.freeTracksプロパティ Its tracks that are free now.Place.onWaitingイベント When a train's agent waits for its way here: at once and every half minute.Place.onTrackChosenイベント When a train's agent chose its track here.Place.onArrivalイベント When a train comes into it.Place.onDepartureイベント When a train has left it altogether.Turnout.nameプロパティ Its name.Turnout.straightメソッド Sets it straight, as a click does.Turnout.divergingメソッド Sets it diverging, as a click does.Turnout.isStraightメソッド Whether it is reported straight now.Turnout.onReportedイベント When it is reported set: "straight" or "diverging".Signal.nameプロパティ Its name.Signal.showsメソッド Whether it shows this aspect now: red, green or caution.Signal.onAspectイベント When it changes: "red", "green" or "caution".Signal.onGreenイベント When it shows green.Signal.onRedイベント When it shows red.Duty.nameプロパティ Its name.DutyStep.trainプロパティ The train whose agent goes through the stop.DutyStep.stepプロパティ Which stop of the duty, counted from 1.DutyStep.momentプロパティ start, arrived, finished or waiting.DutyStep.placeプロパティ The stop's station or yard; null when the stop is one block.DutyStep.blockプロパティ The stop's block, when it is one.DutyStep.secondsプロパティ While waiting: how long, in seconds.DutyStep.reasonプロパティ While waiting: why, in TRAX Control's words.Device.nameプロパティ The name it registered under.Device.isHereメソッド Whether it has TRAX Control open now.Device.onCameイベント When it opens TRAX Control while it had none open.Device.onWentイベント When it has had TRAX Control closed for a little while.ModelClock.timeプロパティ The time of day on the layout now.ModelClock.runningプロパティ Whether it runs.ModelClock.rateプロパティ How many times as fast as real time.ModelClock.atメソッド Every model day at this time.ModelClock.betweenメソッド Whether the model time is between two times.Input.onOnイベント When it goes on.Input.onOffイベント When it goes off.Input.onプロパティ Whether it is on now.Output.greenメソッド Switches it green (on).Output.redメソッド Switches it red (off).Flag.onメソッド Sets it.Flag.offメソッド Clears it.Flag.isOnメソッド Whether it is set.Route.setメソッド Sets it through the interlocking.Waiting.trainプロパティ The train.Waiting.placeプロパティ The station or yard it waits to go to; null for a stop of one block.Waiting.blockプロパティ The block it waits to go to, for a stop of one block.Waiting.secondsプロパティ How long it has waited.Waiting.reasonプロパティ Why, in TRAX Control's words.Delay.trainプロパティ The train.Delay.serviceプロパティ Its service's number this run.Delay.minutesプロパティ How many minutes late.Delay.placeプロパティ Where the service goes, when that is a station or yard.NotThere.trainプロパティ The train that is not there.NotThere.serviceプロパティ The service's number this run.NotThere.placeプロパティ Where it was expected, when that is a station or yard.NotThere.blockプロパティ Where it was expected, when that is one block.TrackChoice.trainプロパティ The train.TrackChoice.blockプロパティ The track.TrackChoice.placeプロパティ The station or yard.RouteEvent.nameプロパティ Its name.RouteEvent.fromプロパティ The block it starts in.RouteEvent.toプロパティ The block it runs to.RouteEvent.stateプロパティ setting, set, disturbed or released.
一致するものはありません。
オブジェクト
- Script The script itselfEverything a script can write without an object in front: the layout's collections (trains, blocks, stations …), the layout as a whole (layout), the model clock (clock), and a few helpers: messages, addresses, flags, routes and time.
- Things A collectionAll things of one sort on your layout, by name: all trains, all blocks, all stations.
- Layout The layoutThe layout as a whole: what happens to all of it (the scripts starting and stopping, routes, the command station, track power, devices coming and going) and what you do for the whole layout (a message, an announcement, track power, the emergency stop).
- Train A trainA train made up on your layout, as in the Trains panel.
- Block A blockA stretch of track with a detector, as in the diagram: a track in a station, a stretch of open line.
- Place A station or yardA station, shunting yard, staging yard, siding or depot: a named group of tracks (blocks).
- Turnout A turnoutA named turnout in the diagram.
- Signal A signalA signal placed on your layout.
- Duty A dutyA duty from the Duties panel: a series of stops a train's agent runs.
- DutyStep A duty's stopWhat a method is given when a duty's stop calls it.
- Device A deviceA tablet, phone or other computer registered with TRAX Control, as on the Devices page.
- ModelClock The model clockYour layout's clock, which can run faster than real time and can stand still; the timetable runs on it.
- Input A feedback addressA feedback address on your command station or feedback module: of a detector, or of a push button or switch on the layout.
- Output An accessory addressAn accessory address on your command station: a light, a bell, an uncoupler, a signal not in the diagram.
- Flag A flagA named on/off switch that exists only inside TRAX Control.
- Route A routeA route from one block to another as TRAX Control finds it: the first way that keeps its direction and needs no turnout by hand.
- Waiting A waiting agentWhat onWaiting gives when a train's agent waits for its route to the next stop: which train, where to, how long already and why.
- Delay A delayWhat onDelayed gives when a timetable train runs late: which train, which service, how many minutes and where to.
- NotThere Stock that is not thereWhat onNotThere gives when a train is not where its circulation expects it: which train, which service and where it should have been.
- TrackChoice A chosen trackWhat a station's onTrackChosen gives when a train's agent chooses a track there: the train, the track and the station.
- RouteEvent A route changingWhat the layout's route events give (onRouteSet, onRouteReady, onRouteDisturbed, onRouteReleased): the route's name, from which block to which, and how it stands now.