Having toggle for an array
deblajw
Posts: 4
I've got a group of buttons that control a set up popup pages. I have set the buttons as an array to easily turn them off when the tp turns off the popups. I am trying to have them as toggle buttons for the popups and stay on when the popup is showing. what i have works fine on the first press (showing the page) and the second (hiding the page) but the third press of the same button will not work - the button won't become active but the popup does show (popups are a function of the touch panel file).
BUTTON_EVENT [ENVIRO_BUTTONS] //BOTTOM BAR TOGGLES
{
PUSH :
{
[vdvTP_1,BUTTON.INPUT.CHANNEL]=![vdvTP_1,BUTTON.INPUT.CHANNEL]
}
}
I'm sure it's something simple -- what am i missing?
BUTTON_EVENT [ENVIRO_BUTTONS] //BOTTOM BAR TOGGLES
{
PUSH :
{
[vdvTP_1,BUTTON.INPUT.CHANNEL]=![vdvTP_1,BUTTON.INPUT.CHANNEL]
}
}
I'm sure it's something simple -- what am i missing?
0
Comments
I would not use the panel's built-in popup navigation. The reason is what you've just discussed that the panel can change and you not know what the heck happened.
What I'd do is this:
Create a variable array that has the names of all the popups you want to track.
Example:
This is an overly simplified way to do it but I think it illustrates the idea.
I commonly have several popups open and how they interrelate is dependent upon what the client is doing at the time and whether or not what they're doing is more system wide or local in nature. (I deal with installs with 20 or more touch panels)
If I had to manage that kind of navigation in the touch panels themselves, I'd go stark-raving mad. The way I have it set up is nice since I make only one TP file. IT goes in every panel in the house no matter where or what it is.
It contains every single popup, graphic, button for every possible thing going on in the install. The code actually handles what that panel at whatever address is actually supposed to do. For example: if the room has a home theater associated with it, it will call up the proper buttons, popups and graphics that relate to that room. If the panel is located elsewhere, the client will never see those items on that panel.
Or even more nicely, I get a call from Mr. client and he says he dropped his MVP8400 in the pool and wants to watch the game in 20 minutes. I can tell him to grab another one, re-address it and Ta-Da, the panel becomes the one that runs his theater without reprogramming anything.
That's my 2 cents...
later
ejm
I think the problem with your code, however, is the difference between input channels, output channels, and feedback channels. Output and feedback are not necessarily the same thing, but the program determines what you want by interpreting the code; you can't address them explicitly (that I know of, except for the TOTAL_OFF keyword, which isn't quite the same). My guess is that syntax is following the output channel on the right side, and the feedback on the left, and so causing the inconsistent results. Changing one doesn't necessarily change the other, or at least not right away. I don't know how the differences are handled, but I suspect it varies with the type of channel and whether it tracks a hardware device, or a virtual, or a button.
At least, that's my understanding of it, which, admittedly, is somewhat murky.
To chime in on pop up control once again since it's been over a month since it's been discussed I believe doing either way is completely acceptable and which way you go depends on what your needs are. I've never done a system completely one way or the other. If it were a perfect world I would prefer doing it all in code but since my world far from perfect and there are so many other things more important I can do to improve my code doing more than is necassary to control pop ups will stay a low priority. When you have to, you have to. When you don't do what you feel like doing or what time permits.