Changeset 858f2ae5 in sasview


Ignore:
Timestamp:
Feb 20, 2009 10:59:13 AM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
33afff7
Parents:
4937983
Message:

improve status bar

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/model_thread.py

    ref628a1 r858f2ae5  
    143143        lx = len(self.x) 
    144144        wx.PostEvent(self.parent, StatusEvent(status=\ 
    145                        "Computing ",curr_thread=self,type="update")) 
     145                       "Computing ",curr_thread=self,type="progress")) 
    146146        for i_x in range(len(self.x)): 
    147147            # Check whether we need to bail out 
  • guiframe/statusbar.py

    r282a3e7 r858f2ae5  
    1717         self.progress = 0       # Current progress value of the bar  
    1818         self.timer = wx.Timer(self,-1)  
     19         self.timer_stop = wx.Timer(self,-1)  
    1920         self.thread= None 
    2021         self.Bind(wx.EVT_TIMER,self.OnTimer, self.timer)  
     22         self.Bind(wx.EVT_TIMER,self.OnTimer_stop, self.timer_stop)  
     23         self.count=0 
    2124          
     25    def OnTimer_stop(self, evt):  
     26        """Update the progress bar while the timer is running  
     27        @param evt: wx.EVT_TIMER  
     28   
     29        """  
     30        self.count +=1 
     31        if self.count ==20: 
     32            self.timer_stop.Stop()  
     33            self.gauge.Hide() 
     34            self.count=0 
    2235    def OnTimer(self, evt):  
    2336        """Update the progress bar while the timer is running  
     
    2639        """  
    2740        # Check stop flag that can be set from non main thread  
    28         self.gauge.Pulse() 
     41        if self.timer.IsRunning():  
     42            self.gauge.Pulse() 
     43        
    2944        
    3045    def set_progress(self): 
     
    96111                self.progress =0 
    97112                self.gauge.SetValue(90)  
    98                      
     113                self.timer_stop.Start(3)     
    99114             
    100115    
Note: See TracChangeset for help on using the changeset viewer.