Home AMX User Forum NetLinx Studio

multiple tp issue

I hope this makes sense....

I have a system with 3 wireless touch panels. All of them are completely identical. They each control each room and each device in the house. All the programming has been done.

Now I am adding a second cable box to they system. (i.e his and hers) There was only one before.

I am trying to find a way to keep just one cable page, and have a "his" and "hers" buttons on that page that changes which box is being viewed and controlled.

I need an easy way to track which room which tp is in. So that if someone changes from "his" to "hers" on one tp, it doesn't mess with the other two. From there it is easy to figure out which box is being controlled.

I could create a separate page for cable box 2, but that requires changing 19 rooms of programming. Way too tedious.

Any ideas???

THanks

Gerrit

Comments

  • GSLogicGSLogic Posts: 562
    You have to create a DEV array for the cable boxes:
    DEV dCable[] = { cable1, cable2 };
    integer nCableBoxSelected[nTotalPanel];

    Set nCableBoxSelected[?] to hold which box was selected and just use that var to send the commands to that select cable box.

    send_command dCable[nCableBoxSelected[panel]], "'SP', whatEver";

    It also helps to create a master touchpanel structure which holds all panel info like, location(used for floating wireless panels)-source-volume-etc.

    Hope this helps!
  • gdemikgdemik Posts: 12
    i guess i was stupid in the way I wrote the code... which goes like this

    BUTTON_EVENT[dvTP1,nCABLEBUTTONS]
    BUTTON_EVENT[dvTP2,nCABLEBUTTONS]
    BUTTON_EVENT[dvTP3,nCABLEBUTTONS]
    {

    all the code crap
    }

    So the user happen to be watching the same box in different rooms, using different tps, and one switches to cable box 2. How do I keep the other tp from "changing" it's control to the other cable box?

    I know how to do this with just one touch panel. I understand arrays, ( a bit) But for some reason my head won't work on this one.

    Thanks
  • Using the array and var GSLogic was talking about you add a TP array like this:

    DEV dTP[]={dvTP1,dvTP2,dvTP3}

    The Button Event would look something like this.
    BUTTON_EVENT[dTP,nCABLEBUTTONS]
    {
         SEND_COMMAND dCable[nCableBoxSelected[GET_LAST(dTP)]],"'SP',GET_LAST(nCABLEBUTTONS)"
    }
    
    
Sign In or Register to comment.