Changeset 04349fe in sasview
- Timestamp:
- Apr 12, 2010 1:57:59 PM (15 years ago)
- 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:
- 89c0919
- Parents:
- b3644f3
- Location:
- guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rb3644f3 r04349fe 158 158 ## Creating a Data2D with output 159 159 if hasattr(output,'data'): 160 msg = "Loading 2D data: %s"%output.filename 161 wx.PostEvent(parent, StatusEvent(status=msg, info="info", type="stop")) 160 162 new_plot = Data2D(image=None, err_image=None) 161 163 -
guiframe/statusbar.py
rb3644f3 r04349fe 41 41 42 42 ## Current progress value of the bar 43 self.nb_start = 0 44 self.nb_progress = 0 45 self.nb_stop = 0 43 46 self.progress = 0 44 47 self.timer = wx.Timer(self, -1) … … 57 60 """ 58 61 wxStatusB.SetStatusText(self, text, MSG_POSITION) 62 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 63 self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 59 64 60 65 def PopStatusText(self, *args, **kwds): … … 64 69 wxStatusB.PushStatusText(self, field=MSG_POSITION,string=string) 65 70 71 def enable_clear_gauge(self): 72 """ 73 """ 74 flag = False 75 if (self.nb_start <= self.nb_stop) or (self.nb_progress <= self.nb_stop): 76 flag = True 77 return flag 78 66 79 def OnTimer_stop(self, evt): 67 80 """Clear the progress bar … … 74 87 self.timer_stop.Stop() 75 88 self.clear_gauge(msg="") 89 self.nb_progress = 0 90 self.nb_start = 0 91 self.nb_stop = 0 76 92 77 93 def OnTimer(self, evt): … … 83 99 if self.timer.IsRunning(): 84 100 self.gauge.Pulse() 85 """ 86 def set_progress(self): 87 #Set the gauge value given the status of a thread 88 self.gauge.Show(True) 89 if self.timer.IsRunning(): 90 while(self.thread.isrunning()): 91 self.progress += 1 92 # Update the progress value if it is less than the range 93 if self.progress < self.gauge.GetRange()-20: 94 self.gauge.SetValue(int(self.progress)) 95 else: 96 self.gauge.SetValue(70) 97 self.progress = 0 98 self.timer.Stop() 99 self.timer.Stop() 100 self.gauge.SetValue(90) 101 self.progress =0 102 """ 101 103 102 def clear_gauge(self, msg=""): 104 103 """ 105 104 Hide the gauge 106 105 """ 107 #self.SetStatusText(str(msg), MSG_POSITION)108 106 self.progress = 0 109 107 self.gauge.SetValue(0) … … 144 142 self.gauge.Show(True) 145 143 if type.lower()=="start": 144 self.nb_start += 1 146 145 self.timer.Stop() 147 146 self.progress += 10 … … 151 150 self.gauge.SetValue(int(self.progress)) 152 151 if type.lower()=="progress": 152 self.nb_progress += 1 153 153 self.timer.Start(100) 154 154 self.gauge.Pulse() … … 159 159 self.gauge.SetValue(int(self.progress)) 160 160 if type.lower()=="stop": 161 self.nb_stop += 1 161 162 self.gauge.Show(True) 162 self.timer.Stop() 163 self.progress = 0 164 self.gauge.SetValue(90) 165 self.timer_stop.Start(3) 163 print "self.enable_clear_gauge()",self.enable_clear_gauge() 164 if self.enable_clear_gauge(): 165 self.timer.Stop() 166 self.progress = 0 167 self.gauge.SetValue(90) 168 self.timer_stop.Start(3) 166 169 167 170 def set_status(self, event):
Note: See TracChangeset
for help on using the changeset viewer.