LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress Indicator

Hi guys. 

 

I have a rather rudamentry mockup of the progress type that I need to show, but its proving to be rather cumbersome to work with. I wanted to make it so that when user selects a particular download, they can efectively pause it, cancel it etc. i.e. making it behave and feel like a list box. Does anyone have a better idea in costumizing controls? Its not really my strong side, and was wondering if someone has a better idea.

 

Also, is there a way of programatically growing and shrinking an array? This way when a download finishes, the element is deleted and it doesn't show the other empty grayed out elements.  

 

Appologies for the messy code. I just wanted to put something together quickly and see the FP look.

 

Kas

0 Kudos
Message 1 of 11
(2,775 Views)

Because you want to use the list both as a control and an indicator, I'm going to suggest something which is more complicated, but will allow you to avoid the many race conditions that you have now.

 

http://forums.ni.com/t5/LabVIEW/Independent-cursors-on-array-of-cluster-of-graphs-or-work-around/m-p...

 

If you look through the posts there, you will see a way to create what is effectively an array of subpanels. In your case the subpanels can all show copies of the same VI (the downloader) and you can create a clean interface. Then, you just need a manager which will accept messages such as "I completed downloading" or "I canceled" and will update the display accordingly.

 

Note that like I said there, this was just a quick example, not a proper framework. See the conversation there.


___________________
Try to take over the world!
Message 2 of 11
(2,741 Views)

this reminds me of what VI shots have done in the past with dynamic loading vi's, re-entrant vi's and queues, have a look at this well explained tutorial video  Smiley Wink

Message 3 of 11
(2,736 Views)

Nice one tst, that actually simplifies the project. I can now use the subVI's for a lot more than simply showing progress. My initial idea was to create an indicator as I had done, and use queues to update the indicater on the main VI. But your way is much more elegant and usefull. For some reason this reminds me of the action engine Smiley Happy 

 

 

apok, thanks for the link. I was looking for that site a while back but I couldn't find it. Sad that they stopped tutorials. I found it very usefull. Do you know any other site that provide video tutorials in this manner? I remember there was another one but it was a pay service. 

 

Thanks again. 

 

Kas

0 Kudos
Message 4 of 11
(2,708 Views)

VI High has very good video tutorials, but they are usually aimed lower than that video - http://blog.sixclear.com/


___________________
Try to take over the world!
0 Kudos
Message 5 of 11
(2,690 Views)

Yep. The most advanced tutorial I saw was implementing state machines Smiley Sad

0 Kudos
Message 6 of 11
(2,686 Views)

I thought that the solution tst proposed should work (which it does), and I made some very minor changes. However I cant get the Panels to load the clone VI's on the proper position, and I can't get the Main subPanel to load the other ones on the proper position neither. 

 

The subpanel should look similar to the image. My aim is to make the subpanel transparent so that only the actual VI loaded can be seen.

 

Attached is also the example code.

 

Thanks 

 

Kas

Download All
0 Kudos
Message 7 of 11
(2,648 Views)

Got it sorted. Unintentionaly resized the FP of the calling VI's and well... panic.

 

Attached is the new version. It should be working. 

 

The vertical scrollbar of the subpanel is a bit of a bother since when initially loading 1 or 2 VI's, it gives the opportunity to scroll up to the user way more than it should. I can't quite put this in words but load 1 or 2 VI's and try scrolling up.

 

Thanks

 

Kas 

0 Kudos
Message 8 of 11
(2,628 Views)

Well, I only see an issue with scrolling UP when there are no VIs visible when you start running. After that, the issue is with scrolling down. The difference I can see from the original example is that you're not hiding the subpanels. In the original, the first step was to hide all the SPs and then only display the needed ones. A subpanel displays the scrollbar based on the content of the FP and if you have the SPs there then the SP will want to show them. Hide them and the problem goes away.

 

Like I said in my first reply, this was just an example. I would NOT recommend building an actual tool based directly on that code. For example, I wouldn't put the management of the references in the main VI. I would also suggest icons for the VIs and I would definitely suggest NOT separating the defer properties. If you do, you run the risk of locking the FP. Having them in the same place in the code mitigates that risk (although you're still potentially open to bugs).


___________________
Try to take over the world!
0 Kudos
Message 9 of 11
(2,620 Views)

Hello tst. thanks for your reply.

 

Youe were right, the "visible" and "position" properties were not set. I thought since I had a white background it wouldn't matter, but now the scrolling is sorted. 

 

I am however worried now litle bit. Since I was actually going to use this code for an aplication, I woudln't want the FP to hang, or any other unwanted bugs to appear. Because of this, would it be possible to elaborate alitle bit more on the management of the VI references? In this app, the reentrant VI's would run "almost" independant of the main VI. Once the reentrant VI's finish operating, they would sent a "finish" command to the main VI, where the main VI would then remove the VI reference and update the subpanels, and also tell the "next" reentrant VI (which is now waiting on the queue to do something) to start working because the first one finished. Hence, I left the reference management on the main VI. 

 

Also, how would the "Defer properties" lock the FP, I don't think I have any race conditions in the subpanel. I only used the subVI's in the subpanel to make the code cleaner. From what I can see, the first SubVI "hide SubPanels" would run first, and the "defer properties" would then run last. 

 

As for the VI Icons, I tend to do this at the very end. Once the aplication is finshed and it behaves like I wanted it to, I go back and redesign the icons properly, since I always tend to create subVI's and sometimes end up deleting them because I changed something. (My bad coding practice is planning as I go along, and not at the beginning).

 

Thanks again.

 

Kas

0 Kudos
Message 10 of 11
(2,599 Views)