def __init__(self, parent, run, api):
"""Initialize the RunPanel.
Args:
parent: The parent Window for this panel.
run: The sequencing run that should be displayed.
api: An initialized instance of an API for interacting with IRIDA.
"""
ScrolledPanel.__init__(self, parent, style=wx.SUNKEN_BORDER)
box = wx.StaticBox(self, label=run.sample_sheet_name)
self._timer = wx.Timer(self)
self._run = run
self._progress_value = 0
self._last_progress = 0
self._last_timer_progress = 0
self._sample_panels = {}
# the current overall progress for the run is calculated as a percentage
# of the total file size of all samples in the run.
self._progress_max = sum(sample.get_files_size() for sample in run.samples_to_upload)
logging.info("Total file size for run is {}".format(self._progress_max))
self._sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
pub.subscribe(self._upload_started, run.upload_started_topic)
pub.subscribe(self._handle_progress, run.upload_progress_topic)
pub.subscribe(self._upload_complete, run.upload_completed_topic)
pub.subscribe(self._upload_failed, run.upload_failed_topic)
for sample in run.sample_list:
self._sample_panels[sample.get_id()] = SamplePanel(self, sample, run, api)
self._sizer.Add(self._sample_panels[sample.get_id()], flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5)
self.SetSizer(self._sizer)
self.Bind(wx.EVT_TIMER, self._update_progress_timer, self._timer)
self.Layout()
self.SetupScrolling()
评论列表
文章目录