Port to new `.update_graphics_from_array()`, pause quote updates on chart interaction

big_data_lines
Tyler Goodlet 2022-04-03 23:34:55 -04:00
parent a9e1c6c50e
commit 2c1daab990
2 changed files with 22 additions and 6 deletions

View File

@ -53,6 +53,10 @@ from ._forms import (
mk_order_pane_layout, mk_order_pane_layout,
) )
from .order_mode import open_order_mode from .order_mode import open_order_mode
# from .._profile import (
# pg_profile_enabled,
# ms_slower_then,
# )
from ..log import get_logger from ..log import get_logger
log = get_logger(__name__) log = get_logger(__name__)
@ -284,6 +288,12 @@ async def graphics_update_loop(
chart.pause_all_feeds() chart.pause_all_feeds()
continue continue
ic = chart.view._ic
if ic:
chart.pause_all_feeds()
await ic.wait()
chart.resume_all_feeds()
# sync call to update all graphics/UX components. # sync call to update all graphics/UX components.
graphics_update_cycle(ds) graphics_update_cycle(ds)
@ -300,8 +310,9 @@ def graphics_update_cycle(
profiler = pg.debug.Profiler( profiler = pg.debug.Profiler(
disabled=True, # not pg_profile_enabled(), disabled=True, # not pg_profile_enabled(),
delayed=False, gt=1/12 * 1e3,
) )
# unpack multi-referenced components # unpack multi-referenced components
chart = ds.chart chart = ds.chart
vlm_chart = ds.vlm_chart vlm_chart = ds.vlm_chart
@ -421,8 +432,11 @@ def graphics_update_cycle(
if ( if (
(xpx < update_uppx or i_diff > 0) (xpx < update_uppx or i_diff > 0)
or trigger_all or trigger_all
and r >= i_step
): ):
vlm_chart.update_curve_from_array('volume', array) # TODO: make it so this doesn't have to be called
# once the $vlm is up?
vlm_chart.update_graphics_from_array('volume', array)
if ( if (
mx_vlm_in_view != vars['last_mx_vlm'] mx_vlm_in_view != vars['last_mx_vlm']
@ -495,7 +509,8 @@ def graphics_update_cycle(
xpx < update_uppx xpx < update_uppx
or i_diff > 0 or i_diff > 0
): ):
chart.update_ohlc_from_array( # chart.update_ohlc_from_array(
chart.update_graphics_from_array(
chart.name, chart.name,
array, array,
) )
@ -534,7 +549,7 @@ def graphics_update_cycle(
if wap_in_history: if wap_in_history:
# update vwap overlay line # update vwap overlay line
chart.update_curve_from_array( chart.update_graphics_from_array(
'bar_wap', 'bar_wap',
array, array,
) )

View File

@ -89,7 +89,7 @@ def update_fsp_chart(
# update graphics # update graphics
# NOTE: this does a length check internally which allows it # NOTE: this does a length check internally which allows it
# staying above the last row check below.. # staying above the last row check below..
chart.update_curve_from_array( chart.update_graphics_from_array(
graphics_name, graphics_name,
array, array,
array_key=array_key or graphics_name, array_key=array_key or graphics_name,
@ -425,6 +425,7 @@ class FspAdmin:
) as (ctx, last_index), ) as (ctx, last_index),
ctx.open_stream() as stream, ctx.open_stream() as stream,
): ):
# register output data # register output data
self._registry[ self._registry[
(fqsn, ns_path) (fqsn, ns_path)
@ -678,7 +679,7 @@ async def open_vlm_displays(
last_val_sticky.update_from_data(-1, value) last_val_sticky.update_from_data(-1, value)
vlm_curve = chart.update_curve_from_array( vlm_curve = chart.update_graphics_from_array(
'volume', 'volume',
shm.array, shm.array,
) )