RailScript

RailScript-namespacereferentie

Deze pagina bevat ieder objectattribuut dat momenteel door de RailKernel runtime-namespace wordt gepubliceerd. Schrijfbare attributen kunnen met ZET worden gewijzigd. Geplande attributen behoren al tot het contract maar retourneren momenteel <not yet implemented>.

Objecten adresseren

Systeemwaarden gebruiken system.attribuut. Andere objecten gebruiken domein["naam"].attribuut of domein["guid"].attribuut. Geïndexeerde locomotieffuncties gebruiken locomotive["naam"].function[nummer].attribuut.

system.projectLoaded
feedback["K31"].occupied
locomotive["Class 66"].function[0].name

Objectcollecties

Een lege selector, zoals block[] of feedback[], duidt alle objecten binnen dat namespace-domein aan. Gebruik deze met VOOR ELK. De lusvariabele vertegenwoordigt steeds één object en biedt precies dezelfde attributen als een individueel geselecteerd object.

commandStation[] feedback[] accessory[] signal[] block[] train[] trainType[] locomotive[] route[] script[] variable[] counter[] timer[]

VOOR ELK item IN block[]
DOE
    LOG item.name + ": " + item.occupied
EINDE

Systeem en project system

Voorbeelden

LOG "Project: " + system.projectName
ALS system.emergencyStop DAN LOG "Noodstop is actief" EINDE

Alleen-lezen

projectLoaded · emergencyStop · applicationVersion · osName · osVersion · osArchitecture · javaVersion · language · currentTime · uptimeMillis · commandStationCount · connectedCommandStationCount · poweredCommandStationCount · allCommandStationsConnected · projectName · projectDirty · projectRevision · scale · catalogueFile · trackCount · flexTrackCount · blockCount · feedbackCount · accessoryCount · signalCount · locomotiveCount · trainCount · trainTypeCount · routeCount · userVariableCount

Centrale commandStation

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: commandStation[]

Voorbeelden

ALS commandStation["ECoS"].connected DAN LOG "ECoS verbonden" EINDE
ZET commandStation["ECoS"].powerOn = WAAR

Alleen-lezen

guid · name · technicalName · type · host · port · connected · vendor · model · articleNumber · firmwareVersion · hardwareVersion · serialNumber · supportsDecoderCvRead · supportsDecoderCvWrite · supportsMfxDecoderRead · supportsFeedbackDeletion · locomotiveCount · accessoryCount · routeCount · feedbackCount · feedbackModuleCount · boosterCount

Schrijfbaar

powerOn

Terugmelder feedback

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: feedback[]

Voorbeelden

WANNEER feedback["K31"].occupied DOE LOG "K31 bezet" EINDE
LOG "Terugmeldlengte: " + feedback["K31"].length

Alleen-lezen

guid · name · commandStation · s88 · bus · module · contact · address · occupied · reliable · unreliable · excludeFromEmergencyStop · forwardRole · backwardRole · railCount · length · blockGuid · blockName · forwardStart · forwardEnd · backwardStart · backwardEnd

Accessoire accessory

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: accessory[]

Voorbeelden

ZET accessory["A.1"].position = STRAIGHT
ALS accessory["A.1"].reserved DAN LOG accessory["A.1"].reservedBy EINDE

Alleen-lezen

guid · name · type · commandStation · address · threeWay · address2 · protocol · defaultState · unreliable · comment · half · reserved · reservedBy · state

Schrijfbaar

position

Sein signal

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: signal[]

Voorbeelden

ZET signal["Inrijsein"].state = GREEN
LOG "Seinblok: " + signal["Inrijsein"].block

Alleen-lezen

guid · name · manufacturer · articleNumber · productName · gauge · signalType · aspects · technology · railwayCountry · railwayCompany · x · y · heightMm · block · blockGuid · blockSide · direction · comment · linkedAccessory · linkedAccessoryGuid · linkedDecoder

Schrijfbaar

state

Blok block

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: block[]

Voorbeelden

ALS block["Perron 1"].occupied DAN LOG block["Perron 1"].currentTrain EINDE
LOG "Voorwaartse stop: " + block["Perron 1"].forwardStop

Alleen-lezen

guid · name · type · abstract · length · forwardBrake · forwardStop · backwardBrake · backwardStop · electrified · occupied · reserved · reservedBy · currentTrain · direction · bidirectional · maximumSpeed · minimumDwellTime · waiting · deadlocked · feedbackCount · accessoryCount · signalCount · decouplerCount · firstForwardFeedback · lastForwardFeedback · forwardEntryFeedback · forwardBrakeFeedback · forwardStopFeedback · forwardExitFeedback · firstBackwardFeedback · lastBackwardFeedback · backwardEntryFeedback · backwardBrakeFeedback · backwardStopFeedback · backwardExitFeedback

