Dokumentacja API
Wszystko, czego skrypt może używać, obiekt po obiekcie. Przy każdym obiekcie jest, czym jest, do czego go używasz i przykład, a potem jego właściwości (bez nawiasów: blocks.B3.occupied), metody (z nawiasami: turnouts.W5.diverging()) i zdarzenia (handler jako closure: stations.South.onArrival { Train train -> … }). Jak to działa, jest w Obiekty, kolekcje i zdarzenia.
„Zwraca” to typ: to, co zwraca właściwość albo metoda, albo co zdarzenie przekazuje handlerowi. Kliknięcie nazwy obiektu przenosi do tego obiektu; pisz w polu wyszukiwania, żeby filtrować po obiekcie, nazwie albo opisie.
To wersja 2 tego, co widzą skrypty. Rzeczy są tylko dodawane; to, co istnieje, nie zmienia nazwy.
Script.trainsWłaściwości Every train on the layout by its name.Script.blocksWłaściwości Every block by its name.Script.placesWłaściwości Every station, yard, staging yard, siding and depot.Script.stationsWłaściwości The stations.Script.yardsWłaściwości The shunting yards.Script.stagingWłaściwości The staging yards.Script.turnoutsWłaściwości Every turnout with a name.Script.dutiesWłaściwości Every duty.Script.signalsWłaściwości Every signal placed on the layout.Script.devicesWłaściwości Every tablet, phone or other computer registered with TRAX Control.Script.atMetody Every day at this time of this computer's clock.Script.layoutWłaściwości The layout itself: start, shutdown, messages, power.Script.clockWłaściwości The model clock: its time, and every model day at a time.Script.inputMetody A feedback address: a detector's or a push button's.Script.outputMetody An accessory address: a light, a signal, an uncoupler.Script.flagMetody A flag, which rules can ask too.Script.routeMetody The first way from one block to another.Script.everyMetody Again and again, every so many seconds.Script.betweenMetody Whether this computer's clock is between two times.Script.sayMetody A message on every screen.Script.announceMetody An announcement: shown and spoken on every screen.Script.logMetody A line in this script's log.Script.powerMetody The track power on or off.Script.stopAllMetody The emergency stop: every train, at once.Things.findMetody The thing with this name, or null.Things.eachMetody Every one of them.Things.valuesMetody All of them.Things.findAllMetody Those that match.Things.containsKeyMetody Whether one has this name.Layout.onStartZdarzenia Once every script has run its own lines.Layout.onRouteSetZdarzenia When a route is set: its turnouts sent.Layout.onRouteReadyZdarzenia When every turnout of a route is reported in place.Layout.onRouteDisturbedZdarzenia When a turnout of a route is reported the other way.Layout.onRouteReleasedZdarzenia When a route is released.Layout.onStationConnectedZdarzenia When the command station is connected again.Layout.onStationLostZdarzenia When the command station is lost.Layout.onPowerOnZdarzenia When the track power goes on.Layout.onPowerOffZdarzenia When the track power goes off.Layout.onEmergencyStopZdarzenia When every train is stopped at once.Layout.onDeviceCameZdarzenia When a device opens TRAX Control while it had none open.Layout.onDeviceWentZdarzenia When a device has had TRAX Control closed for a little while.Layout.onDeviceAsksZdarzenia When a new device registers and asks to be admitted.Layout.onShutdownZdarzenia When the scripts stop: a few seconds at most.Layout.sayMetody A message on every screen.Layout.announceMetody An announcement: shown and spoken on every screen.Layout.powerMetody The track power on or off.Layout.stopAllMetody The emergency stop.Layout.betweenMetody Whether the clock is between two times.Train.nameWłaściwości Its name.Train.onArrivalZdarzenia When it comes into a station or yard.Train.onDepartureZdarzenia When it has left a station or yard altogether.Train.onEnteredZdarzenia When its front comes into a block.Train.onLeftZdarzenia When it has left a block altogether.Train.onWaitingZdarzenia When its agent waits for its way to its next stop: at once and every half minute.Train.onTrackChosenZdarzenia When its agent chose its track in a station or yard.Train.onDelayedZdarzenia When it runs late on its timetable's service: at the threshold, and again at every as many more.Train.onNotThereZdarzenia 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.arriveAtMetody The track its agent is to take at the stop it goes to now; tried at once when it waits.Train.isInMetody Whether it stands in a block or a place now.Train.startAgentMetody Starts its agent, on its own duty or the one given.Train.stopAgentMetody Stops its agent where it is.Block.nameWłaściwości Its name.Block.occupiedWłaściwości Whether it is occupied now.Block.placeWłaściwości The station or yard it belongs to, or null.Block.onOccupiedZdarzenia When it becomes occupied.Block.onFreeZdarzenia When it becomes free.Block.onEnteredZdarzenia When a train's front comes into it.Block.onLeftZdarzenia When a train has left it altogether.Place.nameWłaściwości Its name.Place.kindWłaściwości station, yard, staging, siding, industrialSiding or depot.Place.blocksWłaściwości Its tracks.Place.freeTracksWłaściwości Its tracks that are free now.Place.onWaitingZdarzenia When a train's agent waits for its way here: at once and every half minute.Place.onTrackChosenZdarzenia When a train's agent chose its track here.Place.onArrivalZdarzenia When a train comes into it.Place.onDepartureZdarzenia When a train has left it altogether.Turnout.nameWłaściwości Its name.Turnout.straightMetody Sets it straight, as a click does.Turnout.divergingMetody Sets it diverging, as a click does.Turnout.isStraightMetody Whether it is reported straight now.Turnout.onReportedZdarzenia When it is reported set: "straight" or "diverging".Signal.nameWłaściwości Its name.Signal.showsMetody Whether it shows this aspect now: red, green or caution.Signal.onAspectZdarzenia When it changes: "red", "green" or "caution".Signal.onGreenZdarzenia When it shows green.Signal.onRedZdarzenia When it shows red.Duty.nameWłaściwości Its name.DutyStep.trainWłaściwości The train whose agent goes through the stop.DutyStep.stepWłaściwości Which stop of the duty, counted from 1.DutyStep.momentWłaściwości start, arrived, finished or waiting.DutyStep.placeWłaściwości The stop's station or yard; null when the stop is one block.DutyStep.blockWłaściwości The stop's block, when it is one.DutyStep.secondsWłaściwości While waiting: how long, in seconds.DutyStep.reasonWłaściwości While waiting: why, in TRAX Control's words.Device.nameWłaściwości The name it registered under.Device.isHereMetody Whether it has TRAX Control open now.Device.onCameZdarzenia When it opens TRAX Control while it had none open.Device.onWentZdarzenia When it has had TRAX Control closed for a little while.ModelClock.timeWłaściwości The time of day on the layout now.ModelClock.runningWłaściwości Whether it runs.ModelClock.rateWłaściwości How many times as fast as real time.ModelClock.atMetody Every model day at this time.ModelClock.betweenMetody Whether the model time is between two times.Input.onOnZdarzenia When it goes on.Input.onOffZdarzenia When it goes off.Input.onWłaściwości Whether it is on now.Output.greenMetody Switches it green (on).Output.redMetody Switches it red (off).Flag.onMetody Sets it.Flag.offMetody Clears it.Flag.isOnMetody Whether it is set.Route.setMetody Sets it through the interlocking.Waiting.trainWłaściwości The train.Waiting.placeWłaściwości The station or yard it waits to go to; null for a stop of one block.Waiting.blockWłaściwości The block it waits to go to, for a stop of one block.Waiting.secondsWłaściwości How long it has waited.Waiting.reasonWłaściwości Why, in TRAX Control's words.Delay.trainWłaściwości The train.Delay.serviceWłaściwości Its service's number this run.Delay.minutesWłaściwości How many minutes late.Delay.placeWłaściwości Where the service goes, when that is a station or yard.NotThere.trainWłaściwości The train that is not there.NotThere.serviceWłaściwości The service's number this run.NotThere.placeWłaściwości Where it was expected, when that is a station or yard.NotThere.blockWłaściwości Where it was expected, when that is one block.TrackChoice.trainWłaściwości The train.TrackChoice.blockWłaściwości The track.TrackChoice.placeWłaściwości The station or yard.RouteEvent.nameWłaściwości Its name.RouteEvent.fromWłaściwości The block it starts in.RouteEvent.toWłaściwości The block it runs to.RouteEvent.stateWłaściwości setting, set, disturbed or released.
Nic nie znaleziono.
Obiekty
- 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.