All Downloads are FREE. Search and download functionalities are using the official Maven repository.

data.nodescript.turnouts.crossing_switchpair_onecontrol.nodescript Maven / Gradle / Ivy

## -----------------------------------------------
## Dieses Script definiert ein Accessory mit 4 Aspekte, welches 2 Macros ansteuert.
## Die Macros steuern 2 Powerausg?nge als SwitchPair an, welche die Doppelspulen schalten.
##
## history: 2019-03-04 A. Kuhtz erste Version
##
## -----------------------------------------------

##Pr?fung auf Onecontrol von Opendcc
##require(vid="13", pid="117,140,141,142,122,143,144,145")

## -------------- 1. Select Target
##application(text:de="DKW-Antrieb (Doppelspulen) an OneControl mit SwitchPair (iTrain)", text:en="Double-slip switch (double coil) at OneControl with SwitchPair (iTrain)", text:nl="Kruiswissel (Dubbele Engelsman) met twee spoelen op de OneControl met SchakelPaar poorten (iTrain)")
##instruction(text:de="Konfiguration eines DKW-Antrieb (Doppelspulen) an der OneControl mit SwitchPair", text:en="Configuration of a Double-slip switch (double coil) at the OneControl with SwitchPair")
##
##input($selectedAccessory:accessory, text:de="Auswahl des verwendeten Accessory", text:en="Select the Accessory", default=0)
##input($macroStraight:macro, text:de="Auswahl des ersten Macros (gerade)", text:en="Select the first macro (straight)", default=0)
##input($switchPairPort:switchpair, text:de="Auswahl des SwitchPair-Ausgang", text:en="Select the SwitchPair output", default=0)
##input($delayAfterSwitch:int, text:de="Wartezeit(n * 20ms) nach Schalten", text:en="Delay after switching (n * 20ms)", default=30)
##input($accessoryName:string, text:de="Name des Accessory", text:en="Name of the accessory")
##input($macroName:string, text:de="Name des Macro", text:en="Name of the macro")
##input($switchPairPortName:string, text:de="Name des Port", text:en="Name of the port")
##input($prevent_replace_labels:boolean, text:de="Keine Namen f?r Accessory, Makros, Ports ersetzen", text:en="Prevent replace labels for accessory, macro and ports", default=false)

## -- prepare some variables --
#set($macroTurnout = $macroStraight + 1)

## -- prepare names of ports --
#######################################
## Setzt label, wenn ${prevent_replace_labels} NICHT true
#if (!${prevent_replace_labels})
## 
## Set label of ports
set switchpair ${switchPairPort} name="${switchPairPortName}"
## Set label of macros
set macro ${macroStraight} name="${macroName}_gerade"
set macro ${macroTurnout} name="${macroName}_abzweig"
## Set label of accessory
set accessory ${selectedAccessory} name="${accessoryName}"

## Set label of aspect
set aspect 0 accessory=${selectedAccessory} name="${macroName}_gerade_AC"
set aspect 1 accessory=${selectedAccessory} name="${macroName}_gerade_BD"
set aspect 2 accessory=${selectedAccessory} name="${macroName}_abzweig_BC"
set aspect 3 accessory=${selectedAccessory} name="${macroName}_abzweig_AC"

#end
#######################################

## Macro Weiche gerade
##
select macro ${macroStraight}
## macro repeats once
config macro repeat=1 slowdown=1
## stop the other macro
add step ptype=macro action=stop number=${macroTurnout}
## add the steps to switch the ports
add step ptype=switchPair action=on number=${switchPairPort}
add step ptype=delay delay=${delayAfterSwitch}

## Macro Weiche abzweig
##
select macro ${macroTurnout}
## macro repeats once
config macro repeat=1 slowdown=1
## stop the other macro
add step ptype=macro action=stop number=${macroStraight}
## add the steps to switch the ports
add step ptype=switchPair action=off number=${switchPairPort}
add step ptype=delay delay=${delayAfterSwitch} 

## Define Accessory
select accessory ${selectedAccessory}
config accessory startup restore
add aspect 0 macronumber=${macroStraight}
add aspect 1 macronumber=${macroStraight}
add aspect 2 macronumber=${macroTurnout}
add aspect 3 macronumber=${macroTurnout}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy