Port to new `.update_graphics_from_array()`, pause quote updates on chart interaction
parent
14d5ca1cc6
commit
97beb26a9b
|
@ -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)
|
||||||
|
|
||||||
|
@ -299,8 +309,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
|
||||||
|
@ -409,9 +420,11 @@ def graphics_update_cycle(
|
||||||
if (
|
if (
|
||||||
# if zoomed out alot don't update the last "bar"
|
# if zoomed out alot don't update the last "bar"
|
||||||
(xpx < update_uppx or i_diff > 0)
|
(xpx < update_uppx or i_diff > 0)
|
||||||
# and r >= i_step
|
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']
|
||||||
|
@ -485,7 +498,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,
|
||||||
)
|
)
|
||||||
|
@ -524,7 +538,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,
|
||||||
)
|
)
|
||||||
|
|
|
@ -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)
|
||||||
|
@ -440,6 +441,7 @@ class FspAdmin:
|
||||||
async with stream.subscribe() as stream:
|
async with stream.subscribe() as stream:
|
||||||
async for msg in stream:
|
async for msg in stream:
|
||||||
if msg == 'update':
|
if msg == 'update':
|
||||||
|
log.info(f'Re-syncing graphics for fsp: {ns_path}')
|
||||||
self.linked.graphics_cycle()
|
self.linked.graphics_cycle()
|
||||||
else:
|
else:
|
||||||
log.info(f'recved unexpected fsp engine msg: {msg}')
|
log.info(f'recved unexpected fsp engine msg: {msg}')
|
||||||
|
@ -674,7 +676,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,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue