Home AMX User Forum AMX Technical Discussion

Popup Issus - there has to be a better way

I have data events that provide feedback to my panels, so that if the room's audio zone is on tuner 1, the light up the tuner 1 button and turn on the tuner popup.

I have this written into DEFINE_PROGRAM as the following

If ([dvKitTP,2011])
{
SEND_COMMAND dvKitTP, "'PPON-ST2_1Popup'"
SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
}
If ([dvKitTP,2012])
{
SEND_COMMAND dvKitTP, "'PPON-ST2_1Popup'"
SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
}
If ([dvKitTP,2013]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
{
SEND_COMMAND dvKitTP, "'PPON-FireBallPopup'"
SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
}
If ([dvKitTP,2014]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
{
SEND_COMMAND dvKitTP, "'PPON-CableBoxVideoPopup'"
SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
}
If ([dvKitTP,2015]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
{
SEND_COMMAND dvKitTP, "'PPON-CableBoxVideoPopup'"
SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
}

The issue is that if one selects a video window, since a button is still on, on the next pass thru mainline, the popup comes up over the video window.

The same happens with the "number pad" popup on the cable box and setup windows too.

Notice that i have variables to prevent this, but I know that there has to be a better way to say "if [button, 2014] popup some popup" without running it in mainline.

Please help

Thanks in advance

Rolo

Comments

  • rolorolo Posts: 51
    Popup Issus - there has to be a better way

    I have data events that provide feedback to my panels, so that if the room's audio zone is on tuner 1, the light up the tuner 1 button and turn on the tuner popup.

    I have this written into DEFINE_PROGRAM as the following

    If ([dvKitTP,2011])
    {
    SEND_COMMAND dvKitTP, "'PPON-ST2_1Popup'"
    SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
    }
    If ([dvKitTP,2012])
    {
    SEND_COMMAND dvKitTP, "'PPON-ST2_1Popup'"
    SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
    }
    If ([dvKitTP,2013]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
    {
    SEND_COMMAND dvKitTP, "'PPON-FireBallPopup'"
    SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
    }
    If ([dvKitTP,2014]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
    {
    SEND_COMMAND dvKitTP, "'PPON-CableBoxVideoPopup'"
    SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
    }
    If ([dvKitTP,2015]AND(!(nVideoInUse))AND(!(nNumberPadInUse)))
    {
    SEND_COMMAND dvKitTP, "'PPON-CableBoxVideoPopup'"
    SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
    }

    The issue is that if one selects a video window, since a button is still on, on the next pass thru mainline, the popup comes up over the video window.

    The same happens with the "number pad" popup on the cable box and setup windows too.

    Notice that i have variables to prevent this, but I know that there has to be a better way to say "if [button, 2014] popup some popup" without running it in mainline.

    Please help

    Thanks in advance

    Rolo
  • champchamp Posts: 261
    I'm not sure I follow you right but if I do...

    Put the popup commands into channel events rather than in mainline and the popup won't keep trying to reappear.
  • rolo wrote:
    If ([dvKitTP,2011])
        {
        SEND_COMMAND dvKitTP, "'PPON-ST2_1Popup'"
        SEND_COMMAND dvKitTP, "'PPON-VolPopup'"
        }
    

    This means that EVERY pass through mainline, your panel is being sent a message to display a certain popup.

    This may not fix your problem, but at the VERY least, put this code in the same section that turns [dvKitTP,2001] on in the first place.

    Also, in general, basing conditionals on touch panel channels is usually something to avoid.

    Aside from all that, I'm not getting a clear enough picture in my head of what exactly is going on, so I can't suggest anything else.

    - Chip
  • The command @PPN- can open a popup on a specified page.
    @PPN-&lt;popup>[;<pagename>]

    If no <pagename> is given, the popup opens on current page
    // this will open popup ST2_1Popup on page MainPage 
    // doesn't matter if MainPage is in front or not
    SEND_COMMAND dvKitTP,'@PPN-ST2_1Popup;MainPage'
    
    // this will close popup ST2_1Popup on page MainPage 
    // doesn't matter if MainPage is in front or not
    SEND_COMMAND dvKitTP,'@PPF-ST2_1Popup;MainPage'
    


    Next what I would do is to open the popups on a button push, i.e. when selecting a new source. Additionally, I would use the @PPN to open the popup on correct page.
    PUSH[dvPanel,23] // go to VCR menu
    {
    SEND_COMMAND dvPanel,'@PPN-vcrcontrol;vcrpage'
    SEND_COMMAND dvPanel,'@PPN-volcontrol;vcrpage'
    }
    

    Kind regards,
  • rolorolo Posts: 51
    Popup issue..there has to be a better way

    Maybe I was not clear enough.

    I have several different areas of the code turning on a button when a certain Variable comes on.

    This way when one selects the kitchen, it checks to see what source is on in the kitchen, and turns on the associated button. This way there is a dynamic status update whenever a room is selected. Press the living button, it checks to see what is on in the living room, turns on the button, and pops the popup up.

    This popup coming on is not necessarily the result of a push but instead the button going on which comes from several "status updates" in the software.

    I was hoping to have the popups come up as a result of a data event from the panel or something.

    Something that only runs once instead of every pass thru mainline.

    Thank you for your response

    Rolo
  • rolorolo Posts: 51
    Maybe I was not clear enough.

    I have several different areas of the code turning on a button when a certain Variable comes on.

    This way when one selects the kitchen, it checks to see what source is on in the kitchen, and turns on the associated button. This way there is a dynamic status update whenever a room is selected. Press the living button, it checks to see what is on in the living room, turns on the button, and pops the popup up.

    This popup coming on is not necessarily the result of a push but instead the button going on which comes from several "status updates" in the software.

    I was hoping to have the popups come up as a result of a data event from the panel or something.

    I know that basing stuff on button channel events may not be that great, but it is the only way i can think to do what I am doing.


    Something that only runs once instead of every pass thru mainline.

    Thank you for your response

    Rolo
  • jjamesjjames Posts: 2,908
    What about tracking it with virtual channels rather than a variable and do a CHANNEL_EVENT? Check out Brian's posts here.

    http://www.amxforums.com/showthread.php?t=1213
  • maybe this will help

    push[dvtp, 214] (*Source_control*)
    {
    SEND_COMMAND dvTP,"'@PPX-??'" (*clears previous popup*)
    SEND_COMMAND dvTP,"'@PPN-source'" (*brings up popup named source*)

    this is how I go round it if I understand right..this way the each canel out as you push another button hence state doesnt change on each pass..I dont know if this helps you..
  • frthomasfrthomas Posts: 176
    rolo wrote:
    This way when one selects the kitchen, it checks to see what source is on in the kitchen, and turns on the associated button. This way there is a dynamic status update whenever a room is selected. Press the living button, it checks to see what is on in the living room, turns on the button, and pops the popup up.

    This popup coming on is not necessarily the result of a push but instead the button going on which comes from several "status updates" in the software.

    "one selects the kitchen" means what? Push the kitchen button on the panel that goes to the kitchen page? Does nothing but update the popups?

    The event you're looking for that should update the popup is the room selection. WHICH popup is triggered depends on the source of that room. If rooms are pages, then you can open/close popups on the pages using code shown above when the sources are set (i.e. when switching to tuner in kitchen, the tuner popup is opened on the kitchen page(s)).

    To manage the exclusivity of popups, use popup groups.

    Fred
Sign In or Register to comment.