Mutually Exclusive
sonny
Posts: 208
Greetings...
I can't figure out if I'm nuts, or if DEFINE_MUTUALLY_EXCLUSIVE has inconsistent results. Here is basically what I have...
DEFINE_CONSTANT
BTN1 = 1
BTN2 = 2
BTN3 = 3
BTN4 = 4
DEFINE_MUTUALLY_EXCLUSIVE
([devTP, BTN1]..[devTP, BTN4])
BUTTON_EVENT [devTP, theButtons]
{
PUSH:
{
ON [devTP, BUTTON.INPUT.CHANNEL]
}
}
devTP is an array of devices. The input channel turns on fine on the panels, but the previously selected button stays on as well. Any thoughts?? (and yes, theButtons is a defined array of the constants)
I can't figure out if I'm nuts, or if DEFINE_MUTUALLY_EXCLUSIVE has inconsistent results. Here is basically what I have...
DEFINE_CONSTANT
BTN1 = 1
BTN2 = 2
BTN3 = 3
BTN4 = 4
DEFINE_MUTUALLY_EXCLUSIVE
([devTP, BTN1]..[devTP, BTN4])
BUTTON_EVENT [devTP, theButtons]
{
PUSH:
{
ON [devTP, BUTTON.INPUT.CHANNEL]
}
}
devTP is an array of devices. The input channel turns on fine on the panels, but the previously selected button stays on as well. Any thoughts?? (and yes, theButtons is a defined array of the constants)
0
Comments
Very good question! There are three IO states on a channel; input, output and feedback. Normally Output and Feedback track and stay together. So it acts like input/output object. However when you put them in a mutually exclusive set, feedback and output do not track any longer. So if you pulse/to the channel, the output portion pulses momentarily and the feedback portion stays on. This is why your button seems to stays on. So... AMX created a keyword called Total_Off to force turn off the feedback state of the channel.
Total_Off[dev,chan];
You can actually use this to your advantage. You can pulse/to a channel and the channel will remain on showing last selected.
The main function I'm looking for is visual display of the button on the touch panel...currently active audio source, for example. Feedback for the button is set to Channel, with color changes for On and Off States. Pulsing will pulse the button but won't keep it on. I swear I have used "ON [dev, chan]" in the past within a mutually exclusive set and it has worked. (but I may not be remembering correctly).
I would think by using Pulse I would have to also define the set as DEFINE_LATCHING??
When you say "the previously selected button stays on," do you mean the one that was just hit? I'm trying to figure out what you mean by "the input channel" and "the previously selected button" and where a disconnect would be.
The prior active channel prior to the newly pressed on. For example BTN2 has been pressed and the channel tied to it was turned ON in code, then BTN3 is pressed and turned ON. Now on the TP both BTN2 and BTN3 are in the ON state.
Thanks
Kevin D.
Yes, mutually exclusivity across an array of devices doesn't seem to work. The mutual exclusivity is between the channels of a device, not channels across an array of devices. That would require quadratically more accounting. The compiler allows you to use a dev array in the define_mutex section but it won't behave as desired. Using define_combine might work with mutexes but I have never needed to use this feature. Make the channels mutually exclusive across a virtual device and then using define_combine, combine the virtual with the array of devices.
define_mutually_exclusive
([vdvDev, 1]..[vdvDev, 4])
define_combine
(vdvDev, dvTP[])
BUTTON_EVENT [vdvDev, theButtons]
{
PUSH:
{
ON [vdvDev, BUTTON.INPUT.CHANNEL]
}
}
Paul