Home AMX User Forum AMX Control Products
Options

TPD4's popups control

It seems that whenever I use more than one or two poups on a page, TPD4 cannot properly preview them in the preview tool. Particularly if the popups are attached to button events. Is this a known issue (that some of them fail to display.)

Being pretty new to AMX development, let me ask, do you actually use TPD4's automation for popup display, or pretend it doesn't exist and do all popup management with Netlinx code? Should I just strip all that stuff out of my newly created panel template and do it all olde schoole?

Comments

  • Options
    I find this problem intriguing, can you give me an example panel file that exhibits this?

    FYI: If you put popups in the same group they are mutually exclusive, that is you can't have them on screen simultaneously.
  • Options
    TryllTryll Posts: 33
    Thanks jjj.

    I did have groups that I didn't even realize I was making.

    So, I take it that you do use TPD4's popup control, and don't handle all popups through code?
  • Options
    Panel Preview will not display multiple popups.

    i have seem this problem before, and not when popups are in the same group.

    for example... program one button in a panel to popup more than one popuppage. in PanelPreview, only one of your popup requests will occur.

    but the panel program file will work fine in the panel itself.

    i haven't checked if a newer version of Preview has addressed the problem.
  • Options
    Tryll wrote:
    So, I take it that you do use TPD4's popup control, and don't handle all popups through code?

    not necessarily true. i do a mix of panel popup requests and code popup requests, depending on the application needs.

    i also make sure that when the program restarts, it forces all panels to close all current popups that maybe open (as the panel comes online), just in case some invalid window is still displayed after a reboot.

    example:

    ONLINE:
    {
    SEND_COMMAND Panel,'AKEYR' // close any keyboard that may have been open
    SEND_COMMAND Panel,'@PPX' // close any popups that may have been open
    }
  • Options
    RichardHamilton is right, for a very simple design it may not be necessary to use any code driven page control, but typically it is both. Very complex jobs may use it exclusively. You may want to read a bit about "page tracking" it is a feature on all panels that relays what page is currently displayed to the master, that way you can use the panels pf commands, but the codes can know whats up.
  • Options
    TryllTryll Posts: 33
    Thanks guys. Yes, I currently manage some of my page and popup stuff with code, but other stuff I have been leaving to the TPD4 functions. The system that I am working on right now is pretty complex (heavy duty boardroom) and I'm not sure that I like the fact that TPD4's behaviors are "hidden" from my Netlinx code, that's why I was considering ditching them all, and manually handling everything through code.

    I'll probably attempt a hybrid of some sort, using a bit of both, as my panel shapes up.
  • Options
    I'm using PanelPreview 1.2.1 build 51 (the latest release, Release Date 06/21/2005 ), and it works fine. I placed >360 buttons on each popup and it seems to work fine. Maybe someone could send me the an offending file and I could take a look at it?
  • Options
    TryllTryll Posts: 33
    I don't have a sharable example just now, but my issue seemed to be when a single button would show and hide a number of popups, not when a popup had a lot of buttons. Basically a single button which did something like -

    Hide popup...
    hide popup...
    show popup...
    show popup...
    toggle popup...

    etc.

    Usually, it looked like the second show command was not working. I haven't had a chance yet to see if it can be resolved by correcting any grouping errors.
  • Options
    jjamesjjames Posts: 2,908
    Good Idea!
    Tryll wrote:
    I was considering ditching them all, and manually handling everything through code.
    Personally, that would be the route I would take, excepft for a very few in-panel page flips. I like to know what pop-up page I'm on, so I nearly do all of my page flips in code. This way, if a panel falls offline or you send a new panel update (but not code) and you put this information in the panel's DATA_EVENT, when it comes back online it'll know where it was, and go to those pages. The user would never even know you did something to it, or that it fell offline.

    And if you do your page flips in the panel, and the user changes sources while it's offline . . . they're now viewing a control page of a source they're not controlling - not a good idea as I'm almost certain that would confuse him/her.

    Just my meager opinion . . .
  • Options
    TryllTryll Posts: 33
    Yeah, yeah. These are some of my thoughts too. Plus, it is harder to debug and modify page flips which are caused by some "hidden" TPD4 code. I kind of like the idea of just putting all that code into my source where I can see it.

    So... any magic spells for Netlinx managing page flips? Any way to build out arrays of page commands, or something similar, or do you just stack up the send_commands?
  • Options
    jjamesjjames Posts: 2,908
    I do a SELECT..ACTIVE in a DEFINE_CALL. Then in the panel file, all these pages will be in a single pop-up group, so the hiding happens automatically since the pop-ups are "mutually exclusive". I also do this with sub-nav pop-ups. I group my pop-ups in the panel so that there should be only 2 groups: main area & sub nav. The rest of the stuff that doesn't change (ever) I put on a single PAGE and the popups use a transparent background. And if there's a title that needs to be displayed - I'll put that on the PAGE and just send text commands to it to change according to source.
    DEFINE_CALL 	'POP-UP PAGES'
    (INTEGER nCHAN)	
    {
    	SELECT
    	{
    		ACTIVE(nCHAN = 1):	// SATELLITE
    			SEND_COMMAND dvLIB_TP,'@PPN-DSS'
    			
    		ACTIVE(nCHAN = 2):	// CABLE
    			SEND_COMMAND dvLIB_TP,'@PPN-CABLE'
    			
    		ACTIVE(nCHAN = 3): 	// DVD
    			SEND_COMMAND dvLIB_TP,'@PPN-DVD'
    			
    		ACTIVE(nCHAN = 4): 	// CD
    			SEND_COMMAND dvLIB_TP,'@PPN-CD'
    			
    		ACTIVE(nCHAN = 5): 	// VCR
    			SEND_COMMAND dvLIB_TP,'@PPN-VCR'
    			
    		ACTIVE(nCHAN = 6): 	// TUNER
    			SEND_COMMAND dvLIB_TP,'@PPN-RADIO'
    			
    		ACTIVE(nCHAN = 7): 	// WHOLE HOUSE AUDIO / CONTROL
    			SEND_COMMAND dvLIB_TP,'@PPN-WHOLE HOUSE'
    			
    		ACTIVE(nCHAN = 8): 	// POWER OFF
    			SEND_COMMAND dvLIB_TP,'@PPN-POWER'
    			
    		ACTIVE(nCHAN = 9):	// WEATHER
    			SEND_COMMAND dvLIB_TP,'@PPN-WEATHER'
    	}
    }
    
    DEFINE_EVENT
    BUTTON_EVENT[dv_TP,POWER_BTNS]
    {
    	PUSH:
    	{
    		CALL 'SYSTEM POWER'(nON,GET_LAST(POWER_BTNS),LIBRARY)
    		CALL 'POP-UP PAGES'(GET_LAST(POWER_BTNS))
    	}
    }
    


    Edit: After looking at my code, you could set up an array of the pop-up's names, and do something like this and avoid a CALL or FUNCTION all together:
    DEFINE_CONSTANT
    cPOP_UP[9][11]=
    {
      'DSS'
     ,'CABLE'
     ,'DVD'
     ,'CD'
     ,'VCR'
     ,'TUNER'
     ,'WHOLE HOUSE'
     ,'POWER'
     ,'WEATHER'
    }
    
    
    DEFINE_EVENT
    BUTTON_EVENT[dv_TP,POWER_BTNS]
    {
    	PUSH:
    	{
    		CALL 'SYSTEM POWER'(nON,GET_LAST(POWER_BTNS),LIBRARY)
    		SEND_COMMAND dv_TP[GET_LAST(dv_TP)],"'@PPN-',cPOP_UP[GET_LAST(POWER_BTNS)]"
    	}
    }
    
  • Options
    TryllTryll Posts: 33
    Hey, not bad. Thanks, I may give this a go. So it sounds like you do make use of groups so that you don't need to close similar popups, the act of opening a mutually exclusive one takes care of it. All good tips from this thread that I can use. Thanks.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    I seem to be the odd man out on this subject. I only do page management and popups in code if I really have to; if it's possible at all, I use the panel's popup management. I've had too many cases where communications was not optimum (95%) of my jobs use wireless panels of one sort or another), and a page flip or popup command was missed, and the panel left with the wrong display. So even when I do use code to manage flips, I make sure I provide a way to clear or switch pages manually.
  • Options
    jjamesjjames Posts: 2,908
    DHawthorne wrote:
    I've had too many cases where communications was not optimum (95%) of my jobs use wireless panels of one sort or another), and a page flip or popup command was missed, and the panel left with the wrong display.
    Talk about bad luck. It would seem as if the network would have to hic-up at the exact moment you're sending a command, or the panel would fall off at the exact moment you sent a command. I don't understand how you'd see the wrong page if a command wasn't getting through and was using page flips in code.

    Perhaps I'm not following correctly.
    DHawthorne wrote:
    So even when I do use code to manage flips, I make sure I provide a way to clear or switch pages manually.
    But then aren't you back at the same problem of possibly viewing the wrong page if the panel were to fall offline and they hit a source page or whatnot?

    The whole beauty of AMX is that the master has enough strength or brains to fix problems itself. Well . . . I guess only if you put enough time and effort into making it fix the problems. Otherwise, I'd tell a client go buy a Harmony or a Pronto or something that can't manage itself.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Perhaps I'm too strongly influenced by the old Viewpoint Waves. I've had some very spotty performance on those because they clash with too many other devices in the same bandwidth. So I have had lots and lots of missed commands and updates, so I learned to find ways to avoid code-based panel changes. The habit has carried over ... but it still happens.

    One good example of a code-based flip I use all the time is for projector warmup/cooldown. I pop up a modal dialog that counts down the time needed to wait before the system is ready to proceed, and every now and then, the popup reaches zero and never closes. So I always put a hidden button in the corenr, and tell my client if it gets "stuck" to press that corner. Otherwise, with a modal popup, they would have a dead panel due to a momentary communications glitch. Another is volume bargraphs. I pop them up when the volume button is presses, then off again 8 seconds after release. Sometimes they just don't go away, so I make them if you tap the bargraph itself it closes the popup. Experiences like this have made me shun code based changes where I can. Many times, it's just not feasible, and I feel you need to make allowances in those cases for the worst case of the command getting missed.
  • Options
    Thank you
    I find this problem intriguing, can you give me an example panel file that exhibits this?

    FYI: If you put popups in the same group they are mutually exclusive, that is you can't have them on screen simultaneously.

    I don't know if you are still around or not. But you just saved what is left of my sanity.
Sign In or Register to comment.