Go to Post If you can't make them fit on the robot, then those features don't really add much value. - Cory [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-04-2011, 10:31
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
Progress bar

I have a large file writing to a local variable, is there a good way to make a progress bar for a scenario such as this?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-04-2011, 07:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Progress bar

It isn't trivial, but not too bad. If you don't know how long something will take, but know it will take a long time, the accepted approach is to display an indeterminate progress bar -- the animated kind that throw stuff in the trash or look like a barber pole are examples of this.

If you can estimate the percentage, then you use something like a sliding progress bar.

For the first one, you simply show something that is animated, such as a gif, or perhaps just a piece of text telling the user what you are doing.

If it is the second, you show or ungray a slider when the copy starts, and several times a second, you update the percentage in the slider. At the end of the copy, you hide it.

That is the general approach.
Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 08-04-2011, 12:50
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
Re: Progress bar

The thing is the file could be just about any size, Its a binary file of all the user inputs for any range of time.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-04-2011, 20:22
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Progress bar

How long does it take? Unless you are parsing the data or are doing unnecessary variable thrashing, I wouldn't expect it to take long.

If you can correlate the file size to the time, that will give you a message to put in the UI, and then animate it by counting down.

Personally, I'd focus on fixing it to be fast if possible.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 09-04-2011, 07:20
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
Re: Progress bar

I've already done a lot to make it efficient but it can take a good 5sec to load a 15sec file once you have a large number of user inputs that change often. I don't want to limit myself to 15sec though. If the progress bar is going to be a good size amount of work or slow down my code I don't think I will implement it. I was thinking maybe check to see if the array size changes while being written but I'm a little busy with preparing for the ACT testing I have in about an hour
Reply With Quote
  #6   Spotlight this post!  
Unread 09-04-2011, 08:03
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Progress bar

Good luck with the ACT.

When you are recovered from that, post your latest code, I can help see what is slowing it down.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 09-04-2011, 18:15
siggy2xc siggy2xc is offline
Registered User
AKA: Tyler Siegrist
FRC #1756 (Argos)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: peoria
Posts: 70
siggy2xc is an unknown quantity at this point
Re: Progress bar

Not 100% up to date, but this is pretty close to my current code. My current one is a little messy at the moment
http://code.google.com/p/autoflex-team1736/

ACT was a piece of cake
Reply With Quote
  #8   Spotlight this post!  
Unread 09-04-2011, 22:14
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Progress bar

I downloaded the 1.1 zip and it sounds like the Playback code is what you were talking about.

The thing to realize is that variable nodes are one of the most expensive memory hogs in LV. Wires are always better.

If it isn't guaranteed that the local used to give the datatype to the file read is empty, don't use it. Right click on it and create a constant. Empty the constant and wire that instead. Next delete the variable used to get the array size. Instead get the array size of the data coming from the file read. Similarly, the next sequence frame reads it again. Delete the variable and use the wire to index. Variables without much data in them aren't a big deal, but with a big array, each one matters.

Greg McKaskle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi