From 45464a54652d133557008cfa11b22312d2be030e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 9 Feb 2022 22:15:57 -0500 Subject: [PATCH] Drop graphics throttle to 22Hz, add a `.maxmin` to our view box --- piker/ui/_display.py | 7 +++++-- piker/ui/_interaction.py | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index df51d444..3bfd327a 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -54,7 +54,7 @@ from ..log import get_logger log = get_logger(__name__) # TODO: load this from a config.toml! -_quote_throttle_rate: int = 58 # Hz +_quote_throttle_rate: int = 6 + 16 # Hz # a working tick-type-classes template @@ -266,7 +266,10 @@ async def graphics_update_loop( array_key=curve_name, ) # is this even doing anything? - flow.plot.vb._set_yrange() + flow.plot.vb._set_yrange( + autoscale_linked_plots=False, + name=curve_name, + ) ticks_frame = quote.get('ticks', ()) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index ce56b7b6..dca41855 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -421,6 +421,14 @@ class ChartView(ViewBox): if self._maxmin is None: self._maxmin = chart.maxmin + @property + def maxmin(self) -> Callable: + return self._maxmin + + @maxmin.setter + def maxmin(self, callback: Callable) -> None: + self._maxmin = callback + def wheelEvent( self, ev, @@ -678,6 +686,7 @@ class ChartView(ViewBox): # flag to prevent triggering sibling charts from the same linked # set from recursion errors. autoscale_linked_plots: bool = True, + name: Optional[str] = None, # autoscale_overlays: bool = False, ) -> None: @@ -735,6 +744,7 @@ class ChartView(ViewBox): ) if set_range: + yrange = self._maxmin() if yrange is None: return