Riferimento dell'API
Tutto ciò che uno script può usare, oggetto per oggetto. Per ogni oggetto c'è cos'è, a cosa serve e un esempio, e poi le sue proprietà (senza parentesi: blocks.B3.occupied), i metodi (con parentesi: turnouts.W5.diverging()) e gli eventi (un gestore come closure: stations.South.onArrival { Train train -> … }). Come funziona è spiegato in Oggetti, collezioni ed eventi.
«Restituisce» è il tipo: ciò che una proprietà o un metodo restituisce, o ciò che un evento passa al gestore. Un clic sul nome di un oggetto ti porta a quell'oggetto; digita nel campo di ricerca per filtrare per oggetto, nome o spiegazione.
Questa è la versione 2 di ciò che vedono gli script. Si aggiunge soltanto; ciò che c'è non cambia nome.
Script.trainsProprietà Every train on the layout by its name.Script.blocksProprietà Every block by its name.Script.placesProprietà Every station, yard, staging yard, siding and depot.Script.stationsProprietà The stations.Script.yardsProprietà The shunting yards.Script.stagingProprietà The staging yards.Script.turnoutsProprietà Every turnout with a name.Script.dutiesProprietà Every duty.Script.signalsProprietà Every signal placed on the layout.Script.devicesProprietà Every tablet, phone or other computer registered with TRAX Control.Script.atMetodi Every day at this time of this computer's clock.Script.layoutProprietà The layout itself: start, shutdown, messages, power.Script.clockProprietà The model clock: its time, and every model day at a time.Script.inputMetodi A feedback address: a detector's or a push button's.Script.outputMetodi An accessory address: a light, a signal, an uncoupler.Script.flagMetodi A flag, which rules can ask too.Script.routeMetodi The first way from one block to another.Script.everyMetodi Again and again, every so many seconds.Script.betweenMetodi Whether this computer's clock is between two times.Script.sayMetodi A message on every screen.Script.announceMetodi An announcement: shown and spoken on every screen.Script.logMetodi A line in this script's log.Script.powerMetodi The track power on or off.Script.stopAllMetodi The emergency stop: every train, at once.Things.findMetodi The thing with this name, or null.Things.eachMetodi Every one of them.Things.valuesMetodi All of them.Things.findAllMetodi Those that match.Things.containsKeyMetodi Whether one has this name.Layout.onStartEventi Once every script has run its own lines.Layout.onRouteSetEventi When a route is set: its turnouts sent.Layout.onRouteReadyEventi When every turnout of a route is reported in place.Layout.onRouteDisturbedEventi When a turnout of a route is reported the other way.Layout.onRouteReleasedEventi When a route is released.Layout.onStationConnectedEventi When the command station is connected again.Layout.onStationLostEventi When the command station is lost.Layout.onPowerOnEventi When the track power goes on.Layout.onPowerOffEventi When the track power goes off.Layout.onEmergencyStopEventi When every train is stopped at once.Layout.onDeviceCameEventi When a device opens TRAX Control while it had none open.Layout.onDeviceWentEventi When a device has had TRAX Control closed for a little while.Layout.onDeviceAsksEventi When a new device registers and asks to be admitted.Layout.onShutdownEventi When the scripts stop: a few seconds at most.Layout.sayMetodi A message on every screen.Layout.announceMetodi An announcement: shown and spoken on every screen.Layout.powerMetodi The track power on or off.Layout.stopAllMetodi The emergency stop.Layout.betweenMetodi Whether the clock is between two times.Train.nameProprietà Its name.Train.onArrivalEventi When it comes into a station or yard.Train.onDepartureEventi When it has left a station or yard altogether.Train.onEnteredEventi When its front comes into a block.Train.onLeftEventi When it has left a block altogether.Train.onWaitingEventi When its agent waits for its way to its next stop: at once and every half minute.Train.onTrackChosenEventi When its agent chose its track in a station or yard.Train.onDelayedEventi When it runs late on its timetable's service: at the threshold, and again at every as many more.Train.onNotThereEventi 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.arriveAtMetodi The track its agent is to take at the stop it goes to now; tried at once when it waits.Train.isInMetodi Whether it stands in a block or a place now.Train.startAgentMetodi Starts its agent, on its own duty or the one given.Train.stopAgentMetodi Stops its agent where it is.Block.nameProprietà Its name.Block.occupiedProprietà Whether it is occupied now.Block.placeProprietà The station or yard it belongs to, or null.Block.onOccupiedEventi When it becomes occupied.Block.onFreeEventi When it becomes free.Block.onEnteredEventi When a train's front comes into it.Block.onLeftEventi When a train has left it altogether.Place.nameProprietà Its name.Place.kindProprietà station, yard, staging, siding, industrialSiding or depot.Place.blocksProprietà Its tracks.Place.freeTracksProprietà Its tracks that are free now.Place.onWaitingEventi When a train's agent waits for its way here: at once and every half minute.Place.onTrackChosenEventi When a train's agent chose its track here.Place.onArrivalEventi When a train comes into it.Place.onDepartureEventi When a train has left it altogether.Turnout.nameProprietà Its name.Turnout.straightMetodi Sets it straight, as a click does.Turnout.divergingMetodi Sets it diverging, as a click does.Turnout.isStraightMetodi Whether it is reported straight now.Turnout.onReportedEventi When it is reported set: "straight" or "diverging".Signal.nameProprietà Its name.Signal.showsMetodi Whether it shows this aspect now: red, green or caution.Signal.onAspectEventi When it changes: "red", "green" or "caution".Signal.onGreenEventi When it shows green.Signal.onRedEventi When it shows red.Duty.nameProprietà Its name.DutyStep.trainProprietà The train whose agent goes through the stop.DutyStep.stepProprietà Which stop of the duty, counted from 1.DutyStep.momentProprietà start, arrived, finished or waiting.DutyStep.placeProprietà The stop's station or yard; null when the stop is one block.DutyStep.blockProprietà The stop's block, when it is one.DutyStep.secondsProprietà While waiting: how long, in seconds.DutyStep.reasonProprietà While waiting: why, in TRAX Control's words.Device.nameProprietà The name it registered under.Device.isHereMetodi Whether it has TRAX Control open now.Device.onCameEventi When it opens TRAX Control while it had none open.Device.onWentEventi When it has had TRAX Control closed for a little while.ModelClock.timeProprietà The time of day on the layout now.ModelClock.runningProprietà Whether it runs.ModelClock.rateProprietà How many times as fast as real time.ModelClock.atMetodi Every model day at this time.ModelClock.betweenMetodi Whether the model time is between two times.Input.onOnEventi When it goes on.Input.onOffEventi When it goes off.Input.onProprietà Whether it is on now.Output.greenMetodi Switches it green (on).Output.redMetodi Switches it red (off).Flag.onMetodi Sets it.Flag.offMetodi Clears it.Flag.isOnMetodi Whether it is set.Route.setMetodi Sets it through the interlocking.Waiting.trainProprietà The train.Waiting.placeProprietà The station or yard it waits to go to; null for a stop of one block.Waiting.blockProprietà The block it waits to go to, for a stop of one block.Waiting.secondsProprietà How long it has waited.Waiting.reasonProprietà Why, in TRAX Control's words.Delay.trainProprietà The train.Delay.serviceProprietà Its service's number this run.Delay.minutesProprietà How many minutes late.Delay.placeProprietà Where the service goes, when that is a station or yard.NotThere.trainProprietà The train that is not there.NotThere.serviceProprietà The service's number this run.NotThere.placeProprietà Where it was expected, when that is a station or yard.NotThere.blockProprietà Where it was expected, when that is one block.TrackChoice.trainProprietà The train.TrackChoice.blockProprietà The track.TrackChoice.placeProprietà The station or yard.RouteEvent.nameProprietà Its name.RouteEvent.fromProprietà The block it starts in.RouteEvent.toProprietà The block it runs to.RouteEvent.stateProprietà setting, set, disturbed or released.
Nessun risultato.
Gli oggetti
- 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.