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

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

## -----------------------------------------------
## Dieses Script definiert ein Accessory für eine Dreiwegweiche, welches 3 Macros ansteuert.
## Die Macros steuern 4 Powerausgänge als 2 SwitchPair-Ports an, welche die Doppelspulen schalten.
##
## history: 2021-12-19 A. Kuhtz erste Version, Stoomketel
##
## -----------------------------------------------

##author(A. Kuhtz)

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

## -------------- 1. Select Target
##application(text:de="Dreiwegweiche mit 2 Doppelspulen (Roco H0) an OneControl FW 3.x mit Schaltausgang-Paaren", text:en="Three-Way turnout with 2 double coil (Roco H0) at OneControl FW 3.x with SwitchPair", text:nl="Drievoudige Wisselaandrijving met dubbele spoel (Roco HO) op de OneControl FW 3.x op de SchakelPaar poorten")
##instruction(text:de="Konfiguration einer Dreiwegweiche mit 2 Doppelspulen (Roco H0) an der OneControl FW 3.x mit Schaltausgang-Paaren
Powerports:
Antrieb A - abzweig (grün), Antrieb A - gerade (rot), Antrieb B - abzweig (grün), Antrieb B - gerade (rot)", link="http://wiki.fichtelbahn.de/doku.php?id=konfigvorlagen:turnouts#dreiwegweiche_mit_2_spulen-antrieben_an_onecontrol_itrain") ##instruction(text:en="Configuration of a Three-Way turnout with 2 double coil (Roco H0) at the OneControl FW 3.x with SwitchPair ports
Powerports:
Drive A - turnout (green), Drive A - straight (red), Drive B - turnout (green), Drive B - straight (red)", link="http://wiki.fichtelbahn.de/doku.php?id=konfigvorlagen:turnouts#dreiwegweiche_mit_2_spulen-antrieben_an_onecontrol_itrain") ##instruction(text:nl="Drievoudige Wisselaandrijving met dubbele spoel (Roco HO) op de OneControl FW 3.x op de SchakelPaar poorten
Powerports:
Antrieb A - abzweig (grün), Antrieb A - gerade (rot), Antrieb B - abzweig (grün), Antrieb B - gerade (rot)", link="http://wiki.fichtelbahn.de/doku.php?id=konfigvorlagen:turnouts#dreiwegweiche_mit_2_spulen-antrieben_an_onecontrol_itrain") ## ##input($selectedAccessory:accessory, text:de="Auswahl des verwendeten Accessory", text:en="Select the Accessory", default=0) ##input($macroTurnoutRight:macro, text:de="Auswahl des ersten Macros (rechts)", text:en="Select the first macro (right)", default=0) ##input($switchPairPortA:switchpair, text:de="Auswahl des ersten Schaltausgang-Paar", text:en="Select the first SwitchPair output", default=0) ##input($delayAfterSwitch:int, text:de="Wartezeit(n * 20ms) nach Schalten", text:en="Delay after switching (n * 20ms)", default=30) ##input($turnoutName:string, text:de="Bezeichnung der Weiche: ", text:en="Name of the turnout: ", text:nl="Naam van de Wissel: ", default="W") ## -- prepare some variables -- #set($macroTurnoutStraight = $macroTurnoutRight + 1) #set($macroTurnoutLeft = $macroTurnoutRight + 2) #set($switchPairPortB = $switchPairPortA + 2) ## -- prepare names of ports -- ####################################### ## Setzt label, wenn ${prevent_replace_labels} NICHT true #if (!${prevent_replace_labels}) ## #if ($user_lang == "de") #set($labelRight = "rechts") #set($labelStraight = "gerade") #set($labelLeft = "links") #set($labelCoilA = "Antrieb A") #set($labelCoilB = "Antrieb B") #elseif ($user_lang == "nl") #set($labelRight = "rechtsaf") #set($labelStraight = "rechtdoor") #set($labelLeft = "links") #set($labelCoilA = "Drijfveer A") #set($labelCoilB = "Drijfveer B") #else #set($labelRight = "right") #set($labelStraight = "straight") #set($labelLeft = "left") #set($labelCoilA = "Drive A") #set($labelCoilB = "Drive B") #end ## Set label of ports ##set switchpair ${switchPairPortA} name="${switchPairPortName}_A" ##set switchpair ${switchPairPortB} name="${switchPairPortName}_B" set switchpair ${switchPairPortA} name="SPP$numberTool.format("#00", ${switchPairPortA}) | ${turnoutName} | ${labelCoilA}" set switchpair ${switchPairPortB} name="SPP$numberTool.format("#00", ${switchPairPortB}) | ${turnoutName} | ${labelCoilB}" ## Set label of macros ##set macro ${macroTurnoutRight} name="${macroName}_${labelRight}" ##set macro ${macroTurnoutStraight} name="${macroName}_${labelStraight}" ##set macro ${macroTurnoutLeft} name="${macroName}_${labelLeft}" set macro ${macroTurnoutRight} name="M$numberTool.format("#00", ${macroTurnoutRight})-SPP$numberTool.format("#00", ${switchPairPortA})/SPP$numberTool.format("#00", ${switchPairPortB}) | ${turnoutName} | ${labelRight}" set macro ${macroTurnoutStraight} name="M$numberTool.format("#00", ${macroTurnoutStraight})-SPP$numberTool.format("#00", ${switchPairPortA})/SPP$numberTool.format("#00", ${switchPairPortB}) | ${turnoutName} | ${labelStraight}" set macro ${macroTurnoutLeft} name="M$numberTool.format("#00", ${macroTurnoutLeft})-SPP$numberTool.format("#00", ${switchPairPortA})/SPP$numberTool.format("#00", ${switchPairPortB}) | ${turnoutName} | ${labelLeft}" ## Set label of accessory ##set accessory ${selectedAccessory} name="${accessoryName}" ##set aspect 0 accessory=${selectedAccessory} name="${macroName}_${labelRight}" ##set aspect 1 accessory=${selectedAccessory} name="${macroName}_${labelStraight}" ##set aspect 2 accessory=${selectedAccessory} name="${macroName}_${labelLeft}" set aspect 0 accessory=${selectedAccessory} name="${turnoutName} | ${labelRight}" set aspect 1 accessory=${selectedAccessory} name="${turnoutName} | ${labelStraight}" set aspect 2 accessory=${selectedAccessory} name="${turnoutName} | ${labelLeft}" set accessory ${selectedAccessory} name="A$numberTool.format("#00", ${selectedAccessory})-iTr$numberTool.format("#00", ${selectedAccessory}) | M$numberTool.format("#00", ${macroTurnoutRight})/$numberTool.format("#00", ${macroTurnoutStraight})/$numberTool.format("#00", ${macroTurnoutLeft})-SPP$numberTool.format("#00", ${switchPairPortA})/SPP$numberTool.format("#00", ${switchPairPortB}) | ${turnoutName}" #end ####################################### config port ptype=switchpair ticks=15 number=${switchPairPortA} config port ptype=switchpair ticks=15 number=${switchPairPortB} ## Macro Weiche rechts ## select macro ${macroTurnoutRight} ## macro repeats once config macro repeat=1 slowdown=1 ## stop the other macro add step ptype=macro action=stop number=${macroTurnoutStraight} add step ptype=macro action=stop number=${macroTurnoutLeft} ## add the steps to switch the ports add step ptype=switchpair action=off delay=5 number=${switchPairPortA} add step ptype=switchpair action=on delay=5 number=${switchPairPortB} add step ptype=delay delay=${delayAfterSwitch} ## Macro Weiche gerade ## select macro ${macroTurnoutStraight} ## macro repeats once config macro repeat=1 slowdown=1 ## stop the other macro add step ptype=macro action=stop number=${macroTurnoutRight} add step ptype=macro action=stop number=${macroTurnoutLeft} ## add the steps to switch the ports add step ptype=switchpair action=off delay=5 number=${switchPairPortA} add step ptype=switchpair action=off delay=5 number=${switchPairPortB} add step ptype=delay delay=${delayAfterSwitch} ## Macro Weiche links ## select macro ${macroTurnoutLeft} ## macro repeats once config macro repeat=1 slowdown=1 ## stop the other macro add step ptype=macro action=stop number=${macroTurnoutRight} add step ptype=macro action=stop number=${macroTurnoutStraight} ## add the steps to switch the ports add step ptype=switchpair action=on delay=5 number=${switchPairPortA} add step ptype=switchpair action=off delay=5 number=${switchPairPortB} add step ptype=delay delay=${delayAfterSwitch} ## Define Accessory select accessory ${selectedAccessory} config accessory startup restore add aspect 0 macronumber=${macroTurnoutRight} add aspect 1 macronumber=${macroTurnoutStraight} add aspect 2 macronumber=${macroTurnoutLeft}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy