From fc12e72906921448b8cff747a1d27a6411cbf9c4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 30 Sep 2021 11:19:50 -0400 Subject: [PATCH] Add zero on increment support --- piker/fsp/_engine.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/piker/fsp/_engine.py b/piker/fsp/_engine.py index a11ddda7..c63137c6 100644 --- a/piker/fsp/_engine.py +++ b/piker/fsp/_engine.py @@ -172,6 +172,7 @@ async def cascade( symbol: str, func_name: str, + zero_on_step: bool = False, loglevel: Optional[str] = None, @@ -233,6 +234,11 @@ async def cascade( ) cs, index = await n.start(fsp_target) + + if zero_on_step: + last = dst.array[-1:] + zeroed = np.zeros(last.shape, dtype=last.dtype) + await ctx.started(index) profiler(f'{func_name}: fsp up') @@ -264,6 +270,9 @@ async def cascade( # TODO: some signals, like vlm should be reset to # zero every step. last = array[-1:].copy() + if zero_on_step: + last = zeroed + dst.push(last) last_len = new_len