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

m4_corrections
Tyler Goodlet 2022-04-03 23:34:55 -04:00
parent 264328e119
commit 750e7230da
2 changed files with 22 additions and 6 deletions

View File

@ -53,6 +53,10 @@ from ._forms import (
mk_order_pane_layout,
)
from .order_mode import open_order_mode
# from .._profile import (
# pg_profile_enabled,
# ms_slower_then,
# )
from ..log import get_logger
log = get_logger(__name__)
@ -284,6 +288,12 @@ async def graphics_update_loop(
chart.pause_all_feeds()
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.
graphics_update_cycle(ds)
@ -300,8 +310,9 @@ def graphics_update_cycle(
profiler = pg.debug.Profiler(
disabled=True, # not pg_profile_enabled(),
delayed=False,
gt=1/12 * 1e3,
)
# unpack multi-referenced components
chart = ds.chart
vlm_chart = ds.vlm_chart
@ -421,8 +432,11 @@ def graphics_update_cycle(
if (
(xpx < update_uppx or i_diff > 0)
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 (
mx_vlm_in_view != vars['last_mx_vlm']
@ -495,7 +509,8 @@ def graphics_update_cycle(
xpx < update_uppx
or i_diff > 0
):
chart.update_ohlc_from_array(
# chart.update_ohlc_from_array(
chart.update_graphics_from_array(
chart.name,
array,
)
@ -534,7 +549,7 @@ def graphics_update_cycle(
if wap_in_history:
# update vwap overlay line
chart.update_curve_from_array(
chart.update_graphics_from_array(
'bar_wap',
array,
)

View File

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