Expect new flow type through display and fsp UI code

windows_fixes_yo
Tyler Goodlet 2022-02-08 15:55:57 -05:00
parent e3a3fd2d39
commit ef04781a2b
2 changed files with 21 additions and 17 deletions

View File

@ -106,7 +106,7 @@ def chart_maxmin(
return last_bars_range, mx, max(mn, 0), mx_vlm_in_view return last_bars_range, mx, max(mn, 0), mx_vlm_in_view
async def update_linked_charts_graphics( async def graphics_update_loop(
linked: LinkedSplits, linked: LinkedSplits,
stream: tractor.MsgStream, stream: tractor.MsgStream,
ohlcv: np.ndarray, ohlcv: np.ndarray,
@ -258,13 +258,15 @@ async def update_linked_charts_graphics(
) )
last_mx_vlm = mx_vlm_in_view last_mx_vlm = mx_vlm_in_view
for curve_name, shm in vlm_chart._overlays.items(): for curve_name, flow in vlm_chart._flows.items():
update_fsp_chart( update_fsp_chart(
vlm_chart, vlm_chart,
shm, flow.shm,
curve_name, curve_name,
array_key=curve_name, array_key=curve_name,
) )
# is this even doing anything?
flow.plot.vb._set_yrange()
ticks_frame = quote.get('ticks', ()) ticks_frame = quote.get('ticks', ())
@ -411,14 +413,14 @@ async def update_linked_charts_graphics(
# TODO: all overlays on all subplots.. # TODO: all overlays on all subplots..
# run synchronous update on all derived overlays # run synchronous update on all derived overlays
for curve_name, shm in chart._overlays.items(): for curve_name, flow in chart._flows.items():
update_fsp_chart( update_fsp_chart(
chart, chart,
shm, flow.shm,
curve_name, curve_name,
array_key=curve_name, array_key=curve_name,
) )
# chart._set_yrange() # chart.view._set_yrange()
async def check_for_new_bars( async def check_for_new_bars(
@ -473,11 +475,11 @@ async def check_for_new_bars(
) )
# main chart overlays # main chart overlays
for name in price_chart._overlays: # for name in price_chart._flows:
for curve_name in price_chart._flows:
price_chart.update_curve_from_array( price_chart.update_curve_from_array(
name, curve_name,
price_chart._arrays[name] price_chart._arrays[curve_name]
) )
# each subplot # each subplot
@ -614,7 +616,7 @@ async def display_symbol_data(
# start graphics update loop after receiving first live quote # start graphics update loop after receiving first live quote
ln.start_soon( ln.start_soon(
update_linked_charts_graphics, graphics_update_loop,
linkedsplits, linkedsplits,
feed.stream, feed.stream,
ohlcv, ohlcv,

View File

@ -250,7 +250,7 @@ async def run_fsp_ui(
**conf.get('chart_kwargs', {}) **conf.get('chart_kwargs', {})
) )
# specially store ref to shm for lookup in display loop # specially store ref to shm for lookup in display loop
chart._overlays[name] = shm chart._flows[name].shm = shm
else: else:
# create a new sub-chart widget for this fsp # create a new sub-chart widget for this fsp
@ -634,7 +634,9 @@ async def open_vlm_displays(
for name in names: for name in names:
mxmn = chart.maxmin(name=name) mxmn = chart.maxmin(name=name)
if mxmn: if mxmn:
mx = max(mxmn[1], mx) ymax = mxmn[1]
if ymax > mx:
mx = ymax
return 0, mx return 0, mx
@ -794,7 +796,7 @@ async def open_vlm_displays(
# specially store ref to shm for lookup in display loop # specially store ref to shm for lookup in display loop
# since only a placeholder of `None` is entered in # since only a placeholder of `None` is entered in
# ``.draw_curve()``. # ``.draw_curve()``.
chart._overlays[name] = shm chart._flows[name].shm = shm
chart_curves( chart_curves(
fields, fields,
@ -857,7 +859,7 @@ async def open_vlm_displays(
# dashed line to represent "individual trades" being # dashed line to represent "individual trades" being
# more "granular" B) # more "granular" B)
# style='dash', style='dash',
) )
for pi in (dvlm_pi, tr_pi): for pi in (dvlm_pi, tr_pi):