Channel_event. Off for all channel
patriot_stv
Junior Member
Hello!
I have the following code:
Integer SourceBtn[] = {11,12,13,14}
channel_event [dvRemote, SourceBtn[] {
On : {switch (channel.channel){
case 11 : do something
Case 12: do something
Etc.}}
Off: {switch (channel.channel){
case 11:
Case 12:
Ets.}}
}
How can I perform the necessary action to me, only when all channels are switched off in this array?
I have the following code:
Integer SourceBtn[] = {11,12,13,14}
channel_event [dvRemote, SourceBtn[] {
On : {switch (channel.channel){
case 11 : do something
Case 12: do something
Etc.}}
Off: {switch (channel.channel){
case 11:
Case 12:
Ets.}}
}
How can I perform the necessary action to me, only when all channels are switched off in this array?
Comments
-
Run a check on all channels whenever any of them causes the event.
CHANNEL_EVENT [dvRemote,SourceBtn] { ON : { } OFF : { IF(![dvRemote,SourceBtn[1]] && ![dvRemote,SourceBtn[2]] && ![dvRemote,SourceBtn[4]] && ![dvRemote,SourceBtn[4]]) { // do something } } } -
I am assuming that these are source selection buttons. Do you really want to use a CHANNEL_EVENT here instead of a BUTTON_EVENT?
How are you handling OFF or source=0? Tracking the currently selected source (including OFF) would be cleaner for panel button feedback.
I think we need to know more about the scenario than you have provided in the original post. Based on what I think you are doing, this is the approach I would use.DEFINE_DEVICE dvRemoteZone1 = 10001:1:0 DEFINE_CONSTANT INTEGER nNumAVZones = 1 INTEGER nTPBtn_SourceSelect[] = { 10, //OFF 11, //Source 1 12, //Source 2 13, //Source 3 14 //Source 4 } DEV dvRemoteControls [] = { dvRemoteZone1 } DEFINE_VARIABLE INTEGER nCurrentSource [nNumAVZones] //track who is doing what - suggest using a structure and capture more info on the zone, but this is a quick example. DEFINE_EVENT BUTTON_EVENT [dvRemoteControls, nTPBtn_SourceSelect] //using the array instead of a single remote - project could grow and this is approach is easier to maintain { PUSH: { SWITCH (GET_LAST(nTPBtn_SourceSelect)) { CASE 1: {do something} //Zone Off CASE 2: {do something} //Source 1 } //Update Tracking (would be fake and suggest getting it from the switcher feedback) nCurrentSource [GET_LAST(dvRemoteControls)] = GET_LAST(nTPBtn_SourceSelect) } } -
yes, you're right! it is the source button. besides, they are mutually exclusive.)) here I do not follow the device is turned. but I know that it wants to include relying on the state of the channel)
and to disable all I perform total_off ... and as soon as all the channels is disabled, you need to send a shutdown command to the devices) bad idea? -
Is this for your programming practical exam or a deployed project?
If the project requirement has you acting on channel feedback, then Nick has provided an answer that will work for your needs. For me, I still need more information because I find the question to be out of context, and the additional details would aid me in providing a better and more complete answer.
Maybe others can chime in. -
this is a working project of multiroom, if I may say so. I will later laptop will show you the full text of this piece of code and try to explain in detail what I wanted)
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums