Drop graphics throttle to 22Hz, add a `.maxmin` to our view box

windows_fixes_yo
Tyler Goodlet 2022-02-09 22:15:57 -05:00
parent 723eef3fd6
commit 45464a5465
2 changed files with 15 additions and 2 deletions

View File

@ -54,7 +54,7 @@ from ..log import get_logger
log = get_logger(__name__) log = get_logger(__name__)
# TODO: load this from a config.toml! # 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 # a working tick-type-classes template
@ -266,7 +266,10 @@ async def graphics_update_loop(
array_key=curve_name, array_key=curve_name,
) )
# is this even doing anything? # 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', ()) ticks_frame = quote.get('ticks', ())

View File

@ -421,6 +421,14 @@ class ChartView(ViewBox):
if self._maxmin is None: if self._maxmin is None:
self._maxmin = chart.maxmin 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( def wheelEvent(
self, self,
ev, ev,
@ -678,6 +686,7 @@ class ChartView(ViewBox):
# flag to prevent triggering sibling charts from the same linked # flag to prevent triggering sibling charts from the same linked
# set from recursion errors. # set from recursion errors.
autoscale_linked_plots: bool = True, autoscale_linked_plots: bool = True,
name: Optional[str] = None,
# autoscale_overlays: bool = False, # autoscale_overlays: bool = False,
) -> None: ) -> None:
@ -735,6 +744,7 @@ class ChartView(ViewBox):
) )
if set_range: if set_range:
yrange = self._maxmin() yrange = self._maxmin()
if yrange is None: if yrange is None:
return return