Skip to content

Commit

Permalink
SF: Adapt operation labnotebook
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHuth committed May 29, 2024
1 parent 99ff909 commit 34946fa
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Packages/MIES/MIES_SweepFormula.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34946fa

Please sign in to comment.