All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
data.nodescript.turnouts.turnout_MTB.nodescript Maven / Gradle / Ivy
## -----------------------------------------------
## Dieses Script definiert ein Accessory, welches 2 Macros zum Schalten von Weichen-Doppelspulenantrieben startet.
## Die Macros steuern 2 Powerausg?nge an, welche einen MTB-Antrieb wie einen Doppelspulenantrieb schalten.
## Sowohl die Makros als auch die ports m?ssen aufeinanderfolgend sein.
##
## history: 2021-06-04 A.Kuhtz
##
## -----------------------------------------------
## only for LightControl
##require(vid="13", pid="107")
## -------------- 1. Select Target
##application(text:de="Weichenantrieb (MTB-Antrieb) an Schaltausg?ngen", text:en="Turnout (MTB-drive) at switch ports", text:nl="Wisselaandrijving dmv MTB wisselmotor op de Schakel poort")
##instruction(text:de="Konfiguration eines MTB-Weichenantriebes an Schaltausg?ngen.")
##instruction(text:en="Configuration of a MTB-Turnout at switch ports.")
##instruction(text:nl="Configuratie van a MTB wisselmotor op de Schakel poort.")
##
##input($turnoutName:string, text:de="Bezeichnung der Weiche: ", text:en="Name of the turnout: ", text:nl="Naam van de Wissel: ", default="W")
##input($my_accessory:accessory, text:de="Nummer des zu erzeugenden Accessory", text:en="Number of the Accessory", text:nl="Nummer van de Accessory", default=0)
##input($macroStraight:macro, text:de="Nummer des ersten Macros (Geradeaus)", text:en="Number of the first macro (straight)", text:nl="Nummer van de eerste macro (Rechtdoor)", default=0)
##input($switchPort0:switch, text:de="Nummer des ersten Schaltausgangs", text:en="Number of the first switch port", text:nl="Nummer van de eerste Schakel poort", 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", text:nl="Voorkom vervangingslabels voor accessoire, macro en poorten", default=false)
## -- prepare some variables --
#set($switchPort1 = $switchPort0 + 1)
#set($macroBranch = $macroStraight + 1)
#if ($user_lang == "de")
#set($labelStraight = "Gerade")
#set($labelBranch = "Abzweigend")
#elseif ($user_lang == "nl")
#set($labelStraight = "Rechtdoor")
#set($labelBranch = "Afbuigend")
#else
#set($labelStraight = "Straight")
#set($labelBranch = "Branching off")
#end
## -- prepare names of ports --
#######################################
## Setzt label, wenn ${prevent_replace_labels} NICHT true
#if (!${prevent_replace_labels})
##
## Set label of ports
set switch ${switchPort0} name="SP$numberTool.format("#00", ${switchPort0}) | ${turnoutName} | ${labelStraight}"
set switch ${switchPort1} name="SP$numberTool.format("#00", ${switchPort1}) | ${turnoutName} | ${labelBranch}"
## Set label of macros
set macro ${macroStraight} name="M$numberTool.format("#00", ${macroStraight})-SP$numberTool.format("#00", ${switchPort0}) | ${turnoutName} | ${labelStraight}"
set macro ${macroBranch} name="M$numberTool.format("#00", ${macroBranch})-SP$numberTool.format("#00", ${switchPort1}) | ${turnoutName} | ${labelBranch}"
## Set label of accessory
set accessory ${my_accessory} name="A$numberTool.format("#00", ${my_accessory})-iTr$numberTool.format("#00", ${my_accessory}) | M$numberTool.format("#00", ${macroStraight})$numberTool.format("#00", ${macroBranch})-SP$numberTool.format("#00", ${switchPort0}) | ${turnoutName}"
#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=critical action=begin
add step ptype=delay delay=10
add step ptype=switch action=on number=${switchPort0}
add step ptype=switch action=off delay=100 number=${switchPort0}
add step ptype=delay delay=10
add step ptype=critical action=end
## 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=critical action=begin
add step ptype=delay delay=10
add step ptype=switch action=on number=${switchPort1}
add step ptype=switch action=off delay=100 number=${switchPort1}
add step ptype=delay delay=10
add step ptype=critical action=end
## Define Accessory
select accessory ${my_accessory}
config accessory startup none
add aspect 0 macronumber=${macroStraight}
add aspect 1 macronumber=${macroBranch}