API-Referenz
Alles, was ein Skript verwenden kann, Objekt für Objekt. Bei jedem Objekt steht, was es ist, wofür Sie es verwenden, und ein Beispiel, und danach seine Properties (ohne Klammern: blocks.B3.occupied), Methoden (mit Klammern: turnouts.W5.diverging()) und Events (ein Handler als Closure: stations.South.onArrival { Train train -> … }). Wie das funktioniert, steht unter Objekte, Collections und Events.
„Gibt“ ist der Typ: was eine Property oder Methode zurückgibt, oder was ein Event dem Handler mitgibt. Ein Klick auf den Namen eines Objekts führt Sie zu diesem Objekt; tippen Sie ins Suchfeld, um nach Objekt, Name oder Erklärung zu filtern.
Dies ist Version 2 dessen, was Skripte sehen. Es kommt nur etwas hinzu; was da ist, ändert seinen Namen nicht.
Script.trainsProperties Every train on the layout by its name.Script.blocksProperties Every block by its name.Script.placesProperties Every station, yard, staging yard, siding and depot.Script.stationsProperties The stations.Script.yardsProperties The shunting yards.Script.stagingProperties The staging yards.Script.turnoutsProperties Every turnout with a name.Script.dutiesProperties Every duty.Script.signalsProperties Every signal placed on the layout.Script.devicesProperties Every tablet, phone or other computer registered with TRAX Control.Script.atMethoden Every day at this time of this computer's clock.Script.layoutProperties The layout itself: start, shutdown, messages, power.Script.clockProperties The model clock: its time, and every model day at a time.Script.inputMethoden A feedback address: a detector's or a push button's.Script.outputMethoden An accessory address: a light, a signal, an uncoupler.Script.flagMethoden A flag, which rules can ask too.Script.routeMethoden The first way from one block to another.Script.everyMethoden Again and again, every so many seconds.Script.betweenMethoden Whether this computer's clock is between two times.Script.sayMethoden A message on every screen.Script.announceMethoden An announcement: shown and spoken on every screen.Script.logMethoden A line in this script's log.Script.powerMethoden The track power on or off.Script.stopAllMethoden The emergency stop: every train, at once.Things.findMethoden The thing with this name, or null.Things.eachMethoden Every one of them.Things.valuesMethoden All of them.Things.findAllMethoden Those that match.Things.containsKeyMethoden Whether one has this name.Layout.onStartEvents Once every script has run its own lines.Layout.onRouteSetEvents When a route is set: its turnouts sent.Layout.onRouteReadyEvents When every turnout of a route is reported in place.Layout.onRouteDisturbedEvents When a turnout of a route is reported the other way.Layout.onRouteReleasedEvents When a route is released.Layout.onStationConnectedEvents When the command station is connected again.Layout.onStationLostEvents When the command station is lost.Layout.onPowerOnEvents When the track power goes on.Layout.onPowerOffEvents When the track power goes off.Layout.onEmergencyStopEvents When every train is stopped at once.Layout.onDeviceCameEvents When a device opens TRAX Control while it had none open.Layout.onDeviceWentEvents When a device has had TRAX Control closed for a little while.Layout.onDeviceAsksEvents When a new device registers and asks to be admitted.Layout.onShutdownEvents When the scripts stop: a few seconds at most.Layout.sayMethoden A message on every screen.Layout.announceMethoden An announcement: shown and spoken on every screen.Layout.powerMethoden The track power on or off.Layout.stopAllMethoden The emergency stop.Layout.betweenMethoden Whether the clock is between two times.Train.nameProperties Its name.Train.onArrivalEvents When it comes into a station or yard.Train.onDepartureEvents When it has left a station or yard altogether.Train.onEnteredEvents When its front comes into a block.Train.onLeftEvents When it has left a block altogether.Train.onWaitingEvents When its agent waits for its way to its next stop: at once and every half minute.Train.onTrackChosenEvents When its agent chose its track in a station or yard.Train.onDelayedEvents When it runs late on its timetable's service: at the threshold, and again at every as many more.Train.onNotThereEvents 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.arriveAtMethoden The track its agent is to take at the stop it goes to now; tried at once when it waits.Train.isInMethoden Whether it stands in a block or a place now.Train.startAgentMethoden Starts its agent, on its own duty or the one given.Train.stopAgentMethoden Stops its agent where it is.Block.nameProperties Its name.Block.occupiedProperties Whether it is occupied now.Block.placeProperties The station or yard it belongs to, or null.Block.onOccupiedEvents When it becomes occupied.Block.onFreeEvents When it becomes free.Block.onEnteredEvents When a train's front comes into it.Block.onLeftEvents When a train has left it altogether.Place.nameProperties Its name.Place.kindProperties station, yard, staging, siding, industrialSiding or depot.Place.blocksProperties Its tracks.Place.freeTracksProperties Its tracks that are free now.Place.onWaitingEvents When a train's agent waits for its way here: at once and every half minute.Place.onTrackChosenEvents When a train's agent chose its track here.Place.onArrivalEvents When a train comes into it.Place.onDepartureEvents When a train has left it altogether.Turnout.nameProperties Its name.Turnout.straightMethoden Sets it straight, as a click does.Turnout.divergingMethoden Sets it diverging, as a click does.Turnout.isStraightMethoden Whether it is reported straight now.Turnout.onReportedEvents When it is reported set: "straight" or "diverging".Signal.nameProperties Its name.Signal.showsMethoden Whether it shows this aspect now: red, green or caution.Signal.onAspectEvents When it changes: "red", "green" or "caution".Signal.onGreenEvents When it shows green.Signal.onRedEvents When it shows red.Duty.nameProperties Its name.DutyStep.trainProperties The train whose agent goes through the stop.DutyStep.stepProperties Which stop of the duty, counted from 1.DutyStep.momentProperties start, arrived, finished or waiting.DutyStep.placeProperties The stop's station or yard; null when the stop is one block.DutyStep.blockProperties The stop's block, when it is one.DutyStep.secondsProperties While waiting: how long, in seconds.DutyStep.reasonProperties While waiting: why, in TRAX Control's words.Device.nameProperties The name it registered under.Device.isHereMethoden Whether it has TRAX Control open now.Device.onCameEvents When it opens TRAX Control while it had none open.Device.onWentEvents When it has had TRAX Control closed for a little while.ModelClock.timeProperties The time of day on the layout now.ModelClock.runningProperties Whether it runs.ModelClock.rateProperties How many times as fast as real time.ModelClock.atMethoden Every model day at this time.ModelClock.betweenMethoden Whether the model time is between two times.Input.onOnEvents When it goes on.Input.onOffEvents When it goes off.Input.onProperties Whether it is on now.Output.greenMethoden Switches it green (on).Output.redMethoden Switches it red (off).Flag.onMethoden Sets it.Flag.offMethoden Clears it.Flag.isOnMethoden Whether it is set.Route.setMethoden Sets it through the interlocking.Waiting.trainProperties The train.Waiting.placeProperties The station or yard it waits to go to; null for a stop of one block.Waiting.blockProperties The block it waits to go to, for a stop of one block.Waiting.secondsProperties How long it has waited.Waiting.reasonProperties Why, in TRAX Control's words.Delay.trainProperties The train.Delay.serviceProperties Its service's number this run.Delay.minutesProperties How many minutes late.Delay.placeProperties Where the service goes, when that is a station or yard.NotThere.trainProperties The train that is not there.NotThere.serviceProperties The service's number this run.NotThere.placeProperties Where it was expected, when that is a station or yard.NotThere.blockProperties Where it was expected, when that is one block.TrackChoice.trainProperties The train.TrackChoice.blockProperties The track.TrackChoice.placeProperties The station or yard.RouteEvent.nameProperties Its name.RouteEvent.fromProperties The block it starts in.RouteEvent.toProperties The block it runs to.RouteEvent.stateProperties setting, set, disturbed or released.
Nichts gefunden.
Die Objekte
- 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.