bad situation working with level_event and bargraph, when panel go offline
raulcq01
Posts: 4
i use a level_event to control lights, but i have a bad situation working with level_event and bargraph, when panel go offline the level goes to 0 and the the lights turn off, any idea to resolve this?
this is my code:
/**********************************************************/
DEFINE_CALL 'F_LUZ_SALAJUNTAS_PLAFON' (INTEGER nPOTENCIA)
{
SEND_COMMAND dvRADIA_89,"'P1L',ITOA(nPOTENCIA),'T4'"
nLUZ_SALAJUNTAS_PLAFON = nPOTENCIA
}
/**********************************************************/
BUTTON_EVENT[PANELS_ILUMINACION,101]
{
PUSH:
{
IF (!nLUZ_SALAJUNTAS_PLAFON)
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON'(nLNOR) //ENCIENDE LA LUZ
}
ELSE
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON'(nLAPA) //APAGA LA LUZ
}
SEND_LEVEL PANELS_ILUMINACION,1,nLUZ_SALAJUNTAS_PLAFON
}
}
/**************************************************************/
LEVEL_EVENT[PANELS_ILUMINACION,1]
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON' (LEVEL.VALUE) // LEE EL NIVEL DEL TP Y LO ASIGNA A LA LUZ
}
/* grettings & good codes */
this is my code:
/**********************************************************/
DEFINE_CALL 'F_LUZ_SALAJUNTAS_PLAFON' (INTEGER nPOTENCIA)
{
SEND_COMMAND dvRADIA_89,"'P1L',ITOA(nPOTENCIA),'T4'"
nLUZ_SALAJUNTAS_PLAFON = nPOTENCIA
}
/**********************************************************/
BUTTON_EVENT[PANELS_ILUMINACION,101]
{
PUSH:
{
IF (!nLUZ_SALAJUNTAS_PLAFON)
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON'(nLNOR) //ENCIENDE LA LUZ
}
ELSE
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON'(nLAPA) //APAGA LA LUZ
}
SEND_LEVEL PANELS_ILUMINACION,1,nLUZ_SALAJUNTAS_PLAFON
}
}
/**************************************************************/
LEVEL_EVENT[PANELS_ILUMINACION,1]
{
CALL 'F_LUZ_SALAJUNTAS_PLAFON' (LEVEL.VALUE) // LEE EL NIVEL DEL TP Y LO ASIGNA A LA LUZ
}
/* grettings & good codes */
0
Comments
I typically use a channel on the bargraph as well as a level (or on the up/down ramping buttons if the bargraph is display only). I define a button event for this channel, and have it set a variable to TRUE in the push handler, and false in the release handler. Then test for the variable in the level event. This way level events only get processed when someone is touching the button causing a change, rather than any level change.
Hope this helps,
Don
http://www.amxforums.com/showthread.php?9896-Trouble-with-AMX-Multiroom-DAS-T-0808-SIG&p=67896#post67896
When the panel comes online, presumably you update the level with its current value so its in sync.
Paul
One method is to make the fader a button as well. So, when you touch the fader to move the volume you can withhold send_level until you let go.
Method two is as suggested above: abandon using the fader to adjust the level and use it strictly for display. Then use buttons to ramp the level up or down.
The third is stack two faders on top of each other. The bottom fader is display only. The top fader is transparent but is active. So your top fader adjusts the volume but the bottom one displays the level. You burn twice as many faders this way but it works.