data.nodescript.turnouts.turnout_doublecoil_onecontrol.nodescript Maven / Gradle / Ivy
## -----------------------------------------------
## Dieses Script definiert ein Accessory, welches 2 Macros ansteuert.
## Die Macros steuern 2 Powerausg?nge an, welche die Doppelspulen schalten.
##
## history: 2016-12-24 A.K. erste Version
##
## -----------------------------------------------
## -------------- 1. Select Target
##application(text:de="Weichenantrieb (Doppelspulen) an OneControl")
##application(text:en="Turnout (double coil) at OneControl")
##application(text:nl="Wisselaandrijving met twee spoelen op de OneControl")
##instruction(text:de="Konfiguration eines Weichenantrieb (Doppelspulen) an der OneControl")
##instruction(text:en="Configuration of a Turnout (double coil) at the OneControl")
##instruction(text:nl="Wisselaandrijving met twee spoelen op de OneControl")
##
##input($my_accessory:accessory, text:de="Nummer des zu erzeugenden Accessory", text:en="Number of the Accessory", default=0)
##input($macroStraight:macro, text:de="Nummer des ersten Macros (gerade)", text:en="Number of the first macro (straight)", default=0)
##input($switchPort0:switch, text:de="Nummer des ersten Powerausgang", text:en="Number of the first power output", default=0)
##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($switchPort1 = $switchPort0 + 1)
#set($macroBranch = $macroStraight + 1)
## -- prepare names of ports --
#######################################
## Setzt label, wenn ${prevent_replace_labels} NICHT true
#if (!${prevent_replace_labels})
##
## Set label of ports
set switch ${switchPort0} name="W_${my_accessory}_gerade"
set switch ${switchPort1} name="W_${my_accessory}_abzweig"
## Set label of macros
set macro ${macroStraight} name="W_${my_accessory}_gerade"
set macro ${macroBranch} name="W_${my_accessory}_abzweig"
## Set label of accessory
set accessory ${my_accessory} name="W_${my_accessory}"
#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=${macroBranch}
## add the steps to switch the ports
add step ptype=switch action=off number=${switchPort1}
add step ptype=delay delay=10
add step ptype=switch action=on number=${switchPort0}
add step ptype=switch action=off delay=40 number=${switchPort0}
add step ptype=delay delay=10
## Macro Weiche abzweig
##
select macro ${macroBranch}
## 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=switch action=off number=${switchPort0}
add step ptype=delay delay=10
add step ptype=switch action=on number=${switchPort1}
add step ptype=switch action=off delay=40 number=${switchPort1}
add step ptype=delay delay=10
## Define Accessory
select accessory ${my_accessory}
config accessory startup restore
add aspect 0 macronumber=${macroStraight}
add aspect 1 macronumber=${macroBranch}