Jump to content

Defer Panel Updates and provide status to user


jgcode

Recommended Posts

Howdy.

I have a panel I want to defer updates on, while an heavy object updates (e.g. load Tree, change Plot Colors).

Without using the cursor, how can I show to the user that "something" is happening (i.e. any Throbber or Status indicators will not be updated due to the defer updates property).

Is there a workaround - what do others do?

Cheers

-JG

Link to comment

I've handled this by globally disabling and greying all controls/indicators on the panel prior to a busy state. Then do your work, with deferred updates, and re-enable your controls. Easily done with VI server, there's a Controls[] property somewhere in there. Works good if you have some sort of state machine too, your enable method just needs to be state aware.

Also saw a slick demo at the last NI week that had a VI grey out when it displayed a modal dialog box. Pretty sure it was done with a simple image overlay using the alpha channel. Not sure if it was as simple as toggling visibility, or if it involved moving the image from an off screen location, but it looked really slick.

Link to comment

I perfer setting the mouse busy, although, I also use "cover booleans" to disable the front pannel. The boolean is a classical boolean, coloured transparent. It is then set visable/invisable via the property node whenever needed. This is a very quick/low resource method to disable/colour many items on the FP. I have also used it to display simple text messages, (boolean text, coloured) while disabling and graying the FP.

Link to comment

Thanks Guys,

Although maybe I didn't explain myself clearly, let me try again.

I want to defer panel updates as specific FP Objects are UI intensive, but at the same time I want to show the user that something is happening (with another object on that panel, e.g. Status or Throbber) but it is not possible when I have deferred panel updates set!

I perfer setting the mouse busy, although, I also use "cover booleans" to disable the front pannel. The boolean is a classical boolean, coloured transparent. It is then set visable/invisable via the property node whenever needed. This is a very quick/low resource method to disable/colour many items on the FP. I have also used it to display simple text messages, (boolean text, coloured) while disabling and graying the FP.

I don't want to use the cursor as its a parallel screen that is running (so other actions could be available in other screens).

I've handled this by globally disabling and greying all controls/indicators on the panel prior to a busy state. Then do your work, with deferred updates, and re-enable your controls. Easily done with VI server, there's a Controls[] property somewhere in there. Works good if you have some sort of state machine too, your enable method just needs to be state aware.

Also saw a slick demo at the last NI week that had a VI grey out when it displayed a modal dialog box. Pretty sure it was done with a simple image overlay using the alpha channel. Not sure if it was as simple as toggling visibility, or if it involved moving the image from an off screen location, but it looked really slick.

But I want something to be moving on the screen whilst I am doing the work.

Maybe another panel (VI) over the deferred one that can update whilst the other one is deferring updates would work?

But i could make it look like its part of that panel? More work that I wanted :)

Link to comment

Reading through the replies got me thinking sub panel as well. I'm just not sure what the behavior would be...if a panel's updates are deferred will that property extend to the VI in the sub panel? I'm guessing no, but from an architecture stand point it would make sense that it does, so I honestly don't know what to expect. Sounds like it's experiment time.

Link to comment

Also saw a slick demo at the last NI week that had a VI grey out when it displayed a modal dialog box. Pretty sure it was done with a simple image overlay using the alpha channel. Not sure if it was as simple as toggling visibility, or if it involved moving the image from an off screen location, but it looked really slick.

I quite like making the vi a little bit transparent (say 5-10%) it really brings the focus to the dialogue and is dead easy.

But I'm +1 on disable and greying out controls.

Edited by ShaunR
Link to comment

Reading through the replies got me thinking sub panel as well. I'm just not sure what the behavior would be...if a panel's updates are deferred will that property extend to the VI in the sub panel? I'm guessing no, but from an architecture stand point it would make sense that it does, so I honestly don't know what to expect. Sounds like it's experiment time.

Cool idea.

I am pretty sure I have done this before? But will recheck.

Link to comment

This is somthing that I would use. If i needed somthing to update/blink/do anything on the FP above this, while hiding your work, I would have 2 options.

