Multiple Rooms, Multiple Panels - Get_Last????
mkleynhans
Posts: 78
Hi Guys,
I am busy doing a residential job which has grown from one TP in one area to eight TP's controlling eight
zones. Ordinarily, this would not be too bad but the customer has asked for every TP to have the facility
to control any zone.
I have created Zone pages which have fixed volume buttons for each zone and then call for the matrix changes,
turn on screens, amps etc in an include for each TP. The source buttons are popup pages.
Initially I have built all the source equipment include files to have Dev Arrays for 10 touch panels but I am
struggling slightly on the page flips as the include file for each TP's pageflips is getting HUUGE and too complicated.
Is there a way of using GET_LAST to send the pageflips only to the panel that the trigger button is pressed on?
IE. If I am in the Master Bedroom the Sky HD1 box activity button for the room is 1:22. If this is pressed,
it triggers;
CASE 22: //Masterbedroom Watch Sky 1
{
IF ((cTVLock == 'on') & (cMBRTvLift == 'Down'))
{
SEND_COMMAND dvTP10,"'@PPN-Alert - TV Locked'"
}
ELSE IF ((cTVLock == 'off') & (cMBRTvLift == 'Down'))
{
SEND_COMMAND dvTP10,"'@PPN-Alert - TV Open Sky1'"
}
ELSE
{
CALL 'TP10 BEDROOM WATCH SKY1'
}
}
Is there a way of using GET_LAST TO only send the pageflips or popups to the touch
panel that pushed the button?
Thanks as always...
I am busy doing a residential job which has grown from one TP in one area to eight TP's controlling eight
zones. Ordinarily, this would not be too bad but the customer has asked for every TP to have the facility
to control any zone.
I have created Zone pages which have fixed volume buttons for each zone and then call for the matrix changes,
turn on screens, amps etc in an include for each TP. The source buttons are popup pages.
Initially I have built all the source equipment include files to have Dev Arrays for 10 touch panels but I am
struggling slightly on the page flips as the include file for each TP's pageflips is getting HUUGE and too complicated.
Is there a way of using GET_LAST to send the pageflips only to the panel that the trigger button is pressed on?
IE. If I am in the Master Bedroom the Sky HD1 box activity button for the room is 1:22. If this is pressed,
it triggers;
CASE 22: //Masterbedroom Watch Sky 1
{
IF ((cTVLock == 'on') & (cMBRTvLift == 'Down'))
{
SEND_COMMAND dvTP10,"'@PPN-Alert - TV Locked'"
}
ELSE IF ((cTVLock == 'off') & (cMBRTvLift == 'Down'))
{
SEND_COMMAND dvTP10,"'@PPN-Alert - TV Open Sky1'"
}
ELSE
{
CALL 'TP10 BEDROOM WATCH SKY1'
}
}
Is there a way of using GET_LAST TO only send the pageflips or popups to the touch
panel that pushed the button?
Thanks as always...
0
Comments
http://www.amxforums.com/showthread.php?9393-Netlinx-port-codes
it talks about using get_last with a touch panel dev array, so you can track which touch panel was used and send feedback or page flips, etc just to that one
Yeah, you're going to find the use of get_last a bit sketchy there.
You're going to have to figure out some kind of framework to store and track your index returns.
To be honest, I'd actually rethink the use of nested waits myself. Perhaps if you could post some code on how you wish to handle this. We might be able to suggest a little better way.
E
Inside a BUTTON_EVENT you can use:
SEND_COMMAND BUTTON.INPUT.DEVICE,<the command you want to send>
And inside a DATA_EVENT you can use:
SEND_COMMAND DATA.DEVICE,<the command you want to send>
Thanks you! Thank you! Thank you! This is exactly what I was trying to do. Its basically for multiple
TP's to be able to control any zone so for page flips or certain feedback, I only wanted to send the action
back to the originating panel. Using the Get_Last, it was possible for another panel to intercept and
become the newer Get_Last so this is much better.
Just when you think you are getting better at Netlinx programming, a pro comes along and shows
you something basic that really humbles you
This design is more akin to a stack of universal remotes than to an integration. Although it may be all that the job requires.
How do you approach these sorts of jobs John? I have tested it with two ipads and copying the current device number to a DEV variable for each room seems to work well without a hitch. I could write seperate panel includes for every panel and for every device i guess....
http://www.amxforums.com/showthread.php?9393-Netlinx-port-codes
Our company built a database approach to the problem, tracking all panels, rooms, sources, devices. Everything is a request, no page flips done by the panels. The central database tells the panels what page to show, so we don't need to ask them where they are. All panels can select and control any room, and all panels controlling the same room at the time will be sent the same updates and navigation. "PLAY" on any panel for any device is the same code and port. Since we know where the command came from, we know what to do with it. All touch panels are alike in all systems, driven to show what is needed by the situation of the moment. The central code is the same in every job, driven by data files that define what devices, ui's, rooms, and features the job has. So new jobs are just new data, no programming.
That's more than you will probably want to program yourself, but the concepts are useful when designing your code; think about building an intelligent system instead of a relay race.
Till then its programming for every job. We are still a small business that has been doing AMX for the last couple of years.
I dont know why but every job seems very different ( except the commercial installs) and the customers want completely different looks and logic behind theit interfaces.
Perhaps we should be more stringent in what we offer but I get a real buzz in offering the customers completely bespoke solutions.
I just need to learn how to programme them properly and efficiently..
Thanks for all the help and feedback!
I cannot say who made this statement but there's wisdom in it.
Look at it like a client who wants a high-end automobile.
They can get one custom made from scratch. It will be completely unique. But it will cost 10s of times more to design at the customers specification, engineer, draw up, build and install. Then they need time to tweak and change things.
Or they can buy an off the shelf Fararri that has taken years to engineer build and has been tested thoroughly and runs like a champ. It will cost less and they'll really enjoy driving it. It goes fast and looks awesome.
When it comes down to it, we're all just turning stuff on and off and routing stuff from here to there. The idea of something truly 'custom' is not really honest. The 'custom' part really isn't that uncommon after all and usually causes more headaches in the end.
I'd recommend creating a really solid REPEATABLE system that works every time and is easy to set up and run.
I can help you on your way. Design a system with one touch panel. Then rethink it so you can add as many touch panels to the system as you like without writing another line of code. Do that and you'll have your repeatable system!
Say a panel 2 selects AV room 1 which is a global-access control (as opposed to selecting AV controls then Room 1), I would make this button be part of the global panel controls. Tapping the button would fire the button event and determine panel index 2, set the control type to AV, call sys_panel_update(2) which determines it needs to call av_panel_update(2), which does all of the AV panel updating. Obviously there are no on-panel flips. When a panel comes online, it also runs a sys_panel_update(idx) so it shows up exactly where it left off previously. (It also passes an online parameter just in case the panel should show something else if just coming online, like perhaps a rarely used distributed audio control returning to the main page).
Any events caused by other panels in subsystems or by devices can call a panel_update_all which refreshes all online panels to update feedback.
I have a basic layout with different subsystems that I generally create my projects from and it works well and is easy to maintain. And as ericmedley points out, adding more panels isn't a problem. I typically have a bunch pre-loaded into these arrays so adding a new panel is as simple as loading it and addressing it (so long as the panel needs to work just like existing panels )
It's pretty easy / simple...I can give code / pseudocode examples if desired.
Paul
whatta ya got against if/else, or switch/case? Its fewer letters to type, and no colons involved, and conforms to standard practices. I also think the select and active keywords were poor choices since I so often use those terms in my code for other things, so its confusing to me to see them as keywords. I would end up having to look at code like this:
The compiler lets you use global variables or local variables inside of a wait. When the wait expires the value that is used is the current value of the variable which is not necessarily the value of the variable when the wait was put in the queue. The compiler only stops you from using a stack_var because the variable will (most likely or at least could) be out of scope when the wait expires.
I used to think that way also but there have been a handful of times over the years where a wait_until was the absolute perfect tool. As long as you understand how it works, there is nothing evil about it. Some tools you use all the time and some are specialty tools.
As the official spokesman for Select Active I take exception to your comments. I’m going to speak to my lawyer in the morning. I may be filing a libel case (pun intended.)
I’ve been bit by the Switch Case bug before so unless I’m Casing something consecutive and simple like 1,2,3,4 I stay away from it.
Yes, I meant stack variables. I try to discourage the use of local variables as well though. I haven't used local_var since back in the previous millenium.
I don't think you can set a wait to be fast enough to outrun the processor, so the variable will always be out of scope. Its more that the variable no longer exists, more than its value is incorrect. You'd end up with a segmentation fault if the compiler allowed it. Even if you use wait 0 it still won't compile even though theoretically the variable is still in scope when the wait expires.
I think programmers that use wait_until a lot are absolute perfect tools
That's first amendment protected free speech. I would have to counter sue for malicious prosecution, defamation of character, tortious business interference, and probably some civil rights claims.
You do have to be careful of the Switch Case bug, but I'm certain select/active has its share of bugs as well does it not? Being the grand poobah of select/active you must have encountered one or two during your reign.
Paul
Nope, never encountered one ever.
And it’s Mr. Grand Poobah to you.
Nuttin, I like them too. Select/active isn't really interchangable with switch/case which has bugs or had bugs and since I don't remember If the bugs are still there I use it sparingly but even with the bugs I still like it.
Active():
Esle if()
Yep, that colon should be a deal breaker. . For me when I start adding else if's it's time to consider select/active but sometime when I'm writing code I just start with a select/active with only one active and maybe a deafault (active(1)) just in case it expands as I continue to build the code. Often I end up with many more active's but sometimes it remains at one and in my world that's fine. Your world is obviously different.
I think someone did a test and found that nested IFs actually run faster than a SELECT...ACTIVE, but I imagine that varies with the complexity of the tests.