MIES
MIES copied to clipboard
Add support for default values of optional analysis parameters
Idea:
Function/WAVE MyAnalysisFunction_GetDefault(string name)
strswitch(name)
case "optParam1":
return {1, 2, 3}
break
case "optParam2":
// no good default
return $""
break
default:
ASSERT(0, "Unimplemented for parameter " + name)
break
endswitch
End
XXX_GetDefault:
- must only handle optional parameters
- can pack strings/numbers into single element (text) waves
- only text waves and FP/DP waves are accepted as returned waves
- can return
$""for saying "want to handle that at runtime" or "no good default" - Don't allow stimset saving (interactively from WB GUI) and DAQ starting if the default values don't pass the XXX_CheckParam tests or the function does not adhere to the requirements here.
Tasks:
- [ ] Implementation including AFH_ helper function
- [ ] Suggest default value in wavebuilder GUI
- [ ] Tests
If this is done, think about if "no good default" really makes sense here.
Yes it does.
Consider doing this work with #1532
Another thing to consider is that we would like to store the default values in the labnotebook. AFM_UpdateAnalysisFunctionWave should then also fetch the default values and include that in the wave from GetAnalysisFunctionStorage so that gets stored in the labnotebook.
The use case is that we would like to document default values as these are part of the metadata of the measurement. As also the default values could change.