Stack events
Denis
Junior Member
Hi
I would like to know, when we have 2 or more touch panel in the same projetc, each touch panel have some common devices, if it's better to do differents program for each panel or if we can stack buttons event
ex:
BUTTON_EVENT [dvTP_STORES_PISCINE,4]
BUTTON_EVENT [dvTPK_STORES_PISCINE,4]
or complete program for each button of each device
I would like to know, when we have 2 or more touch panel in the same projetc, each touch panel have some common devices, if it's better to do differents program for each panel or if we can stack buttons event
ex:
BUTTON_EVENT [dvTP_STORES_PISCINE,4]
BUTTON_EVENT [dvTPK_STORES_PISCINE,4]
or complete program for each button of each device
Comments
-
The best, IMHO, is to delcare a DEV array containing both panels:
DEFINE_DEVICE TP1 = 10001:1:0 TP2 = 10002:1:0 DEFINE_VARIABLE TPs[] = {TP1,TP2} DEFINE_EVENT BUTTON_EVENT [TPs,1] { PUSH: { // This will trigger if button ch. 1 is pushed on either channel } } DEFINE_PROGRAM [TPs,1] = [SomeDevice,PowerOn] // This will light up the button on BOTH panels when channel 'PowerOn' on 'SomeDevice' is on
You can still address panels separately:BUTTON_EVENT [TP1,2] { PUSH: { // Only triggers for TP1 } } BUTTON_EVENT [TP2,2] { PUSH: { // Only triggers for TP2 } }
- Chip -
Denis wrote:I would like to know [...] if it's better to [..]
Internally all forms resolve to the same code, so the better way is the one you like best and find the most easy to maintain.
Chip's method has the great advantage of scalability: just add the panel to the dev array and voila! (for the shared buttons at least).
However, I do find that "overusing" dev arrays and channel arrays and other arrays may sometimes lead to code not easily grasped unless you're firmly into it, the kind you look at 6 months later and wonder what this is trying to achieve. So I would not bother if few functions are shared.
Fred
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums