From e6b549786a96a4927a16b79c4ad6475637ff02fa Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 11 Feb 2025 16:10:09 +0100 Subject: [PATCH] SF_OperationTPIterate: Handle non-existing sweep data Broken since 83713dd90 (SF Implement new select operation, 2024-10-02). --- Packages/MIES/MIES_SweepFormula.ipf | 4 ++-- Packages/tests/Basic/UTF_SweepFormula_Operations.ipf | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index e1a4cfe390..46b069e5c6 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -3219,8 +3219,8 @@ static Function/WAVE SF_OperationTPIterate(string graph, WAVE/WAVE mode, WAVE/Z/ continue endif - WAVE/Z selectData = selectDataComp[%SELECTION] - WAVE/WAVE sweepData = SF_OperationTPImpl(graph, mode, selectData, ignoreTPs, opShort) + WAVE/Z selectData = selectDataComp[%SELECTION] + WAVE/Z/WAVE sweepData = SF_OperationTPImpl(graph, mode, selectData, ignoreTPs, opShort) if(!WaveExists(sweepData)) continue endif diff --git a/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf b/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf index a77bd7c425..a31d0c836b 100644 --- a/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf @@ -328,6 +328,18 @@ static Function CheckTPFitResult(WAVE/WAVE wv, string fit, string result, variab CHECK_EQUAL_VAR(trailLength, maxlength) End +static Function TestOperationTP() + + string win, formula + + win = GetDataBrowserWithData() + + formula = "tp(tpfit(exp, amp), select(selvis(all), selsweeps(1000)))" + WAVE/Z/WAVE output = SF_ExecuteFormula(formula, win, useVariables = 0) + CHECK_WAVE(output, WAVE_WAVE) + CHECK_EQUAL_VAR(DimSize(output, ROWS), 0) +End + static Function TestOperationTPfit() string formula, strRef, dataType, dataTypeRef