Define a single `ChartPlotWidget.feed: Feed` for pause/resume

multichartz_backup
Tyler Goodlet 2022-11-16 13:40:15 -05:00
parent f9f975b173
commit 7ad6bfa470
1 changed files with 11 additions and 13 deletions

View File

@ -896,7 +896,7 @@ class ChartPlotWidget(pg.PlotWidget):
# registry of overlay curve names # registry of overlay curve names
self._flows: dict[str, Flow] = {} self._flows: dict[str, Flow] = {}
self._feeds: dict[Symbol, Feed] = {} self.feed: Feed | None = None
self._labels = {} # registry of underlying graphics self._labels = {} # registry of underlying graphics
self._ysticks = {} # registry of underlying graphics self._ysticks = {} # registry of underlying graphics
@ -917,20 +917,18 @@ class ChartPlotWidget(pg.PlotWidget):
self._on_screen: bool = False self._on_screen: bool = False
def resume_all_feeds(self): def resume_all_feeds(self):
... feed = self.feed
# try: if feed:
# for feed in self._feeds.values(): try:
# for flume in feed.flumes.values(): self.linked.godwidget._root_n.start_soon(feed.resume)
# self.linked.godwidget._root_n.start_soon(flume.resume) except RuntimeError:
# except RuntimeError: # TODO: cancel the qtractor runtime here?
# # TODO: cancel the qtractor runtime here? raise
# raise
def pause_all_feeds(self): def pause_all_feeds(self):
... feed = self.feed
# for feed in self._feeds.values(): if feed:
# for flume in feed.flumes.values(): self.linked.godwidget._root_n.start_soon(feed.pause)
# self.linked.godwidget._root_n.start_soon(flume.pause)
@property @property
def view(self) -> ChartView: def view(self) -> ChartView: