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.signals.SBB_Zwergsignal.nodescript Maven / Gradle / Ivy
### Dieses Script definiert ein Asseccory,
### um die drei LED eines SBB Zwergsignals
### anzusteuern.
###
### Hardware: 3 Lightports (Port 0 = ws_lu , 1 = ws_r, 2 = ws_lo)
### Software: 1 accessory
### 3 Makros, 0 = Fahrt,
### 1 = Halt,
### 2 = Vorsicht
###
###
### history: 2018-02-23 Markus von Allmen
###
### 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="SBB Zwergsignal, 3 Fahrbegriffe", text:en="SBB dwarf signal, 3 Aspects")
##instruction(text:de="SBB Zwergsignal, 3 Fahrbegriffe Lightports 0 = ws_lu , 1 = ws_r, 2 = ws_lo Macros = Fahrt, Halt, Vorsicht ", link="https://forum.opendcc.de/wiki/doku.php?id=konfigvorlagen:sbb_system_l")
##instruction(text:en="SBB dwarf signal, 3 Aspects Lightports 0 = ws_lu , 1 = ws_r, 2 = ws_lo Macros = free ride, stop, caution", link="https://forum.opendcc.de/wiki/doku.php?id=konfigvorlagen:sbb_system_l" )
###
##input($AccessoryName:string, text:de="Name des Signal-Accessories: ", text:en="Name of the signal Accessory: ", default="SBB Zwergsignal")
##input($my_accessory:accessory, text:de="Nummer des zu erzeugenden Accessory: ", text:en="Number of the Accessory: ", default=0)
##input($my_macro:macro, text:de="Nummer des ersten Macros (Halt): ", text:en="Number of the first macro (stop): ", default=0)
##input($start_led:light, text:de="Nummer des ersten Lightport (ws_lu): ", text:en="Number of the first Lightport (ws_lu): ", 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)
#set($led_gap = 1) ### die anderen 2 LED sind an den folgenden 2 Lightports angeschlossen
###
### -------------- 2. set Parameters for Ports
#set($WertbeiOff = 0)
#set($WertbeiOn = 200)
#set($Ueberblenden = 5)
#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. define macros and lightports
#set($mCount = 0)
#set($macro_h = $my_macro + $mCount)### Halt
#set($mCount = $mCount + 1)
#set($macro_f = $my_macro + $mCount) ### Fahrt
#set($mCount = $mCount + 1)
#set($macro_v = $my_macro + $mCount) ### Vorsicht
###############################################################
#set($led_ws_lu = $start_led) ### LED ws_lu an erstem lightport, der eingegeben wurde
config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_ws_lu}
#set($led_ws_r = $start_led + 1) ### LED ws_r an nächstem lightport
config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_ws_r}
#set($led_ws_lo = $start_led + 2) ### LED ws_lo an nächstem lightport
config port ptype=light ValueOff=${WertbeiOff} ValueOn=${WertbeiOn} ${DimmzeitOffParam} ${DimmzeitOnParam} number=${led_ws_lo}
###############################################################
########################################
### Setzt label, wenn ${prevent_replace_labels} NICHT true
#if (!${prevent_replace_labels})
###
### Set label of Ports
set light ${led_ws_lu} name="${AccessoryName}_${my_accessory}_${led_ws_lu}_ws_lu"
set light ${led_ws_r} name="${AccessoryName}_${my_accessory}_${led_ws_r}_ws_r"
set light ${led_ws_lo} name="${AccessoryName}_${my_accessory}_${led_ws_lo}_ws_lo"
### Set label of Macro
set macro ${macro_h} name="${AccessoryName}_${my_accessory}_Halt"
set macro ${macro_f} name="${AccessoryName}_${my_accessory}_Fahrt"
set macro ${macro_v} name="${AccessoryName}_${my_accessory}_Vorsicht"
### Set label of Accessories
set accessory ${my_accessory} name="${AccessoryName}_${my_accessory}"
#end
########################################
################################################/
### Macro Zwergsignal Halt
###
select macro ${macro_h}
config macro repeat=1 slowdown=1
### nicht benoetigte LED's ausschalten
add step ptype=light action=down number=${led_ws_lo}
### Halt setzten, nach $Ueberblenden Ticks
add step ptype=light action=up delay=${Ueberblenden} number=${led_ws_lu}
add step ptype=light action=up number=${led_ws_r}
###
### Ende Macro Zwergsignal Halt
###
################################################/
################################################/
### Macro Zwergsignal Fahrt
###
select macro ${macro_f}
config macro repeat=1 slowdown=1
### nicht benoetigte LED's ausschalten
add step ptype=light action=down number=${led_ws_lu}
add step ptype=light action=down delay=${Ueberblenden} number=${led_ws_r}
### Fahrt setzten, nach $Ueberblenden Ticks
add step ptype=light action=up number=${led_ws_lu}
add step ptype=light action=up delay=${Ueberblenden} number=${led_ws_lo}
### Ende Macro Zwergsignal Fahrt
###
################################################/
################################################/
### Macro Macro Zwergsignal Vorsicht
###
select macro ${macro_v}
config macro repeat=1 slowdown=1
### nicht benoetigte LED's ausschalten
add step ptype=light action=down number=${led_ws_lu}
### Halt setzten, nach $Ueberblenden Ticks
add step ptype=light action=up delay=${Ueberblenden} number=${led_ws_r}
add step ptype=light action=up number=${led_ws_lo}
###
### Ende Macro Zwergsignal Vorsicht
###
################################################/
### Define Accessory
#set($aCount = 0)
select accessory ${my_accessory}
add aspect ${aCount} macronumber=${macro_f}
#set($aCount = $aCount + 1)
add aspect ${aCount} macronumber=${macro_h}
#set($aCount = $aCount + 1)
add aspect ${aCount} macronumber=${macro_v}