Home AMX User Forum AMX General Discussion

DEVLEV issue

I am trying to trigger a level event of a series of different panels using the same level number and have seen that a DEVLEV array may do the trick for me, but for some reason I cannot get the event to trigger. See below for the code:

PROGRAM_NAME='Hull Business Centre'


DEFINE_DEVICE

TP_Room_0 = 10000:1:1 // iPad Ver 2
TP_Room_1 = 10001:1:1 // iPad Ver 2
TP_Room_2 = 10002:1:1 // iPad Ver 2


DEFINE_CONSTANT

INTEGER VOLUME_AC_IN_LEVEL = 59

DEVLEV dlvTPACVol[3] =
{
{TP_Room_0, VOLUME_AC_IN_LEVEL},
{TP_Room_1, VOLUME_AC_IN_LEVEL},
{TP_Room_2, VOLUME_AC_IN_LEVEL}
}


DEFINE_EVENT

LEVEL_EVENT[dlvTPACVol] // AC mic volume level change
{
local_var integer nACZoneVolTriggered
send_string 0, 'hello'
nACZoneVolTriggered = get_last(dlvTPACVol)
}


What am I doing wrong?

Comments

  • zack.boydzack.boyd Posts: 94
    Though I don't know why this doesn't work(and I did confirm it does not work), I feel like I've been tripped up by it before in my earlier days.

    My usual MO is to create an array of panels, then reference channels/levels individually. So in this instance:
    [I]PROGRAM_NAME='Hull Business Centre'[/I]
    
    [I]DEFINE_DEVICE
    
    TP_Room_0 = 10000:1:0 // iPad Ver 2
    TP_Room_1 = 10001:1:0 // iPad Ver 2
    TP_Room_2 = 10002:1:0 // iPad Ver 2
    
    
    DEFINE_CONSTANT
    
    INTEGER VOLUME_AC_IN_LEVEL = 59
    
    DEV dvPanels[3] = {TP_Room_0,TP_Room_1,TP_Room_2}
    
    DEFINE_EVENT
    
    LEVEL_EVENT[dvPanels,VOLUME_AC_IN_LEVEL] // AC mic volume level change
    {
    local_var integer nACZoneVolTriggered
    send_string 0, 'hello'
    nACZoneVolTriggered = LEVEL.VALUE
    }[/I]
    
    
  • IVCBenIVCBen Posts: 3
    Hi Zack.

    Thanks for your reply, that had done the trick and at least I now know l wasn't doing anything particularly wrong with my method, it just doesn't work.

    Another perculiar issue I have now come accross is that if I use the code from above, but if I combine the virtual devices with the real ones and then point the level event at the new virtual device array it does not trigger anything.
    PROGRAM_NAME='Hull Business Centre'

    DEFINE_DEVICE

    TP_Room_0 = 10000:1:0 // iPad Ver 2
    TP_Room_1 = 10001:1:0 // iPad Ver 2
    TP_Room_2 = 10002:1:0 // iPad Ver 2

    vdvTP_Room_0 = 33000:1:0 // vtp 1
    vdvTP_Room_1 = 33001:1:0 // vtp 2
    vdvTP_Room_2 = 33002:1:0 // vtp 3

    define_combine(vdvTP_Room_0, TP_Room_0)
    define_combine(vdvTP_Room_1, TP_Room_1)
    define_combine(vdvTP_Room_2, TP_Room_2)


    DEFINE_CONSTANT

    INTEGER VOLUME_AC_IN_LEVEL = 59

    //DEV dvPanels[3] = {TP_Room_0,TP_Room_1,TP_Room_2}
    DEV vdvPanels[3] = {vdvTP_Room_0, vdvTP_Room_1, vdvTP_Room_2}

    DEFINE_EVENT

    LEVEL_EVENT[vdvPanels, 0]
    {
    send_string 0, 'hello2'
    }

    button_event[vdvPanels, 0]
    {
    push:
    {
    send_string 0, 'button pushed'
    }
    }

    The button pushing works fine though...
  • zack.boydzack.boyd Posts: 94
    Try adding:
    SET_VIRTUAL_LEVEL_COUNT(vdvTP_Room_0,60)
    SET_VIRTUAL_LEVEL_COUNT(vdvTP_Room_1,60)
    SET_VIRTUAL_LEVEL_COUNT(vdvTP_Room_2,60)
    
Sign In or Register to comment.