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

data.nodescript.signals.NS-1955-Hoofdsein_Hauptsignal.nodescript Maven / Gradle / Ivy

### Dieses Script definiert ein Asseccory, 
### um die drei LED eines 195'er Hauptsignal der Niederländischen Einsenbahn (NS)
### anzusteuern.
###
### Hardware: 3 Lightport (Port 0 = Ro, 1 = Ge, 2 = Gr)
### Software: 1 accessory
###           6 macros, 0 = Ro, 1 = Gr, 2 = Ge, 3 = Ro*, 4 = Gr*, 5 = Ge*
### * = flashlight
###
### history: 2017-05-23 A.Tillner, erste Version
###
###
### -------------- 1. Select Target
##application(text:de="NS-1955-Hoofdsein/Hauptsignal", text:en="NS-Mainsignal")
##instruction(text:de="NS-1955-Hoofdsein/Hauptsignal: 
Lightports = Ro, Ge, Gr
Macros = Ro, Gr, Ge, Ro*, Gr*, Ge*
* = Blinklicht", text:en="NS-Mainsignal:
Lightports = Ro, Ge, Gr
Macros = Ro, Gr, Ge, Ro*, Gr*, Ge*
* = Flashlight", link="https://forum.opendcc.de/wiki/doku.php?id=konfigvorlagen:signale_ns_1955" ) ### ##input($AccessoryName:string, text:de="Name des Accessories: ", text:en="Name of the Accessory: ", default="NS-Hoofdsein") ##input($my_accessory:accessory, text:de="Nummer des zu erzeugenden Accessory: ", text:en="Nummber of the Accessory: ", default=0) ##input($my_macro:macro, text:de="Nummer des ersten Macros (Ro): ", text:en="Number of the first macro (Ro): ", default=0) ##input($start_led:light, text:de="Nummer des ersten Lightport (Ro): ", text:en="Number of the first Lightport (Ro): ", default=0) ##input($led_Rood_flash:boolean, text:de="Rood blinken", text:en="Red flashing", default=true) ##input($led_groen_flash:boolean, text:de="Groen blinken", text:en="Green flashing", default=true) ##input($led_geel_flash:boolean, text:de="Geel blinken", text:en="Yellow flashing", default=true) ##input($prevent_replace_labels:boolean, text:de="Keine Namen fuer Accessory, Makros, Ports ersetzen", text:en="Prevent replace labels for accessory, macro and ports", default=false) #set($led_gap = 1) ### die anderen vier LED sind an den folgenden vier Lightports angeschlossen ### ### -------------- 2. set Parameters for Ports #set($WertbeiOff = 0) #set($WertbeiOn = 200) #set($Ueberblenden = 15) #set($OnTime = 0) #if (${dimm_range} == 8) ### Es handelt sich um einen Knoten mit 8 Bit Dimming #set($DimmzeitOff = 10) #set($DimmzeitOn = 10) #set($DimmzeitOffParam = "DimmOff=${DimmzeitOff}") #set($DimmzeitOnParam = "DimmOn=${DimmzeitOn}") #else ### Es handelt sich um einen Knoten mit 16 Bit Dimming #set($DimmzeitOff = 2500) #set($DimmzeitOn = 2500) #set($DimmzeitOffParam = "DimmOff88=${DimmzeitOff}") #set($DimmzeitOnParam = "DimmOn88=${DimmzeitOn}") #end ### -------------- 3. execute part of the script #set($macrocount = 0) #set($macro_Rood = $my_macro + $macrocount) ### need some additional macros #set($macrocount = $macrocount + 1) #set($macro_Groen = $my_macro + $macrocount) ### need some additional macros #set($macrocount = $macrocount + 1) #set($macro_Geel = $my_macro + $macrocount) ### need some additional macros #if ( $led_Rood_flash == true) #set($macrocount = $macrocount + 1) #set($macro_Rood_Flash = $my_macro + $macrocount) ### need some additional macros #end #if ( $led_groen_flash == true) #set($macrocount = $macrocount + 1) #set($macro_Groen_Flash = $my_macro + $macrocount) ### need some additional macros #end #if ( $led_geel_flash == true) #set($macrocount = $macrocount + 1) #set($macro_Geel_Flash = $my_macro + $macrocount) ### need some additional macros #end #set($led_ro = $start_led) ### LED gn_links an erstem lightport, der eingegeben wurde #set($led_ge = 1 * $led_gap + $start_led) ### LED gn_rechts an nächstem lightport #set($led_gr = 2 * $led_gap + $start_led) ### LED gn_rechts an nächstem lightport ######################################## ### Setzt label, wenn ${prevent_replace_labels} NICHT true #if (!${prevent_replace_labels}) ### ### Set label of Ports set light ${led_ro} name="${AccessoryName}_${my_accessory}_${led_ro}_Ro" set light ${led_gr} name="${AccessoryName}_${my_accessory}_${led_gr}_Gr" set light ${led_ge} name="${AccessoryName}_${my_accessory}_${led_ge}_Ge" ### Set label of Macro set macro ${macro_Rood} name="${AccessoryName}_${my_accessory}_Rood" set macro ${macro_Groen} name="${AccessoryName}_${my_accessory}_Groen" set macro ${macro_Geel} name="${AccessoryName}_${my_accessory}_Geel" #if ( $led_Rood_flash == true) set macro ${macro_Rood_Flash} name="${AccessoryName}_${my_accessory}_Rood_*" #end #if ( $led_groen_flash == true) set macro ${macro_Groen_Flash} name="${AccessoryName}_${my_accessory}_Groen_*" #end #if ( $led_geel_flash == true) set macro ${macro_Geel_Flash} name="${AccessoryName}_${my_accessory}_Geel_*" #end ### Set label of Accessories set accessory ${my_accessory} name="${AccessoryName}_${my_accessory}" #end ######################################## ### ### Ports: (set Parameters) config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_ro} config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_gr} config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_ge} ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Rood} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=up delay=${Ueberblenden} number=${led_ro} ### ### Ende Macro Hauptsignal Halt ### ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Groen} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=up delay=${Ueberblenden} number=${led_gr} ### ### Ende Macro Hauptsignal Halt ### ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Geel} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=up delay=${Ueberblenden} number=${led_ge} ### ### Ende Macro Hauptsignal Halt ### #if ( $led_Rood_flash == true) ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Rood_Flash} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=blinkb delay=${Ueberblenden} number=${led_ro} ### ### Ende Macro Hauptsignal Halt ### #end #if ( $led_groen_flash == true) ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Groen_Flash} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=blinkb delay=${Ueberblenden} number=${led_gr} ### ### Ende Macro Hauptsignal Halt ### #end #if ( $led_geel_flash == true) ################################################/ ### Macro Hauptsignal Halt ### select macro ${macro_Geel_Flash} config macro repeat=1 slowdown=1 ### nicht benoetigte LED's ausschalten add step ptype=light action=down number=${led_ro} add step ptype=light action=down number=${led_gr} add step ptype=light action=down number=${led_ge} ### Vorsicht setzten, nach $Ueberblenden Ticks add step ptype=light action=blinkb delay=${Ueberblenden} number=${led_ge} ### ### Ende Macro Hauptsignal Halt ### #end ################################################/ ### Define Accessory select accessory ${my_accessory} add aspect 0 macroname="${AccessoryName}_${my_accessory}_Rood" add aspect 1 macroname="${AccessoryName}_${my_accessory}_Groen" add aspect 2 macroname="${AccessoryName}_${my_accessory}_Geel" #if ( $led_Rood_flash == true) add aspect 3 macroname="${AccessoryName}_${my_accessory}_Rood_*" #end #if ( $led_groen_flash == true) add aspect 4 macroname="${AccessoryName}_${my_accessory}_Groen_*" #end #if ( $led_geel_flash == true) add aspect 5 macroname="${AccessoryName}_${my_accessory}_Geel_*" #end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy