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

data.nodescript.signals.DB_Abfahrsignal_Zp9.nodescript Maven / Gradle / Ivy

### Dieses Script definiert ein Accessory, 
### um die LEDs eines Abfahrsignal Zp 9 (DB)
### anzusteuern.
###
### Hardware: 1 Lightport (Port 0 = grün)
### Software: 1 accessory
###           2 macros, 0 = aus, 1 = Zp9
###
### history: 2022-04-29 A.Kuhtz, erste Version
###
### how to use:
### A) configure
###    In section 1, define your ports and the desired accessory number
###    In section 2, define your settings (like brightness and speed)
### B) load and run this script
###    what will happen?
###    1. the ports will be configured with the given parameters
###    2. three new macros for the aspects will be defined
###    3. these macros will be assigned to the accessory
### C) have fun
###
### -------------- 1. Select Target
##application(text:de="DB Abfahrsignal Zp 9", text:en="DB Abfahrsignal Zp 9")
##instruction(text:de="DB Abfahrsignal Zp 9
erster Lichtausgang = grün
Makros = Aus, Zp9") ##instruction(text:en="DB Abfahrsignal Zp 9
lightport = green
macro = off, Zp9") ### ##input($AccessoryName:string, text:de="Name des Abfahrsignal-Accessory: ", text:en="Name of the Abfahrsignal Accessory: ", default="Abfahrsignal") ##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 (Aus): ", text:en="Number of the first macro (off): ", default=0) ##input($start_led:light, text:de="Nummer des Lightport (grüne LED): ", text:en="Number of the Lightport (green LED): ", default=0) ##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) ### ### -------------- 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($macro0 = $my_macro) ### need some additional macros #set($macro1 = $macro0 + 1) ### need some additional macros #set($led_gn = $start_led) ### LED green an lightport, der eingegeben wurde ####################################### ### Setzt label, wenn ${prevent_replace_labels} NICHT true #if (!${prevent_replace_labels}) ### Set label of Ports set light ${led_gn} name="${AccessoryName}_${my_accessory}_${led_gn}_gn" ### Set label of Macro set macro ${macro0} name="${AccessoryName}_${my_accessory}_aus" set macro ${macro1} name="${AccessoryName}_${my_accessory}_Zp9" ### Set label of Asseccories set accessory ${my_accessory} name="${AccessoryName}_${my_accessory}" set aspect 0 accessory=${my_accessory} name="Aus" set aspect 1 accessory=${my_accessory} name="Zp 9" #end ####################################### ### ### Ports: (set Parameters) config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_gn} ################################################/ ### Macro Abfahrsignal aus ### select macro ${macro0} config macro repeat=1 slowdown=1 ### 'aus' setzten, $Ueberblenden Ticks dunkel add step ptype=light action=down delay=${Ueberblenden} number=${led_gn} ### ### Ende Macro Abfahrsignal aus ### #################################################/ ### Macro Abfahrsignal Zp9 ### select macro ${macro1} config macro repeat=1 slowdown=1 ### Sp1 setzten, $Ueberblenden Ticks dunkel add step ptype=light action=up delay=${Ueberblenden} number=${led_gn} ### ### Ende Macro Abfahrsignal Zp9 ### ################################################/ ### Define Accessory select accessory ${my_accessory} add aspect 0 macroname="${AccessoryName}_${my_accessory}_aus" add aspect 1 macroname="${AccessoryName}_${my_accessory}_Zp9" config accessory startup restore ## restore; none; aspect=1




© 2015 - 2024 Weber Informatics LLC | Privacy Policy