data.nodescript.lighteffects.NeoControlEWS_ledtab_seq.nodescript Maven / Gradle / Ivy
## Script only for NeoControl EWS!
## This script creates a sequence in the table for the LED stripe assignment
##
## Hardware: Neocontrol with NeoControl EWS firmware
## Software:
##
## history: 2017-01-08 V.Dierkes, first version
## 2017-02-18 V.Dierkes, use predefined variables to calculate CV addresses
## 2017-02-18 V.Dierkes, check VID and PID
## 2017-02-18 V.Dierkes, predefined variable light_count was renamed
## 2017-03-18 V.Dierkes, replaced tabs by spaces
## 2017-04-24 V.Dierkes, missed one change for predefined variable light_count
## 2017-04-24 V.Dierkes, improve instruction text, use application
## 2019-11-25 V.Dierkes, merge GIT with local version
## 2020-04-07 V.Dierkes, Fix size of 20 instead of ${node_accessory_count} for accessory CV area
##
## how to use:
## A) configure
## Not needed
## B) load and run this script
## what will happen?
## 1. a sequence of assignment for the LED stripes will be created
##
##require(vid="13", pid="129")
##application(text:de="NeoEWS: LED Zuordnung - Ordne einen Block Lightports einem Block Ausg?nge zu", text:en="NeoEWS: LED mapping - assign a block of lightports to a block of outputs")
##instruction(text:de="F?r die NeoEWS!
Es wird ein Block Lightports (definiert durch die Nummer des ersten Lightports und durch die Anzahl der Lightports) einem Block Ausg?nge (definiert durch die Nummer des ersten Ausgangs) zugeordnet.", text:en="For NeoEWS!
A block of lightports (defined by the number of the first lightport and by the quantity of lightports) will be assigned to a block of outputs (defined by the number of the first output).", link="https://forum.opendcc.de/wiki/doku.php?id=onews:onewsi#led_zuordnung")
##
##input($start_light:light, text:de="Erster Lightport", text:en="First light port", default=0)
##input($start_stripe:int, text:de="Erste Position im Stripe", text:en="First position in the stripe", default=0)
##input($quantity:int, text:de="Anzahl der LEDs", text:en="Quantity of LEDs", default=1)
## -------------- 1. Select Target
#if((${vid} == 13) && (${pid} == 129))
## Only for Neo_EWS
## -------------- 2. Define default values
#set($cv_base_lights = 81)
#set($cv_base_accessory = $cv_base_lights + ( 5 * ${node_light_count}) )
## Fix size of 20 instead of ${node_accessory_count} for accessory CV area
#set($cv_base_colors = $cv_base_accessory + ( 10 * 20) )
#set($cv_base_groups = $cv_base_colors + ( 3 * 32 ) )
#set($cv_base_mapping = $cv_base_groups + ( 6 * 16 ) )
#set($cv_base_config = $cv_base_mapping + ( 1 * 256 ) )
#set($cv_base_acc_cfg = $cv_base_config + ( 6 ) )
## -------------- 3. execute part of the script
#if($start_light + $quantity - 1 <= ${node_light_count})
#set($cv_base = $cv_base_mapping)
#set($cv_addr = $cv_base + $start_stripe)
#foreach ($i in [1..$quantity])
set CV ${cv_addr} ${start_light}
#set ($cv_addr = $cv_addr + 1)
#set ($start_light = $start_light + 1)
#end
#end
#end
#######################################