1) place this VI into a subpanel, and call it, while placing the updating element on the parent. It would be extra work on the subpanel, and a little more challenging from a design point of view.

2) make a pop-up thats greyed and somewhat transparent. (I am leaning here if the cover Boolean won't work)

I like the KeepItSimple method, but your requirements will dictate your choice.

PS: VI is saved in 8.6

disabled grey.vi

Link to comment

I want to defer panel updates as specific FP Objects are UI intensive, but at the same time I want to show the user that something is happening (with another object on that panel, e.g. Status or Throbber) but it is not possible when I have deferred panel updates set!

You could try with a simple animated gif.

wait2.gif

Would it stop too with deferred panel updates?

EDIT: Yeah, I thought I remembered this example from John.

RE-EDIT: Well, deferring panel updates does stop the animation. But John's example is a superposition of a transparent VI which won't be affected...

Link to comment

This is somthing that I would use. If i needed somthing to update/blink/do anything on the FP above this, while hiding your work, I would have 2 options.

1) place this VI into a subpanel, and call it, while placing the updating element on the parent. It would be extra work on the subpanel, and a little more challenging from a design point of view.

2) make a pop-up thats greyed and somewhat transparent. (I am leaning here if the cover Boolean won't work)

I like the KeepItSimple method, but your requirements will dictate your choice.

PS: VI is saved in 8.6

Cheers, just to clarify, its not that I want to hide my work, its that I want to speed it up.

But whilst I am doing that work I want something (i.e. Throbber) to be doing something (i.e Throbber moving) so the user knows its all good and the screen hasn't frozen up.

You could try with a simple animated gif.

wait2.gif

Would it stop too with deferred panel updates?

Thats a good idea too, I will try that - I don't know the answer yet.

Currently my Throbber is a button with start (.gif) and stop (.png).

<edit>

Ok maybe a stupid question?

How do I get a gif on the FP.

Drag and Drop not supported.

Subpanel does not update if calling VI panel is deferred :(

So it doesn't work, but, well, good to know I guess.

What I was doing previously (mentioned above) was a subpanel deferring its updates (which does not affect 'parent' VI)

</edit>

Link to comment

<edit>

Ok maybe a stupid question?

How do I get a gif on the FP.

Drag and Drop not supported.

Subpanel does not update if calling VI panel is deferred :(

Well, thats good to know that.

</edit>

I had the same problem with dropped GIF... but check the edit I made concerning John Lokanis' example...

<object id="scPlayer" class="embeddedObject" width="272" height="370" type="application/x-shockwave-flash" data="http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/jingh264player.swf" >

<param name="movie" value="http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/jingh264player.swf" />

<param name="quality" value="high" />

<param name="bgcolor" value="#FFFFFF" />

<param name="flashVars" value="thumb=http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/FirstFrame.jpg&containerwidth=272&containerheight=370&content=http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/2010-09-30_0038.mp4&blurover=false" />

<param name="allowFullScreen" value="true" />

<param name="scale" value="showall" />

<param name="allowScriptAccess" value="always" />

<param name="base" value="http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/" />

<video width="272" height="370" controls="controls"><br />

<source src="http://content.screencast.com/users/normandinf/folders/Jing/media/3c02b570-2242-47fd-b675-9a5e8884cc3c/2010-09-30_0038.mp4" type="video/mp4;" /><br />

<b>Your browser cannot play this video. <a href="http://www.screencast.com/handlers/redirect.ashx?target=viewingembededhelp">Learn how to fix this</a>.</b>

</video>

</object>

Link to comment

I'd like to add that you should keep it simple. Animations are nice but not essential. A simple overlay with a message: Updating Graph... or Processing, Please Wait... should suffice.

Adding a busy cursor will also re-enforce the message and will prevent clicking on the front panel. Also, don't forget that the busy cursor applies only to the front panel you want it to. In other words, the user will only see a busy cursor on the panel that is busy and he/she can still use the mouse on the non-busy front panels.

post-2-070044800 1285826221_thumb.png

Link to comment

Also, don't forget that the busy cursor applies only to the front panel you want it to. In other words, the user will only see a busy cursor on the panel that is busy and he/she can still use the mouse on the non-busy front panels.

Ok, (as I posted above) I assumed differently, a quick test confirms that I was wrong, so that is good.

I can do as per your example but I would still like to see something (i.e. throbber, status bar etc...) moving on the panel though.

As a test I loaded the entire C:\ directory into a Tree it was taking minutes.... (I didn't wait for it to finish)

So in this case, I would really like my user to see something moving during this time.

I would very much like to keep it simple, but I workarounds aren't i.e. sticking the Tree in a subpanel OR having a VI overlayed (what if the user wants to be move the screen? O will have to synch both VIs) are currenly my only options? Unless there is a method for defer Tree updates I haven't seen? If not this would make a good Idea on the Idea Exchange IMHO.

Link to comment

Ok, (as I posted above) I assumed differently, a quick test confirms that I was wrong, so that is good.

I can do as per your example but I would still like to see something (i.e. throbber, status bar etc...) moving on the panel though.

As a test I loaded the entire C:\ directory into a Tree it was taking minutes.... (I didn't wait for it to finish)

So in this case, I would really like my user to see something moving during this time.

I would very much like to keep it simple, but I workarounds aren't i.e. sticking the Tree in a subpanel OR having a VI overlayed (what if the user wants to be move the screen? O will have to synch both VIs) are currenly my only options? Unless there is a method for defer Tree updates I haven't seen? If not this would make a good Idea on the Idea Exchange IMHO.

Doesn't get much simpler than an animated gif that is visible or not :P

Edited by ShaunR
Link to comment

Doesn't get much simpler than an animated gif that is visible or not :P

Ok, here is where i learn something. How can you have the gif animated if the front panel is deferred? Perhaps I'm doing it wrong? sad.gif

Unless there is a method for defer Tree updates I haven't seen? If not this would make a good Idea on the Idea Exchange IMHO.

Yes, it would be great to defer the updates of a specific control.

Link to comment

Doesn't get much simpler than an animated gif that is visible or not :P

(I would still like more options tho - status bar, status text etc...)

Thats because I can't get this to work. Ok, so I must be doing something completely stupid?

If I set Visible = FALSE first then Defer = TRUE the gif does not show until I set Defer = FALSE

If I set Defer = TRUE first then Visible = FALSE if only updates when I resize the window.

<object id="scPlayer" class="embeddedObject" width="841" height="502" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/FirstFrame.jpg&containerwidth=841&containerheight=502&content=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/Defer%20Panel%20Updates.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/"> </object>

Can you or Francois post code?

Link to comment

Actually, making a VI overlay is not a bad idea. I also took a look at John's example and think this may be the way to go. This allows you to make the status code a nice reusable module. You can pass the VI name to the overlay and inside it will have smarts to force itself to always be positioned on top of the VI named (have it running in a tight loop).

You would need to add code that forces the overlay VI to track the busy VI.

Link to comment

(I would still like more options tho - status bar, status text etc...)

Thats because I can't get this to work. Ok, so I must be doing something completely stupid?

If I set Visible = FALSE first then Defer = TRUE the gif does not show until I set Defer = FALSE

If I set Defer = TRUE first then Visible = FALSE if only updates when I resize the window.

<object id="scPlayer" class="embeddedObject" width="841" height="502" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/FirstFrame.jpg&containerwidth=841&containerheight=502&content=http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/Defer%20Panel%20Updates.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LabVIEW/media/2b81030a-c431-43c2-b553-967c8e470db3/"> </object>

Can you or Francois post code?

Try this.

Link to comment

That's whacky ShaunR!

What type of image is that? Is it an animated gif? I can see that it works but when I replace your image with my animated gif it doesn't work. So all I can think of is your animated gif is a different format.

Yup. An animated gif. That's about all that windows tells me. I don't know what type or version. Yours doesn't seem to work on my machine either. Hmmmm. Now I'm really interested biggrin.gif

Edited by ShaunR
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.