def _upload_started(self):
"""Update the display when the upload is started.
This method will add the progress bar and progress text to the display
when the run.upload_started_topic is received.
"""
logging.info("Upload started for {} with max size {}".format(self._run.upload_started_topic, self._progress_max))
pub.unsubscribe(self._upload_started, self._run.upload_started_topic)
self.Freeze()
self._progress = wx.Gauge(self, id=wx.ID_ANY, range=100, size=(250, 20))
self._progress_text = wx.StaticText(self, label=" 0%")
progress_sizer = wx.BoxSizer(wx.HORIZONTAL)
progress_sizer.Add(self._progress, proportion=1)
progress_sizer.Add(self._progress_text, proportion=0)
self._sizer.Insert(0, progress_sizer, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5)
self.Layout()
# Update our parent sizer so that samples don't get hidden
self.GetParent().Layout()
self.Thaw()
self._timer.Start(1000)
评论列表
文章目录