Home AMX User Forum AMX Design Tools

display warning message when connection to master is lost

hey everyone,

i searched like crazy for that one but couldn't find anything in the forum:

is there a way for a panel (700Vi and 5200i in particular) to automatically display a popup when the connection to the master is lost (eg. master has crashed or is rebooting)?

what i want to do is the following: when there's no connection to the master, a fullscreen popup shall prevent the user from pushing any buttons until the connection is reestablished.

do you know if there's any way to do this?

thx in advance!
stefan

Comments

  • What I've done in the past for that is to make a button that says "Please Wait, Establishing Connection" or similar. I usually made it pretty large, but not the entire screen. I put the error text and colors in the button's off state, and made the on state completely transparent. So, in code you could just set that button to be on in define_program or whatever and when the panel loses connection, the button turns off and the error message appears. There could be more elegant ways of doing this, but that's what worked for me. At the time, I couldn't figure a way to do it with a popup, so I just settled on the button idea.
  • thanks for the quick answer!

    As I'm using 5 adjoining popups to build my application I can't put a large button to cover the whole screen - so I need to do this with another popup. I don't want to just display a message to the user but really prevent him from pushing any buttons.

    I hope there's a way to do this...
  • Spire_JeffSpire_Jeff Posts: 1,917
    Just copy and paste the button to each popup. Set the same address and channel codes on all instances of the button.

    Jeff
  • I don't think that's a pretty solution - it'll be hell to handle as i'm using a lot of popups to dynamically create my pages. It's quite a sophisticated interface for a very large house.

    There has to be a better way of doing this...
  • Spire_JeffSpire_Jeff Posts: 1,917
    Make it easy. Instead of displaying a message, just have the off state be Red and set the opacity level to 120 or whatever looks good. Then the whole panel will turn Red when communication is lost.

    If you have a nav bar, you could display a connecting to master message there, but I have found that the panel turning red is a good indicator that things will not function (unless the panel theme is mainly Red :) )

    Jeff
  • Thanks Matt and Jeff!

    I guess there's no easier way than what you described... it's just that with this button on top of everything else on every popup it gets really nasty to edit the panelfile. I'll give it a try and let you know if ever I find a prettier solution.
  • Yes, once you have the button there it is definitely annoying to make little changes to the pages/popups. But it's just the only real solution I've come across. I usually keep a copy of that button on a blank popup all by itself so I can delete the button before I work on a page and then copy/paste it back in place.
  • doesn't work in critical situations

    Hi again,

    unfortunately your solution doesn't work in critical situation. I just tried it as described above: I used a button with an empty on-state and an off-state containing the warning that there's no connection to master. In code I set the button to "on". If I reboot the master, the button correctly switches to "off" - all is well so far.

    If, however,
    (1) the mobile panel loses the connection to master because it loses network connection or
    (2) the master crashes uncontrollable
    the button doesn't switch to "off".

    This is, I guess, because the master sends a "disconnect" when properly shutting down or rebooting. On losing network connection or crashing no such command is sent to the panels and therefor all buttons stay "on".

    I'm lost... does anyone now another way to achieve this*?

    greetings,
    stefan

    *I'd like to display a popup when connection to master is lost to prevent users from pushing any buttons while there's no connection.
  • It's not instantaneous; it does take a short amount of time before the button state will change, but then again it takes time for the panel's internal connection status indicator to reflect a lost connection as well. Perhaps this timeout can be tweaked, but I'm not sure.
  • Hm, ok, I waited really long - after intentionally killing the master the button was still "on" after the master had fully rebooted (took about 5min). If it really takes this long I'll have to find another way anyway...
  • Have a look at system level 0:8 (this is what the green button and "Connected to System" message are using in your TP setup).
    You should be able to create a similar multi state bargraph, basically a replica of your green button.

    0:8 Levels are "0,7,8" - DISCONNECTED and the rest "1,2,3,4,5,6,9,10,11" CONNECTED.
    The states of your BIG button should correspondingly be "transparent" for all the CONNECTED levels, and "warning" for states 1,7,9 (assuming that you use states 1-12 for levels 0-11, this will match levels 0,7,8).

    System channel 0:1 is also an option, but the state will "blink" on and off even if connected, so it will probably not suit your purpose.

    I hope this helps...
  • Hi,

    I already tried it - unfortunately it seems multistate-bargraphs won't let me click buttons underneath even if currently showing a transparent state. It's the same with transparent popups - if I put a transparent popup containing nothing on top of my application I can't click any buttons...
  • Yeah, 5 minutes is a long time and thus makes the whole idea a bit less than useful. I was thinking in the past it took about 10-20 seconds on mine, which was not quite as fast as I had hoped, but still fairly useful.
  • I guess it depends on the size of the project? That would explain the long delay as my project is currently huge...
  • matt95gsr wrote: »
    What I've done in the past for that is to make a button that says "Please Wait, Establishing Connection" or similar. I usually made it pretty large, but not the entire screen. I put the error text and colors in the button's off state, and made the on state completely transparent. So, in code you could just set that button to be on in define_program or whatever and when the panel loses connection, the button turns off and the error message appears. There could be more elegant ways of doing this, but that's what worked for me. At the time, I couldn't figure a way to do it with a popup, so I just settled on the button idea.

    I've tried with different button types now but it seems I can't click through any button even if all its states are transparent. Did it work for you and am I just crazy? Or was there a change in TPDesign?

    I'm currently using TPDesign 4 in version 2.11.0
  • For a button you can set "Touch Style" as passthrough (instead of active touch). This will not work though for Multistate Bargraph.
  • thats true, but I can't assign the "pass through" property to only one state but to all states. So even if the fullscreen warning is displayed, the user can still click the buttons underneath. And as you said - it won't work with multistate bargraphs.

    phew.
  • ColzieColzie Posts: 470
    I know you are asking for a popup, but you could create an "Offline" TP Page, and set the panel's Inactivity page to that page. Then in code ping the panel every x seconds to keep it on your "real" page(s). If the TP doesn't get the ping, it flips to the Offline page.

    Just a thought...
  • Hi,

    that sounds about the closest I'll ever get ;-) I'll give it a try and let you know about it.

    Thanks!
  • thats true, but I can't assign the "pass through" property to only one state but to all states. So even if the fullscreen warning is displayed, the user can still click the buttons underneath. And as you said - it won't work with multistate bargraphs.

    phew.

    You're correct that they can still push the buttons behind the warning even if it's active, but if you handle your feedback and page flips in code those button pushes won't do anything.
Sign In or Register to comment.