Jump to content

Progress bar for parsing file


Arfur9
 Share

Recommended Posts

I have a GUI based app which can parse an XML file and lists any cameras in the XML, the problem I have is these XML files can be huge, so while this file is being read the gui appears to hang

Here's a pick of the WIP beasty

post-71610-0-23128200-1348264573_thumb.p

If the loaded scene is an XML you would click cam and the cameras are added in the list box.

Most of the progress bars seem to be based on elapsed time which isn't much good, a 100meg XML takes around a minute on my 2 core machine

If anyone wants to see the code they can but its not much use if you don't have the render software its designed for

If someone can point me in the right direction it would be great.

To be honest its only there to cut down the chances of the user doing typos and the batch script failing

thanks in advance

Link to comment
Share on other sites

Arfur9,

Something like this is a very simple way to show progress

; *** Start added by AutoIt3Wrapper ***
#include <WindowsConstants.au3>
; *** End added by AutoIt3Wrapper ***
; *** Start added by AutoIt3Wrapper ***
#include <GUIConstantsEx.au3>
#include <timers.au3>
; *** End added by AutoIt3Wrapper ***
#AutoIt3Wrapper_Add_Constants=n
demo()
func demo()
 local $gui020 = guicreate("Progress Indicator",500,30,-1,-1,$ws_popup)
     GUICtrlSetBkColor($gui020,0x990000)
     guisetfont(12,800)
 global $lbl020 = guictrlcreatelabel("",100,5,400,20)
        guictrlcreatelabel("Processing",10,5,90,20)
     guisetstate()
     _Timer_SetTimer($gui020, 1000, "_UpdateProgress")
 local $msg, $cnt=0
 while 1
  $msg = guigetmsg()
  switch $msg
   case $gui_event_close
    Exit
  EndSwitch
 wend
endfunc
Func _UpdateProgress($hWnd, $Msg, $iIDTimer, $dwTime)
 #forceref $hWnd, $Msg, $iIDTimer, $dwTime
 GUICtrlSetData($lbl020,guictrlread($lbl020) & '.')
EndFunc

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...