From 34946fa397ab042223248e34c687e3695e9d3beb Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 28 May 2024 19:26:30 +0200 Subject: [PATCH] SF: Adapt operation labnotebook --- Packages/MIES/MIES_SweepFormula.ipf | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index d510b96367..1210c6a3d7 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -5053,13 +5053,40 @@ static Function/WAVE SF_OperationLabnotebook(variable jsonId, string jsonPath, s SFH_ASSERT(IsTextWave(wLbnKey) && DimSize(wLbnKey, ROWS) == 1 && !DimSize(wLbnKey, COLS), "First parameter needs to be a string labnotebook key.") lbnKey = wLbnKey[0] - WAVE/WAVE output = SF_OperationLabnotebookImpl(graph, lbnKey, selectData, mode, SF_OP_LABNOTEBOOK) + WAVE/WAVE output = SF_OperationLabnotebookIterate(graph, lbnKey, selectData, mode, SF_OP_LABNOTEBOOK) JWN_SetStringInWaveNote(output, SF_META_OPSTACK, AddListItem(SF_OP_LABNOTEBOOK, "")) return SFH_GetOutputForExecutor(output, graph, SF_OP_LABNOTEBOOK) End +static Function/WAVE SF_OperationLabnotebookIterate(string graph, string lbnKey, WAVE/WAVE/Z selectDataArray, variable mode, string opShort) + + WAVE/WAVE/Z result = $"" + + for(WAVE/WAVE selectDataComp : selectDataArray) + + if(!WaveExists(selectDataComp)) + continue + endif + + WAVE/Z selectData = selectDataComp[0] + WAVE/WAVE lbnData = SF_OperationLabnotebookImpl(graph, lbnKey, selectData, mode, opShort) + if(!WaveExists(lbnData)) + continue + endif + + if(!WaveExists(result)) + WAVE/WAVE result = lbnData + continue + endif + + Concatenate/FREE/WAVE/NP {lbnData}, result + endfor + + return result +End + static Function/WAVE SF_OperationLabnotebookImpl(string graph, string lbnKey, WAVE/Z selectData, variable mode, string opShort) variable i, numSelected, index, settingsIndex