From 5e1b15f3190bdc426d8fb1b0d4c7153f436bed76 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 29 Apr 2021 15:23:16 -0400 Subject: [PATCH] Repair indents from rebasing --- piker/ui/_chart.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index eb868c01..6b6e4f83 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -1293,20 +1293,27 @@ async def run_fsp( # fsp_func_name ) + # XXX: ONLY for sub-chart fsps, overlays have their + # data looked up from the chart's internal array set. + # TODO: we must get a data view api going STAT!! + chart._shm = shm + + # should **not** be the same sub-chart widget + assert chart.name != linked_charts.chart.name + + # sticky only on sub-charts atm + last_val_sticky = chart._ysticks[chart.name] + + # read from last calculated value + array = shm.array + value = array[fsp_func_name][-1] + last_val_sticky.update_from_data(-1, value) + chart._lc.focus() - # read last value - array = shm.array - value = array[fsp_func_name][-1] - - last_val_sticky = chart._ysticks[chart.name] - last_val_sticky.update_from_data(-1, value) - - chart.update_curve_from_array(fsp_func_name, array) - - chart._shm = shm + # works also for overlays in which case data is looked up from + # internal chart array set.... chart.update_curve_from_array(fsp_func_name, shm.array) - chart._shm = shm # TODO: figure out if we can roll our own `FillToThreshold` to # get brush filled polygons for OS/OB conditions.