Get_Last Panel # to a variable...
mkleynhans
Posts: 78
Hi there,
I am hoping to convert a Get_Last panel number to a variable to be used within a Define_Call but cannot seem to get it right..
I am using Get_Last to carry out page flips etc. on the panel that initiates the button press but want to then take
the Get_Last value and store it in a variable to be used within the Define_Call..
So effectively if 10010:1:1 presses the button the page-flipping within the Case 1: below gets carried out on 10010 for all steps within the Call, based on a variable..
What I am trying to do is to lock the TP number down to all actions within the Define_Call so that if someone
initiates another button press in the same room, it doesn't get confused..
Is there a way of writing something like...
cTempPanelNo = dvTP_Kitchen[nDeviceKitchen].NUMBER
and then SEND_COMMAND cTempPanelNo:1:0, "'Blah Blah.....'"
I have tried what I am capable of and keep getting dimension mismatch and array errors...
I am hoping to convert a Get_Last panel number to a variable to be used within a Define_Call but cannot seem to get it right..
I am using Get_Last to carry out page flips etc. on the panel that initiates the button press but want to then take
the Get_Last value and store it in a variable to be used within the Define_Call..
So effectively if 10010:1:1 presses the button the page-flipping within the Case 1: below gets carried out on 10010 for all steps within the Call, based on a variable..
BUTTON_EVENT [dvTP_Kitchen,BUTTON.INPUT.CHANNEL] { PUSH: { nDeviceKitchen = GET_LAST(dvTP_Kitchen); SWITCH(BUTTON.INPUT.CHANNEL) { CASE 1: CALL 'KITCHEN WATCH SKY1' CASE 2: CALL 'KITCHEN WATCH FREEVIEW' CASE 3: CALL 'KITCHEN WATCH LOUNGE BD' CASE 4: CALL 'KITCHEN WATCH ROKU' CASE 6: CALL 'KITCHEN AIRPLAY' CASE 7: CALL 'KITCHEN MUSIC SERVER 1' CASE 8: CALL 'KITCHEN MUSIC SERVER 2' CASE 9: CALL 'KITCHEN RADIO' CASE 10: CALL 'KITCHEN WATCH CINEMA BD' CASE 11: CALL 'KITCHEN WATCH BEDROOM BD' CASE 13: CALL 'KITCHEN WATCH CCTV' CASE 20: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'@PPN-Shutdown_Kitchen'" CASE 21: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'PAGE-Src_Kitchen_1'" CASE 22: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'PAGE-Src_Kitchen_2'" CASE 23: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'PAGE-Src_Kitchen_3'" CASE 24: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'PAGE-Src_Kitchen_4'" CASE 98: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'@PPN-Lighting_Kitchen'" CASE 99: SEND_COMMAND dvTP_Kitchen[nDeviceKitchen].NUMBER:1:0,"'@PPN-Shutdown_Kitchen'" CASE 100: CALL 'TURN KITCHEN OFF' } } }
What I am trying to do is to lock the TP number down to all actions within the Define_Call so that if someone
initiates another button press in the same room, it doesn't get confused..
Is there a way of writing something like...
cTempPanelNo = dvTP_Kitchen[nDeviceKitchen].NUMBER
and then SEND_COMMAND cTempPanelNo:1:0, "'Blah Blah.....'"
I have tried what I am capable of and keep getting dimension mismatch and array errors...
0
Comments
Then you can do the switch case there.
the way I will do it is creating a device for the GUI logic. using function to process you page logic (switch,case,send_command
As I understand it you are just trying to get the device number from the index that triggered the event? In your define call just specify a DEV type parameter and pass it dvTP_Kitchen[nDeviceKitchen].
Paul
Its working well - BUT - I am waiting for two panels that have chosen the same zone to have a problem eventually when two calls are called and the Get_Last panel number changes half way through the call.
This is the reason I was trying to convert my Dev no to a variable and then keep sending the different steps of the get call to the Panel number that was converted at the beginning of the call so to speak.
Greg, I will go through this in detail to see if I can convert my code... The include for all of these panels is 5k lines long so it could be a nightmare but I desperately want to do this the right way and get better at doing this
You can use that like a usage flag... any value >0 means we are "in use".