Trein train

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: train[]

Voorbeelden

ALS train["Intercity 1200"].placed DAN LOG train["Intercity 1200"].currentBlock EINDE
WANNEER train["Intercity 1200"].newFeedback DOE LOG "Nieuwe feedback bereikt" EINDE

Alleen-lezen

guid · name · locomotive · locomotiveGuid · trainType · trainTypeGuid · lengthMm · wagonGroupCount · motionSamplingEnabled · placed · newFeedback · currentBlock · currentBlockGuid · currentRoute · currentRouteGuid · currentFeedback · currentFeedbackGuid · direction · placedElementType · placedElementGuid · placedOffsetMm · brakeDistanceMmSpeed50 · brakeDistanceMmSpeed70 · brakeDistanceMmSpeed90 · brakeDistanceMmSpeed110 · motionSpeedMmPerSec50 · motionSpeedMmPerSec70 · motionSpeedMmPerSec90 · motionSpeedMmPerSec110

Gepland

speed · state · destination · route · waiting · deadlocked · automatic · reservedBlockCount

Treintype trainType

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: trainType[]

Voorbeelden

LOG trainType["Intercity"].maximumSpeedKmh
ALS trainType["Intercity"].alignAtPlatform DAN LOG "Perronuitlijning actief" EINDE

Alleen-lezen

guid · name · category · maximumSpeedKmh · unlimitedMaximumSpeed · accelerationFactor · brakingFactor · priority · reservationCount · reservationBeforeDeparture · alignAtPlatform · trainCount · allowedBlockCount

Locomotief locomotive

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: locomotive[]

Voorbeelden

ZET locomotive["NS 1200"].speed = 64
ZET locomotive["NS 1200"].function[3].active = WAAR

Alleen-lezen

guid · name · displayName · description · comment · brand · catalogueNumber · gauge · commandStation · address · protocol · speedSteps · lengthMm · maximumSpeedKmh · locomotiveType · electric · configuredDirection · decoderUid · mfxUid · decoderTemplate · imageFile · feedbackDistanceFront · feedbackDistanceRear · volume · totalDistanceKm · totalRunningTimeMillis · functionCount

Schrijfbaar

speed

Alleen-lezen

function[n].name · function[n].type · function[n].mode · function[n].visible · function[n].directional · function[n].autoOffMs

Gepland

speedKmh · direction · moving · connected · currentBlock · currentBlockGuid · reserved · reservedBy · placed · trainName · trainGuid · minimumDecoderStep · maximumDecoderStep · calibratedSpeedTable · acceleration · braking · massSimulation · brakeCorrection · automatic · active · blocked · outOfService · maintenanceInterval · maintenanceDue · pushPullMode · function[n].active

Route route

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: route[]

Voorbeelden

LOG route["Stationsronde"].fromBlock + " → " + route["Stationsronde"].toBlock
RIJD "Intercity 1200" VIA "Stationsronde" WACHTRIJ

Alleen-lezen

guid · name · fromBlock · fromBlockGuid · toBlock · toBlockGuid · blockCount · legCount · trackCount · accessoryCount · corridorLengthMm · respectBlockDirection · continuationRoute · continuationRouteGuid

Gepland

active · queued · reserved · reservedBy · available · blocked

RailScript script

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: script[]

Voorbeelden

RUN "Geluiden stationsronde"
WANNEER !script["Geluiden stationsronde"].isRunning DOE LOG "Geluidsscript voltooid" EINDE

Alleen-lezen

guid · name · enabled · language · isRunning

Gebruikersvariabele variable

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: variable[]

Voorbeelden

ZET variable["bedrijfsmodus"].value = "nacht"
LOG variable["bedrijfsmodus"].value

Alleen-lezen

guid · name · type · defaultValue · description · persistent · readOnly

Schrijfbaar

value (unless readOnly)

Teller counter

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: counter[]

Voorbeelden

ZET counter["vertrekken"].value = counter["vertrekken"].value + 1
LOG counter["vertrekken"].value

Alleen-lezen

guid · name · initialValue · minimum · maximum · step · enabled · comment

Schrijfbaar

value

Timer timer

Collectie-identifier en attributen die via de lusvariabele beschikbaar zijn: timer[]

Voorbeelden

ZET timer["stationsstop"].durationMillis = 30000
WANNEER timer["stationsstop"].expired DOE LOG "Stationsstop voltooid" EINDE

Alleen-lezen

guid · name · duration · elapsed · elapsedMillis · remaining · remainingMillis · expired · enabled · comment

Schrijfbaar

durationMillis · running