Changeset ef628a1 in sasview for guiframe


Ignore:
Timestamp:
Feb 17, 2009 12:13:12 PM (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:
202a7dc3
Parents:
f343069
Message:

statusbar improved

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/model_thread.py

    rdd66fbd ref628a1  
    110110        self.model = model 
    111111        self.starttime = 0 
    112         
     112        wx.PostEvent(self.parent, StatusEvent(status=\ 
     113                    "Start Drawing model  ",curr_thread=self,type="start")) 
    113114         
    114115    def isquit(self): 
     
    122123            raise KeyboardInterrupt 
    123124         
    124     def update(self, output=None, time=None): 
     125    def update(self, output=None): 
    125126         
    126127        wx.PostEvent(self.parent, StatusEvent(status="Plot \ 
    127         #updating ... %g sec" % time,curr_thread=self,type="update")) 
     128        #updating ... ",curr_thread=self,type="update")) 
    128129         
    129130         
     
    138139         
    139140        self.starttime = time.time() 
    140         print "model_thread" 
     141         
     142         
     143        lx = len(self.x) 
    141144        wx.PostEvent(self.parent, StatusEvent(status=\ 
    142                     "Start Drawing model %g " % (self.starttime))) 
    143         lx = len(self.x) 
    144         
     145                       "Computing ",curr_thread=self,type="update")) 
    145146        for i_x in range(len(self.x)): 
    146147            # Check whether we need to bail out 
    147             self.update(output=output, time=time.time() ) 
     148            self.update(output=output ) 
    148149            self.isquit() 
    149150             
  • guiframe/statusbar.py

    rdd66fbd ref628a1  
    1515         self.timer = wx.Timer(self,-1)  
    1616         self.thread= None 
    17          #self.Bind(wx.EVT_TIMER,self.OnTimer, self.timer)  
     17         self.Bind(wx.EVT_TIMER,self.OnTimer, self.timer)  
    1818          
    1919    def OnTimer(self, evt):  
     
    2323        """  
    2424        # Check stop flag that can be set from non main thread  
    25         if self.thread!=None and self.thread.isrunning(): 
    26             self.set_progress() 
     25        self.gauge.Pulse() 
    2726        
    2827    def set_progress(self): 
     
    6463                self.gauge.Show(True) 
    6564                if type.lower()=="start": 
     65                    self.timer.Stop() 
    6666                    self.SetStatusText( str(msg), 0) 
     67                    self.progress +=10 
     68                    self.gauge.SetValue(int(self.progress))  
    6769                    #self.timer.Start(1000) 
    6870                    #print "went here" 
     
    7173                    if self.progress < self.gauge.GetRange()-20: 
    7274                        self.gauge.SetValue(int(self.progress))  
     75                if type.lower()=="progress": 
     76                    self.timer.Start(100) 
     77                    self.SetStatusText( str(msg), 0) 
     78                    self.gauge.Pulse() 
     79                    print "in progress" 
     80                     
    7381                if  type.lower()=="update": 
    7482                     
Note: See TracChangeset for help on using the changeset viewer.