From 40879cc3f3d694e8541c0b6d58d412b41c3e9a7c Mon Sep 17 00:00:00 2001 From: Max Brauer Date: Fri, 28 Jul 2023 14:28:25 +0200 Subject: [PATCH] Code Style: Unify comma in function signatures See https://github.com/byte-physics/igor-pro-coding-conventions/issues/34 --- Packages/MIES/MIES_Configuration.ipf | 14 +++++++------- Packages/MIES/MIES_DataBrowser.ipf | 2 +- Packages/MIES/MIES_Epochs.ipf | 6 +++--- Packages/MIES/MIES_GuiPopupMenuExt.ipf | 4 ++-- Packages/MIES/MIES_GuiUtilities.ipf | 4 ++-- Packages/MIES/MIES_MiesUtilities.ipf | 2 +- Packages/MIES/MIES_SweepFormula.ipf | 4 ++-- Packages/MIES/MIES_SweepFormula_Helpers.ipf | 10 +++++----- Packages/MIES/MIES_Utilities.ipf | 8 ++++---- Packages/tests/Basic/UTF_SweepFormula.ipf | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Packages/MIES/MIES_Configuration.ipf b/Packages/MIES/MIES_Configuration.ipf index 19e4461809..b32e44f20a 100644 --- a/Packages/MIES/MIES_Configuration.ipf +++ b/Packages/MIES/MIES_Configuration.ipf @@ -435,7 +435,7 @@ End /// /// @param fName file name of configuration file to read configuration /// @param rigFile [optional, default = ""] name of secondary rig configuration file with complementary data. This parameter is valid when loading for a DA_Ephys panel -Function CONF_RestoreWindow(string fName[, string rigFile]) +Function CONF_RestoreWindow(string fName, [string rigFile]) variable jsonID, restoreMask string input, wName, errMsg, fullFilePath, panelType @@ -1216,7 +1216,7 @@ End /// @param winHandle window handle /// @param uKey [optional, default = EXPCONFIG_UDATA_WINHANDLE] userdata key that stores the handle value /// @returns Window name of the window with the given handle; empty string if not found. -static Function/S CONF_FindWindow(winHandle[, uKey]) +static Function/S CONF_FindWindow(winHandle, [uKey]) string winHandle, uKey variable i, j, numWin, numSubWin @@ -1249,7 +1249,7 @@ End /// @param ctrlName Control name /// @param jsonPath [optional, default = n/a] When given: the control is expected to be a named json object (with the control nice name) /// If not given: the jsons second level (assuming default format) is searched for the associated object. This is slower. -static Function CONF_RestoreControl(wName, restoreMask, jsonID, ctrlName[, jsonPath]) +static Function CONF_RestoreControl(wName, restoreMask, jsonID, ctrlName, [jsonPath]) string wName variable restoreMask, jsonID string ctrlName, jsonPath @@ -1468,7 +1468,7 @@ End /// @param[in] saveMask bit pattern based configuration setting for saving @sa WindowControlSavingMask /// @param[in] excCtrlTypes [optional, default = ""], list of control type codes for excluded control types for saving e.g. "1;6;" to exclude all buttons and charts /// @returns json ID of object where all controls where serialized into -Function CONF_AllWindowsToJSON(wName, saveMask[, excCtrlTypes]) +Function CONF_AllWindowsToJSON(wName, saveMask, [excCtrlTypes]) string wName variable saveMask string excCtrlTypes @@ -1529,7 +1529,7 @@ End /// @param saveMask Bit mask which properties are saved from WindowControlSavingMask constants /// @param excCtrlTypes [optional, default = ""] List of excluded control types that are ignored /// @returns jsonID ID of json containing the serialized GUI data -Function CONF_WindowToJSON(wName, saveMask[, excCtrlTypes]) +Function CONF_WindowToJSON(wName, saveMask, [excCtrlTypes]) string wName variable saveMask string excCtrlTypes @@ -2509,7 +2509,7 @@ End /// @param[in] loadRigFile [optional, default 0] when set, load the rig file instead /// /// @returns jsonId or NaN if data was not present -static Function [variable jsonId, string txtData] CONF_LoadConfigUsedForDAEphysPanel(string wName[, variable loadRigFile]) +static Function [variable jsonId, string txtData] CONF_LoadConfigUsedForDAEphysPanel(string wName, [variable loadRigFile]) string fName, str @@ -2543,7 +2543,7 @@ static Function CONF_TransferPreviousDAEphysJson(variable jsonId, variable prevJ endfor End -static Function CONF_RemoveRigElementsFromDAEphysJson(variable jsonId, variable rigJsonId[, string jsonPath]) +static Function CONF_RemoveRigElementsFromDAEphysJson(variable jsonId, variable rigJsonId, [string jsonPath]) string newJsonPath, key diff --git a/Packages/MIES/MIES_DataBrowser.ipf b/Packages/MIES/MIES_DataBrowser.ipf index 84c469894c..2d175edbc3 100644 --- a/Packages/MIES/MIES_DataBrowser.ipf +++ b/Packages/MIES/MIES_DataBrowser.ipf @@ -596,7 +596,7 @@ End /// @param win Name of the DataBrowser /// @param index Index of the sweep /// @param bdi [optional, default = n/a] BufferedDrawInfo structure, when given buffered draw is used. -Function DB_AddSweepToGraph(string win, variable index[, STRUCT BufferedDrawInfo &bdi]) +Function DB_AddSweepToGraph(string win, variable index, [STRUCT BufferedDrawInfo &bdi]) STRUCT TiledGraphSettings tgs variable sweepNo, traceIndex diff --git a/Packages/MIES/MIES_Epochs.ipf b/Packages/MIES/MIES_Epochs.ipf index 764502dc3a..78d3d73538 100644 --- a/Packages/MIES/MIES_Epochs.ipf +++ b/Packages/MIES/MIES_Epochs.ipf @@ -693,7 +693,7 @@ End /// @param[in] level level of epoch /// @param[in] lowerlimit [optional, default = -Inf] epBegin is limited between lowerlimit and Inf, epEnd must be > this limit /// @param[in] upperlimit [optional, default = Inf] epEnd is limited between -Inf and upperlimit, epBegin must be < this limit -static Function EP_AddEpoch(device, channel, channelType, epBegin, epEnd, epTags, epShortName, level[, lowerlimit, upperlimit]) +static Function EP_AddEpoch(device, channel, channelType, epBegin, epEnd, epTags, epShortName, level, [lowerlimit, upperlimit]) string device variable channel, channelType variable epBegin, epEnd @@ -911,7 +911,7 @@ End /// This is required for callers who want to read epochs during MID_SWEEP_EVENT in analysis functions. /// /// @returns Text wave with epoch information, only rows fitting the input parameters are returned. Can also be a null wave. -Function/WAVE EP_GetEpochs(WAVE numericalValues, WAVE textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname[, variable treelevel, WAVE/T epochsWave]) +Function/WAVE EP_GetEpochs(WAVE numericalValues, WAVE textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname, [variable treelevel, WAVE/T epochsWave]) variable index, epochCnt, midSweep string regexp @@ -1087,7 +1087,7 @@ static Function/WAVE EP_GetGaps(WAVE numericalValues, WAVE textualValues, variab End /// @brief Returns the following epoch of a given epoch name in a specified tree level -Function/WAVE EP_GetNextEpoch(WAVE numericalValues, WAVE textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname, variable treelevel[, variable ignoreGaps]) +Function/WAVE EP_GetNextEpoch(WAVE numericalValues, WAVE textualValues, variable sweepNo, variable channelType, variable channelNumber, string shortname, variable treelevel, [variable ignoreGaps]) variable currentEnd, dim diff --git a/Packages/MIES/MIES_GuiPopupMenuExt.ipf b/Packages/MIES/MIES_GuiPopupMenuExt.ipf index 76012c617d..8969c57ec4 100644 --- a/Packages/MIES/MIES_GuiPopupMenuExt.ipf +++ b/Packages/MIES/MIES_GuiPopupMenuExt.ipf @@ -583,7 +583,7 @@ End /// @param[in] menuList 1d text wave with menu items /// @param[in] method [optional, default = PEXT_SUBSPLIT_DEFAULT] sets how the menu items are split to sub menus @sa PEXT_SubMenuSplitting /// @returns 1d text wave where each element contains a list of menu items. Each element represents a sub menu. -Function/WAVE PEXT_SplitToSubMenus(menuList[, method]) +Function/WAVE PEXT_SplitToSubMenus(menuList, [method]) WAVE/T/Z menuList variable method @@ -662,7 +662,7 @@ End /// /// @param[in] splitMenu 1d text wave with menu item lists for sub menus as returned by PEXT_SplitToSubMenus() /// @param[in] method [optional, default = PEXT_SUBNAMEGEN_DEFAULT] sets how the sub menu names are generated @sa PEXT_SubMenuNameGeneration -Function PEXT_GenerateSubMenuNames(splitMenu[, method]) +Function PEXT_GenerateSubMenuNames(splitMenu, [method]) WAVE/T/Z splitMenu variable method diff --git a/Packages/MIES/MIES_GuiUtilities.ipf b/Packages/MIES/MIES_GuiUtilities.ipf index 2fbcc1ed93..7b82d623e2 100644 --- a/Packages/MIES/MIES_GuiUtilities.ipf +++ b/Packages/MIES/MIES_GuiUtilities.ipf @@ -925,7 +925,7 @@ End /// @param[in] orientation [optional: default not set] filter orientation of axes see @ref AxisOrientationConstants /// @param[in] mode [optional: default #AXIS_RANGE_DEFAULT] filter returned axis information by mode see @ref AxisPropModeConstants /// @return free wave with rows = axes, cols = axes info, dimlabel of rows is axis name -Function/Wave GetAxesProperties(graph[, axesRegexp, orientation, mode]) +Function/Wave GetAxesProperties(graph, [axesRegexp, orientation, mode]) string graph, axesRegexp variable orientation, mode @@ -990,7 +990,7 @@ End /// @param[in] axesRegexp [optional: default not set] filter axes names list by this optional regular expression /// @param[in] orientation [optional: default not set] filter orientation of axes see @ref AxisOrientationConstants /// @param[in] mode [optional: default 0] axis set mode see @ref AxisPropModeConstants -Function SetAxesProperties(graph, props[, axesRegexp, orientation, mode]) +Function SetAxesProperties(graph, props, [axesRegexp, orientation, mode]) string graph Wave props string axesRegexp diff --git a/Packages/MIES/MIES_MiesUtilities.ipf b/Packages/MIES/MIES_MiesUtilities.ipf index aa50b2a7fa..1b8f84048b 100644 --- a/Packages/MIES/MIES_MiesUtilities.ipf +++ b/Packages/MIES/MIES_MiesUtilities.ipf @@ -2648,7 +2648,7 @@ End /// @param experiment name of the experiment the sweep stems from /// @param channelSelWave channel selection wave /// @param bdi [optional, default = n/a] initialized BufferedDrawInfo structure, when given draw calls are buffered instead for later execution @sa OVS_EndIncrementalUpdate -Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WAVE numericalValues, WAVE/T textualValues, STRUCT TiledGraphSettings &tgs, DFREF sweepDFR, WAVE/T axisLabelCache, variable &traceIndex, string experiment, WAVE channelSelWave[, STRUCT BufferedDrawInfo &bdi]) +Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WAVE numericalValues, WAVE/T textualValues, STRUCT TiledGraphSettings &tgs, DFREF sweepDFR, WAVE/T axisLabelCache, variable &traceIndex, string experiment, WAVE channelSelWave, [STRUCT BufferedDrawInfo &bdi]) variable axisIndex, numChannels variable numDACs, numADCs, numTTLs, i, j, k, hasPhysUnit, hardwareType diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index 5b5ab5a0ad..d547f56615 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -4080,7 +4080,7 @@ static Function/WAVE SF_OperationPowerSpectrum(variable jsonId, string jsonPath, return SFH_GetOutputForExecutor(output, graph, SF_OP_POWERSPECTRUM, clear=input) End -static Function/WAVE SF_PowerSpectrumRatio(WAVE/Z input, variable ratioFreq, variable deltaHz[, WAVE fitData]) +static Function/WAVE SF_PowerSpectrumRatio(WAVE/Z input, variable ratioFreq, variable deltaHz, [WAVE fitData]) string sLeft, sRight, maxSigma, minAmp variable err, left, right, minFreq, maxFreq, endFreq, base @@ -4944,7 +4944,7 @@ End /// @param singleResult [optional, default 0], if set then the first dataSet is retrieved from the waveRef wave and returned, the waveRef wave is disposed /// @param checkExist [optional, default 0], only valid if singleResult=1, if set then the data wave in the single dataSet retrieved must exist /// @param useVariables [optional, default 1], when not set, hint the function that the formula string contains only an expression and no variable definitions -Function/WAVE SF_ExecuteFormula(string formula, string graph[, variable singleResult, variable checkExist, variable useVariables]) +Function/WAVE SF_ExecuteFormula(string formula, string graph, [variable singleResult, variable checkExist, variable useVariables]) variable jsonId diff --git a/Packages/MIES/MIES_SweepFormula_Helpers.ipf b/Packages/MIES/MIES_SweepFormula_Helpers.ipf index 7a9b7248b8..2aa4c617a6 100644 --- a/Packages/MIES/MIES_SweepFormula_Helpers.ipf +++ b/Packages/MIES/MIES_SweepFormula_Helpers.ipf @@ -253,7 +253,7 @@ End /// All programmer error checks must still use ASSERT(). /// /// UTF_NOINSTRUMENTATION -Function SFH_ASSERT(variable condition, string message[, variable jsonId]) +Function SFH_ASSERT(variable condition, string message, [variable jsonId]) if(!condition) if(!ParamIsDefault(jsonId)) @@ -604,7 +604,7 @@ Function SFH_AddToArgSetupStack(WAVE output, WAVE/Z input, string argSetupStr, [ JSON_Release(argStackId) End -Function/WAVE SFH_GetOutputForExecutorSingle(WAVE/Z data, string graph, string opShort[, variable discardOpStack, WAVE clear, string dataType]) +Function/WAVE SFH_GetOutputForExecutorSingle(WAVE/Z data, string graph, string opShort, [variable discardOpStack, WAVE clear, string dataType]) discardOpStack = ParamIsDefault(discardOpStack) ? 0 : !!discardOpStack if(!ParamIsDefault(clear)) @@ -627,7 +627,7 @@ Function/WAVE SFH_GetOutputForExecutorSingle(WAVE/Z data, string graph, string o return SFH_GetOutputForExecutor(output, graph, opShort) End -Function/WAVE SFH_GetOutputForExecutor(WAVE output, string win, string opShort[, WAVE clear]) +Function/WAVE SFH_GetOutputForExecutor(WAVE output, string win, string opShort, [WAVE clear]) if(!ParamIsDefault(clear)) SFH_CleanUpInput(clear) @@ -657,7 +657,7 @@ static Function SFH_ConvertAllReturnDataToPermanent(WAVE/WAVE output, string win End /// @brief Retrieves from an argument the first dataset and disposes the argument -Function/WAVE SFH_ResolveDatasetElementFromJSON(variable jsonId, string jsonPath, string graph, string opShort, variable argNum[, variable checkExist]) +Function/WAVE SFH_ResolveDatasetElementFromJSON(variable jsonId, string jsonPath, string graph, string opShort, variable argNum, [variable checkExist]) checkExist = ParamIsDefault(checkExist) ? 0 : !!checkExist @@ -679,7 +679,7 @@ End /// @param newDataType data type of output /// @param argSetup [optional, default=$""] 2d text wave with argument setup of operation @sa SFH_GetNewArgSetupWave /// @param keepX [optional, default=0] When set then xvalues and xlabel of output are kept. -Function SFH_TransferFormulaDataWaveNoteAndMeta(WAVE/WAVE input, WAVE/WAVE output, string opShort, string newDataType[, WAVE/T argSetup, variable keepX]) +Function SFH_TransferFormulaDataWaveNoteAndMeta(WAVE/WAVE input, WAVE/WAVE output, string opShort, string newDataType, [WAVE/T argSetup, variable keepX]) variable sweepNo, numResults, i, setXLabel, size string opStack, argSetupStr, inDataType diff --git a/Packages/MIES/MIES_Utilities.ipf b/Packages/MIES/MIES_Utilities.ipf index 9fec2d7242..4d5b583fdb 100644 --- a/Packages/MIES/MIES_Utilities.ipf +++ b/Packages/MIES/MIES_Utilities.ipf @@ -846,7 +846,7 @@ End /// @param wv wave reference, can be numeric or text /// @param caseSensitive [optional, default = 1] Indicates whether comparison should be case sensitive. Applies only if the input wave is a text wave /// @param dontDuplicate [optional, default = 0] for a single element input wave no new free wave is created but the input wave is returned. -threadsafe Function/WAVE GetUniqueEntries(WAVE wv[, variable caseSensitive, variable dontDuplicate]) +threadsafe Function/WAVE GetUniqueEntries(WAVE wv, [variable caseSensitive, variable dontDuplicate]) variable numRows @@ -909,7 +909,7 @@ End /// @param dontDuplicate [optional, default = 0] for a single element input wave no new free wave is created but the input wave is returned. /// /// @return free wave with unique entries -threadsafe static Function/WAVE GetUniqueTextEntries(WAVE/T wv[, variable caseSensitive, variable dontDuplicate]) +threadsafe static Function/WAVE GetUniqueTextEntries(WAVE/T wv, [variable caseSensitive, variable dontDuplicate]) variable numEntries, numDuplicates, i @@ -4901,7 +4901,7 @@ End /// @param[in] fileFilter [optional, default = "Plain Text Files (*.txt):.txt;All Files:.*;"] file filter string in Igor specific notation. /// @param[in] message [optional, default = "Select file"] window title of the save file dialog. /// @returns loaded string data and full path fileName -Function [string data, string fName] LoadTextFile(string fileName[, string fileFilter, string message]) +Function [string data, string fName] LoadTextFile(string fileName, [string fileFilter, string message]) variable fNum, zFlag @@ -6186,7 +6186,7 @@ End /// @param input Wave to perform FFT on /// @param winFunc [optional, defaults to NONE] FFT window function /// @param padSize [optional, defaults to the next power of 2 of the input wave row size] Target size used for padding -threadsafe Function/WAVE DoFFT(WAVE input[, string winFunc, variable padSize]) +threadsafe Function/WAVE DoFFT(WAVE input, [string winFunc, variable padSize]) if(ParamIsDefault(padSize)) padSize = TP_GetPowerSpectrumLength(DimSize(input, ROWS)) diff --git a/Packages/tests/Basic/UTF_SweepFormula.ipf b/Packages/tests/Basic/UTF_SweepFormula.ipf index fba4ea3291..3cf98ea3b3 100644 --- a/Packages/tests/Basic/UTF_SweepFormula.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula.ipf @@ -2227,7 +2227,7 @@ static Function TestOperationSelect() End -static Function CheckSweepsFromData(WAVE/WAVE dataWref, WAVE sweepRef, variable numResults, WAVE chanIndex[, WAVE ranges]) +static Function CheckSweepsFromData(WAVE/WAVE dataWref, WAVE sweepRef, variable numResults, WAVE chanIndex, [WAVE ranges]) variable i