Use new flag, add more marks through display loop

pre_flow
Tyler Goodlet 2022-05-13 16:22:49 -04:00
parent a8fa034b61
commit b83ec0fad6
1 changed files with 16 additions and 8 deletions

View File

@ -54,10 +54,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 ( from .._profile import (
# pg_profile_enabled, pg_profile_enabled,
# ms_slower_then, ms_slower_then,
# ) )
from ..log import get_logger from ..log import get_logger
log = get_logger(__name__) log = get_logger(__name__)
@ -319,9 +319,12 @@ def graphics_update_cycle(
profiler = pg.debug.Profiler( profiler = pg.debug.Profiler(
msg=f'Graphics loop cycle for: `{chart.name}`', msg=f'Graphics loop cycle for: `{chart.name}`',
disabled=True, # not pg_profile_enabled(), delayed=True,
gt=1/12 * 1e3, # disabled=not pg_profile_enabled(),
# gt=ms_slower_then, disabled=True,
ms_threshold=ms_slower_then,
# ms_threshold=1/12 * 1e3,
) )
# unpack multi-referenced components # unpack multi-referenced components
@ -366,7 +369,9 @@ def graphics_update_cycle(
l, lbar, rbar, r = brange l, lbar, rbar, r = brange
mx = mx_in_view + tick_margin mx = mx_in_view + tick_margin
mn = mn_in_view - tick_margin mn = mn_in_view - tick_margin
profiler('maxmin call')
profiler('`ds.maxmin()` call')
liv = r >= i_step # the last datum is in view liv = r >= i_step # the last datum is in view
if ( if (
@ -394,6 +399,7 @@ def graphics_update_cycle(
# pixel in a curve should show new data based on uppx # pixel in a curve should show new data based on uppx
# and then iff update curves and shift? # and then iff update curves and shift?
chart.increment_view(steps=i_diff) chart.increment_view(steps=i_diff)
profiler('view incremented')
if vlm_chart: if vlm_chart:
# always update y-label # always update y-label
@ -425,6 +431,7 @@ def graphics_update_cycle(
# connected to update accompanying overlay # connected to update accompanying overlay
# graphics.. # graphics..
) )
profiler('`vlm_chart.update_graphics_from_flow()`')
if ( if (
mx_vlm_in_view != vars['last_mx_vlm'] mx_vlm_in_view != vars['last_mx_vlm']
@ -433,6 +440,7 @@ def graphics_update_cycle(
vlm_chart.view._set_yrange( vlm_chart.view._set_yrange(
yrange=yrange, yrange=yrange,
) )
profiler('`vlm_chart.view._set_yrange()`')
# print(f'mx vlm: {last_mx_vlm} -> {mx_vlm_in_view}') # print(f'mx vlm: {last_mx_vlm} -> {mx_vlm_in_view}')
vars['last_mx_vlm'] = mx_vlm_in_view vars['last_mx_vlm'] = mx_vlm_in_view