Code driven page jumps.
Jeff Lockyear
Posts: 147
I'm looking at changing my ways from having my page jumps in TPD to having them in code. I've done a little here and there, but I'm starting to run into cases where the panel design I want to use doesn't really support page jumps in TPD; at least not easily.
I was wondering if anyone had any tips to point me in the right direction before I hare off and start whacking out code.
I typically try to have my panels work the same way and have the same design, but inevitably there are differences that make the panels individuals. Never ask a client for their opinion....
Thanks.
I was wondering if anyone had any tips to point me in the right direction before I hare off and start whacking out code.
I typically try to have my panels work the same way and have the same design, but inevitably there are differences that make the panels individuals. Never ask a client for their opinion....
Thanks.
0
Comments
Why are they paying for a custom system then?
What got me started in doing page flips in code is the ability to send exactly the same UI file to all panels in one system.
If you have multiple panels, each in their own room, you would probably have a unique lighting page for each room. Rather than only having the control page for room one in the fie for panel one and the control page for room two in panel two, put all the pages in all the panels.
I would then name the pages something like Lighting1, Lighting2, etc. This way you can use a simple variable table to flip to a certain page from a certain panel with something like SEND_COMMAND dvPanel,"'PAGE-Lighting',ITOA(variable_derived_from_code)"
I could conceive doing everything in code but lazziness always prevents it.
The only time I use the panel's navigation is for shutting off "Are You Sure?" popups.
That's exactly what started me on this path. I can make all the music and general control (HVAC, Spa, etc) common among all the panels, but it's always lighting that splits them up. I didn't consider putting all the lighting pages on all the panels and just sniping the one I want for a given panel.
Solution: Put the keypad & layouts in the code. I have an array that shows & hides buttons based on how many buttons there are. If there's only three on a keypad, buttons 2, 5 and 8 are shown. If there are six buttons on a keypad buttons 1,3,4,6,7 and 9 are shown up. (1 being upper left, 9 being bottom most right; 3x3 configuration.)
I have 9 buttons on each page, then hide & show accordingly. All buttons have dynamic text. Makes it nice to have a common page. Just changes via code.
The kind of flips I leave in the panel are the ones where a source might need several pages, and the panel handles those. That's pretty much about it. I used to keep almost all my flips in the panel, and still have jobs out there where that happens, but it's not something I do on a new job anymore.
With audio page flips I would have a channel trigger the switcher programming, so I could send page commands based on that. It's buttons that are purely for navigation that I'm wondering about.
Navigational buttons to me sometimes are more difficult than controlling or selecting a source. I mean seriously, how difficult (after a while) is it to send a PLAY command? Or to turn a TV on? It's easy to control a device. It's the logic that goes into the GUI that can make or kill a project. If the user is having issues getting to a place in the panel, it doesn't matter if something isn't working. As programmers we are responsible for A LOT in a job - making it easy for the user to understand and use is part of it, and that includes getting them to where they need.
I group all of my buttons in arrays: transport, power off, source select, categories and special buttons. Everything except the transport (and sometimes the special ones, i.e. presets, etc.) buttons call some kind of page manipulation.
Quick question for you Jeff - are you using lots and lots of pages, or a few pages and lots of popups?
I'm also a big fan of arrays for channel numbers.