diff --git a/Packages/Conversion/MIES_MassExperimentProcessing.ipf b/Packages/Conversion/MIES_MassExperimentProcessing.ipf index 0d231ef14b..a85879ae05 100644 --- a/Packages/Conversion/MIES_MassExperimentProcessing.ipf +++ b/Packages/Conversion/MIES_MassExperimentProcessing.ipf @@ -46,7 +46,7 @@ End static StrConstant kPackageName = "MIES PXP to NWBv2" static StrConstant kPreferencesFileName = "ProcessPrefsMIESNWBv2.bin" -static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file. +static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file. static Structure MultiExperimentProcessPrefs uint32 version // Prefs version @@ -314,7 +314,7 @@ Function StartMultiExperimentProcessWrapper() // 64: Ignore + and - in the alphanumeric sort so that "Text-09" sorts before "Text-10". Set options to 80 or 81. files = SortList(files, FILE_LIST_SEP, 80) - WAVE/T/Z inputPXPs = ListToTextWave(files, FILE_LIST_SEP) + WAVE/Z/T inputPXPs = ListToTextWave(files, FILE_LIST_SEP) jsonID = JSON_New() JSON_AddWave(jsonID, "/inputFiles", inputPXPs) diff --git a/Packages/MIES/MIES_AcquisitionStateHandling.ipf b/Packages/MIES/MIES_AcquisitionStateHandling.ipf index 1a1d5183f4..e4aa075981 100644 --- a/Packages/MIES/MIES_AcquisitionStateHandling.ipf +++ b/Packages/MIES/MIES_AcquisitionStateHandling.ipf @@ -11,6 +11,7 @@ /// @brief Get the acquisition state as string Function/S AS_StateToString(variable acqState) + switch(acqState) case AS_INACTIVE: return "AS_INACTIVE" @@ -201,6 +202,7 @@ End /// /// Requires that they were recorded with AS_RecordStateTransition(). Function/WAVE AS_GenerateEncounteredTransitions() + variable numEntries, i, j WAVE acqStateTracking = GetAcqStateTracking() diff --git a/Packages/MIES/MIES_AmplifierInteraction.ipf b/Packages/MIES/MIES_AmplifierInteraction.ipf index 3e7dc54873..1d1ddd7343 100644 --- a/Packages/MIES/MIES_AmplifierInteraction.ipf +++ b/Packages/MIES/MIES_AmplifierInteraction.ipf @@ -13,7 +13,7 @@ static Constant ZERO_TOLERANCE = 100 // pA static StrConstant AMPLIFIER_CONTROLS_VC = "setvar_DataAcq_Hold_VC;check_DataAcq_Amp_Chain;check_DatAcq_HoldEnableVC;setvar_DataAcq_WCC;setvar_DataAcq_WCR;check_DatAcq_WholeCellEnable;setvar_DataAcq_RsCorr;setvar_DataAcq_RsPred;check_DataAcq_Amp_Chain;check_DatAcq_RsCompEnable;setvar_DataAcq_PipetteOffset_VC;button_DataAcq_FastComp_VC;button_DataAcq_SlowComp_VC;button_DataAcq_AutoPipOffset_VC" static StrConstant AMPLIFIER_CONTROLS_IC = "setvar_DataAcq_Hold_IC;check_DatAcq_HoldEnable;setvar_DataAcq_BB;check_DatAcq_BBEnable;setvar_DataAcq_CN;check_DatAcq_CNEnable;setvar_DataAcq_AutoBiasV;setvar_DataAcq_AutoBiasVrange;setvar_DataAcq_IbiasMax;check_DataAcq_AutoBias;setvar_DataAcq_PipetteOffset_IC;button_DataAcq_AutoBridgeBal_IC" -static Constant MAX_PIPETTEOFFSET = 150 // mV +static Constant MAX_PIPETTEOFFSET = 150 // mV static Constant MIN_PIPETTEOFFSET = -150 static Constant NUM_TRIES_AXON_TELEGRAPH = 10 @@ -124,8 +124,7 @@ End /// /// @param clampMode clamp mode (pass `NaN` for doesn't matter) /// @param func MCC function, one of @ref AI_SendToAmpConstants -Function AI_GetMCCScale(clampMode, func) - variable clampMode, func +Function AI_GetMCCScale(variable clampMode, variable func) if(IsFinite(clampMode)) AI_AssertOnInvalidClampMode(clampMode) @@ -203,10 +202,7 @@ End /// before use, some callers might save time in doing that once themselves. /// /// @return 0 on success, 1 otherwise -Function AI_UpdateAmpModel(device, ctrl, headStage, [value, sendToAll, checkBeforeWrite, selectAmp]) - string device - string ctrl - variable headStage, value, sendToAll, checkBeforeWrite, selectAmp +Function AI_UpdateAmpModel(string device, string ctrl, variable headStage, [variable value, variable sendToAll, variable checkBeforeWrite, variable selectAmp]) variable i, diff, selectedHeadstage, clampMode, oppositeMode, oldTab variable runMode = TEST_PULSE_NOT_RUNNING @@ -479,17 +475,13 @@ End /// @brief Convenience wrapper for #AI_UpdateAmpView /// /// Disallows setting single controls for outside callers as #AI_UpdateAmpModel should be used for that. -Function AI_SyncAmpStorageToGUI(device, headstage) - string device - variable headstage +Function AI_SyncAmpStorageToGUI(string device, variable headstage) return AI_UpdateAmpView(device, headstage) End /// @brief Sync the settings from the GUI to the amp storage wave and the MCC application -Function AI_SyncGUIToAmpStorageAndMCCApp(device, headStage, clampMode) - string device - variable headStage, clampMode +Function AI_SyncGUIToAmpStorageAndMCCApp(string device, variable headStage, variable clampMode) string ctrl, list variable i, numEntries @@ -656,9 +648,7 @@ static Function/S AI_AmpStorageControlToRowLabel(ctrl) break endswitch End -Function AI_SetMIESHeadstage(device, [headstage, increment]) - string device - variable headstage, increment +Function AI_SetMIESHeadstage(string device, [variable headstage, variable increment]) if(ParamIsDefault(headstage) && ParamIsDefault(increment)) return NaN @@ -677,9 +667,7 @@ End /// /// @param device device /// @param headStage [optional: defaults to all active headstages] -Function AI_ZeroAmps(device, [headStage]) - string device - variable headstage +Function AI_ZeroAmps(string device, [variable headStage]) variable i // Ensure that data in BaselineSSAvg is up to date by verifying that TP is active @@ -732,11 +720,7 @@ End /// @brief Query the MCC application for the gains and units of the given clamp mode /// /// Assumes that the correct amplifier is already selected! -Function AI_QueryGainsUnitsForClampMode(device, headstage, clampMode, DAGain, ADGain, DAUnit, ADUnit) - string device - variable headstage, clampMode - variable &DAGain, &ADGain - string &DAUnit, &ADUnit +Function AI_QueryGainsUnitsForClampMode(string device, variable headstage, variable clampMode, variable &DAGain, variable &ADGain, string &DAUnit, string &ADUnit) DAGain = NaN ADGain = NaN @@ -758,10 +742,7 @@ End /// @brief Update the `ChanAmpAssign` and `ChanAmpAssignUnit` waves according to the passed /// clamp mode with the gains and units. -Function AI_UpdateChanAmpAssign(device, headStage, clampMode, DAGain, ADGain, DAUnit, ADUnit) - string device - variable headStage, clampMode, DAGain, ADGain - string DAUnit, ADUnit +Function AI_UpdateChanAmpAssign(string device, variable headStage, variable clampMode, variable DAGain, variable ADGain, string DAUnit, string ADUnit) AI_AssertOnInvalidClampMode(clampMode) @@ -787,15 +768,13 @@ Function AI_UpdateChanAmpAssign(device, headStage, clampMode, DAGain, ADGain, DA End /// @brief Assert on invalid clamp modes, does nothing otherwise -Function AI_AssertOnInvalidClampMode(clampMode) - variable clampMode +Function AI_AssertOnInvalidClampMode(variable clampMode) ASSERT(AI_IsValidClampMode(clampMode), "invalid clamp mode") End /// @brief Return true if the given clamp mode is valid -Function AI_IsValidClampMode(clampMode) - variable clampMode +Function AI_IsValidClampMode(variable clampMode) return clampMode == V_CLAMP_MODE || clampMode == I_CLAMP_MODE || clampMode == I_EQUAL_ZERO_MODE End @@ -808,9 +787,7 @@ End /// For each unique serial number one MCC is opened. /// @param ampTitleList [optional, defaults to blank] MCC gui window title /// @return 1 if all unique MCCs specified in ampSerialNumList were opened, 0 if one or more MCCs specified in ampSerialNumList were not able to be opened -Function AI_OpenMCCs(ampSerialNumList, [ampTitleList]) - string ampSerialNumList - string ampTitleList +Function AI_OpenMCCs(string ampSerialNumList, [string ampTitleList]) string cmd, serialStr, title variable i, j, numDups, serialNum, failedToOpenCount @@ -919,9 +896,7 @@ End #ifdef AMPLIFIER_XOPS_PRESENT ///@brief Returns the holding command of the amplifier -Function AI_GetHoldingCommand(device, headstage) - string device - variable headstage +Function AI_GetHoldingCommand(string device, variable headstage) if(AI_SelectMultiClamp(device, headstage) != AMPLIFIER_CONNECTION_SUCCESS) return NaN @@ -937,9 +912,7 @@ End /// DAP_ChangeHeadStageMode() if possible. /// /// @brief One of @ref AmplifierClampModes or NaN if no amplifier is connected -Function AI_GetMode(device, headstage) - string device - variable headstage +Function AI_GetMode(string device, variable headstage) if(AI_SelectMultiClamp(device, headstage) != AMPLIFIER_CONNECTION_SUCCESS) return NaN @@ -1017,9 +990,7 @@ End /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// /// @returns one of @ref AISelectMultiClampReturnValues -Function AI_SelectMultiClamp(device, headStage) - string device - variable headStage +Function AI_SelectMultiClamp(string device, variable headStage) variable channel, axonSerial, err string mccSerial @@ -1044,10 +1015,7 @@ Function AI_SelectMultiClamp(device, headStage) End /// @brief Set the clamp mode of user linked MCC based on the headstage number -Function AI_SetClampMode(device, headStage, mode, [zeroStep]) - string device - variable headStage - variable mode, zeroStep +Function AI_SetClampMode(string device, variable headStage, variable mode, [variable zeroStep]) if(ParamIsDefault(zeroStep)) zeroStep = 0 @@ -1088,10 +1056,7 @@ End /// before use, some callers might save time in doing that once themselves. /// /// @returns return value (for getters, respects `usePrefixes`), success (`0`) or error (`NaN`). -Function AI_SendToAmp(device, headStage, mode, func, value, [checkBeforeWrite, usePrefixes, selectAmp]) - string device - variable headStage, mode, func, value - variable checkBeforeWrite, usePrefixes, selectAmp +Function AI_SendToAmp(string device, variable headStage, variable mode, variable func, variable value, [variable checkBeforeWrite, variable usePrefixes, variable selectAmp]) variable ret, headstageMode, scale string str @@ -1450,9 +1415,7 @@ End /// before using, some callers might be able to skip it. /// /// @return 0 on success, 1 when the headstage does not have an amplifier connected or it could not be selected -Function AI_EnsureCorrectMode(device, headStage, [selectAmp]) - string device - variable headStage, selectAmp +Function AI_EnsureCorrectMode(string device, variable headStage, [variable selectAmp]) variable serial, channel, storedMode, setMode, ampConnectionState @@ -1493,9 +1456,7 @@ End /// /// @param device device /// @param sweepNo data wave sweep number -Function AI_FillAndSendAmpliferSettings(device, sweepNo) - string device - variable sweepNo +Function AI_FillAndSendAmpliferSettings(string device, variable sweepNo) variable i, axonSerial, channel, ampConnState, clampMode string mccSerial @@ -1608,8 +1569,7 @@ End /// The data is inserted into `ChanAmpAssign` and `ChanAmpAssignUnit` /// /// @return number of connected amplifiers -Function AI_QueryGainsFromMCC(device) - string device +Function AI_QueryGainsFromMCC(string device) variable clampMode, old_ClampMode, i, numConnAmplifiers, clampModeSwitchAllowed variable DAGain, ADGain @@ -1661,6 +1621,7 @@ End /// @brief Create the amplifier connection waves Function AI_FindConnectedAmps() + string list IH_RemoveAmplifierConnWaves() @@ -1718,16 +1679,12 @@ End #else // AMPLIFIER_XOPS_PRESENT -Function AI_GetHoldingCommand(device, headstage) - string device - variable headstage +Function AI_GetHoldingCommand(string device, variable headstage) DEBUGPRINT("Unimplemented") End -Function AI_GetMode(device, headstage) - string device - variable headstage +Function AI_GetMode(string device, variable headstage) DEBUGPRINT("Unimplemented") End @@ -1748,45 +1705,32 @@ static Function AI_SwitchAxonAmpMode() DEBUGPRINT("Unimplemented") End -Function AI_SelectMultiClamp(device, headStage) - string device - variable headStage +Function AI_SelectMultiClamp(string device, variable headStage) DEBUGPRINT("Unimplemented") End -Function AI_SetClampMode(device, headStage, mode, [zeroStep]) - string device - variable headStage - variable mode, zeroStep +Function AI_SetClampMode(string device, variable headStage, variable mode, [variable zeroStep]) DEBUGPRINT("Unimplemented") End -Function AI_SendToAmp(device, headStage, mode, func, value, [checkBeforeWrite, usePrefixes, selectAmp]) - string device - variable headStage, mode, func, value - variable checkBeforeWrite, usePrefixes, selectAmp +Function AI_SendToAmp(string device, variable headStage, variable mode, variable func, variable value, [variable checkBeforeWrite, variable usePrefixes, variable selectAmp]) DEBUGPRINT("Unimplemented") End -Function AI_EnsureCorrectMode(device, headStage, [selectAmp]) - string device - variable headStage, selectAmp +Function AI_EnsureCorrectMode(string device, variable headStage, [variable selectAmp]) DEBUGPRINT("Unimplemented") End -Function AI_FillAndSendAmpliferSettings(device, sweepNo) - string device - variable sweepNo +Function AI_FillAndSendAmpliferSettings(string device, variable sweepNo) DEBUGPRINT("Unimplemented") End -Function AI_QueryGainsFromMCC(device) - string device +Function AI_QueryGainsFromMCC(string device) DEBUGPRINT("Unimplemented") End diff --git a/Packages/MIES/MIES_AnalysisBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser.ipf index 1dbbdef099..d4f3f8adbc 100644 --- a/Packages/MIES/MIES_AnalysisBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser.ipf @@ -210,8 +210,7 @@ End /// @brief save deviceList to wave /// @return created wave. -Function/WAVE AB_SaveDeviceList(deviceList, dataFolder) - string deviceList, dataFolder +Function/WAVE AB_SaveDeviceList(string deviceList, string dataFolder) variable numDevices WAVE/T wv = GetAnalysisDeviceWave(dataFolder) @@ -512,7 +511,7 @@ static Function AB_FillListWave(string diskLocation, string fileName, string dev list[index][%'#headstages'][0] = "unknown" endif - WAVE/T/Z settingsText = GetLastSetting(textualValues, sweepNo, "Stim Wave Name", DATA_ACQUISITION_MODE) + WAVE/Z/T settingsText = GetLastSetting(textualValues, sweepNo, "Stim Wave Name", DATA_ACQUISITION_MODE) numRows = WaveExists(settingsText) ? NUM_HEADSTAGES : 0 WAVE/Z settings = GetLastSetting(numericalValues, sweepNo, "Set Sweep Count", DATA_ACQUISITION_MODE) @@ -826,8 +825,7 @@ static Function AB_LoadTPStorageFromIgor(expFilePath, expFolder, device) return numWavesLoaded End -Function AB_LoadTPStorageFromNWB(nwbFilePath, expFolder, device) - string nwbFilePath, expFolder, device +Function AB_LoadTPStorageFromNWB(string nwbFilePath, string expFolder, string device) variable h5_fileID, testpulseGroup, numEntries, i string dataFolderPath, list, name, groupName @@ -1740,10 +1738,12 @@ static Function AB_LoadFromFile(loadType, [sweepBrowserDFR]) End Function AB_FreeWorkingDFs(WAVE/T relativeDFPaths, variable actualSize) + AB_FreeOrAllocWorkingDF(relativeDFPaths, actualSize, 1) End Function AB_AllocWorkingDFs(WAVE/T relativeDFPaths, variable actualSize) + AB_FreeOrAllocWorkingDF(relativeDFPaths, actualSize, 0) End @@ -2036,7 +2036,7 @@ static Function AB_LoadSweepFromNWBgeneric(h5_groupID, nwbVersion, channelList, configSweep[numEntries][%type] = p.channelType configSweep[numEntries][%number] = p.channelNumber configSweep[numEntries][%timeMS] = trunc(DimDelta(loaded, ROWS) * ONE_TO_MILLI) - configSweep[numEntries][3] = -1 // -1 for faked Config_Sweeps Waves + configSweep[numEntries][3] = -1 // -1 for faked Config_Sweeps Waves // set unit in config_wave from WaveNote of loaded dataset Note/K configSweep, AddListItem(WaveUnits(loaded, COLS), Note(configSweep), ";", Inf) @@ -2134,7 +2134,7 @@ static Function AB_LoadSweepFromIgor(string discLocation, string expFolder, DFRE numChannels = DimSize(sweepT, ROWS) for(i = 0; i < numChannels; i += 1) [componentsDataPath, channelName] = SplitTextSweepElement(sweepT[i]) - sweepT[i] = channelName + sweepT[i] = channelName endfor channelWaveList = TextWaveToList(sweepT, ";") DFREF sweepComponentsDFR = NewFreeDataFolder() @@ -2692,6 +2692,7 @@ static Function AB_CheckPanelVersion(string panel) End Function AB_BrowserStartupSettings() + string panel panel = AB_GetPanelName() @@ -2716,8 +2717,7 @@ Function AB_BrowserStartupSettings() End /// @brief Button "Expand all" -Function AB_ButtonProc_ExpandAll(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_ExpandAll(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventcode) case 2: @@ -2731,8 +2731,7 @@ Function AB_ButtonProc_ExpandAll(ba) : ButtonControl End /// @brief Button "Collapse all" -Function AB_ButtonProc_CollapseAll(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_CollapseAll(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: @@ -2746,8 +2745,7 @@ Function AB_ButtonProc_CollapseAll(ba) : ButtonControl End /// @brief Button "Load Sweeps" -Function AB_ButtonProc_LoadSweeps(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_LoadSweeps(STRUCT WMButtonAction &ba) : ButtonControl variable oneValidSweep string panel @@ -2774,8 +2772,7 @@ Function AB_ButtonProc_LoadSweeps(ba) : ButtonControl End /// @brief Button "Load Both" -Function AB_ButtonProc_LoadBoth(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_LoadBoth(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventcode) case 2: @@ -2787,8 +2784,7 @@ Function AB_ButtonProc_LoadBoth(ba) : ButtonControl End /// @brief Button "Load Stimsets" -Function AB_ButtonProc_LoadStimsets(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_LoadStimsets(STRUCT WMButtonAction &ba) : ButtonControl variable oneValidStimset @@ -2807,8 +2803,7 @@ Function AB_ButtonProc_LoadStimsets(ba) : ButtonControl End /// @brief Button "Refresh" -Function AB_ButtonProc_Refresh(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_Refresh(STRUCT WMButtonAction &ba) : ButtonControl variable size, index, refreshIndex string entry @@ -2859,8 +2854,7 @@ Function AB_ButtonProc_Refresh(ba) : ButtonControl End /// @brief Button "Open folder(s)" -Function AB_ButtonProc_OpenFolders(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_OpenFolders(STRUCT WMButtonAction &ba) : ButtonControl string symbPath, folder variable size, i @@ -2894,8 +2888,7 @@ Function AB_ButtonProc_OpenFolders(ba) : ButtonControl End /// @brief Button "Remove folder(s)" -Function AB_ButtonProc_Remove(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_Remove(STRUCT WMButtonAction &ba) : ButtonControl variable size, i @@ -2923,8 +2916,7 @@ End /// @brief Button "Add folder" /// Display dialog box for choosing a folder and call AB_ScanFolder() -Function AB_ButtonProc_AddFolder(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_AddFolder(STRUCT WMButtonAction &ba) : ButtonControl string baseFolder, folder variable size @@ -2962,8 +2954,7 @@ End /// @brief Button "Add files" /// Display dialog box for choosing files and call AB_AddFolder() -Function AB_ButtonProc_AddFiles(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_AddFiles(STRUCT WMButtonAction &ba) : ButtonControl string baseFolder, symbPath, fileFilters, fNum, message, fileList variable i, size, index @@ -3046,8 +3037,7 @@ static Function AB_SaveSourceListInSettings() End /// @brief Button "Select same stim set sweeps" -Function AB_ButtonProc_SelectStimSets(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_SelectStimSets(STRUCT WMButtonAction &ba) : ButtonControl variable numEntries, i string selectedStimSet @@ -3090,8 +3080,7 @@ Function AB_ButtonProc_SelectStimSets(ba) : ButtonControl End /// @brief main ListBox list_experiment_contents -Function AB_ListBoxProc_ExpBrowser(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function AB_ListBoxProc_ExpBrowser(STRUCT WMListboxAction &lba) : ListBoxControl variable mask, numRows, row, col @@ -3169,8 +3158,7 @@ static Function AB_UpdateColors() End /// @brief Button "Open comment NB" -Function AB_ButtonProc_OpenCommentNB(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_OpenCommentNB(STRUCT WMButtonAction &ba) : ButtonControl variable row, mapIndex string device, fileName, dataFolder, discLocation @@ -3223,8 +3211,7 @@ Function AB_ButtonProc_OpenCommentNB(ba) : ButtonControl return 0 End -Function AB_ButtonProc_ResaveAsNWB(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AB_ButtonProc_ResaveAsNWB(STRUCT WMButtonAction &ba) : ButtonControl variable row, i, index, overwrite string fileType, discLocation, experiment, win @@ -3510,7 +3497,7 @@ Function/S AB_GetStimsetList(string fileType, string discLocation, string dataFo DFREF dfr = GetAnalysisLabNBFolder(dataFolder, device) WAVE/SDFR=dfr $LBN_NUMERICAL_VALUES_NAME - WAVE/SDFR=dfr/T $LBN_TEXTUAL_VALUES_NAME + WAVE/T/SDFR=dfr $LBN_TEXTUAL_VALUES_NAME return AB_GetStimsetFromSweepGeneric(sweep, numericalValues, textualValues) End @@ -3567,9 +3554,7 @@ End /// numericalValues and textualValues are generated from device /// /// @returns list of stimsets -Function/S AB_GetStimsetFromPanel(device, sweep) - string device - variable sweep +Function/S AB_GetStimsetFromPanel(string device, variable sweep) WAVE numericalValues = GetLBNumericalValues(device) WAVE/T textualValues = GetLBTextualValues(device) @@ -3577,8 +3562,7 @@ Function/S AB_GetStimsetFromPanel(device, sweep) return AB_GetStimsetFromSweepGeneric(sweep, numericalValues, textualValues) End -Function AB_WindowHook(s) - STRUCT WMWinHookStruct &s +Function AB_WindowHook(STRUCT WMWinHookStruct &s) switch(s.eventCode) case EVENT_WINDOW_HOOK_KILL: diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf index f2e5e60690..8a48b44419 100644 --- a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf @@ -15,8 +15,7 @@ static Function/WAVE SB_GetSweepBrowserMapFromGraph(win) return GetSweepBrowserMap(SB_GetSweepBrowserFolder(win)) End -Function/DF SB_GetSweepBrowserFolder(win) - string win +Function/DF SB_GetSweepBrowserFolder(string win) return BSP_GetFolder(win, MIES_BSP_PANEL_FOLDER) End @@ -74,9 +73,7 @@ Function/DF SB_GetSweepDataFolder(WAVE/T sweepMap, [variable sweepNo, variable i return GetAnalysisSweepPath(dataFolder, device) End -Function/DF SB_GetSweepDataPathFromIndex(sweepBrowserDFR, mapIndex) - DFREF sweepBrowserDFR - variable mapIndex +Function/DF SB_GetSweepDataPathFromIndex(DFREF sweepBrowserDFR, variable mapIndex) string device, expFolder variable sweep @@ -98,9 +95,7 @@ Function/DF SB_GetSweepDataPathFromIndex(sweepBrowserDFR, mapIndex) return $GetAnalysisSweepDataPathAS(expFolder, device, sweep) End -Function SB_GetIndexFromSweepDataPath(win, dataDFR) - string win - DFREF dataDFR +Function SB_GetIndexFromSweepDataPath(string win, DFREF dataDFR) variable mapIndex, sweepNo string device, expFolder, sweepFolder @@ -178,8 +173,7 @@ End /// graph originated from /// /// @param graph sweep browser name -Function/S SB_GetListOfExperiments(graph) - string graph +Function/S SB_GetListOfExperiments(string graph) WAVE/T sweepMap = SB_GetSweepBrowserMapFromGraph(graph) @@ -232,8 +226,7 @@ End /// @param graph name of main window or external subwindow in SweepBrowser /// @param channel type of the channel, one of #XOP_CHANNEL_NAMES /// @param experiment [optional, defaults to all] name of the experiment the channel wave should originate from -Function/WAVE SB_GetChannelInfoFromGraph(graph, channel, [experiment]) - string graph, channel, experiment +Function/WAVE SB_GetChannelInfoFromGraph(string graph, string channel, [string experiment]) variable i, j, numEntries, idx, numWaves, channelNumber string list, headstage, path @@ -307,8 +300,7 @@ Function/WAVE SB_GetChannelInfoFromGraph(graph, channel, [experiment]) return channelMap End -Function SB_UpdateSweepPlot(win) - string win +Function SB_UpdateSweepPlot(string win) string device, dataFolder, graph, scPanel, lbPanel, experiment variable mapIndex, i, numEntries, sweepNo, traceIndex, currentSweep @@ -331,7 +323,7 @@ Function SB_UpdateSweepPlot(win) WAVE axesProps = GetAxesProperties(graph) - WAVE/T/Z cursorInfos = GetCursorInfos(graph) + WAVE/Z/T cursorInfos = GetCursorInfos(graph) RemoveTracesFromGraph(graph) RemoveFreeAxisFromGraph(graph) TUD_Clear(graph, recursive = 0) @@ -377,10 +369,7 @@ Function SB_UpdateSweepPlot(win) SetAxesProperties(graph, axesProps) End -Function SB_AddToSweepBrowser(sweepBrowser, fileName, dataFolder, device, sweep) - DFREF sweepBrowser - string fileName, dataFolder, device - variable sweep +Function SB_AddToSweepBrowser(DFREF sweepBrowser, string fileName, string dataFolder, string device, variable sweep) variable index string sweepStr = num2str(sweep) @@ -445,8 +434,7 @@ Function/DF SB_OpenSweepBrowser([variable mode]) return sweepBrowserDFR End -Function/S SB_GetSweepList(win) - string win +Function/S SB_GetSweepList(string win) string list = "", str variable numRows, i @@ -482,8 +470,7 @@ End /// @brief Returns a numeric wave with all sweep numbers /// /// Can contain duplicates! -Function/WAVE SB_GetPlainSweepList(win) - string win +Function/WAVE SB_GetPlainSweepList(string win) variable numRows @@ -636,8 +623,7 @@ Function/WAVE SB_GetLogbookWave(string win, variable logbookType, variable logbo endswitch End -Function SB_PopupMenuSelectSweep(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function SB_PopupMenuSelectSweep(STRUCT WMPopupAction &pa) : PopupMenuControl string win, bsPanel variable newSweep, newIndex @@ -664,8 +650,7 @@ Function SB_PopupMenuSelectSweep(pa) : PopupMenuControl endswitch End -Function SB_ButtonProc_ExportTraces(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function SB_ButtonProc_ExportTraces(STRUCT WMButtonAction &ba) : ButtonControl string graph @@ -680,6 +665,7 @@ Function SB_ButtonProc_ExportTraces(ba) : ButtonControl End Function SB_AddSweepToGraph(string win, variable index) + STRUCT TiledGraphSettings tgs variable sweepNo, traceIndex diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf index 151e38a6d7..07b6e48a4c 100644 --- a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf @@ -89,9 +89,7 @@ static Function SBE_FillExportSettings(win, sett) End /// @brief Return a list of possible axes for the export panel -Function/S SBE_GetSelectedAxis(graphPopup, axisOrientation) - string graphPopup - variable axisOrientation +Function/S SBE_GetSelectedAxis(string graphPopup, variable axisOrientation) string graph string list = "New;" @@ -227,8 +225,7 @@ static Function/WAVE SBE_GetPulseStartTimesForSel() End /// @brief Display the export panel -Function SBE_ShowExportPanel(sourceWindow) - string sourceWindow +Function SBE_ShowExportPanel(string sourceWindow) string panel = SBE_EXPORT_PANEL @@ -333,10 +330,10 @@ static Function SBE_ExportSweepBrowser(sett) endX = pulseStartTimes[sett.numPulses] + sett.postLastPulse clipXRange = 1 elseif(sett.useCursorRange) - xcsrA = xcsr(A, sett.sourceGraph) - xcsrB = xcsr(B, sett.sourceGraph) + xcsrA = xcsr(A, sett.sourceGraph) + xcsrB = xcsr(B, sett.sourceGraph) [beginX, endX] = MinMax(xcsrA, xcsrB) - clipXRange = 1 + clipXRange = 1 elseif(isFinite(sett.manualRangeBegin) && IsFinite(sett.manualRangeEnd)) beginX = sett.manualRangeBegin endX = sett.manualRangeEnd @@ -564,8 +561,7 @@ static Function SBE_ExportSweepBrowser(sett) Execute/P/Q "SetDataFolder " + saveDFR End -Function SBE_PopMenu_ExportTargetAxis(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function SBE_PopMenu_ExportTargetAxis(STRUCT WMPopupAction &pa) : PopupMenuControl string popStr, win, list @@ -595,8 +591,7 @@ Function SBE_PopMenu_ExportTargetAxis(pa) : PopupMenuControl return 0 End -Function SBE_PopMenu_ExportTargetGraph(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function SBE_PopMenu_ExportTargetGraph(STRUCT WMPopupAction &pa) : PopupMenuControl string popStr, win @@ -617,8 +612,7 @@ Function SBE_PopMenu_ExportTargetGraph(pa) : PopupMenuControl return 0 End -Function SBE_ButtonProc_PerformExport(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function SBE_ButtonProc_PerformExport(STRUCT WMButtonAction &ba) : ButtonControl string win @@ -635,8 +629,7 @@ Function SBE_ButtonProc_PerformExport(ba) : ButtonControl return 0 End -Function SBE_CheckProc_UsePulseForXRange(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function SBE_CheckProc_UsePulseForXRange(STRUCT WMCheckboxAction &cba) : CheckBoxControl string listXManual, listXPulses, win @@ -661,8 +654,7 @@ Function SBE_CheckProc_UsePulseForXRange(cba) : CheckBoxControl return 0 End -Function SBE_PopMenuProc_PulsesADTrace(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function SBE_PopMenuProc_PulsesADTrace(STRUCT WMPopupAction &pa) : PopupMenuControl variable numPulses diff --git a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf index 94db8a747e..6fb64ad748 100644 --- a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf @@ -29,9 +29,7 @@ /// depending on the hardware /// /// @return headstage or NaN (for non-associated channels) -Function AFH_GetHeadstageFromADC(device, AD) - string device - variable AD +Function AFH_GetHeadstageFromADC(string device, variable AD) WAVE channelClampMode = GetChannelClampMode(device) @@ -45,9 +43,7 @@ End /// depending on the hardware /// /// @return headstage or NaN (for non-associated channels) -Function AFH_GetHeadstageFromDAC(device, DA) - string device - variable DA +Function AFH_GetHeadstageFromDAC(string device, variable DA) WAVE channelClampMode = GetChannelClampMode(device) @@ -60,9 +56,7 @@ End /// @param headstage headstage in the range [0,8[ /// /// @return AD channel or NaN (for non-associated channels) -Function AFH_GetADCFromHeadstage(device, headstage) - string device - variable headstage +Function AFH_GetADCFromHeadstage(string device, variable headstage) variable i, retHeadstage @@ -82,9 +76,7 @@ End /// @param headstage headstage in the range [0,8[ /// /// @return DA channel or NaN (for non-associated channels) -Function AFH_GetDACFromHeadstage(device, headstage) - string device - variable headstage +Function AFH_GetDACFromHeadstage(string device, variable headstage) variable i, retHeadstage @@ -105,9 +97,7 @@ End /// `GetDAQConfigWave(device)` to get that wave. /// @param channelNumber hardware channel number /// @param channelType channel type, one of @ref XopChannelConstants -threadsafe Function AFH_GetDAQDataColumn(DAQConfigWave, channelNumber, channelType) - WAVE DAQConfigWave - variable channelNumber, channelType +threadsafe Function AFH_GetDAQDataColumn(WAVE DAQConfigWave, variable channelNumber, variable channelType) variable numRows, i @@ -138,8 +128,7 @@ End /// /// @param DAQConfigWave DAQ configuration wave, most users need to call /// `GetDAQConfigWave(device)` to get that wave. -threadsafe Function/WAVE AFH_GetChannelUnits(DAQConfigWave) - WAVE DAQConfigWave +threadsafe Function/WAVE AFH_GetChannelUnits(WAVE DAQConfigWave) string units @@ -158,9 +147,7 @@ End /// `GetDAQConfigWave(device)` to get that wave. /// @param channelNumber hardware channel number /// @param channelType channel type, one of @ref XopChannelConstants -Function/S AFH_GetChannelUnit(DAQConfigWave, channelNumber, channelType) - WAVE DAQConfigWave - variable channelNumber, channelType +Function/S AFH_GetChannelUnit(WAVE DAQConfigWave, variable channelNumber, variable channelType) variable idx @@ -177,8 +164,7 @@ End /// @brief Return the sweep number of the last acquired sweep /// /// @return a non-negative integer sweep number or NaN if there is no data -Function AFH_GetLastSweepAcquired(device) - string device +Function AFH_GetLastSweepAcquired(string device) WAVE/Z sweeps = AFH_GetSweeps(device) @@ -191,6 +177,7 @@ End /// @brief Return a numeric wave with all acquired sweep numbers, $"" if there is none Function/WAVE AFH_GetSweeps(string device) + string list DFREF dfr = GetDeviceDataPath(device) @@ -210,8 +197,7 @@ End /// @brief Return the sweep wave of the last acquired sweep /// /// @return an existing sweep wave or an invalid wave reference if there is no data -Function/WAVE AFH_GetLastSweepWaveAcquired(device) - string device +Function/WAVE AFH_GetLastSweepWaveAcquired(string device) return GetSweepWave(device, AFH_GetLastSweepAcquired(device)) End @@ -274,9 +260,7 @@ End /// belong to the same RA cycle /// /// Return an invalid wave reference if not all required labnotebook entries are available -threadsafe Function/WAVE AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) - WAVE numericalValues - variable sweepNo +threadsafe Function/WAVE AFH_GetSweepsFromSameRACycle(WAVE numericalValues, variable sweepNo) if(!IsValidSweepNumber(sweepNo)) return $"" @@ -312,9 +296,7 @@ End /// belong to the same stimset cycle /// /// Return an invalid wave reference if not all required labnotebook entries are available -threadsafe Function/WAVE AFH_GetSweepsFromSameSCI(numericalValues, sweepNo, headstage) - WAVE numericalValues - variable sweepNo, headstage +threadsafe Function/WAVE AFH_GetSweepsFromSameSCI(WAVE numericalValues, variable sweepNo, variable headstage) if(!IsValidSweepNumber(sweepNo)) return $"" @@ -403,11 +385,7 @@ End /// @param headstageOrChannelNum headstage [0, NUM_HEADSTAGES[ or channel number for TTL channels [0, NUM_DA_TTL_CHANNELS] /// @param channelType One of @ref XopChannelConstants /// @param config [optional, defaults to config wave of the sweep returned by GetConfigWave()] config wave -Function/WAVE AFH_ExtractOneDimDataFromSweep(device, sweep, headstageOrChannelNum, channelType, [config]) - string device - WAVE sweep - variable headstageOrChannelNum, channelType - WAVE config +Function/WAVE AFH_ExtractOneDimDataFromSweep(string device, WAVE sweep, variable headstageOrChannelNum, variable channelType, [WAVE config]) variable channelNum, col @@ -496,9 +474,7 @@ End /// /// @param func Analysis function `V3` which must be valid and existing /// @param mode Bit mask values from @ref GetListOfParamsModeFlags -Function/S AFH_GetListOfAnalysisParams(func, mode) - string func - variable mode +Function/S AFH_GetListOfAnalysisParams(string func, variable mode) string params, re @@ -555,8 +531,7 @@ End /// /// @ingroup AnalysisFunctionParameterHelpers /// @param params serialized parameters, usually just #AnalysisFunction_V3.params -Function/S AFH_GetListOfAnalysisParamNames(params) - string params +Function/S AFH_GetListOfAnalysisParamNames(string params) string entry, name string list = "" @@ -602,10 +577,7 @@ End /// aborts if the type does not match. Implies `typeCheck = true`. /// @ingroup AnalysisFunctionParameterHelpers /// @return one of @ref AnalysisFunctionParameterTypes or an empty string -Function/S AFH_GetAnalysisParamType(name, params, [typeCheck, expectedType]) - string name, params - variable typeCheck - string expectedType +Function/S AFH_GetAnalysisParamType(string name, string params, [variable typeCheck, string expectedType]) string typeAndValue string type = "" @@ -651,9 +623,7 @@ End /// @param defValue [optional, defaults to `NaN`] return this value if the parameter could not be found /// /// @ingroup AnalysisFunctionParameterHelpers -Function AFH_GetAnalysisParamNumerical(name, params, [defValue]) - string name, params - variable defValue +Function AFH_GetAnalysisParamNumerical(string name, string params, [variable defValue]) string contents @@ -680,10 +650,7 @@ End /// @param percentDecoded [optional, defaults to true] if the return value should be percent decoded or not. /// /// @ingroup AnalysisFunctionParameterHelpers -Function/S AFH_GetAnalysisParamTextual(name, params, [defValue, percentDecoded]) - string name, params - string defValue - variable percentDecoded +Function/S AFH_GetAnalysisParamTextual(string name, string params, [string defValue, variable percentDecoded]) string contents @@ -722,9 +689,7 @@ End /// /// @return wave reference to free numeric wave, or invalid wave ref in case the /// parameter could not be found. -Function/WAVE AFH_GetAnalysisParamWave(name, params, [defValue]) - string name, params - WAVE defValue +Function/WAVE AFH_GetAnalysisParamWave(string name, string params, [WAVE defValue]) string contents @@ -754,10 +719,7 @@ End /// /// @return wave reference to free text wave, or invalid wave ref in case the /// parameter could not be found. -Function/WAVE AFH_GetAnalysisParamTextWave(name, params, [defValue, percentDecoded]) - string name, params - WAVE/T defValue - variable percentDecoded +Function/WAVE AFH_GetAnalysisParamTextWave(string name, string params, [WAVE/T defValue, variable percentDecoded]) string contents @@ -792,8 +754,7 @@ End /// @brief Check if the given name is a valid user parameter name /// /// @ingroup AnalysisFunctionParameterHelpers -Function AFH_IsValidAnalysisParameter(name) - string name +Function AFH_IsValidAnalysisParameter(string name) return IsValidObjectName(name) End @@ -801,8 +762,7 @@ End /// @brief Check if the given type is a valid user parameter type /// /// @ingroup AnalysisFunctionParameterHelpers -Function AFH_IsValidAnalysisParamType(type) - string type +Function AFH_IsValidAnalysisParamType(string type) return !IsEmpty(type) && WhichListItem(type, ANALYSIS_FUNCTION_PARAMS_TYPES, ";", 0, 0) != -1 End @@ -815,9 +775,7 @@ End /// aborts if the type does not match. /// /// @ingroup AnalysisFunctionParameterHelpers -Function/S AFH_GetAnalysisParameter(name, params, [expectedType]) - string name, params - string expectedType +Function/S AFH_GetAnalysisParameter(string name, string params, [string expectedType]) string type, value @@ -838,8 +796,7 @@ End /// @ingroup AnalysisFunctionParameterHelpers /// /// @return serialized parameters with `name` removed -Function/S AFH_RemoveAnalysisParameter(name, params) - string name, params +Function/S AFH_RemoveAnalysisParameter(string name, string params) ASSERT(AFH_IsValidAnalysisParameter(name), "Name is not a valid analysis parameter") return GrepList(params, "(?i)\\Q" + name + "\\E" + ":.*", 1, ",") @@ -860,6 +817,7 @@ End /// /// @return multiline error messages, an empty string on success Function/S AFH_CheckAnalysisParameter(string genericFunc, STRUCT CheckParametersStruct &s) + string allNames, presentNames, message, name string reqNamesAndTypesFromFunc, reqNames string optNamesAndTypesFromFunc, optNames @@ -1010,7 +968,7 @@ End /// @param wv [optional] wave parameter can be numeric or text Function AFH_AddAnalysisParameter(string setName, string name, [variable var, string str, WAVE wv]) - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(setName) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(setName) ASSERT(WaveExists(WPT), "Missing stimset") ASSERT(ParamIsDefault(var) + ParamIsDefault(str) + ParamIsDefault(wv) == 2, "Expected one of var, str or wv") @@ -1124,6 +1082,7 @@ End /// /// @return headstage in the range [0, NUM_HEADSTAGES], or NaN if nothing could be found Function AFH_GetHeadstageFromActiveADC(WAVE/Z statusADC, variable activeADCount) + variable i, s ASSERT(DimSize(statusADC, ROWS) == LABNOTEBOOK_LAYER_COUNT, "Invalid number of rows") diff --git a/Packages/MIES/MIES_AnalysisFunctionManagement.ipf b/Packages/MIES/MIES_AnalysisFunctionManagement.ipf index d9ead5652d..6cf8780abe 100644 --- a/Packages/MIES/MIES_AnalysisFunctionManagement.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionManagement.ipf @@ -12,9 +12,7 @@ /// @brief Call the analysis function associated with the stimset from the wavebuilder /// /// @return Valid analysis function return types, zero otherwise, see also @ref AnalysisFunctionReturnTypes -Function AFM_CallAnalysisFunctions(device, eventType) - string device - variable eventType +Function AFM_CallAnalysisFunctions(string device, variable eventType) variable i, valid_f1, valid_f2, valid_f3, ret, DAC, sweepsInSet, hwIsSutter variable realDataLengthAD, realDataLengthDA, sweepNo, fifoPositionAD, fifoPositionDA, sampleIntDA, sampleIntAD @@ -210,8 +208,7 @@ End /// @brief Update the analysis function storage wave from the stimset waves notes /// /// We are called earlier than DAP_CheckSettings() so we can not rely on anything setup in a sane way. -Function AFM_UpdateAnalysisFunctionWave(device) - string device +Function AFM_UpdateAnalysisFunctionWave(string device) variable i, j, DAC string setName, possibleFunctions, func diff --git a/Packages/MIES/MIES_AnalysisFunctionPrototypes.ipf b/Packages/MIES/MIES_AnalysisFunctionPrototypes.ipf index 37c6615498..6fc5c1b103 100644 --- a/Packages/MIES/MIES_AnalysisFunctionPrototypes.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionPrototypes.ipf @@ -20,11 +20,7 @@ /// @param headStage active headstage index /// /// @return ignored -Function AFP_ANALYSIS_FUNC_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function AFP_ANALYSIS_FUNC_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) ASSERT(0, "Prototype function which must not be called") End @@ -40,11 +36,7 @@ End /// higher due to alignment requirements of the data acquisition hardware. `NaN` for #PRE_DAQ_EVENT events. /// /// @return see @ref AnalysisFunction_V3DescriptionTable -Function AFP_ANALYSIS_FUNC_V2(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function AFP_ANALYSIS_FUNC_V2(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) ASSERT(0, "Prototype function which must not be called") End @@ -53,9 +45,7 @@ End /// @param s analysis event structure /// /// @return see @ref AnalysisFunction_V3DescriptionTable -Function AFP_ANALYSIS_FUNC_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function AFP_ANALYSIS_FUNC_V3(string device, STRUCT AnalysisFunction_V3 &s) ASSERT(0, "Prototype function which must not be called") End @@ -69,8 +59,7 @@ End /// @brief Prototype function for the user supplied parameter help functions /// -Function/S AFP_PARAM_HELP_GETTER_V3(name) - string name +Function/S AFP_PARAM_HELP_GETTER_V3(string name) ASSERT(0, "Prototype function which must not be called") End diff --git a/Packages/MIES/MIES_AnalysisFunctions.ipf b/Packages/MIES/MIES_AnalysisFunctions.ipf index db7f74b4b1..09d76f4e63 100644 --- a/Packages/MIES/MIES_AnalysisFunctions.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions.ipf @@ -174,30 +174,20 @@ static Constant ITI_LOCAL = 15 ///< Inter-trial-i static Constant POST_DELAY = 150 ///< Delay after stimulation event in which no other event can occur in ms ///@} -Function TestAnalysisFunction_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function TestAnalysisFunction_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) printf "Analysis function version 1 called: device %s, eventType \"%s\", headstage %d\r", device, StringFromList(eventType, EVENT_NAME_LIST), headStage printf "Next sweep: %d\r", DAG_GetNumericalValue(device, "SetVar_Sweep") End -Function TestAnalysisFunction_V2(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function TestAnalysisFunction_V2(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) printf "Analysis function version 2 called: device %s, eventType \"%s\", headstage %d\r", device, StringFromList(eventType, EVENT_NAME_LIST), headStage return 0 End -Function TestAnalysisFunction_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function TestAnalysisFunction_V3(string device, STRUCT AnalysisFunction_V3 &s) string names, name, type variable numEntries, i @@ -223,7 +213,7 @@ Function TestAnalysisFunction_V3(device, s) WAVE/Z wv = AFH_GetAnalysisParamWave(name, s.params) print wv case "textwave": - WAVE/T/Z wvText = AFH_GetAnalysisParamTextWave(name, s.params) + WAVE/Z/T wvText = AFH_GetAnalysisParamTextWave(name, s.params) print wvText break default: @@ -270,9 +260,7 @@ End /// @brief Measure the time between mid sweep calls /// /// Used mainly for debugging. -Function MeasureMidSweepTiming_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function MeasureMidSweepTiming_V3(string device, STRUCT AnalysisFunction_V3 &s) NVAR lastCall = $GetTemporaryVar() @@ -295,11 +283,7 @@ Function MeasureMidSweepTiming_V3(device, s) return 0 End -Function Enforce_VC(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function Enforce_VC(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) if(eventType != PRE_DAQ_EVENT) return 0 @@ -316,11 +300,7 @@ Function Enforce_VC(device, eventType, DAQDataWave, headStage, realDataLength) return 0 End -Function Enforce_IC(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function Enforce_IC(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) if(eventType != PRE_DAQ_EVENT) return 0 @@ -341,11 +321,7 @@ End // Starts with a pop-up menu to set initial parameters and then switches holding potential midway through total number of sweeps /// @brief Force active headstages into voltage clamp -Function SetStimConfig_Vclamp(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function SetStimConfig_Vclamp(string device, variable eventType, WAVE DAQDataWave, variable headStage) setVClampMode() @@ -354,11 +330,7 @@ Function SetStimConfig_Vclamp(device, eventType, DAQDataWave, headStage) End /// @brief Force active headstages into current clamp -Function SetStimConfig_Iclamp(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function SetStimConfig_Iclamp(string device, variable eventType, WAVE DAQDataWave, variable headStage) setIClampMode() @@ -367,11 +339,7 @@ Function SetStimConfig_Iclamp(device, eventType, DAQDataWave, headStage) End /// @brief Change holding potential midway through stim set -Function ChangeHoldingPotential(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function ChangeHoldingPotential(string device, variable eventType, WAVE DAQDataWave, variable headStage) variable SweepsRemaining = switchHolding(VM2_LOCAL) @@ -379,11 +347,7 @@ Function ChangeHoldingPotential(device, eventType, DAQDataWave, headStage) End /// @brief Print last Stim Set run and headstage mode and holding potential -Function LastStimSet(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function LastStimSet(string device, variable eventType, WAVE DAQDataWave, variable headStage) PGC_SetAndActivateControl(device, "check_Settings_TPAfterDAQ", val = CHECKBOX_SELECTED) @@ -425,9 +389,7 @@ End /// @param Scale Stimulus amplitude in mV /// @param Sweeps Number of sweeps /// @param ITI Inter-trial-interval -Function SetStimParam(stimSet, Vm1, Scale, Sweeps, ITI) - variable Vm1, scale, sweeps, ITI - string stimSet +Function SetStimParam(string stimSet, variable Vm1, variable Scale, variable Sweeps, variable ITI) setHolding(Vm1) PGC_SetAndActivateControl(DEFAULT_DEVICE, "Wave_DA_All", str = stimset) @@ -445,8 +407,7 @@ End /// @brief Set holding potential for active headstages /// /// @param Vm1 Holding potential -Function setHolding(Vm1) - variable Vm1 +Function setHolding(variable Vm1) variable i WAVE statusHS = DAG_GetChannelState(DEFAULT_DEVICE, CHANNEL_TYPE_HEADSTAGE) @@ -497,8 +458,7 @@ End /// Switch occurs after X/2 number of data sweeps. If X!/2 switchSweep = floor(X/2) /// /// @param Vm2 Holding potential to switch to -Function switchHolding(Vm2) - variable Vm2 +Function switchHolding(variable Vm2) variable numSweeps, SweepsRemaining, switchSweep, i, clampMode @@ -593,11 +553,7 @@ End /// the left over time at the 20th call. /// /// This function needs to be set for Pre DAQ, Mid Sweep and Post Sweep Event. -Function TestPrematureSweepStop(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function TestPrematureSweepStop(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) variable num SVAR temp = $GetTemporaryString() @@ -619,11 +575,7 @@ Function TestPrematureSweepStop(device, eventType, DAQDataWave, headStage, realD return 0 End -Function preDAQ_MP_mainConfig(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preDAQ_MP_mainConfig(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) ASSERT(eventType == PRE_DAQ_EVENT, "Invalid event type") @@ -634,11 +586,7 @@ Function preDAQ_MP_mainConfig(device, eventType, DAQDataWave, headStage, realDat PGC_SetAndActivateControl(device, "Check_DataAcq1_RepeatAcq", val = 1) End -Function preDAQ_MP_IfMixed(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preDAQ_MP_IfMixed(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) ASSERT(eventType == PRE_DAQ_EVENT, "Invalid event type") @@ -649,11 +597,7 @@ Function preDAQ_MP_IfMixed(device, eventType, DAQDataWave, headStage, realDataLe PGC_SetAndActivateControl(device, "Check_DataAcq1_RepeatAcq", val = 1) End -Function preDAQ_MP_ChirpBlowout(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preDAQ_MP_ChirpBlowout(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) ASSERT(eventType == PRE_DAQ_EVENT, "Invalid event type") @@ -673,11 +617,7 @@ End /// - Does currently nothing for "Mid Sweep" Event /// - Does not support DA/AD channels not associated with a MIES headstage (aka unassociated DA/AD Channels) /// - All active headstages must be in "Current Clamp" -Function AdjustDAScale(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function AdjustDAScale(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) variable val, index, DAC, ADC string ctrl, msg @@ -763,6 +703,7 @@ End /// /// Usually called by PSQ_AdjustDAScale(). Function FitResistance(string device, variable headstage, [variable showPlot, variable anaFuncType]) + variable deltaVCol, DAScaleCol, i, j, sweepNo, idx, numEntries variable lastWrittenSweep, sweepPassed string graph, textBoxString, trace, key @@ -948,9 +889,7 @@ End /// @param relative (optional) relative DAScale modifier /// @param offset (optional) offset DAScale value /// @param roundTopA (optional, defaults to false) round the set DAScale to integer pA values -Function SetDAScale(device, headstage, [absolute, relative, offset, roundTopA]) - string device - variable headstage, absolute, relative, offset, roundTopA +Function SetDAScale(string device, variable headstage, [variable absolute, variable relative, variable offset, variable roundTopA]) variable amps, DAC string DAUnit, ctrl, lbl @@ -990,6 +929,7 @@ End /// @brief Return a list of required parameters Function/S ReachTargetVoltage_GetParams() + return "[EnableIndexing:variable],[IndexingEndStimsetAllIC:string]" End @@ -1046,6 +986,7 @@ End /// - An inital DAScale of -20pA is used, a fixup value of -100pA is used on /// the next sweep if the measured resistance is smaller than 20MΩ Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s) + variable sweepNo, index, i, targetV, prevActiveHS, prevSendToAllAmp variable amps, result variable autoBiasCheck, holdingPotential, indexing @@ -1269,7 +1210,7 @@ Function/S SetControlInEvent_CheckParam(string name, STRUCT CheckParametersStruc return "Must be of type \"text wave\"" endif - WAVE/T/Z data = AFH_GetAnalysisParamTextWave(name, s.params) + WAVE/Z/T data = AFH_GetAnalysisParamTextWave(name, s.params) if(!WaveExists(data)) return "Does not hold anything." @@ -1327,9 +1268,7 @@ End /// /// \endrst /// -Function SetControlInEvent(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function SetControlInEvent(string device, STRUCT AnalysisFunction_V3 &s) string guiElements, guiElem, type, valueStr, event, msg, win, windowsWithGUIElement, databrowser, str variable numEntries, i, controlType, j, numTuples, numMatches, numWindows, k @@ -1375,7 +1314,7 @@ Function SetControlInEvent(device, s) endif endif - WAVE/T/Z data = AFH_GetAnalysisParamTextWave(guiElem, s.params) + WAVE/Z/T data = AFH_GetAnalysisParamTextWave(guiElem, s.params) ASSERT(WaveExists(data), "No payload") numTuples = DimSize(data, ROWS) diff --git a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf index d5a540452f..056dfc452c 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf @@ -40,8 +40,7 @@ static Function AD_GetColorForResultMessage(string result) End /// @brief Update the dashboards of the given sweepbrowser/databrowser -Function AD_Update(win) - string win +Function AD_Update(string win) string mainPanel variable numEntries, refTime @@ -196,8 +195,8 @@ static Function AD_FillWaves(win, list, info) WAVE/Z totalSweepsPresent = GetPlainSweepList(win) // as many sweeps as entries in numericalValuesWave/textualValuesWave - WAVE/WAVE/Z numericalValuesWave = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES) - WAVE/WAVE/Z textualValuesWave = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES) + WAVE/Z/WAVE numericalValuesWave = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES) + WAVE/Z/WAVE textualValuesWave = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES) if(!WaveExists(numericalValuesWave) || !WaveExists(textualValuesWave) || !WaveExists(totalSweepsPresent)) return 0 @@ -278,8 +277,8 @@ static Function AD_FillWaves(win, list, info) endif [anaFuncType, waMode] = AD_GetAnalysisFunctionType(numericalValues, anaFuncTypes, sweepNo, headstage) - anaFunc = anaFuncs[headstage] - stimset = stimsets[headstage] + anaFunc = anaFuncs[headstage] + stimset = stimsets[headstage] if(anaFuncType == INVALID_ANALYSIS_FUNCTION) passed = NaN @@ -472,7 +471,7 @@ End static Function/S AD_GetDAScaleOperationMode(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, variable headstage) - WAVE/T/Z params = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, "Function params (encoded)", headstage, DATA_ACQUISITION_MODE) + WAVE/Z/T params = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, "Function params (encoded)", headstage, DATA_ACQUISITION_MODE) // fallback to old names if(!WaveExists(params)) @@ -496,7 +495,7 @@ static Function/S AD_GetDAScaleFailMsg(numericalValues, textualValues, sweepNo, numPasses = PSQ_NumPassesInSet(numericalValues, PSQ_DA_SCALE, sweepNo, headstage) - WAVE/T/Z params = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, "Function params (encoded)", headstage, DATA_ACQUISITION_MODE) + WAVE/Z/T params = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, "Function params (encoded)", headstage, DATA_ACQUISITION_MODE) // fallback to old names if(!WaveExists(params)) @@ -1219,11 +1218,12 @@ End /// /// Requires that the sweep is displayed. Function AD_PlotBounds(string browser, variable sweepNo) + string key, graph, leftAxis variable outerRelativeBound, innerRelativeBound, baselineVoltage, lastX, headstage WAVE/Z numericalValues = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, sweepNumber = sweepNo) - WAVE/T/Z textualValues = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES, sweepNumber = sweepNo) + WAVE/Z/T textualValues = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES, sweepNumber = sweepNo) ASSERT(WaveExists(numericalValues) && WaveExists(textualValues), "Missing labnotebook") WAVE/Z statusHS = GetLastSetting(numericalValues, sweepNo, "Headstage Active", UNKNOWN_MODE) @@ -1252,7 +1252,7 @@ Function AD_PlotBounds(string browser, variable sweepNo) graph = GetMainWindow(browser) - WAVE/T/Z leftAxisMatches = TUD_GetUserDataAsWave(graph, "YAXIS", \ + WAVE/Z/T leftAxisMatches = TUD_GetUserDataAsWave(graph, "YAXIS", \ keys = {"channelType", "channelNumber", "sweepNumber"}, \ values = {"AD", num2str(statusADC[headstage]), num2str(sweepNo)}) ASSERT(WaveExists(leftAxisMatches) && DimSize(leftAxisMatches, ROWS) >= 1, "Could not find sweep displayed") @@ -1285,8 +1285,7 @@ Function AD_PlotBounds(string browser, variable sweepNo) ModifyGraph/W=$graph lstyle(chirpBoundLowerMin)=7, rgb(chirpBoundLowerMin)=(0, 0, 65535) End -Function AD_ListBoxProc(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function AD_ListBoxProc(STRUCT WMListboxAction &lba) : ListBoxControl switch(lba.eventCode) case 3: // double click @@ -1299,8 +1298,7 @@ Function AD_ListBoxProc(lba) : ListBoxControl return 0 End -Function AD_CheckProc_PassedSweeps(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function AD_CheckProc_PassedSweeps(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -1311,8 +1309,7 @@ Function AD_CheckProc_PassedSweeps(cba) : CheckBoxControl return 0 End -Function AD_CheckProc_FailedSweeps(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function AD_CheckProc_FailedSweeps(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -1323,8 +1320,7 @@ Function AD_CheckProc_FailedSweeps(cba) : CheckBoxControl return 0 End -Function AD_CheckProc_Toggle(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function AD_CheckProc_Toggle(STRUCT WMCheckboxAction &cba) : CheckBoxControl string win diff --git a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf index af89de5210..23d59020c0 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf @@ -276,9 +276,7 @@ End /// /// Chunks (10): /// - Region, 0-based -Function/WAVE MSQ_CreateOverrideResults(device, headstage, type) - string device - variable headstage, type +Function/WAVE MSQ_CreateOverrideResults(string device, variable headstage, variable type) variable DAC, numCols, numRows, numLayers, numChunks, typeOfWave string stimset @@ -306,7 +304,7 @@ Function/WAVE MSQ_CreateOverrideResults(device, headstage, type) numCols = NUM_HEADSTAGES numLayers = 10 numChunks = 10 - typeOfWave = 0 // text wave + typeOfWave = 0 // text wave break default: ASSERT(0, "invalid type") @@ -496,6 +494,7 @@ End /// @brief Return a list of required parameters for MSQ_FastRheoEst() Function/S MSQ_FastRheoEst_GetParams() + return "MaximumDAScale:variable," + \ "PostDAQDAScale:variable," + \ "PostDAQDAScaleFactor:variable," + \ @@ -504,8 +503,7 @@ Function/S MSQ_FastRheoEst_GetParams() "SamplingMultiplier:variable" End -Function/S MSQ_FastRheoEst_GetHelp(name) - string name +Function/S MSQ_FastRheoEst_GetHelp(string name) strswitch(name) case "SamplingMultiplier": @@ -596,9 +594,7 @@ End /// ---| |-------------------------------------------- /// /// @endverbatim -Function MSQ_FastRheoEst(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function MSQ_FastRheoEst(string device, STRUCT AnalysisFunction_V3 &s) variable totalOnsetDelay, setPassed, sweepPassed, multiplier, newDAScaleValue, found, val variable i, postDAQDAScale, postDAQDAScaleFactor, DAC, maxDAScale, allHeadstagesExceeded, minRheoOffset @@ -1048,11 +1044,11 @@ End /// @brief Require parameters from stimset Function/S MSQ_DAScale_GetParams() + return "DAScales:wave" End -Function/S MSQ_DAScale_GetHelp(name) - string name +Function/S MSQ_DAScale_GetHelp(string name) strswitch(name) case "DAScales": @@ -1092,9 +1088,7 @@ End /// .. image:: /dot/multi-patch-seq-dascale.svg /// \endrst /// -Function MSQ_DAScale(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function MSQ_DAScale(string device, STRUCT AnalysisFunction_V3 &s) variable i, index, ret, headstagePassed, val, sweepNo string msg, key, ctrl diff --git a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf index 953dcdcb52..d42cacb134 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf @@ -482,7 +482,7 @@ End /// @param device device /// @param spikePositionsLBN spike position of each pulse, ordered per headstage, for the current sweep /// @param minimumSpikePosition minimum allowed spike position -static Function/WAVE SC_SpikePositionQC(string device, WAVE/T/Z spikePositionsLBN, variable minimumSpikePosition) +static Function/WAVE SC_SpikePositionQC(string device, WAVE/Z/T spikePositionsLBN, variable minimumSpikePosition) string list, msg variable numPulses, i, j @@ -746,7 +746,7 @@ static Function SC_ReactToQCFailures(string device, variable sweepNo, string par case SC_SPIKE_COUNT_STATE_STR_MIXED: printf "The spike count on headstage %d in sweep %d is mixed (some pulses have too few, others too many)\n", i, sweepNo key = CreateAnaFuncLBNKey(SC_SPIKE_CONTROL, MSQ_FMT_LBN_SPIKE_COUNTS_STATE, query = 1) - WAVE/T/Z spikeCountsRAC = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, key, i, UNKNOWN_MODE) + WAVE/Z/T spikeCountsRAC = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, key, i, UNKNOWN_MODE) ASSERT(WaveExists(spikeCountsRAC), "Expected at least one sweep") WAVE/Z indizes = FindIndizes(spikeCountsRAC, str = SC_SPIKE_COUNT_STATE_STR_MIXED) ASSERT(WaveExists(indizes), "Could not find at least one mixed entry") @@ -772,6 +772,7 @@ static Function SC_ReactToQCFailures(string device, variable sweepNo, string par End Function/S SC_SpikeControl_GetParams() + return "AutoBiasBaselineModifier:variable," + \ "DAScaleModifier:variable," + \ "DAScaleOperator:string," + \ @@ -785,8 +786,7 @@ Function/S SC_SpikeControl_GetParams() "MinimumSpikePosition:variable" End -Function/S SC_SpikeControl_GetHelp(name) - string name +Function/S SC_SpikeControl_GetHelp(string name) strswitch(name) case "FailedPulseLevel": @@ -953,9 +953,7 @@ End /// Therefore the spike position will be 110 in `PA crd` which is one point after the end of the pulse. /// /// The graphs were made with http://asciiflow.com. -Function SC_SpikeControl(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function SC_SpikeControl(string device, STRUCT AnalysisFunction_V3 &s) variable i, index, ret, headstagePassed, sweepPassed, val, failedPulseLevel, maxTrialsAllowed, minimumSpikePosition variable DAC, setPassed, minTrials, maxTrials, skippedBack, idealNumberOfSpikes, rerunExceededResult diff --git a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf index 28067b5741..ee46d04f5d 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf @@ -193,9 +193,7 @@ static Constant PSQ_DS_DASCALE = 0x7 ///@} /// @brief Fills `s` according to the analysis function type -Function PSQ_GetPulseSettingsForType(type, s) - variable type - STRUCT PSQ_PulseSettings &s +Function PSQ_GetPulseSettingsForType(variable type, STRUCT PSQ_PulseSettings &s) string msg @@ -525,7 +523,7 @@ static Function PSQ_EvaluateBaselineProperties(string device, STRUCT AnalysisFun endif endif [chunkStartTimeMax, chunkLengthTime] = PSQ_GetBaselineChunkTimes(chunk, ps, totalOnsetDelay, durations) - baselineType = chunk ? PSQ_BL_POST_PULSE : PSQ_BL_PRE_PULSE + baselineType = chunk ? PSQ_BL_POST_PULSE : PSQ_BL_PRE_PULSE else WAVE numericalValues = GetLBNumericalValues(device) WAVE textualValues = GetLBTextualValues(device) @@ -542,7 +540,7 @@ static Function PSQ_EvaluateBaselineProperties(string device, STRUCT AnalysisFun DAC = AFH_GetDACFromHeadstage(device, headstage) ASSERT(IsFinite(DAC), "Non-finite DAC") - WAVE/T/Z userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, s.sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, PSQ_BASELINE_SELECTION_SHORT_NAME_RE_MATCHER, treelevel = EPOCH_USER_LEVEL, epochsWave = epochsWave) + WAVE/Z/T userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, s.sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, PSQ_BASELINE_SELECTION_SHORT_NAME_RE_MATCHER, treelevel = EPOCH_USER_LEVEL, epochsWave = epochsWave) ASSERT(WaveExists(userChunkEpochs), "Could not find baseline chunk selection user epochs") if(chunk >= DimSize(userChunkEpochs, ROWS)) @@ -1011,9 +1009,7 @@ End /// @brief Return the number of passed sweeps in all sweeps from the given /// stimset cycle -Function PSQ_NumPassesInSet(numericalValues, type, sweepNo, headstage) - WAVE numericalValues - variable type, sweepNo, headstage +Function PSQ_NumPassesInSet(WAVE numericalValues, variable type, variable sweepNo, variable headstage) string key @@ -1296,7 +1292,7 @@ Function/WAVE PSQ_CreateOverrideResults(string device, variable headstage, varia break case PSQ_SEAL_EVALUATION: numChunks = 4 - numRows = 2 // upper limit + numRows = 2 // upper limit numCols = IDX_NumberOfSweepsInSet(stimset) layerDimLabels = "BaselineQC;ResistanceA;ResistanceB;AsyncQC" break @@ -1316,7 +1312,7 @@ Function/WAVE PSQ_CreateOverrideResults(string device, variable headstage, varia ASSERT(0, "invalid type") endswitch - WAVE/D/Z wv = GetOverrideResults() + WAVE/Z/D wv = GetOverrideResults() numLayers = ItemsInList(layerDimLabels, ";") if(WaveExists(wv)) @@ -1675,6 +1671,7 @@ End /// @brief Return the truth that str is a valid PSQ_DAScale operation mode Function PSQ_DS_IsValidMode(string str) + return !cmpstr(str, PSQ_DS_SUB) || !cmpstr(str, PSQ_DS_SUPRA) || !cmpstr(str, PSQ_DS_ADAPT) End @@ -1721,7 +1718,7 @@ static Function PSQ_GetLastPassingDAScale(string device, variable headstage, str // check for subthreshold operation mode modeKey = CreateAnaFuncLBNKey(PSQ_DA_SCALE, PSQ_FMT_LBN_DA_OPMODE, query = 1) - WAVE/T/Z setting = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, modeKey, headstage, UNKNOWN_MODE) + WAVE/Z/T setting = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, modeKey, headstage, UNKNOWN_MODE) if(WaveExists(setting) && !cmpstr(setting[INDEP_HEADSTAGE], opMode)) return sweepNo @@ -1960,7 +1957,7 @@ static Function [variable start, variable stop] PSQ_DS_GetFrequencyEvalRangeForR WAVE textualValues = GetLBTextualValues(device) WAVE DACs = GetLastSetting(numericalValues, sweepNo, "DAC", DATA_ACQUISITION_MODE) - WAVE/T/Z epochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DACs[headstage], "^E1$") + WAVE/Z/T epochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DACs[headstage], "^E1$") ASSERT(WaveExists(epochs), "Could not find E1 epoch") ASSERT(DimSize(epochs, ROWS) == 1, "Expected exactly one epoch") supraEpochLength = str2num(epochs[0][EPOCH_COL_ENDTIME]) - str2num(epochs[0][EPOCH_COL_STARTTIME]) @@ -1979,7 +1976,7 @@ static Function [variable start, variable stop] PSQ_DS_GetFrequencyEvalRange(str WAVE textualValues = GetLBTextualValues(device) WAVE DACs = GetLastSetting(numericalValues, sweepNo, "DAC", DATA_ACQUISITION_MODE) - WAVE/T/Z epochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DACs[headstage], "^E1$") + WAVE/Z/T epochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DACs[headstage], "^E1$") ASSERT(WaveExists(epochs), "Could not find E1 epoch") ASSERT(DimSize(epochs, ROWS) == 1, "Expected exactly one epoch") @@ -2014,10 +2011,10 @@ static Function [WAVE apfreq, WAVE DAScale] PSQ_DS_GatherFrequencyCurrentData(st endif if(fromRhSuAd) - refSweepNo = PSQ_GetLastPassingDAScale(device, headstage, PSQ_DS_SUPRA) + refSweepNo = PSQ_GetLastPassingDAScale(device, headstage, PSQ_DS_SUPRA) [start, stop] = PSQ_DS_GetFrequencyEvalRangeForRhSuAd(device, headstage, refSweepNo) else - refSweepNo = sweepNo + refSweepNo = sweepNo [start, stop] = PSQ_DS_GetFrequencyEvalRange(device, headstage, refSweepNo) endif @@ -2268,7 +2265,7 @@ static Function PSQ_DS_CreateSurveyPlotForUser(string device, variable sweepNo, WAVE numericalValues = GetLBNumericalValues(device) WAVE textualValues = GetLBTextualValues(device) - [WAVE apfreq, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_APFREQ, filterPassing = 1, fromRhSuAd = fromRhSuAd) + [WAVE apfreq, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_APFREQ, filterPassing = 1, fromRhSuAd = fromRhSuAd) [WAVE DAScale, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_DASCALE, filterPassing = 1, fromRhSuAd = fromRhSuAd) /// PSQ_FMT_LBN_DA_AT_RSA_FREQ @@ -2536,7 +2533,7 @@ static Function [variable maxSlope, WAVE fitSlopes, WAVE DAScales] PSQ_DS_Calcul WAVE textualValues = GetLBTextualValues(device) [WAVE fitSlopes, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_FI_SLOPE) - [WAVE DAScales, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_DASCALE) + [WAVE DAScales, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_DASCALE) if(IsNaN(fitSlope)) return [NaN, fitSlopes, DAScales] @@ -2940,19 +2937,19 @@ static Function [WAVE futureDAScales, WAVE apfreq, WAVE DAScales] PSQ_DS_GatherF WAVE textualValues = GetLBTextualValues(device) key = CreateAnaFuncLBNKey(PSQ_DA_SCALE, PSQ_FMT_LBN_DA_AT_FUTURE_DASCALES, query = 1) - WAVE/T/Z futureDAScalesHistoricLBN = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, key, headstage, UNKNOWN_MODE) + WAVE/Z/T futureDAScalesHistoricLBN = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, key, headstage, UNKNOWN_MODE) if(WaveExists(futureDAScalesHistoricLBN)) - WAVE/D/Z futureDAScalesHistoric = ListToNumericWave(futureDAScalesHistoricLBN[headstage], ";") + WAVE/Z/D futureDAScalesHistoric = ListToNumericWave(futureDAScalesHistoricLBN[headstage], ";") else Make/FREE/D/N=0 futureDAScalesHistoric endif [WAVE DAScales, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_DASCALE, filterPassing = 1, beforeSweepQCResult = 1) - [WAVE apfreq, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_APFREQ, filterPassing = 1, beforeSweepQCResult = 1) + [WAVE apfreq, emptySCI] = PSQ_DS_GetLabnotebookData(numericalValues, textualValues, sweepNo, headstage, PSQ_DS_APFREQ, filterPassing = 1, beforeSweepQCResult = 1) if(!emptySCI) - WAVE/D/Z futureDAScalesFromLastSweep = PSQ_DS_GatherOvershootCorrection(cdp, apfreq, DAScales, futureDAScalesHistoric) + WAVE/Z/D futureDAScalesFromLastSweep = PSQ_DS_GatherOvershootCorrection(cdp, apfreq, DAScales, futureDAScalesHistoric) if(WaveExists(futureDAScalesFromLastSweep)) Concatenate/FREE/NP=(ROWS) {futureDAScalesFromLastSweep}, futureDAScalesHistoric @@ -3185,7 +3182,7 @@ static Function [variable daScaleStepMinNorm, variable daScaleStepMaxNorm] PSQ_D if(!CheckIfSmall(fitCoeff[%Slope])) daScaleMinStepWidth = (maxFrequencyChangePercent * PERCENT_TO_ONE) / abs(fitCoeff[%Slope]) else - [minimum, maximum] = WaveMinAndMax(DAScalesRhSuAd) + [minimum, maximum] = WaveMinAndMax(DAScalesRhSuAd) daScaleMinStepWidth = fallbackDAScaleRangeFac * (maximum - minimum) endif @@ -3410,6 +3407,7 @@ End /// @brief Require parameters from stimset Function/S PSQ_DAScale_GetParams() + return "[AbsFrequencyMinDistance:variable]," + \ "AsyncQCChannels:wave," + \ "[BaselineRMSLongThreshold:variable]," + \ @@ -3505,7 +3503,7 @@ Function/S PSQ_DAScale_CheckParam(string name, STRUCT CheckParametersStruct &s) case "SamplingMultiplier": return PSQ_CheckParamCommon(name, s) case "DAScales": - WAVE/D/Z wv = AFH_GetAnalysisParamWave(name, s.params) + WAVE/Z/D wv = AFH_GetAnalysisParamWave(name, s.params) if(!WaveExists(wv)) return "Wave must exist" endif @@ -3691,9 +3689,7 @@ End /// /// @endverbatim /// -Function PSQ_DAScale(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function PSQ_DAScale(string device, STRUCT AnalysisFunction_V3 &s) variable val, totalOnsetDelay, DAScale, baselineQCPassed, passingSupraSweep variable i, numberOfSpikes, samplingFrequencyPassed, numPoints, numFailedSweeps @@ -3890,7 +3886,7 @@ Function PSQ_DAScale(device, s) PSQ_DS_CreateSurveyPlotForUser(device, s.sweepNo, s.headstage, fromRhSuAd = 1) - WAVE/D/Z futureDAScales = PSQ_DS_GatherOvershootCorrection(cdp, apfreqRhSuAd, DAScalesRhSuAd, $"") + WAVE/Z/D futureDAScales = PSQ_DS_GatherOvershootCorrection(cdp, apfreqRhSuAd, DAScalesRhSuAd, $"") validFit = PSQ_DS_AreFitResultsValid(device, s.sweepNo, s.headstage, fitOffsetFromRhSuAd, fitSlopeFromRhSuAd, fromRhSuAd = 1) @@ -4086,7 +4082,7 @@ Function PSQ_DAScale(device, s) Make/FREE/D/N=2 coefWave CurveFit/Q/N=1/NTHR=1/M=0/W=2 line, kwCWave=coefWave, spikeFrequencies[]/D/X=DAScalesPlot[]; AbortOnRTE - WAVE/D/Z W_sigma = MakeWaveFree($"W_sigma") + WAVE/Z/D W_sigma = MakeWaveFree($"W_sigma") if(!WaveExists(W_sigma)) Make/FREE/D/N=2 W_sigma = NaN @@ -4316,6 +4312,7 @@ End /// @brief Return a list of required parameters Function/S PSQ_SquarePulse_GetParams() + return "AsyncQCChannels:wave," + \ "[SamplingFrequency:variable]," + \ "SamplingMultiplier:variable" @@ -4383,9 +4380,7 @@ End /// ---| |-------------------------------------------- /// /// @endverbatim -Function PSQ_SquarePulse(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function PSQ_SquarePulse(string device, STRUCT AnalysisFunction_V3 &s) variable stepsize, DAScale, totalOnsetDelay, setPassed, sweepPassed, multiplier variable val, samplingFrequencyPassed, asyncAlarmPassed, ret @@ -4569,6 +4564,7 @@ End /// @brief Return a list of required parameters Function/S PSQ_Rheobase_GetParams() + return "AsyncQCChannels:wave," + \ "[BaselineRMSLongThreshold:variable]," + \ "[BaselineRMSShortThreshold:variable]," + \ @@ -4645,9 +4641,7 @@ End /// ---| |-------------------------------------------- /// /// @endverbatim -Function PSQ_Rheobase(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function PSQ_Rheobase(string device, STRUCT AnalysisFunction_V3 &s) variable DAScale, val, numSweeps, currentSweepHasSpike, lastSweepHasSpike, setPassed, diff variable baselineQCPassed, finalDAScale, initialDAScale, stepSize, previousStepSize, samplingFrequencyPassed @@ -4999,6 +4993,7 @@ End /// @brief Return a list of required parameters Function/S PSQ_Ramp_GetParams() + return "AsyncQCChannels:wave," + \ "[BaselineRMSLongThreshold:variable]," + \ "[BaselineRMSShortThreshold:variable]," + \ @@ -5088,9 +5083,7 @@ End /// ---/ |-------------------------------------------- /// /// @endverbatim -Function PSQ_Ramp(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function PSQ_Ramp(string device, STRUCT AnalysisFunction_V3 &s) variable DAScale, val, numSweeps, currentSweepHasSpike, setPassed variable baselineQCPassed, finalDAScale, initialDAScale, samplingFrequencyPassed @@ -5435,6 +5428,7 @@ End /// @returns result set passing state (0/1) /// @returns maxOccurences maximum number of passing sets with the same DASCale value Function [variable result, variable maxOccurences] PSQ_CR_SetHasPassed(WAVE numericalValues, variable sweepNo, variable headstage) + variable i, numEntries, scaleFactor, index, maxValue string key @@ -5898,6 +5892,7 @@ Function/S PSQ_Chirp_GetHelp(string name) End Function/S PSQ_Chirp_CheckParam(string name, STRUCT CheckParametersStruct &s) + variable val string str @@ -5975,6 +5970,7 @@ End /// @brief Return a list of required analysis functions for PSQ_Chirp() Function/S PSQ_Chirp_GetParams() + return "[AmpBesselFilter:variable]," + \ "[AmpBesselFilterRestore:variable]," + \ "AsyncQCChannels:wave," + \ @@ -6059,9 +6055,7 @@ End /// ~ /// /// @endverbatim -Function PSQ_Chirp(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function PSQ_Chirp(string device, STRUCT AnalysisFunction_V3 &s) variable InnerRelativeBound, OuterRelativeBound, sweepPassed, setPassed, boundsAction, failsInSet, leftSweeps, chunk, multiplier variable length, minLength, DAC, resistance, passingDaScaleSweep, sweepsInSet, passesInSet, acquiredSweepsInSet, samplingFrequencyPassed @@ -6451,7 +6445,7 @@ Function PSQ_Chirp(device, s) // and baselineQC is not failing [boundsAction, scalingFactorDaScale] = PSQ_CR_DetermineBoundsAction(device, s.scaledDACWave, s.headstage, s.sweepNo, chirpStart, cycleEnd, innerRelativeBound, outerRelativeBound, boundsEvaluationMode) - insideBounds = (boundsAction == PSQ_CR_PASS) + insideBounds = (boundsAction == PSQ_CR_PASS) WAVE result = LBN_GetNumericWave() result[INDEP_HEADSTAGE] = insideBounds key = CreateAnaFuncLBNKey(PSQ_CHIRP, PSQ_FMT_LBN_CR_INSIDE_BOUNDS) @@ -6509,7 +6503,7 @@ static Function [variable epBegin, variable epEnd] PSQ_CR_GetSpikeEvaluationRang WAVE epochsWave = GetEpochsWave(device) - WAVE/T/Z evaluationEpoch = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ + WAVE/Z/T evaluationEpoch = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ "^U_CR_SE$", treelevel = EPOCH_USER_LEVEL, epochsWave = epochsWave) if(WaveExists(evaluationEpoch)) @@ -6572,7 +6566,7 @@ static Function [variable epBegin, variable epEnd] PSQ_CR_GetChirpEvaluationRang WAVE epochsWave = GetEpochsWave(device) - WAVE/T/Z evaluationEpoch = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ + WAVE/Z/T evaluationEpoch = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ "^U_CR_CE$", treelevel = EPOCH_USER_LEVEL, epochsWave = epochsWave) if(WaveExists(evaluationEpoch)) @@ -6637,7 +6631,7 @@ Function/WAVE PSQ_CR_GetFullCycleEpochs(WAVE numericalValues, WAVE/T textualValu string regexp sprintf regexp, "^(E1_TG_C%d|E1_TG_C%d)$", 0, requestedCycles - 1 - WAVE/T/Z fullCycleEpochs = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ + WAVE/Z/T fullCycleEpochs = EP_GetEpochs(numericalValues, textualValues, NaN, XOP_CHANNEL_TYPE_DAC, DAC, \ regexp, treelevel = 2, epochsWave = epochsWave) return fullCycleEpochs @@ -6717,6 +6711,7 @@ static Function PSQ_SetStimulusSets(string device, variable headstage, string pa End Function/S PSQ_PipetteInBath_CheckParam(string name, STRUCT CheckParametersStruct &s) + variable val string str @@ -6768,6 +6763,7 @@ Function/S PSQ_PipetteInBath_GetHelp(string name) End Function/S PSQ_PipetteInBath_GetParams() + return "AsyncQCChannels:wave," + \ "[BaselineRMSLongThreshold:variable]," + \ "[BaselineRMSShortThreshold:variable]," + \ @@ -6823,6 +6819,7 @@ End /// /// @endverbatim Function PSQ_PipetteInBath(string device, STRUCT AnalysisFunction_V3 &s) + variable multiplier, chunk, baselineQCPassed, ret, DAC, pipetteResistanceQCPassed, samplingFrequencyQCPassed, asyncAlarmPassed variable sweepsInSet, passesInSet, acquiredSweepsInSet, sweepPassed, setPassed, numSweepsFailedAllowed, failsInSet variable maxPipetteResistance, minPipetteResistance, expectedNumTestpulses, numTestPulses, pipetteResistance @@ -7160,6 +7157,7 @@ static Function PSQ_CreateTestpulseLikeEpoch(WAVE/T epochWave, variable DAC, str End Function/S PSQ_SealEvaluation_CheckParam(string name, STRUCT CheckParametersStruct &s) + variable val string str @@ -7214,6 +7212,7 @@ Function/S PSQ_SealEvaluation_GetHelp(string name) End Function/S PSQ_SealEvaluation_GetParams() + return "AsyncQCChannels:wave," + \ "[BaselineChunkLength:variable]," + \ "[BaselineRMSLongThreshold:variable]," + \ @@ -7280,6 +7279,7 @@ End /// /// @endverbatim Function PSQ_SealEvaluation(string device, STRUCT AnalysisFunction_V3 &s) + variable multiplier, chunk, baselineQCPassed, ret, DAC, samplingFrequencyQCPassed, sealResistanceMax variable sweepsInSet, passesInSet, acquiredSweepsInSet, sweepPassed, setPassed, numSweepsFailedAllowed, failsInSet, asyncAlarmPassed variable expectedNumTestpulses, numTestPulses, sealResistanceA, sealResistanceB, sealResistanceQCPassed, testpulseGroupSel, sealThreshold @@ -7636,6 +7636,7 @@ Function PSQ_SE_CreateEpochsImpl(WAVE/T epochWave, variable DAC, variable totalO End Function PSQ_SE_GetTestpulseGroupSelection(string params) + string str = AFH_GetAnalysisParamTextual("TestPulseGroupSelector", params, defValue = "Both") return PSQ_SE_ParseTestpulseGroupSelection(str) @@ -7656,6 +7657,7 @@ static Function PSQ_SE_ParseTestpulseGroupSelection(string str) End Function/S PSQ_TrueRestingMembranePotential_CheckParam(string name, STRUCT CheckParametersStruct &s) + variable val string str @@ -7731,6 +7733,7 @@ Function/S PSQ_TrueRestingMembranePotential_GetHelp(string name) End Function/S PSQ_TrueRestingMembranePotential_GetParams() + return "AsyncQCChannels:wave," + \ "AbsoluteVoltageDiff:variable," + \ "[BaselineChunkLength:variable]," + \ @@ -7783,6 +7786,7 @@ End /// /// @endverbatim Function PSQ_TrueRestingMembranePotential(string device, STRUCT AnalysisFunction_V3 &s) + variable multiplier, ret, preActiveHS, chunk, baselineQCPassed, spikeQCPassed, IsFinished, targetV, iti variable averageVoltageQCPassed, samplingFrequencyQCPassed, setPassed, sweepPassed, DAC, level, totalOnsetDelay, ignoredTime variable numSweepsFailedAllowed, averageVoltage, numSpikes, position, midsweepReturnValue, asyncAlarmPassed @@ -8319,6 +8323,7 @@ static Function PSQ_CheckAsyncAlarmStateAndStoreInLabnotebook(string device, var End Function/S PSQ_AccessResistanceSmoke_CheckParam(string name, STRUCT CheckParametersStruct &s) + variable val strswitch(name) @@ -8378,6 +8383,7 @@ Function/S PSQ_AccessResistanceSmoke_GetHelp(string name) End Function/S PSQ_AccessResistanceSmoke_GetParams() + return "AsyncQCChannels:wave," + \ "[BaselineChunkLength:variable]," + \ "[BaselineRMSLongThreshold:variable]," + \ @@ -8438,6 +8444,7 @@ End /// /// @endverbatim Function PSQ_AccessResistanceSmoke(string device, STRUCT AnalysisFunction_V3 &s) + variable multiplier, numTestpulses, expectedNumTestpulses, ret, accessResistance, steadyStateResistance, chunk, baselineQCPassed, numSweepsFailedAllowed variable accessResistanceQC, steadyStateResistanceQC, resistanceRatioQC, sweepPassed, setPassed, baselinePassed, samplingFrequencyPassed, midsweepReturnValue variable asyncAlarmPassed diff --git a/Packages/MIES/MIES_ArtefactRemoval.ipf b/Packages/MIES/MIES_ArtefactRemoval.ipf index cecfbecdb0..e243be9e47 100644 --- a/Packages/MIES/MIES_ArtefactRemoval.ipf +++ b/Packages/MIES/MIES_ArtefactRemoval.ipf @@ -161,8 +161,7 @@ static Function/S AR_GetHighlightTraces(graph) return TextWaveToList(traces, ";") End -Function AR_HighlightArtefactsEntry(graph) - string graph +Function AR_HighlightArtefactsEntry(string graph) string traces, trace, extPanel variable numEntries, i, index, row @@ -244,7 +243,7 @@ static Function AR_HandleRanges(graph, [removeRange]) continue endif - WAVE/T/Z leftAxisMatches = TUD_GetUserDataAsWave(graph, "YAXIS", keys = {"channelType", "channelNumber"}, \ + WAVE/Z/T leftAxisMatches = TUD_GetUserDataAsWave(graph, "YAXIS", keys = {"channelType", "channelNumber"}, \ values = {"AD", num2str(j)}) ASSERT(WaveExists(leftAxisMatches) && DimSize(leftAxisMatches, ROWS) >= 1, "Expected one hit") leftAxis = leftAxisMatches[0] @@ -314,8 +313,7 @@ static Function AR_SetSweepFolder(device, sweepDFR) BSP_SetFolder(device, sweepDFR, MIES_BSP_AR_SWEEPFOLDER) End -Function AR_MainListBoxProc(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function AR_MainListBoxProc(STRUCT WMListboxAction &lba) : ListBoxControl string graph @@ -330,8 +328,7 @@ Function AR_MainListBoxProc(lba) : ListBoxControl return 0 End -Function AR_SetVarProcCutoffLength(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function AR_SetVarProcCutoffLength(STRUCT WMSetVariableAction &sva) : SetVariableControl string graph, device @@ -349,8 +346,7 @@ Function AR_SetVarProcCutoffLength(sva) : SetVariableControl return 0 End -Function AR_ButtonProc_RemoveRanges(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function AR_ButtonProc_RemoveRanges(STRUCT WMButtonAction &ba) : ButtonControl string graph, win @@ -367,10 +363,7 @@ Function AR_ButtonProc_RemoveRanges(ba) : ButtonControl return 0 End -Function AR_UpdateTracesIfReq(graph, sweepFolder, sweepNo) - string graph - variable sweepNo - DFREF sweepFolder +Function AR_UpdateTracesIfReq(string graph, DFREF sweepFolder, variable sweepNo) string device @@ -389,8 +382,7 @@ Function AR_UpdateTracesIfReq(graph, sweepFolder, sweepNo) AR_HandleRanges(graph) End -Function AR_CheckProc_Update(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function AR_CheckProc_Update(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -402,8 +394,7 @@ Function AR_CheckProc_Update(cba) : CheckBoxControl End /// checks if AR is active. -Function AR_IsActive(win) - string win +Function AR_IsActive(string win) return BSP_IsActive(win, MIES_BSP_AR) End diff --git a/Packages/MIES/MIES_Async.ipf b/Packages/MIES/MIES_Async.ipf index 3365984a51..71389fa53f 100644 --- a/Packages/MIES/MIES_Async.ipf +++ b/Packages/MIES/MIES_Async.ipf @@ -40,8 +40,7 @@ static StrConstant ASYNC_WLCOUNTER_STR = "workloadClassCounter" /// @param disableTask [optional, default = 0] when set to 1 the background task processing readouts is not started /// /// @return 1 if ASYNC framework was started, 0 if ASYNC framework was already running, in this case the number of threads is not changed -Function ASYNC_Start(numThreads, [disableTask]) - variable numThreads, disableTask +Function ASYNC_Start(variable numThreads, [variable disableTask]) variable i @@ -81,8 +80,8 @@ End /// @param dfr reference to thread data folder /// /// @return data folder reference to output data folder -threadsafe Function/DF ASYNC_Worker(dfr) - DFREF dfr +threadsafe Function/DF ASYNC_Worker(DFREF dfr) + End /// @brief Prototype function for an async readout function @@ -167,6 +166,7 @@ End /// @brief Receives data from finished workloads. Calls the user defined readout function. /// For in order readouts this function buffers pending result data folders until they can be processed in order. Function ASYNC_ThreadReadOut() + variable bufferSize, i variable justBuffered @@ -327,8 +327,7 @@ End /// The function takes care to buffer results if they should be processed in order. /// /// @param s default structure for Igor background tasks -Function ASYNC_BackgroundReadOut(s) - STRUCT WMBackgroundStruct &s +Function ASYNC_BackgroundReadOut(STRUCT WMBackgroundStruct &s) return ASYNC_ThreadReadOut() End @@ -344,13 +343,7 @@ End /// @param str [optional, default = 0] string to be added as parameter /// @param move [optional, default = 0] if a wave was given as parameter and move is not zero then the wave is moved to the threads data folder /// @param name [optional, default = paramXXX] name of the added parameter -Function ASYNC_AddParam(dfr, [w, var, str, move, name]) - DFREF dfr - WAVE w - variable var - string str - variable move - string name +Function ASYNC_AddParam(DFREF dfr, [WAVE w, variable var, string str, variable move, string name]) variable paramCnt string paramName @@ -427,8 +420,7 @@ End /// are executed. /// /// @return 2 if ASYNC framework was not running, 1 if a timeout was encountered, 0 otherwise -Function ASYNC_Stop([timeout, fromAssert]) - variable timeout, fromAssert +Function ASYNC_Stop([variable timeout, variable fromAssert]) variable i, endtime, waitResult, localtgID, outatime, err, doe, d variable inputCount, outputCount @@ -591,8 +583,7 @@ End /// @brief Puts a prepared thread data folder to parallel execution in another thread /// /// @param dfr data folder that is setup for thread and is to be deployed -Function ASYNC_Execute(dfr) - DFREF dfr +Function ASYNC_Execute(DFREF dfr) variable orderIndex, size, index string dest diff --git a/Packages/MIES/MIES_AsynchronousData.ipf b/Packages/MIES/MIES_AsynchronousData.ipf index 86b525a0eb..6b7428560d 100644 --- a/Packages/MIES/MIES_AsynchronousData.ipf +++ b/Packages/MIES/MIES_AsynchronousData.ipf @@ -24,9 +24,7 @@ End /// @brief Read the given asynchronous channel and return the scaled value /// It is only valid to call for ITC and SUTTER when there is no acquisition running. -Function ASD_ReadChannel(device, channel) - string device - variable channel +Function ASD_ReadChannel(string device, variable channel) string ctrl variable gain, deviceChannelOffset, rawChannelValue, hardwareType diff --git a/Packages/MIES/MIES_BackgroundWatchdog.ipf b/Packages/MIES/MIES_BackgroundWatchdog.ipf index b9afc82fab..8f0ba9ac3f 100644 --- a/Packages/MIES/MIES_BackgroundWatchdog.ipf +++ b/Packages/MIES/MIES_BackgroundWatchdog.ipf @@ -91,24 +91,28 @@ Function BW_StartPanel() End Function BW_CreatePanel() + NewPanel/K=1/N=$PANEL/W=(400, 264, 0, 0) as "MIES Background Watcher Panel" SetWindow kwTopWin, hook(mainHook)=BkgWatcher#BW_WindowHook ModifyPanel fixedSize=1 End Function BW_StartTask() + CtrlNamedBackground $TASK, period=30, proc=$(GetIndependentModuleName() + "#BW_BackgroundWatchdog"), start Button button_startstop_bkg, pos={0, 0}, size={14 * XGRID + XOFFS, YGRID}, proc=BkgWatcher#BW_ButtonProc_StopTask, title="Stop" Button button_startstop_bkg, help={"Start/Stop the background task for updating the traffic light style controls"} End Function BW_StopTask() + CtrlNamedBackground $TASK, stop BW_PanelUpdate() Button button_startstop_bkg, proc=BkgWatcher#BW_ButtonProc_StartTask, title="Start (currently stopped)" End Function BW_PanelUpdate() + string taskinfo, ctrl, base, title, helpstr variable tasks, state, ypos, i, runstate, colr, colg, colb, basecol @@ -190,8 +194,7 @@ End /// @brief Helper background task for debugging /// /// @ingroup BackgroundFunctions -Function BW_BackgroundWatchdog(s) - STRUCT WMBackgroundStruct &s +Function BW_BackgroundWatchdog(STRUCT WMBackgroundStruct &s) // stop background task if the panel was killed DoWindow $PANEL @@ -203,8 +206,7 @@ Function BW_BackgroundWatchdog(s) return 0 End -Function BW_ButtonProc_ShowTask(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BW_ButtonProc_ShowTask(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -227,8 +229,7 @@ Function BW_ButtonProc_ShowTask(ba) : ButtonControl return 0 End -Function BW_ButtonProc_QuitTask(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BW_ButtonProc_QuitTask(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -249,8 +250,7 @@ Function BW_ButtonProc_QuitTask(ba) : ButtonControl return 0 End -Function BW_WindowHook(s) - STRUCT WMWinHookStruct &s +Function BW_WindowHook(STRUCT WMWinHookStruct &s) variable hookResult @@ -269,8 +269,7 @@ Function BW_WindowHook(s) return hookResult End -Function BW_ButtonProc_StartTask(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BW_ButtonProc_StartTask(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -282,8 +281,7 @@ Function BW_ButtonProc_StartTask(ba) : ButtonControl return 0 End -Function BW_ButtonProc_StopTask(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BW_ButtonProc_StopTask(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up diff --git a/Packages/MIES/MIES_Blowout.ipf b/Packages/MIES/MIES_Blowout.ipf index 08a7ffbe40..c69cdde290 100644 --- a/Packages/MIES/MIES_Blowout.ipf +++ b/Packages/MIES/MIES_Blowout.ipf @@ -41,8 +41,7 @@ Function BWO_SelectDevice() End /// @brief Executes blowout protocol -Function BWO_Go(device) - string device +Function BWO_Go(string device) if(!BWO_CheckGlobalSettings(device)) return NaN diff --git a/Packages/MIES/MIES_BrowserSettingsPanel.ipf b/Packages/MIES/MIES_BrowserSettingsPanel.ipf index 86d94cad06..012b8d0f13 100644 --- a/Packages/MIES/MIES_BrowserSettingsPanel.ipf +++ b/Packages/MIES/MIES_BrowserSettingsPanel.ipf @@ -33,15 +33,13 @@ static Constant BSP_EPOCH_LEVELS = 5 /// @brief return the name of the external panel depending on main window name /// /// @param mainPanel mainWindow panel name -Function/S BSP_GetPanel(mainPanel) - string mainPanel +Function/S BSP_GetPanel(string mainPanel) return GetMainWindow(mainPanel) + "#" + EXT_PANEL_SUBWINDOW End /// @brief return the name of the WaveNote Display inside BSP -Function/S BSP_GetNotebookSubWindow(win) - string win +Function/S BSP_GetNotebookSubWindow(string win) return BSP_GetPanel(win) + "#WaveNoteDisplay" End @@ -49,26 +47,22 @@ End /// @brief return the name of the bottom Panel /// /// @param mainPanel mainWindow panel name -Function/S BSP_GetSweepControlsPanel(mainPanel) - string mainPanel +Function/S BSP_GetSweepControlsPanel(string mainPanel) return GetMainWindow(mainPanel) + "#" + EXT_PANEL_SWEEPCONTROL End -Function/S BSP_GetSFFormula(mainPanel) - string mainPanel +Function/S BSP_GetSFFormula(string mainPanel) return BSP_GetPanel(mainPanel) + "#" + EXT_PANEL_SF_FORMULA End -Function/S BSP_GetSFJSON(mainPanel) - string mainPanel +Function/S BSP_GetSFJSON(string mainPanel) return BSP_GetPanel(mainPanel) + "#" + EXT_PANEL_SF_JSON End -Function/S BSP_GetSFHELP(mainPanel) - string mainPanel +Function/S BSP_GetSFHELP(string mainPanel) string helpNotebook @@ -81,8 +75,7 @@ End /// @brief Inits controls of BrowserSettings side Panel /// /// @param mainPanel mainWindow panel name -Function BSP_InitPanel(mainPanel) - string mainPanel +Function BSP_InitPanel(string mainPanel) string graph @@ -217,8 +210,7 @@ End /// @brief dynamic settings for panel initialization /// /// @param mainPanel mainWindow panel name -Function BSP_DynamicStartupSettings(mainPanel) - string mainPanel +Function BSP_DynamicStartupSettings(string mainPanel) variable sweepNo string bsPanel, shPanel, experiments, devices @@ -260,8 +252,7 @@ Function BSP_DynamicStartupSettings(mainPanel) End /// @brief Hook function for the Sweep Formula Notebook -Function BSP_SweepFormulaHook(s) - STRUCT WMWinHookStruct &s +Function BSP_SweepFormulaHook(STRUCT WMWinHookStruct &s) string win, bsPanel @@ -286,8 +277,7 @@ End /// @brief Unsets all control properties that are set in BSP_DynamicStartupSettings for DataBrowser type /// /// @param mainPanel mainWindow panel name -Function BSP_UnsetDynamicStartupSettings(mainPanel) - string mainPanel +Function BSP_UnsetDynamicStartupSettings(string mainPanel) string bsPanel, shPanel @@ -308,8 +298,7 @@ Function BSP_UnsetDynamicStartupSettings(mainPanel) EnableControls(shPanel, "popup_Device;popup_Experiment") End -Function BSP_BindListBoxWaves(win) - string win +Function BSP_BindListBoxWaves(string win) string mainPanel, bsPanel @@ -350,8 +339,7 @@ End /// /// @param win name of external panel or main window /// @returns channel selection wave -Function/WAVE BSP_GetChannelSelectionWave(win) - string win +Function/WAVE BSP_GetChannelSelectionWave(string win) DFREF dfr = BSP_GetFolder(win, MIES_BSP_PANEL_FOLDER) WAVE wv = GetChannelSelectionWave(dfr) @@ -366,9 +354,7 @@ End /// @param versionCheck [optional, defaults to true] abort on outdated window version /// /// @return DFR to specified folder. No check for invalid folders -Function/DF BSP_GetFolder(win, folderType, [versionCheck]) - string win, folderType - variable versionCheck +Function/DF BSP_GetFolder(string win, string folderType, [variable versionCheck]) string mainPanel @@ -395,9 +381,7 @@ End /// @param win name of external panel or main window /// @param dfr DataFolder Reference to the folder /// @param folderType see the FOLDER constants in this file -Function BSP_SetFolder(win, dfr, folderType) - string win, folderType - DFREF dfr +Function BSP_SetFolder(string win, DFREF dfr, string folderType) string mainPanel @@ -413,8 +397,7 @@ End /// @param win name of external panel or main window /// /// @return device as string -Function/S BSP_GetDevice(win) - string win +Function/S BSP_GetDevice(string win) string mainPanel @@ -434,8 +417,7 @@ End /// /// @param win name of external panel or main window /// @param device bound device as string -Function/S BSP_SetDevice(win, device) - string win, device +Function/S BSP_SetDevice(string win, string device) string mainPanel @@ -451,8 +433,7 @@ End /// @param win name of external panel or main window /// /// @return D for DataBrowser or S for SweepBrowser -Function/S BSP_GetBrowserType(win) - string win +Function/S BSP_GetBrowserType(string win) string mainPanel @@ -528,15 +509,13 @@ Function BSP_SetSweepBrowser(string win, variable mode) End /// @brief wrapper function for external calls -Function BSP_IsSweepBrowser(win) - string win +Function BSP_IsSweepBrowser(string win) return !cmpstr(BSP_GetBrowserType(win), BROWSERTYPE_SWEEPBROWSER) End /// @brief wrapper function for external calls -Function BSP_IsDataBrowser(win) - string win +Function BSP_IsDataBrowser(string win) return !cmpstr(BSP_GetBrowserType(win), BROWSERTYPE_DATABROWSER) End @@ -545,8 +524,7 @@ End /// /// @param win name of external panel or main window /// @return 1 if device is assigned and 0 otherwise. does not check if device is valid. -Function BSP_HasBoundDevice(win) - string win +Function BSP_HasBoundDevice(string win) string device = BSP_GetDevice(win) @@ -576,8 +554,7 @@ End /// @brief enable/disable the OVS buttons /// /// @param win specify mainPanel or bsPanel with OVS controls -Function BSP_SetOVSControlStatus(win) - string win +Function BSP_SetOVSControlStatus(string win) string controlList = "group_properties_sweeps;popup_overlaySweeps_select;setvar_overlaySweeps_offset;" \ + "setvar_overlaySweeps_step;check_overlaySweeps_disableHS;check_overlaySweeps_non_commula;" \ @@ -589,8 +566,7 @@ End /// @brief enable/disable the AR buttons /// /// @param win specify mainPanel or bsPanel with OVS controls -Function BSP_SetARControlStatus(win) - string win +Function BSP_SetARControlStatus(string win) string controlList = "group_properties_artefact;setvar_cutoff_length_before;setvar_cutoff_length_after;button_RemoveRanges;check_auto_remove;check_highlightRanges;list_of_ranges1;" @@ -600,8 +576,7 @@ End /// @brief enable/disable the SF buttons /// /// @param win specify mainPanel or bsPanel with OVS controls -Function BSP_SetSFControlStatus(win) - string win +Function BSP_SetSFControlStatus(string win) string controlList @@ -614,9 +589,7 @@ End /// @param win specify mainPanel or bsPanel with OVS controls /// @param controlList list of controls /// @param status 1: enable; 0: disable -Function BSP_SetControlStatus(win, controlList, status) - string win, controlList - variable status +Function BSP_SetControlStatus(string win, string controlList, variable status) string bsPanel @@ -671,8 +644,7 @@ static Function BSP_HidePanel(string win) End /// @brief panel close hook for side panel -Function BSP_ClosePanelHook(s) - STRUCT WMWinHookStruct &s +Function BSP_ClosePanelHook(STRUCT WMWinHookStruct &s) string mainPanel @@ -686,8 +658,7 @@ Function BSP_ClosePanelHook(s) return 0 End -Function BSP_SweepsAndMouseWheel(s) - STRUCT WMWinHookStruct &s +Function BSP_SweepsAndMouseWheel(STRUCT WMWinHookStruct &s) string graph, scPanel, ctrl @@ -720,8 +691,7 @@ Function BSP_SweepsAndMouseWheel(s) End /// @brief enable/disable checkbox control for side panel -Function BSP_CheckBoxProc_ArtRemoval(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_CheckBoxProc_ArtRemoval(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string mainPanel @@ -737,8 +707,7 @@ Function BSP_CheckBoxProc_ArtRemoval(cba) : CheckBoxControl End /// @brief enable/disable checkbox control for side panel -Function BSP_CheckBoxProc_PerPulseAver(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_CheckBoxProc_PerPulseAver(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string mainPanel @@ -753,8 +722,7 @@ Function BSP_CheckBoxProc_PerPulseAver(cba) : CheckBoxControl End /// @brief enable/disable checkbox control for side panel -Function BSP_CheckBoxProc_SweepFormula(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_CheckBoxProc_SweepFormula(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string mainPanel @@ -769,8 +737,7 @@ Function BSP_CheckBoxProc_SweepFormula(cba) : CheckBoxControl End /// @brief procedure for the open button of the side panel -Function BSP_ButtonProc_Panel(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BSP_ButtonProc_Panel(STRUCT WMButtonAction &ba) : ButtonControl string win @@ -784,8 +751,7 @@ Function BSP_ButtonProc_Panel(ba) : ButtonControl return 0 End -Function BSP_SliderProc_ChangedSetting(spa) : SliderControl - STRUCT WMSliderAction &spa +Function BSP_SliderProc_ChangedSetting(STRUCT WMSliderAction &spa) : SliderControl string win @@ -797,8 +763,7 @@ Function BSP_SliderProc_ChangedSetting(spa) : SliderControl return 0 End -Function BSP_TimeAlignmentProc(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_TimeAlignmentProc(STRUCT WMCheckBoxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -807,8 +772,7 @@ Function BSP_TimeAlignmentProc(cba) : CheckBoxControl endswitch End -Function BSP_TimeAlignmentPopup(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function BSP_TimeAlignmentPopup(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -819,8 +783,7 @@ Function BSP_TimeAlignmentPopup(pa) : PopupMenuControl return 0 End -Function BSP_TimeAlignmentLevel(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function BSP_TimeAlignmentLevel(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -833,8 +796,7 @@ Function BSP_TimeAlignmentLevel(sva) : SetVariableControl return 0 End -Function BSP_DoTimeAlignment(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BSP_DoTimeAlignment(STRUCT WMButtonAction &ba) : ButtonControl string graph, win @@ -856,8 +818,7 @@ Function BSP_DoTimeAlignment(ba) : ButtonControl return 0 End -Function BSP_CheckProc_ScaleAxes(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function BSP_CheckProc_ScaleAxes(STRUCT WMCheckboxAction &cba) : CheckBoxControl string ctrls, graph, bsPanel variable numCtrls, i @@ -888,8 +849,7 @@ Function BSP_CheckProc_ScaleAxes(cba) : CheckBoxControl return 0 End -Function BSP_AxisScalingLevelCross(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function BSP_AxisScalingLevelCross(STRUCT WMSetVariableAction &sva) : SetVariableControl string graph, bsPanel @@ -980,9 +940,7 @@ End /// @param win name of external panel or main window /// @param elementID one of MIES_BSP_* constants like MIES_BSP_PA /// @return 1 if setting was activated, 0 otherwise -Function BSP_IsActive(win, elementID) - string win - variable elementID +Function BSP_IsActive(string win, variable elementID) string bsPanel, control @@ -1044,8 +1002,7 @@ Function BSP_UpdateHelpNotebook(string helpNotebook) End /// @brief Return a sweep formula graph name unique for that sweepbrowser/databrowser -Function/S BSP_GetFormulaGraph(win) - string win +Function/S BSP_GetFormulaGraph(string win) if(!BSP_HasBoundDevice(win)) return CleanupName(SF_PLOT_NAME_TEMPLATE, 0) @@ -1065,10 +1022,7 @@ End /// @brief Parse a control name for the "Channel Selection Panel" and return /// its channel type and number. The number will be NaN for the ALL control. -Function BSP_ParseChannelSelectionControl(ctrl, channelType, channelNum) - string ctrl - string &channelType - variable &channelNum +Function BSP_ParseChannelSelectionControl(string ctrl, string &channelType, variable &channelNum) string channelNumStr @@ -1085,9 +1039,7 @@ End /// @brief Set the channel selection dialog controls according to the channel /// selection wave -Function BSP_ChannelSelectionWaveToGUI(panel, channelSel) - string panel - WAVE channelSel +Function BSP_ChannelSelectionWaveToGUI(string panel, WAVE channelSel) string list, channelType, ctrl variable channelNum, numEntries, i @@ -1108,9 +1060,7 @@ End /// @brief Set the channel selection wave acccording to the channel selection /// controls -Function BSP_GUIToChannelSelectionWave(win, ctrl, checked) - string win, ctrl - variable checked +Function BSP_GUIToChannelSelectionWave(string win, string ctrl, variable checked) variable channelNum, numEntries string channelType @@ -1131,11 +1081,7 @@ End /// /// `channelSel` will be the result from BSP_FetchSelectedChannels() which is a /// copy of the permanent channel selection wave. -Function BSP_RemoveDisabledChannels(channelSel, ADCs, DACs, statusHS, numericalValues, sweepNo) - WAVE channelSel - WAVE ADCs, DACs, numericalValues - variable sweepNo - WAVE statusHS +Function BSP_RemoveDisabledChannels(WAVE channelSel, WAVE ADCs, WAVE DACs, WAVE statusHS, WAVE numericalValues, variable sweepNo) variable numADCs, numDACs, i @@ -1174,8 +1120,7 @@ Function BSP_RemoveDisabledChannels(channelSel, ADCs, DACs, statusHS, numericalV endfor End -Function BSP_ScaleAxes(win) - string win +Function BSP_ScaleAxes(string win) string graph, bsPanel variable visXRange, equalY, equalYIgn, level @@ -1222,8 +1167,7 @@ Function [STRUCT TiledGraphSettings tgs] BSP_GatherTiledGraphSettings(string win endif End -Function BSP_CheckProc_ChangedSetting(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_CheckProc_ChangedSetting(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string graph, bsPanel, ctrl variable checked @@ -1278,8 +1222,7 @@ Function BSP_CheckProc_ChangedSetting(cba) : CheckBoxControl return 0 End -Function BSP_ButtonProc_RestoreData(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BSP_ButtonProc_RestoreData(STRUCT WMButtonAction &ba) : ButtonControl string bspPanel, bsPanel, graph, device variable numEntries, i, sweepNo @@ -1331,8 +1274,7 @@ Function BSP_ButtonProc_RestoreData(ba) : ButtonControl return 0 End -Function BSP_CheckProc_OverlaySweeps(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function BSP_CheckProc_OverlaySweeps(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string graph, bsPanel @@ -1365,6 +1307,7 @@ End /// /// @returns returns the specified logbook wave or a null wave Function/WAVE BSP_GetLogbookWave(string win, variable logbookType, variable logbookWaveType, [variable sweepNumber, variable selectedExpDevice]) + string shPanel, device, dataFolder if(ParamIsDefault(selectedExpDevice)) @@ -1443,6 +1386,7 @@ End /// @brief Return the last and first sweep numbers Function [variable first, variable last] BSP_FirstAndLastSweepAcquired(string win) + string list WAVE/Z sweeps = GetPlainSweepList(win) @@ -1454,8 +1398,7 @@ Function [variable first, variable last] BSP_FirstAndLastSweepAcquired(string wi return [sweeps[0], sweeps[DimSize(sweeps, ROWS) - 1]] End -Function BSP_ButtonProc_ChangeSweep(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function BSP_ButtonProc_ChangeSweep(STRUCT WMButtonAction &ba) : ButtonControl string graph, scPanel, bsPanel variable first, last, formerLast, sweepNo, overlaySweeps @@ -1492,14 +1435,12 @@ Function BSP_ButtonProc_ChangeSweep(ba) : ButtonControl End // Called from ACL_DisplayTab after the new tab is selected -Function BSP_MainTabControlFinal(tca) - STRUCT WMTabControlAction &tca +Function BSP_MainTabControlFinal(STRUCT WMTabControlAction &tca) BSP_UpdateSweepNote(tca.win) End -Function BSP_UpdateSweepNote(win) - string win +Function BSP_UpdateSweepNote(string win) string scPanel, lbPanel, bsPanel, device, sweepNote string dataFolder, graph @@ -1603,14 +1544,14 @@ Function BSP_AddTracesForEpochs(string win) DFREF dfr = GetEpochsVisualizationFolder(BSP_GetFolder(win, MIES_BSP_PANEL_FOLDER)) BSP_RemoveTraces(win) - WAVE/T/Z traceInfosHS = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"AD", "1"}) + WAVE/Z/T traceInfosHS = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"AD", "1"}) if(!WaveExists(traceInfosHS)) // fallback to DA traces - WAVE/T/Z traceInfosHS = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"DA", "1"}) + WAVE/Z/T traceInfosHS = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"DA", "1"}) endif - WAVE/T/Z traceInfosUnassocDA = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"DA", "0"}) - WAVE/T/Z traceInfosTTL = GetTraceInfos(win, addFilterKeys = {"channelType"}, addFilterValues = {"TTL"}) + WAVE/Z/T traceInfosUnassocDA = GetTraceInfos(win, addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"DA", "0"}) + WAVE/Z/T traceInfosTTL = GetTraceInfos(win, addFilterKeys = {"channelType"}, addFilterValues = {"TTL"}) if(!WaveExists(traceInfosHS) && !WaveExists(traceInfosUnassocDA) && !WaveExists(traceInfosTTL)) return NaN @@ -1654,7 +1595,7 @@ Function BSP_AddTracesForEpochs(string win) ASSERT(WaveExists(textualValues), "Textual LabNotebook not found.") // present since a2172f03 (Added generations of epoch information wave, 2019-05-22) - WAVE/T/Z epochsFromLBN = EP_FetchEpochs(numericalValues, textualValues, sweepNumber, sweepDFR, channelNumber, channelType) + WAVE/Z/T epochsFromLBN = EP_FetchEpochs(numericalValues, textualValues, sweepNumber, sweepDFR, channelNumber, channelType) if(!WaveExists(epochsFromLBN)) continue endif @@ -1722,8 +1663,7 @@ Function BSP_AddTracesForEpochs(string win) endfor End -Function BSP_EpochGraphToolTip(s) - STRUCT WMTooltipHookStruct &s +Function BSP_EpochGraphToolTip(STRUCT WMTooltipHookStruct &s) variable idx, hasShortname string first, last, tags, treelevel, shortname @@ -1735,9 +1675,9 @@ Function BSP_EpochGraphToolTip(s) s.isHtml = 1 WAVE w = s.yWave // The trace's Y wave if(WaveDims(w) > 2) - WAVE/T/Z epochs = $GetStringFromWaveNote(w, "EpochInfo") + WAVE/Z/T epochs = $GetStringFromWaveNote(w, "EpochInfo") ASSERT(WaveExists(epochs), "Missing epoch info") - hookResult = 1 // 1 tells Igor to use our custom tooltip + hookResult = 1 // 1 tells Igor to use our custom tooltip idx = w[s.row][s.column][1] first = num2strHighPrec(str2num(epochs[idx][EPOCH_COL_STARTTIME]) * ONE_TO_MILLI, precision = EPOCHTIME_PRECISION, shorten = 1) @@ -1759,8 +1699,7 @@ Function BSP_EpochGraphToolTip(s) return hookResult End -Function BSP_SFHelpWindowHook(s) - STRUCT WMWinHookStruct &s +Function BSP_SFHelpWindowHook(STRUCT WMWinHookStruct &s) string mainWin, sfWin, bspPanel, cmdStr variable modMask, refContentCRC, contentCRC @@ -1912,8 +1851,7 @@ static Function/S BSP_RetrieveSFHelpTextImpl(string win, string hlpStart, string return Trimstring(S_value) End -Function BSP_WindowHook(s) - STRUCT WMWinHookStruct &s +Function BSP_WindowHook(STRUCT WMWinHookStruct &s) string win diff --git a/Packages/MIES/MIES_Browser_Plotter.ipf b/Packages/MIES/MIES_Browser_Plotter.ipf index 96b56d1eb8..d0ee469a77 100644 --- a/Packages/MIES/MIES_Browser_Plotter.ipf +++ b/Packages/MIES/MIES_Browser_Plotter.ipf @@ -117,7 +117,7 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA WAVE TTLs = GetTTLListFromConfig(config) // 602debb9 (Record the active headstage in the settingsHistory, 2014-11-04) - WAVE/D/Z statusHS = GetLastSetting(numericalValues, sweepNo, "Headstage Active", DATA_ACQUISITION_MODE) + WAVE/Z/D statusHS = GetLastSetting(numericalValues, sweepNo, "Headstage Active", DATA_ACQUISITION_MODE) if(!WaveExists(statusHS)) // 5872e556 (Modified files: DR_MIES_TangoInteract: changes recommended by Thomas ..., 2014-09-11) WAVE/Z DACsFromLBN = GetLastSetting(numericalValues, sweepNo, "DAC", DATA_ACQUISITION_MODE) @@ -197,8 +197,8 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA if(oodDAQEnabled) [oodDAQRegionsAll, totalOodRangeMS] = GetOodDAQFullRange(tgs, oodDAQRegions) - totalRangeDAPoints = totalOodRangeMS / samplingIntDA - numRegions = ItemsInList(oodDAQRegionsAll) + totalRangeDAPoints = totalOodRangeMS / samplingIntDA + numRegions = ItemsInList(oodDAQRegionsAll) else stimSetLength = GetLastSettingIndep(numericalValues, sweepNo, "Stim set length", DATA_ACQUISITION_MODE) DEBUGPRINT("Stim set length (labnotebook, NaN for oodDAQ)", var = stimSetLength) @@ -373,7 +373,7 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA // 15: TTL bits (sum) rack one // 16-19: TTL bits (single) rack one - [s] = GetHeadstageColor(headstage, channelType = channelType, channelNumber = guiChannelNumber, isSplitted = isTTLSplitted) + [s] = GetHeadstageColor(headstage, channelType = channelType, channelNumber = guiChannelNumber, isSplitted = isTTLSplitted) first = 0 // number of horizontally distributed @@ -725,6 +725,7 @@ End /// - POST_PLOT_ADDED_SWEEPS -> OVS indizes of the added sweep /// Use OVS_GetSweepAndExperiment() to convert an index into a sweep/experiment pair. Function PostPlotTransformations(string win, variable mode, [WAVE/Z additionalData]) + STRUCT TiledGraphSettings tgs string graph @@ -748,9 +749,9 @@ Function PostPlotTransformations(string win, variable mode, [WAVE/Z additionalDa InitPostPlotSettings(graph, pps) if(pps.zeroTraces) - WAVE/T/Z traces = GetAllSweepTraces(graph, prefixTraces = 0) + WAVE/Z/T traces = GetAllSweepTraces(graph, prefixTraces = 0) else - WAVE/T/Z traces = $"" + WAVE/Z/T traces = $"" endif ZeroTracesIfReq(graph, traces, pps.zeroTraces) @@ -829,7 +830,7 @@ static Function AverageWavesFromSameYAxisIfReq(graph, averagingEnabled, averageD endif // remove existing average traces - WAVE/T/Z averageTraces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Average"}) + WAVE/Z/T averageTraces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Average"}) numTraces = WaveExists(averageTraces) ? DimSize(averageTraces, ROWS) : 0 for(i = 0; i < numTraces; i += 1) trace = averageTraces[i] @@ -837,7 +838,7 @@ static Function AverageWavesFromSameYAxisIfReq(graph, averagingEnabled, averageD TUD_RemoveUserData(graph, trace) endfor - WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"sweep"}) + WAVE/Z/T traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"sweep"}) if(!WaveExists(traces)) return NaN @@ -966,7 +967,7 @@ End static Function ZeroTracesIfReq(graph, traces, zeroTraces) string graph variable zeroTraces - WAVE/T/Z traces + WAVE/Z/T traces string trace variable numTraces, i @@ -1016,7 +1017,7 @@ static Function LayoutGraph(string win, STRUCT TiledGraphSettings &tgs) graph = GetMainWindow(win) RemoveFreeAxisFromGraph(graph) - WAVE/T/Z allVerticalAxesNonUnique = TUD_GetUserDataAsWave(graph, "YAXIS") + WAVE/Z/T allVerticalAxesNonUnique = TUD_GetUserDataAsWave(graph, "YAXIS") if(!WaveExists(allVerticalAxesNonUnique)) // empty graph @@ -1033,23 +1034,23 @@ static Function LayoutGraph(string win, STRUCT TiledGraphSettings &tgs) // (? 0) regex = DB_AXIS_PART_EPOCHS + "_" + ttlsWithBits[i] - WAVE/T/Z axes = GrepWave(allVerticalAxes, regex) + WAVE/Z/T axes = GrepWave(allVerticalAxes, regex) ASSERT(WaveExists(axes), "Unexpected number of matches") EnableAxis(graph, axes, EPOCH_SLOT_MULTIPLIER * spacePerSlot, first, last) endif sprintf regex, ".*(?= 0) @@ -1050,8 +1047,8 @@ static Function CONF_GatherControlsFromJSON(ctrlData, jsonID, basePath) return 0 endif - WAVE/T/Z ctrlSubGroups - WAVE/T/Z niceNames + WAVE/Z/T ctrlSubGroups + WAVE/Z/T niceNames [ctrlSubGroups, niceNames] = SplitTextWaveBySuffix(ctrlGroups, EXPCONFIG_CTRLGROUP_SUFFIX) numElems = DimSize(ctrlSubGroups, ROWS) @@ -1078,9 +1075,8 @@ End /// @param restoreMask Bit mask which properties are restored from WindowControlSavingMask constants /// @param jsonID ID of existing json /// @returns name of main window after restore -Function/S CONF_JSONToWindow(wName, restoreMask, jsonID) - string wName - variable restoreMask, jsonID +Function/S CONF_JSONToWindow(string wName, variable restoreMask, variable jsonID) + string excludeList variable i, colNiceName, colArrayName, colCtrlName, winNum, numCtrl, numWinCtrl, numGroups, numNice, offset, numWindows, numCtrlArrays, numArrayElem, isTagged @@ -1502,10 +1498,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]) - string wName - variable saveMask - string excCtrlTypes +Function CONF_AllWindowsToJSON(string wName, variable saveMask, [string excCtrlTypes]) string wList, curWinName, errMsg variable i, numWins, jsonID, jsonIDWin @@ -1563,10 +1556,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]) - string wName - variable saveMask - string excCtrlTypes +Function CONF_WindowToJSON(string wName, variable saveMask, [string excCtrlTypes]) string ctrlList, ctrlName, radioList, tmpList, wList, cbCtrlName, coupledIndexKeys = "", excUserKeys, radioFunc, str, errMsg variable numCtrl, i, j, jsonID, numCoupled, setRadioPos, ctrlType, coupledCnt, numUniqueCtrlArray, numDupCheck @@ -1881,7 +1871,7 @@ static Function CONF_ControlToJSON(wName, ctrlName, saveMask, jsonID, excCtrlTyp if(!IsEmpty(S_Userdata) && str2num(StringFromList(pos, EXPCONFIG_GUI_SUSERDATA))) JSON_AddString(jsonID, udataPath, S_Userdata) endif - WAVE/T/Z udataKeys = GetUserDataKeys(S_recreation) + WAVE/Z/T udataKeys = GetUserDataKeys(S_recreation) numUdataKeys = WaveExists(udataKeys) ? DimSize(udataKeys, ROWS) : 0 for(i = 0; i < numUdataKeys; i += 1) uDataKey = udataKeys[i] @@ -2483,8 +2473,7 @@ End /// @param serialNum Serial number of MCC /// @param winTitle Name of MCC window /// @param winPosition One of 4 monitors to position MCCs in -Function CONF_Position_MCC_Win(serialNum, winTitle, winPosition) - string serialNum, winTitle, winPosition +Function CONF_Position_MCC_Win(string serialNum, string winTitle, string winPosition) string cmd, fullPath, cmdPath variable w @@ -2682,7 +2671,7 @@ Function CONF_UpdatePackageSettingsFromConfigFiles(variable jsonIdPkg) string fName, input, fullFilePath, globalSettingsPath variable jsonIdConf - WAVE/T/Z configFiles = CONF_GetConfigFiles() + WAVE/Z/T configFiles = CONF_GetConfigFiles() if(WaveExists(configFiles)) globalSettingsPath = "/" + EXPCONFIG_RESERVED_DATABLOCK + "/" + EXPCONFIG_JSON_GLOBALPACKAGESETTINGBLOCK for(fName : configFiles) diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index b10e5820ec..f1fa8f200b 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -1284,7 +1284,7 @@ StrConstant PSQ_RB_FINALSCALE_FAKE_KEY = "PSQRheobaseFinalDAScaleFake" /// @name PatchSeq DAScale ///@{ -Constant PSQ_DS_OFFSETSCALE_FAKE = 23 // pA +Constant PSQ_DS_OFFSETSCALE_FAKE = 23 // pA StrConstant PSQ_DS_SUB = "Sub" StrConstant PSQ_DS_SUPRA = "Supra" StrConstant PSQ_DS_ADAPT = "AdaptiveSupra" @@ -2186,7 +2186,7 @@ Constant BROWSER_MODE_ALL = 0xFF Constant THREAD_QUEUE_TRIES = 1000 Constant HARDWARE_ITC_FIFO_ERROR = -1 -Constant HARDWARE_ITC_STUCK_FIFO_TICKS = 120 // 2s +Constant HARDWARE_ITC_STUCK_FIFO_TICKS = 120 // 2s StrConstant SF_PLOT_NAME_TEMPLATE = "SweepFormula plot" StrConstant SFH_USER_DATA_BROWSER = "browser" diff --git a/Packages/MIES/MIES_DAC-Hardware.ipf b/Packages/MIES/MIES_DAC-Hardware.ipf index 70ce97b182..6247311853 100644 --- a/Packages/MIES/MIES_DAC-Hardware.ipf +++ b/Packages/MIES/MIES_DAC-Hardware.ipf @@ -112,11 +112,7 @@ static Constant SUTTER_ACQUISITION_BACKGROUND = 2 /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// @param offset [optional, defaults to zero] offset into the data wave in points -Function HW_PrepareAcq(hardwareType, deviceID, mode, [data, dataFunc, config, configFunc, flags, offset]) - variable hardwareType, deviceID, mode - WAVE/Z data, config - FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, configFunc - variable flags, offset +Function HW_PrepareAcq(variable hardwareType, variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) switch(hardwareType) case HARDWARE_ITC_DAC: @@ -141,8 +137,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return 0 if sucessfull, 1 on error -Function HW_SelectDevice(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_SelectDevice(variable hardwareType, variable deviceID, [variable flags]) switch(hardwareType) case HARDWARE_ITC_DAC: @@ -162,9 +157,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return device identifier -Function HW_OpenDevice(deviceToOpen, hardwareType, [flags]) - string deviceToOpen - variable &hardwareType, flags +Function HW_OpenDevice(string deviceToOpen, variable &hardwareType, [variable flags]) string deviceType, deviceNumber variable deviceTypeIndex, deviceNumberIndex, deviceID, prelimHWType @@ -202,8 +195,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_CloseDevice(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_CloseDevice(variable hardwareType, variable deviceID, [variable flags]) HW_AssertOnInvalid(hardwareType, deviceID) @@ -227,8 +219,7 @@ End /// @param channel hardware channel number /// @param value value to write in volts /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_WriteDAC(hardwareType, deviceID, channel, value, [flags]) - variable hardwareType, deviceID, channel, value, flags +Function HW_WriteDAC(variable hardwareType, variable deviceID, variable channel, variable value, [variable flags]) string realDeviceOrPressure @@ -257,8 +248,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return value in volts -Function HW_ReadADC(hardwareType, deviceID, channel, [flags]) - variable hardwareType, deviceID, channel, flags +Function HW_ReadADC(variable hardwareType, variable deviceID, variable channel, [variable flags]) string realDeviceOrPressure @@ -290,8 +280,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return bitmask denoting the state of the channel/line -Function HW_ReadDigital(hardwareType, deviceID, channel, [line, flags]) - variable hardwareType, deviceID, channel, line, flags +Function HW_ReadDigital(variable hardwareType, variable deviceID, variable channel, [variable line, variable flags]) string realDeviceOrPressure variable rack, xopChannel, ttlBit @@ -331,8 +320,7 @@ End /// @param value bitmask to write /// @param line bit of TTL line, (only for hardware types which support single TTL writes/read) /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_WriteDigital(hardwareType, deviceID, channel, value, [line, flags]) - variable hardwareType, deviceID, value, channel, line, flags +Function HW_WriteDigital(variable hardwareType, variable deviceID, variable channel, variable value, [variable line, variable flags]) string realDeviceOrPressure variable ttlBit, rack, xopChannel @@ -367,8 +355,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_EnableYoking(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_EnableYoking(variable hardwareType, variable deviceID, [variable flags]) HW_AssertOnInvalid(hardwareType, deviceID) @@ -388,8 +375,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_DisableYoking(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_DisableYoking(variable hardwareType, variable deviceID, [variable flags]) HW_AssertOnInvalid(hardwareType, deviceID) @@ -411,8 +397,7 @@ End /// @param prepareForDAQ immediately prepare for the next data acquisition after stopping it /// @param zeroDAC set all used DA channels to zero /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_StopAcq(hardwareType, deviceID, [prepareForDAQ, zeroDAC, flags]) - variable hardwareType, deviceID, prepareForDAQ, zeroDAC, flags +Function HW_StopAcq(variable hardwareType, variable deviceID, [variable prepareForDAQ, variable zeroDAC, variable flags]) string device HW_AssertOnInvalid(hardwareType, deviceID) @@ -437,8 +422,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return one if running, zero otherwise -Function HW_IsRunning(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_IsRunning(variable hardwareType, variable deviceID, [variable flags]) string realDeviceOrPressure, device HW_AssertOnInvalid(hardwareType, deviceID) @@ -463,8 +447,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return free numeric/text wave with information and dimension labels -Function/WAVE HW_GetDeviceInfo(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function/WAVE HW_GetDeviceInfo(variable hardwareType, variable deviceID, [variable flags]) string realDeviceOrPressure HW_AssertOnInvalid(hardwareType, deviceID) @@ -492,6 +475,7 @@ End /// @param device name of the device /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags Function/WAVE HW_GetDeviceInfoUnregistered(variable hardwareType, string device, [variable flags]) + variable deviceID #ifdef EVIL_KITTEN_EATING_MODE @@ -610,8 +594,7 @@ End /// @param triggerMode [optional, defaults to #HARDWARE_DAC_DEFAULT_TRIGGER] one of @ref TriggerModeStartAcq /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// @param repeat [optional, default 0] for NI devices, repeats the scan after it ends -Function HW_StartAcq(hardwareType, deviceID, [triggerMode, flags, repeat]) - variable hardwareType, deviceID, triggerMode, flags, repeat +Function HW_StartAcq(variable hardwareType, variable deviceID, [variable triggerMode, variable flags, variable repeat]) HW_AssertOnInvalid(hardwareType, deviceID) @@ -638,8 +621,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_ResetDevice(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function HW_ResetDevice(variable hardwareType, variable deviceID, [variable flags]) string realDeviceOrPressure HW_AssertOnInvalid(hardwareType, deviceID) @@ -665,8 +647,7 @@ End /// /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier -Function HW_AssertOnInvalid(hardwareType, deviceID) - variable hardwareType, deviceID +Function HW_AssertOnInvalid(variable hardwareType, variable deviceID) ASSERT(HW_IsValidHardwareType(hardwareType), "Invalid hardwareType") ASSERT(HW_IsValidDeviceID(deviceID), "Invalid deviceID") @@ -704,9 +685,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param pressureDevice required for registering pressure control devices -Function HW_RegisterDevice(mainDevice, hardwareType, deviceID, [pressureDevice]) - string mainDevice, pressureDevice - variable hardwareType, deviceID +Function HW_RegisterDevice(string mainDevice, variable hardwareType, variable deviceID, [string pressureDevice]) HW_AssertOnInvalid(hardwareType, deviceID) @@ -726,8 +705,7 @@ End /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_DeRegisterDevice(hardwareType, deviceID, [flags]) - variable deviceID, hardwareType, flags +Function HW_DeRegisterDevice(variable hardwareType, variable deviceID, [variable flags]) if(!HW_IsValidDeviceID(deviceID) || !HW_IsValidHardwareType(hardwareType)) return NaN @@ -745,8 +723,7 @@ End /// @param deviceID device identifier /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function/S HW_GetMainDeviceName(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function/S HW_GetMainDeviceName(variable hardwareType, variable deviceID, [variable flags]) string mainDevice @@ -777,8 +754,7 @@ End /// @param deviceID device identifier /// @param hardwareType One of @ref HardwareDACTypeConstants /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function/S HW_GetDeviceName(hardwareType, deviceID, [flags]) - variable hardwareType, deviceID, flags +Function/S HW_GetDeviceName(variable hardwareType, variable deviceID, [variable flags]) string mainDevice, pressureDevice @@ -915,6 +891,7 @@ End /// There is no corresponding function for other hardware types like NI devices /// because those do not have a two part device name Function/S HW_ITC_BuildDeviceString(string deviceType, string deviceNumber) + ASSERT(!isEmpty(deviceType) && !isEmpty(deviceNumber), "empty device type or number") if(FindListItem(deviceType, DEVICE_TYPES_ITC) > -1) @@ -1042,8 +1019,8 @@ End /// @brief Output an informative error message for the ITC XOP2 operations /// /// @return 0 on success, 1 otherwise -threadsafe Function HW_ITC_HandleReturnValues(flags, ITCError, ITCXOPError) - variable flags, ITCError, ITCXOPError +threadsafe Function HW_ITC_HandleReturnValues(variable flags, variable ITCError, variable ITCXOPError) + string msg variable outputErrorMessage, tries @@ -1191,9 +1168,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return ITC device ID -Function HW_ITC_OpenDevice(deviceType, deviceNumber, [flags]) - variable deviceType, deviceNumber - variable flags +Function HW_ITC_OpenDevice(variable deviceType, variable deviceNumber, [variable flags]) variable deviceID, tries, i @@ -1223,8 +1198,7 @@ Function HW_ITC_OpenDevice(deviceType, deviceNumber, [flags]) End /// @brief Close all ITC devices -Function HW_ITC_CloseAllDevices([flags]) - variable flags +Function HW_ITC_CloseAllDevices([variable flags]) variable i @@ -1242,8 +1216,7 @@ Function HW_ITC_CloseAllDevices([flags]) End /// @see HW_CloseDevice -Function HW_ITC_CloseDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_CloseDevice(variable deviceID, [variable flags]) variable tries @@ -1271,8 +1244,7 @@ Function HW_ITC_CloseDevice(deviceID, [flags]) End /// @see HW_SelectDevice -Function HW_ITC_SelectDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_SelectDevice(variable deviceID, [variable flags]) variable tries @@ -1286,8 +1258,7 @@ Function HW_ITC_SelectDevice(deviceID, [flags]) End /// @see HW_GetDeviceInfo -Function/WAVE HW_ITC_GetDeviceInfo(deviceID, [flags]) - variable deviceID, flags +Function/WAVE HW_ITC_GetDeviceInfo(variable deviceID, [variable flags]) variable tries @@ -1303,8 +1274,7 @@ Function/WAVE HW_ITC_GetDeviceInfo(deviceID, [flags]) End /// @see HW_EnableYoking -Function HW_ITC_EnableYoking(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_EnableYoking(variable deviceID, [variable flags]) variable tries @@ -1318,8 +1288,7 @@ Function HW_ITC_EnableYoking(deviceID, [flags]) End /// @see HW_DisableYoking -Function HW_ITC_DisableYoking(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_DisableYoking(variable deviceID, [variable flags]) variable tries @@ -1333,8 +1302,7 @@ Function HW_ITC_DisableYoking(deviceID, [flags]) End /// @see HW_StopAcq (threadsafe variant) -threadsafe Function HW_ITC_StopAcq_TS(deviceID, [prepareForDAQ, flags]) - variable deviceID, prepareForDAQ, flags +threadsafe Function HW_ITC_StopAcq_TS(variable deviceID, [variable prepareForDAQ, variable flags]) variable tries @@ -1361,10 +1329,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @see HW_StopAcq -Function HW_ITC_StopAcq(deviceID, [config, configFunc, prepareForDAQ, zeroDAC, flags]) - variable deviceID, prepareForDAQ, zeroDAC, flags - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc +Function HW_ITC_StopAcq(variable deviceID, [WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable prepareForDAQ, variable zeroDAC, variable flags]) variable i, numEntries, tries string device @@ -1407,8 +1372,7 @@ End /// @brief Return the deviceID of the currently selected /// ITC device from the XOP -Function HW_ITC_GetCurrentDevice([flags]) - variable flags +Function HW_ITC_GetCurrentDevice([variable flags]) variable tries @@ -1440,10 +1404,7 @@ End /// @param deviceID device identifier /// @param config ITC config wave /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -threadsafe Function HW_ITC_ResetFifo_TS(deviceID, config, [flags]) - variable deviceID - WAVE config - variable flags +threadsafe Function HW_ITC_ResetFifo_TS(variable deviceID, WAVE config, [variable flags]) variable tries @@ -1463,11 +1424,7 @@ End /// @param[in] config [optional] ITC config wave /// @param configFunc [optional, defaults to GetITCChanConfigWave()] override wave getter for the ITC config wave /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_ITC_ResetFifo(deviceID, [config, configFunc, flags]) - variable deviceID - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc - variable flags +Function HW_ITC_ResetFifo(variable deviceID, [WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags]) variable tries string device @@ -1495,8 +1452,7 @@ Function HW_ITC_ResetFifo(deviceID, [config, configFunc, flags]) End /// @see HW_StartAcq (threadsafe variant) -threadsafe Function HW_ITC_StartAcq_TS(deviceID, triggerMode, [flags]) - variable deviceID, triggerMode, flags +threadsafe Function HW_ITC_StartAcq_TS(variable deviceID, variable triggerMode, [variable flags]) variable tries @@ -1522,8 +1478,7 @@ threadsafe Function HW_ITC_StartAcq_TS(deviceID, triggerMode, [flags]) End /// @see HW_StartAcq -Function HW_ITC_StartAcq(deviceID, triggerMode, [flags]) - variable deviceID, triggerMode, flags +Function HW_ITC_StartAcq(variable deviceID, variable triggerMode, [variable flags]) variable tries @@ -1562,8 +1517,7 @@ End /// /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_ITC_IsRunning(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_IsRunning(variable deviceID, [variable flags]) DEBUGPRINTSTACKINFO() @@ -1580,8 +1534,7 @@ End /// /// @param deviceID device identifier /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function/WAVE HW_ITC_GetState(deviceID, [flags]) - variable deviceID, flags +Function/WAVE HW_ITC_GetState(variable deviceID, [variable flags]) variable tries @@ -1603,8 +1556,7 @@ threadsafe static Function HW_ITC_ShouldContinue(variable tries, variable itcErr End /// @see HW_ReadADC -Function HW_ITC_ReadADC(deviceID, channel, [flags]) - variable deviceID, channel, flags +Function HW_ITC_ReadADC(variable deviceID, variable channel, [variable flags]) variable tries @@ -1620,8 +1572,7 @@ Function HW_ITC_ReadADC(deviceID, channel, [flags]) End /// @see HW_WriteDAC -Function HW_ITC_WriteDAC(deviceID, channel, value, [flags]) - variable deviceID, channel, value, flags +Function HW_ITC_WriteDAC(variable deviceID, variable channel, variable value, [variable flags]) variable tries @@ -1635,8 +1586,7 @@ Function HW_ITC_WriteDAC(deviceID, channel, value, [flags]) End /// @see HW_ReadDigital -Function HW_ITC_ReadDigital(deviceID, xopChannel, [flags]) - variable deviceID, xopChannel, flags +Function HW_ITC_ReadDigital(variable deviceID, variable xopChannel, [variable flags]) variable tries @@ -1652,8 +1602,7 @@ Function HW_ITC_ReadDigital(deviceID, xopChannel, [flags]) End /// @see HW_WriteDigital -Function HW_ITC_WriteDigital(deviceID, xopChannel, value, [flags]) - variable deviceID, xopChannel, value, flags +Function HW_ITC_WriteDigital(variable deviceID, variable xopChannel, variable value, [variable flags]) variable tries @@ -1667,15 +1616,13 @@ Function HW_ITC_WriteDigital(deviceID, xopChannel, value, [flags]) End /// @brief Set the debug flag of the ITC XOP to ON/OFF (threadsafe variant) -threadsafe Function HW_ITC_DebugMode_TS(state, [flags]) - variable state, flags +threadsafe Function HW_ITC_DebugMode_TS(variable state, [variable flags]) ITCSetGlobals2/D=(state)/Z=1 End /// @brief Set the debug flag of the ITC XOP to ON/OFF -Function HW_ITC_DebugMode(state, [flags]) - variable state, flags +Function HW_ITC_DebugMode(variable state, [variable flags]) DEBUGPRINTSTACKINFO() @@ -1692,11 +1639,7 @@ End /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param offset [optional, defaults to zero] offset into the data wave in points /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_ITC_PrepareAcq(deviceID, mode, [data, dataFunc, config, configFunc, flags, offset]) - variable deviceID, mode - WAVE/Z data, config - FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, configFunc - variable flags, offset +Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) string device variable tries @@ -1767,12 +1710,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return 1 if more data needs to be acquired, 0 if done. On hardware error we also return 1. -threadsafe Function HW_ITC_MoreData_TS(deviceID, ADChannelToMonitor, stopCollectionPoint, config, [fifoPos, flags]) - variable deviceID - variable ADChannelToMonitor, stopCollectionPoint - WAVE config - variable &fifoPos - variable flags +threadsafe Function HW_ITC_MoreData_TS(variable deviceID, variable ADChannelToMonitor, variable stopCollectionPoint, WAVE config, [variable &fifoPos, variable flags]) variable fifoPosValue, offset, ret, tries @@ -1814,13 +1752,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return 1 if more data needs to be acquired, 0 if done. On hardware error we also return 1. -Function HW_ITC_MoreData(deviceID, [ADChannelToMonitor, stopCollectionPoint, config, configFunc, fifoPos, flags]) - variable deviceID - variable ADChannelToMonitor, stopCollectionPoint - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc - variable &fifoPos - variable flags +Function HW_ITC_MoreData(variable deviceID, [variable ADChannelToMonitor, variable stopCollectionPoint, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable &fifoPos, variable flags]) variable fifoPosValue, offset, ret, tries string device @@ -1875,6 +1807,7 @@ Function HW_ITC_MoreData(deviceID, [ADChannelToMonitor, stopCollectionPoint, con End Function/WAVE HW_ITC_GetVersionInfo([variable flags]) + variable ret, tries do @@ -1908,8 +1841,7 @@ Function/S HW_ITC_ListDevices() DEBUGPRINT("Unimplemented") End -Function HW_ITC_HandleReturnValues(flags, ITCError, ITCXOPError) - variable flags, ITCError, ITCXOPError +Function HW_ITC_HandleReturnValues(variable flags, variable ITCError, variable ITCXOPError) DEBUGPRINT("Unimplemented") End @@ -1920,65 +1852,52 @@ threadsafe static Function/S HW_ITC_GetXOPErrorMessage(errCode) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_OpenDevice(deviceType, deviceNumber, [flags]) - variable deviceType, deviceNumber - variable flags +Function HW_ITC_OpenDevice(variable deviceType, variable deviceNumber, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_CloseAllDevices([flags]) - variable flags +Function HW_ITC_CloseAllDevices([variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_CloseDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_CloseDevice(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_SelectDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_SelectDevice(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function/WAVE HW_ITC_GetDeviceInfo(deviceID, [flags]) - variable deviceID, flags +Function/WAVE HW_ITC_GetDeviceInfo(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_EnableYoking(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_EnableYoking(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_DisableYoking(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_DisableYoking(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -threadsafe Function HW_ITC_StopAcq_TS(deviceID, [prepareForDAQ, flags]) - variable deviceID, prepareForDAQ, flags +threadsafe Function HW_ITC_StopAcq_TS(variable deviceID, [variable prepareForDAQ, variable flags]) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_StopAcq(deviceID, [config, configFunc, prepareForDAQ, zeroDAC, flags]) - variable deviceID, prepareForDAQ, zeroDAC, flags - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc +Function HW_ITC_StopAcq(variable deviceID, [WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable prepareForDAQ, variable zeroDAC, variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_GetCurrentDevice([flags]) - variable flags +Function HW_ITC_GetCurrentDevice([variable flags]) DEBUGPRINT("Unimplemented") End @@ -1989,114 +1908,83 @@ threadsafe static Function/WAVE HW_ITC_GetFifoPosFromConfig(config_t) DEBUGPRINT_TS("Unimplemented") End -threadsafe Function HW_ITC_ResetFifo_TS(deviceID, config, [flags]) - variable deviceID - WAVE config - variable flags +threadsafe Function HW_ITC_ResetFifo_TS(variable deviceID, WAVE config, [variable flags]) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_ResetFifo(deviceID, [config, configFunc, flags]) - variable deviceID - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc - variable flags +Function HW_ITC_ResetFifo(variable deviceID, [WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags]) DEBUGPRINT("Unimplemented") End -threadsafe Function HW_ITC_StartAcq_TS(deviceID, triggerMode, [flags]) - variable deviceID, triggerMode, flags +threadsafe Function HW_ITC_StartAcq_TS(variable deviceID, variable triggerMode, [variable flags]) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_StartAcq(deviceID, triggerMode, [flags]) - variable deviceID, triggerMode, flags +Function HW_ITC_StartAcq(variable deviceID, variable triggerMode, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_IsRunning(deviceID, [flags]) - variable deviceID, flags +Function HW_ITC_IsRunning(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function/WAVE HW_ITC_GetState(deviceID, [flags]) - variable deviceID, flags +Function/WAVE HW_ITC_GetState(variable deviceID, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_ReadADC(deviceID, channel, [flags]) - variable deviceID, channel, flags +Function HW_ITC_ReadADC(variable deviceID, variable channel, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_WriteDAC(deviceID, channel, value, [flags]) - variable deviceID, channel, value, flags +Function HW_ITC_WriteDAC(variable deviceID, variable channel, variable value, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_ReadDigital(deviceID, xopChannel, [flags]) - variable deviceID, xopChannel, flags +Function HW_ITC_ReadDigital(variable deviceID, variable xopChannel, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_WriteDigital(deviceID, xopChannel, value, [flags]) - variable deviceID, xopChannel, value, flags +Function HW_ITC_WriteDigital(variable deviceID, variable xopChannel, variable value, [variable flags]) DEBUGPRINT("Unimplemented") End -threadsafe Function HW_ITC_DebugMode_TS(state, [flags]) - variable state, flags +threadsafe Function HW_ITC_DebugMode_TS(variable state, [variable flags]) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_DebugMode(state, [flags]) - variable state, flags +Function HW_ITC_DebugMode(variable state, [variable flags]) DEBUGPRINT("Unimplemented") End -Function HW_ITC_PrepareAcq(deviceID, mode, [data, dataFunc, config, configFunc, flags, offset]) - variable deviceID, mode - WAVE/Z data, config - FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, configFunc - variable flags, offset +Function HW_ITC_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) DEBUGPRINT("Unimplemented") End -threadsafe Function HW_ITC_MoreData_TS(deviceID, ADChannelToMonitor, stopCollectionPoint, config, [fifoPos, flags]) - variable deviceID - variable ADChannelToMonitor, stopCollectionPoint - WAVE config - variable &fifoPos - variable flags +threadsafe Function HW_ITC_MoreData_TS(variable deviceID, variable ADChannelToMonitor, variable stopCollectionPoint, WAVE config, [variable &fifoPos, variable flags]) DEBUGPRINT_TS("Unimplemented") End -Function HW_ITC_MoreData(deviceID, [ADChannelToMonitor, stopCollectionPoint, config, configFunc, fifoPos, flags]) - variable deviceID - variable ADChannelToMonitor, stopCollectionPoint - WAVE/Z config - FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc - variable &fifoPos - variable flags +Function HW_ITC_MoreData(variable deviceID, [variable ADChannelToMonitor, variable stopCollectionPoint, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable &fifoPos, variable flags]) DEBUGPRINT("Unimplemented") End Function/WAVE HW_ITC_GetVersionInfo([variable flags]) + DEBUGPRINT("Unimplemented") End @@ -2107,20 +1995,18 @@ End #endif -Function/WAVE HW_WAVE_GETTER_PROTOTYPE(str) - string str +Function/WAVE HW_WAVE_GETTER_PROTOTYPE(string str) + End -threadsafe Function/WAVE HW_ITC_Transpose(wv) - WAVE wv +threadsafe Function/WAVE HW_ITC_Transpose(WAVE wv) MatrixOp/FREE wv_t = wv^t return wv_t End -Function/WAVE HW_ITC_TransposeAndToInt(wv) - WAVE wv +Function/WAVE HW_ITC_TransposeAndToInt(WAVE wv) MatrixOp/FREE wv_t = int32(wv^t) @@ -2133,8 +2019,7 @@ End /// @brief Returns the device channel offset for the given device /// /// @returns 16 for ITC1600 and 0 for all other types -Function HW_ITC_CalculateDevChannelOff(device) - string device +Function HW_ITC_CalculateDevChannelOff(string device) if(IsITC1600(device)) return 16 @@ -2144,9 +2029,7 @@ Function HW_ITC_CalculateDevChannelOff(device) End /// @brief Return the `first` and `last` TTL bits/channels for the given `rack` -threadsafe Function HW_ITC_GetRackRange(rack, first, last) - variable rack - variable &first, &last +threadsafe Function HW_ITC_GetRackRange(variable rack, variable &first, variable &last) if(rack == RACK_ZERO) first = 0 @@ -2165,9 +2048,7 @@ End /// /// The DA_Ephys panel e.g. labels the first ttlBit of #RACK_ONE as 4, but the /// ITC XOP treats that as 0. -Function HW_ITC_ClipTTLBit(device, ttlBit) - string device - variable ttlBit +Function HW_ITC_ClipTTLBit(string device, variable ttlBit) if(HW_ITC_GetRackForTTLBit(device, ttlBit) == RACK_ONE) return ttlBit - NUM_ITC_TTL_BITS_PER_RACK @@ -2178,9 +2059,7 @@ End /// @brief Return the rack number for the given ttlBit (the ttlBit is /// called `TTL channel` in the DA Ephys panel) -Function HW_ITC_GetRackForTTLBit(device, ttlBit) - string device - variable ttlBit +Function HW_ITC_GetRackForTTLBit(string device, variable ttlBit) ASSERT(ttlBit < NUM_DA_TTL_CHANNELS, "Invalid channel index") @@ -2196,9 +2075,7 @@ End /// /// Only the ITC1600 has two racks. The channel numbers differ for the /// different ITC device types. -Function HW_ITC_GetITCXOPChannelForRack(device, rack) - string device - variable rack +Function HW_ITC_GetITCXOPChannelForRack(string device, variable rack) if(rack == RACK_ZERO) if(IsITC1600(device)) @@ -2218,8 +2095,7 @@ End /// /// - ITC1600 can have 1 or 2 racks /// - other device types have 1 -Function HW_ITC_GetNumberOfRacks(device) - string device +Function HW_ITC_GetNumberOfRacks(string device) WAVE deviceInfo = GetDeviceInfoWave(device) @@ -2229,8 +2105,7 @@ End /// @brief Assert on using an invalid ITC device name /// /// @param deviceName ITC device name -Function HW_ITC_AssertOnInvalid(deviceName) - string deviceName +Function HW_ITC_AssertOnInvalid(string deviceName) ASSERT(HW_ITC_IsValidDeviceName(deviceName), "Invalid ITC device name") End @@ -2238,8 +2113,7 @@ End /// @brief Check wether the given ITC device name is valid /// /// Currently a device name is valid if it is not empty. -Function HW_ITC_IsValidDeviceName(deviceName) - string deviceName +Function HW_ITC_IsValidDeviceName(string deviceName) return !isEmpty(deviceName) End @@ -2253,8 +2127,7 @@ End /// @brief Assert on using an invalid NI device name /// /// @param deviceName NI device name -Function HW_NI_AssertOnInvalid(deviceName) - string deviceName +Function HW_NI_AssertOnInvalid(string deviceName) ASSERT(HW_NI_IsValidDeviceName(deviceName), "Invalid NI device name") End @@ -2262,8 +2135,7 @@ End /// @brief Check wether the given NI device name is valid /// /// Currently a device name is valid if it is not empty. -Function HW_NI_IsValidDeviceName(deviceName) - string deviceName +Function HW_NI_IsValidDeviceName(string deviceName) return !isEmpty(deviceName) End @@ -2317,8 +2189,7 @@ static Constant HW_NI_FIFO_MIN_FREE_DISK_SPACE = 960000000 /// /// @see HW_StartAcq -Function HW_NI_StartAcq(deviceID, triggerMode, [flags, repeat]) - variable deviceID, triggerMode, flags, repeat +Function HW_NI_StartAcq(variable deviceID, variable triggerMode, [variable flags, variable repeat]) string device, realDeviceOrPressure, FIFONote, noteID, fifoName, errMsg variable i, pos, endpos, channelTimeOffset, err @@ -2379,11 +2250,7 @@ End /// @param configFunc [optional, defaults to GetDAQConfigWave()] override wave getter for the ITC config wave /// @param offset [optional, defaults to zero] offset into the data wave in points /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_PrepareAcq(deviceID, mode, [data, dataFunc, config, configFunc, flags, offset]) - variable deviceID, mode - WAVE/Z data, config - FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, configFunc - variable flags, offset +Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) string device, tempStr, realDeviceOrPressure, filename, clkStr, wavegenStr, TTLStr, fifoName, errMsg variable i, aiCnt, ttlCnt, channels, sampleIntervall, numEntries, fifoSize, err, minimum, maximum @@ -2442,8 +2309,8 @@ Function HW_NI_PrepareAcq(deviceID, mode, [data, dataFunc, config, configFunc, f break case XOP_CHANNEL_TYPE_DAC: WAVE NIChannel = NIDataWave[i] - wavegenStr += GetWavesDataFolder(NIChannel, 2) + "," - wavegenStr += num2str(config[i][%ChannelNumber]) + "," + wavegenStr += GetWavesDataFolder(NIChannel, 2) + "," + wavegenStr += num2str(config[i][%ChannelNumber]) + "," [minimum, maximum] = WaveMinAndMax(NIChannel) sprintf tempStr, "%10f", max(-10, minimum - 0.001) wavegenStr += tempStr + "," @@ -2561,9 +2428,7 @@ End /// @param device name of NI device /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_OpenDevice(device, [flags]) - string device - variable flags +Function HW_NI_OpenDevice(string device, [variable flags]) DEBUGPRINTSTACKINFO() @@ -2577,6 +2442,7 @@ End /// @brief Print all available properties of all NI devices to the commandline Function HW_NI_PrintPropertiesOfDevices() + string device variable numAI, numAO, numCounter, numDIO, selfCalDate @@ -2621,9 +2487,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return bitmask of variable width -Function HW_NI_ReadDigital(device, [DIOPort, DIOLine, flags]) - string device - variable DIOPort, DIOLine, flags +Function HW_NI_ReadDigital(string device, [variable DIOPort, variable DIOLine, variable flags]) variable taskID, ret, result, lineGrouping string line @@ -2681,9 +2545,7 @@ End /// @param DIOLine [optional, defaults to all lines of the port] Allows to write /// only a single line instead of all bits of the port /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_WriteDigital(device, value, [DIOPort, DIOLine, flags]) - string device - variable DIOPort, DIOLine, value, flags +Function HW_NI_WriteDigital(string device, variable value, [variable DIOPort, variable DIOLine, variable flags]) variable taskID, ret, lineGrouping string line @@ -2751,9 +2613,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return 0 on success, 1 otherwise -Function HW_NI_WriteAnalogSingleAndSlow(device, channel, value, [flags]) - string device - variable channel, value, flags +Function HW_NI_WriteAnalogSingleAndSlow(string device, variable channel, variable value, [variable flags]) variable ret @@ -2782,9 +2642,7 @@ End /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @return volts -Function HW_NI_ReadAnalogSingleAndSlow(device, channel, [flags]) - string device - variable channel, flags +Function HW_NI_ReadAnalogSingleAndSlow(string device, variable channel, [variable flags]) variable value @@ -2832,8 +2690,7 @@ End /// @brief Return a list of all NI devices which can be opened /// /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function/S HW_NI_ListDevices([flags]) - variable flags +Function/S HW_NI_ListDevices([variable flags]) DEBUGPRINTSTACKINFO() @@ -2857,8 +2714,7 @@ End /// @param[in] flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags /// /// @see HW_StopAcq -Function HW_NI_StopAcq(deviceID, [zeroDAC, flags]) - variable deviceID, zeroDAC, flags +Function HW_NI_StopAcq(variable deviceID, [variable zeroDAC, variable flags]) string device @@ -2876,8 +2732,7 @@ End /// /// @param[in] deviceID ID of the NI device /// @param[in] flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_StopADC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopADC(variable deviceID, [variable flags]) DEBUGPRINTSTACKINFO() @@ -2906,8 +2761,7 @@ End /// /// @param[in] deviceID ID of the NI device /// @param[in] flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_StopDAC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopDAC(variable deviceID, [variable flags]) DEBUGPRINTSTACKINFO() @@ -2935,8 +2789,7 @@ End /// /// @param[in] deviceID ID of the NI device /// @param[in] flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_StopTTL(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopTTL(variable deviceID, [variable flags]) DEBUGPRINTSTACKINFO() @@ -2964,8 +2817,7 @@ End /// /// @param[in] deviceID ID of the NI device /// @param[in] flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -Function HW_NI_ZeroDAC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_ZeroDAC(variable deviceID, [variable flags]) DEBUGPRINTSTACKINFO() @@ -3000,8 +2852,7 @@ End /// @brief Kill the FIFO of the given NI device /// /// @param deviceID device identifier -Function HW_NI_KillFifo(deviceID) - variable deviceID +Function HW_NI_KillFifo(variable deviceID) DEBUGPRINTSTACKINFO() @@ -3058,8 +2909,7 @@ End /// @brief Reset task IDs for NI hardware /// /// @param device name of the NI device -Function HW_NI_ResetTaskIDs(device) - string device +Function HW_NI_ResetTaskIDs(string device) NVAR taskIDADC = $GetNI_ADCTaskID(device) NVAR taskIDDAC = $GetNI_DACTaskID(device) @@ -3072,8 +2922,7 @@ End /// @brief Check if the device is running /// /// @param device name of the NI device -Function HW_NI_IsRunning(device) - string device +Function HW_NI_IsRunning(string device) DEBUGPRINTSTACKINFO() @@ -3117,8 +2966,7 @@ static Function HW_NI_CalibrateDevice(device, [force, flags]) End /// @see HW_CloseDevice -Function HW_NI_CloseDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_CloseDevice(variable deviceID, [variable flags]) string deviceType, deviceNumber, deviceName @@ -3140,9 +2988,7 @@ Function HW_NI_CloseDevice(deviceID, [flags]) End /// @see HW_GetDeviceInfo -Function/WAVE HW_NI_GetDeviceInfo(device, [flags]) - string device - variable flags +Function/WAVE HW_NI_GetDeviceInfo(string device, [variable flags]) DEBUGPRINTSTACKINFO() @@ -3188,53 +3034,42 @@ End #else -Function HW_NI_StartAcq(deviceID, triggerMode, [flags, repeat]) - variable deviceID, triggerMode, flags, repeat +Function HW_NI_StartAcq(variable deviceID, variable triggerMode, [variable flags, variable repeat]) + DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_PrepareAcq(deviceID, mode, [data, dataFunc, config, configFunc, flags, offset]) - variable deviceID - variable mode - WAVE/Z data, config - FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, configFunc - variable flags, offset +Function HW_NI_PrepareAcq(variable deviceID, variable mode, [WAVE/Z data, FUNCREF HW_WAVE_GETTER_PROTOTYPE dataFunc, WAVE/Z config, FUNCREF HW_WAVE_GETTER_PROTOTYPE configFunc, variable flags, variable offset]) DoAbortNow("NI-DAQ XOP is not available") End Function/S HW_NI_GetPropertyListOfDevices(string device) + return "" End Function HW_NI_PrintPropertiesOfDevices() + DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_ReadDigital(device, [DIOPort, DIOLine, flags]) - string device - variable DIOPort, DIOLine, flags +Function HW_NI_ReadDigital(string device, [variable DIOPort, variable DIOLine, variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_WriteDigital(device, value, [DIOPort, DIOLine, flags]) - string device - variable DIOPort, DIOLine, value, flags +Function HW_NI_WriteDigital(string device, variable value, [variable DIOPort, variable DIOLine, variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_WriteAnalogSingleAndSlow(device, channel, value, [flags]) - string device - variable channel, value, flags +Function HW_NI_WriteAnalogSingleAndSlow(string device, variable channel, variable value, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_ReadAnalogSingleAndSlow(device, channel, [flags]) - string device - variable channel, flags +Function HW_NI_ReadAnalogSingleAndSlow(string device, variable channel, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End @@ -3244,38 +3079,32 @@ Function HW_NI_GetAnalogInputConfig(string device, variable channel, [variable f DoAbortNow("NI-DAQ XOP is not available") End -Function/S HW_NI_ListDevices([flags]) - variable flags +Function/S HW_NI_ListDevices([variable flags]) return "" End -Function HW_NI_StopAcq(deviceID, [zeroDAC, flags]) - variable deviceID, zeroDAC, flags +Function HW_NI_StopAcq(variable deviceID, [variable zeroDAC, variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_StopDAC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopDAC(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_StopADC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopADC(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_StopTTL(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_StopTTL(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_ZeroDAC(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_ZeroDAC(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End @@ -3294,35 +3123,27 @@ static Function HW_NI_CalibrateDevice(device, [force, flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_IsRunning(device, [flags]) - string device - variable flags +Function HW_NI_IsRunning(string device, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_OpenDevice(device, [flags]) - string device - variable flags +Function HW_NI_OpenDevice(string device, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_CloseDevice(deviceID, [flags]) - variable deviceID, flags +Function HW_NI_CloseDevice(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function/WAVE HW_NI_GetDeviceInfo(device, [flags]) - string device - variable flags +Function/WAVE HW_NI_GetDeviceInfo(string device, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -Function HW_NI_ResetTaskIDs(device) - string device +Function HW_NI_ResetTaskIDs(string device) DoAbortNow("NI-DAQ XOP is not available") End @@ -3531,10 +3352,10 @@ Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCRE if(IsNaN(headStage)) // unassoc ADC [inChannel, encodeInfo] = HW_SU_GetEncodeFromUnassocADC(unassocADCIndex) - unassocADCIndex += 1 + unassocADCIndex += 1 else [inChannel, encodeInfo] = HW_SU_GetEncodeFromHS(headstage) - inChannel *= 2 + inChannel *= 2 if(config[i][%CLAMPMODE] == I_CLAMP_MODE) inChannel += 1 endif @@ -3549,7 +3370,7 @@ Function HW_SU_PrepareAcq(variable deviceId, variable mode, [WAVE/Z data, FUNCRE if(IsNaN(headStage)) // unassoc DAC [outChannel, encodeInfo] = HW_SU_GetEncodeFromUnassocDAC(unassocDACIndex) - unassocDACIndex += 1 + unassocDACIndex += 1 else [outChannel, encodeInfo] = HW_SU_GetEncodeFromHS(headstage) endif @@ -3683,7 +3504,7 @@ Function HW_SU_ZeroDAC(variable deviceID, [variable flags]) if(IsNaN(headStage)) // unassoc DAC [outChannel, encodeInfo] = HW_SU_GetEncodeFromUnassocDAC(unassocDACIndex) - unassocDACIndex += 1 + unassocDACIndex += 1 else [outChannel, encodeInfo] = HW_SU_GetEncodeFromHS(headstage) endif @@ -3696,11 +3517,11 @@ Function HW_SU_ZeroDAC(variable deviceID, [variable flags]) // we need to run some input as well to have the command hook from SutterDAQScanWave Redimension/N=(1, -1) input - input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) + input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) [inChannel, encodeInfo] = HW_SU_GetEncodeFromHS(0) - inChannel *= 2 - input[0][%CHANNEL] = num2istr(inChannel) - input[0][%ENCODEINFO] = encodeInfo + inChannel *= 2 + input[0][%CHANNEL] = num2istr(inChannel) + input[0][%ENCODEINFO] = encodeInfo HW_SU_AcquireImpl(device, input, output, $"", SUTTER_ACQUISITION_FOREGROUND, timeout = 1) End @@ -3718,10 +3539,10 @@ Function HW_SU_ReadADC(variable deviceID, variable channel, [variable flags]) WAVE channelAD = GetSutterSingleSampleADCInputWave(device) Redimension/N=(1, -1) input - input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) + input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) [inChannel, encodeInfo] = HW_SU_GetEncodeFromUnassocADC(channel) - input[0][%CHANNEL] = num2istr(inChannel) - input[0][%ENCODEINFO] = encodeInfo + input[0][%CHANNEL] = num2istr(inChannel) + input[0][%ENCODEINFO] = encodeInfo HW_SU_AcquireImpl(device, input, $"", $"", SUTTER_ACQUISITION_FOREGROUND, timeout = 1, inputOnly = 1) @@ -3744,18 +3565,18 @@ Function HW_SU_WriteDAC(variable deviceID, variable channel, variable value, [va channelDA = value Redimension/N=(1, -1) output - output[0][%OUTPUTWAVE] = GetWavesDataFolder(channelDA, 2) + output[0][%OUTPUTWAVE] = GetWavesDataFolder(channelDA, 2) [outChannel, encodeInfo] = HW_SU_GetEncodeFromUnassocDAC(channel) - output[0][%CHANNEL] = num2istr(outChannel) - output[0][%ENCODEINFO] = encodeInfo + output[0][%CHANNEL] = num2istr(outChannel) + output[0][%ENCODEINFO] = encodeInfo // we need to run some input as well to have the command hook from SutterDAQScanWave Redimension/N=(1, -1) input - input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) + input[0][%INPUTWAVE] = GetWavesDataFolder(channelAD, 2) [inChannel, encodeInfo] = HW_SU_GetEncodeFromHS(0) - inChannel *= 2 - input[0][%CHANNEL] = num2istr(inChannel) - input[0][%ENCODEINFO] = encodeInfo + inChannel *= 2 + input[0][%CHANNEL] = num2istr(inChannel) + input[0][%ENCODEINFO] = encodeInfo HW_SU_AcquireImpl(device, input, output, $"", SUTTER_ACQUISITION_FOREGROUND, timeout = 1) End diff --git a/Packages/MIES/MIES_DAEphys.ipf b/Packages/MIES/MIES_DAEphys.ipf index 6d66542209..8e43d9772c 100644 --- a/Packages/MIES/MIES_DAEphys.ipf +++ b/Packages/MIES/MIES_DAEphys.ipf @@ -48,6 +48,7 @@ End /// @brief Returns a list of DAC devices for NI devices /// @return list of NI DAC devices, #NONE if there are none Function/S DAP_GetNIDeviceList() + variable i, j, numPattern, numDevices string propList string devList, pattern, device @@ -193,6 +194,7 @@ End /// Useful when adding controls to GUI. Facilitates use of auto generation of GUI code. /// Useful when template experiment file has been overwritten. Function DAP_EphysPanelStartUpSettings() + string device variable i @@ -793,8 +795,7 @@ Function DAP_EphysPanelStartUpSettings() CleanupOperationQueueResult() End -Function DAP_WindowHook(s) - STRUCT WMWinHookStruct &s +Function DAP_WindowHook(STRUCT WMWinHookStruct &s) string device, ctrl variable sgn, i @@ -848,6 +849,7 @@ End /// @brief Return a popValue string suitable for stimsets /// @todo rework the code to have a fixed popValue Function/S DAP_FormatStimSetPopupValue(variable channelType, [string searchString]) + if(ParamIsDefault(searchString)) searchString = "*" endif @@ -874,8 +876,7 @@ End /// @brief Called by ACL tab control after the tab is updated. /// see line 257 of ACL_TabUtilities.ipf -Function DAP_TabControlFinalHook(tca) - STRUCT WMTabControlAction &tca +Function DAP_TabControlFinalHook(STRUCT WMTabControlAction &tca) string win @@ -892,8 +893,7 @@ Function DAP_TabControlFinalHook(tca) return 0 End -Function DAP_SetVarProc_Channel_Search(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_Channel_Search(STRUCT WMSetVariableAction &sva) : SetVariableControl variable channelIndex, channelType, channelControl variable i, isCustomSearchString, numSuppChannels @@ -962,8 +962,7 @@ Function DAP_SetVarProc_Channel_Search(sva) : SetVariableControl return 0 End -Function DAP_DAorTTLCheckProc(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_DAorTTLCheckProc(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, control @@ -987,8 +986,7 @@ Function DAP_DAorTTLCheckProc(cba) : CheckBoxControl endswitch End -Function DAP_CheckProc_Channel_All(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_Channel_All(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, control, lbl variable i, checked, allChecked, channelIndex, channelType, controlType, numEntries @@ -1027,8 +1025,7 @@ Function DAP_CheckProc_Channel_All(cba) : CheckBoxControl End /// @brief Determines if the control refers to an "All" control -Function DAP_IsAllControl(channelIndex) - variable channelIndex +Function DAP_IsAllControl(variable channelIndex) return channelIndex == CHANNEL_INDEX_ALL \ || channelIndex == CHANNEL_INDEX_ALL_V_CLAMP \ @@ -1039,9 +1036,7 @@ End /// /// @returns 0 if the given channel is a DA channel and not in the expected /// clamp mode as determined by `controlChannelIndex`, 1 otherwise -Function DAP_DACHasExpectedClampMode(device, controlChannelIndex, channelNumber, channelType) - string device - variable controlChannelIndex, channelNumber, channelType +Function DAP_DACHasExpectedClampMode(string device, variable controlChannelIndex, variable channelNumber, variable channelType) variable headstage, clampMode @@ -1070,8 +1065,7 @@ Function DAP_DACHasExpectedClampMode(device, controlChannelIndex, channelNumber, return 0 End -Function DAP_CheckProc_AD(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_AD(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, control @@ -1101,9 +1095,7 @@ End /// /// This is different from what GetChannelClampMode holds as we here hold the /// setup information and GetChannelClampMode holds what is currently active. -Function GetHeadstageFromSettings(device, channelType, channelNumber, clampMode) - string device - variable channelType, channelNumber, clampMode +Function GetHeadstageFromSettings(string device, variable channelType, variable channelNumber, variable clampMode) variable i, row @@ -1197,9 +1189,7 @@ End /// /// @param device device /// @param runMode One of @ref DAQRunModes except DAQ_NOT_RUNNING -Function DAP_OneTimeCallBeforeDAQ(device, runMode) - string device - variable runMode +Function DAP_OneTimeCallBeforeDAQ(string device, variable runMode) variable i, DAC, ADC, hardwareType @@ -1343,6 +1333,7 @@ End /// @param forcedStop [optional, defaults to false] if DAQ was aborted (true) or stopped by itself (false) /// @param startTPAfterDAQ [optional, defaults to true] start "TP after DAQ" if enabled at the end Function DAP_OneTimeCallAfterDAQ(string device, variable stopReason, [variable forcedStop, variable startTPAfterDAQ]) + variable hardwareType, indexing forcedStop = ParamIsDefault(forcedStop) ? 0 : !!forcedStop @@ -1414,7 +1405,7 @@ static Function DAP_DocumentStopReason(string device, variable stopReason) Make/FREE/N=(3, 1)/T keys keys[0][0] = "DAQ stop reason" - keys[1][0] = "" // @todo: use enumeration as unit once available + keys[1][0] = "" // @todo: use enumeration as unit once available keys[2][0] = LABNOTEBOOK_NO_TOLERANCE Make/FREE/D/N=(1, 1, LABNOTEBOOK_LAYER_COUNT) values = NaN @@ -1424,8 +1415,7 @@ static Function DAP_DocumentStopReason(string device, variable stopReason) ED_AddEntriesToLabnotebook(values, keys, sweepNo, device, UNKNOWN_MODE) End -Function DAP_CheckProc_IndexingState(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_IndexingState(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device @@ -1447,8 +1437,7 @@ Function DAP_CheckProc_IndexingState(cba) : CheckBoxControl return 0 End -Function DAP_CheckProc_ShowScopeWin(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_ShowScopeWin(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device @@ -1490,8 +1479,7 @@ static Function DAP_TurnOffAllChannels(device, channelType) endif End -Function DAP_ButtonProc_AllChanOff(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_AllChanOff(STRUCT WMButtonAction &ba) : ButtonControl string device @@ -1507,9 +1495,7 @@ Function DAP_ButtonProc_AllChanOff(ba) : ButtonControl End /// @brief Update the ITI for the given device -Function DAP_UpdateITIAcrossSets(device, maxITI) - string device - variable maxITI +Function DAP_UpdateITIAcrossSets(string device, variable maxITI) if(DAG_GetNumericalValue(device, "Check_DataAcq_Get_Set_ITI")) PGC_SetAndActivateControl(device, "SetVar_DataAcq_ITI", val = maxITI) @@ -1517,8 +1503,7 @@ Function DAP_UpdateITIAcrossSets(device, maxITI) End /// @brief Procedure for DA/TTL popupmenus including indexing wave popupmenus -Function DAP_PopMenuChkProc_StimSetList(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuChkProc_StimSetList(STRUCT WMPopupAction &pa) : PopupMenuControl string ctrl, list string device, stimSet @@ -1589,8 +1574,7 @@ Function DAP_PopMenuChkProc_StimSetList(pa) : PopupMenuControl return 0 End -Function DAP_SetVarProc_DA_Scale(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_DA_Scale(STRUCT WMSetVariableAction &sva) : SetVariableControl variable val, channelIndex, channelType, controlType, numEntries, i string device, ctrl @@ -1706,8 +1690,7 @@ static Function DAP_IsSampleIntervalValid(string device, variable channelType, v endswitch End -Function DAP_UpdateSweepSetVariables(device) - string device +Function DAP_UpdateSweepSetVariables(string device) variable numSetRepeats @@ -1728,8 +1711,7 @@ Function DAP_UpdateSweepSetVariables(device) SetValDisplay(device, "valdisp_DataAcq_SweepsActiveSet", var = IDX_MaxNoOfSweeps(device, 1)) End -Function DAP_SetVarProc_TotSweepCount(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_TotSweepCount(STRUCT WMSetVariableAction &sva) : SetVariableControl string device @@ -1746,8 +1728,7 @@ Function DAP_SetVarProc_TotSweepCount(sva) : SetVariableControl return 0 End -Function DAP_ButtonCtrlFindConnectedAmps(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonCtrlFindConnectedAmps(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventcode) case 2: // mouse up @@ -1769,6 +1750,7 @@ Function/S DAP_GetNiceAmplifierChannelList() End Function/S DAP_FormatTelegraphServerList(WAVE telegraphServers) + variable i, numRows string str string list = "" @@ -1793,9 +1775,7 @@ static Function/S DAP_GetAmplifierDef(ampSerial, ampChannel) End /// @brief Parse the entries which DAP_GetAmplifierDef() created -Function DAP_ParseAmplifierDef(amplifierDef, ampSerial, ampChannelID) - string amplifierDef - variable &Serial, &ChannelID +Function DAP_ParseAmplifierDef(string amplifierDef, variable &Serial, variable &ChannelID) ampSerial = NaN ampChannelID = NaN @@ -1808,9 +1788,7 @@ Function DAP_ParseAmplifierDef(amplifierDef, ampSerial, ampChannelID) ASSERT(V_Flag == 2, "Unexpected amplifier popup list format") End -Function DAP_SyncDeviceAssocSettToGUI(device, headStage) - string device - variable headStage +Function DAP_SyncDeviceAssocSettToGUI(string device, variable headStage) DAP_AbortIfUnlocked(device) @@ -1818,8 +1796,7 @@ Function DAP_SyncDeviceAssocSettToGUI(device, headStage) P_UpdatePressureControls(device, headStage) End -Function DAP_PopMenuProc_Headstage(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_Headstage(STRUCT WMPopupAction &pa) : PopupMenuControl string device variable headStage @@ -1838,8 +1815,7 @@ Function DAP_PopMenuProc_Headstage(pa) : PopupMenuControl return 0 End -Function DAP_PopMenuProc_CAA(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_CAA(STRUCT WMPopupAction &pa) : PopupMenuControl string device @@ -1856,8 +1832,7 @@ Function DAP_PopMenuProc_CAA(pa) : PopupMenuControl return 0 End -Function DAP_SetVarProc_CAA(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_CAA(STRUCT WMSetVariableAction &sva) : SetVariableControl string device @@ -1892,8 +1867,7 @@ Function DAP_SetVarProc_CAA(sva) : SetVariableControl return 0 End -Function DAP_ButtonProc_ClearChanCon(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_ClearChanCon(STRUCT WMButtonAction &ba) : ButtonControl string device variable headStage, daVC, daIC, adVC, adIC @@ -2002,9 +1976,7 @@ End /// @param mode One of @ref DataAcqModes /// /// @return 0 for valid settings, 1 for invalid settings -Function DAP_CheckSettings(device, mode) - string device - variable mode +Function DAP_CheckSettings(string device, variable mode) variable numDACs, numADCs, numHS, numEntries, i, clampMode, headstage variable ampSerial, ampChannelID, hardwareType @@ -3090,8 +3062,7 @@ End /// @brief Returns the name of the checkbox control (radio button) handling the clamp mode of the given headstage or all headstages /// @param mode One of the amplifier modes @ref AmplifierClampModes /// @param headstage number of the headstage or one of @ref AllHeadstageModeConstants -Function/S DAP_GetClampModeControl(mode, headstage) - variable mode, headstage +Function/S DAP_GetClampModeControl(variable mode, variable headstage) ASSERT(headStage >= CHANNEL_INDEX_ALL_I_ZERO && headStage < NUM_HEADSTAGES, "invalid headStage index") @@ -3132,9 +3103,7 @@ End /// @param[out] mode I_CLAMP_MODE, V_CLAMP_MODE or I_EQUAL_ZERO_MODE, the currently active mode for headstage controls /// and the clamp mode of the control for clamp mode controls /// @param[out] headStage number of the headstage or one of @ref AllHeadstageModeConstants -Function DAP_GetInfoFromControl(device, ctrl, mode, headStage) - string device, ctrl - variable &mode, &headStage +Function DAP_GetInfoFromControl(string device, string ctrl, variable &mode, variable &headStage) string clampMode = "Radio_ClampMode_" string headStageCtrl = "Check_DataAcqHS_" @@ -3202,8 +3171,7 @@ Function DAP_GetInfoFromControl(device, ctrl, mode, headStage) AI_AssertOnInvalidClampMode(mode) End -Function DAP_CheckProc_ClampMode(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_ClampMode(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable mode, headStage string device, control @@ -3235,8 +3203,7 @@ Function DAP_CheckProc_ClampMode(cba) : CheckBoxControl return 0 End -Function DAP_CheckProc_HedstgeChck(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_HedstgeChck(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, control variable checked @@ -3267,9 +3234,7 @@ End /// @param clampMode Clamp mode to activate /// @param headstage Headstage [0, 8[ or use one of @ref AllHeadstageModeConstants /// @param options One of @ref ClampModeChangeOptions -Function DAP_ChangeHeadStageMode(device, clampMode, headstage, options) - string device - variable headstage, clampMode, options +Function DAP_ChangeHeadStageMode(string device, variable clampMode, variable headstage, variable options) string iZeroCtrl, VCctrl, ICctrl, headstageCtrl, ctrl variable activeHS, testPulseMode, oppositeMode, DAC, ADC, i, oldTab, oldState, newSliderPos @@ -3512,9 +3477,7 @@ End /// /// @param device device /// @param mode One of @ref ToggleAcquisitionButtonConstants -Function DAP_ToggleAcquisitionButton(device, mode) - string device - variable mode +Function DAP_ToggleAcquisitionButton(string device, variable mode) ASSERT(mode == DATA_ACQ_BUTTON_TO_STOP || mode == DATA_ACQ_BUTTON_TO_DAQ, "Invalid mode") @@ -3533,9 +3496,7 @@ End /// /// @param device device /// @param mode One of @ref ToggleTestpulseButtonConstants -Function DAP_ToggleTestpulseButton(device, mode) - string device - variable mode +Function DAP_ToggleTestpulseButton(string device, variable mode) ASSERT(mode == TESTPULSE_BUTTON_TO_STOP || mode == TESTPULSE_BUTTON_TO_START, "Invalid mode") @@ -3550,8 +3511,7 @@ Function DAP_ToggleTestpulseButton(device, mode) Button StartTestPulseButton, title=text, win=$device End -Function DAP_ButtonProc_AutoFillGain(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_AutoFillGain(STRUCT WMButtonAction &ba) : ButtonControl string device variable numConnAmplifiers @@ -3576,8 +3536,7 @@ Function DAP_ButtonProc_AutoFillGain(ba) : ButtonControl return 0 End -Function DAP_SliderProc_MIESHeadStage(sc) : SliderControl - STRUCT WMSliderAction &sc +Function DAP_SliderProc_MIESHeadStage(STRUCT WMSliderAction &sc) : SliderControl variable mode, headstage string device @@ -3606,8 +3565,7 @@ Function DAP_SliderProc_MIESHeadStage(sc) : SliderControl return 0 End -Function DAP_SetVarProc_AmpCntrls(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_AmpCntrls(STRUCT WMSetVariableAction &sva) : SetVariableControl string device, ctrl variable headStage @@ -3626,8 +3584,7 @@ Function DAP_SetVarProc_AmpCntrls(sva) : SetVariableControl return 0 End -Function DAP_ButtonProc_AmpCntrls(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_AmpCntrls(STRUCT WMButtonAction &ba) : ButtonControl string device, ctrl variable headStage @@ -3645,8 +3602,7 @@ Function DAP_ButtonProc_AmpCntrls(ba) : ButtonControl return 0 End -Function DAP_CheckProc_AmpCntrls(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_AmpCntrls(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, ctrl variable headStage @@ -3666,8 +3622,7 @@ Function DAP_CheckProc_AmpCntrls(cba) : CheckBoxControl End /// @brief Check box procedure for multiple device (MD) support -Function DAP_CheckProc_MDEnable(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_MDEnable(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable checked string device @@ -3700,8 +3655,7 @@ Function DAP_HandleSingleDeviceDependentControls(string device) End /// @brief Controls TP Insertion into set sweeps before the sweep begins -Function DAP_CheckProc_InsertTP(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function DAP_CheckProc_InsertTP(STRUCT WMCheckBoxAction &cba) : CheckBoxControl string device @@ -3734,8 +3688,7 @@ Function DAP_UpdateOnsetDelay(string device) SetValDisplay(device, "valdisp_DataAcq_OnsetDelayAuto", var = testPulseDurWithBL) End -Function DAP_SetVarProc_TestPulseSett(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_TestPulseSett(STRUCT WMSetVariableAction &sva) : SetVariableControl variable TPState string device @@ -3756,8 +3709,7 @@ Function DAP_SetVarProc_TestPulseSett(sva) : SetVariableControl return 0 End -Function DAP_CheckProc_TestPulseSett(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_TestPulseSett(STRUCT WMCheckboxAction &cba) : CheckBoxControl string device, ctrl variable saveTP, dataAcqRunMode, checked @@ -3779,6 +3731,7 @@ Function DAP_CheckProc_TestPulseSett(cba) : CheckBoxControl End Function DAP_AdaptAutoTPColorAndDependent(string device) + variable runMode, hasAutoTPActive, disabledSaveTP runMode = RoVAR(GetTestpulseRunMode(device)) @@ -3813,8 +3766,7 @@ Function DAP_UnlockAllDevices() endfor End -Function DAP_CheckProc_RepeatedAcq(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_RepeatedAcq(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -3846,8 +3798,7 @@ static Function DAP_ToggleCheckBoxes(win, ctrl, list, checked) SetCheckBoxState(win, partner, !checked) End -Function DAP_CheckProc_SyncCtrl(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_SyncCtrl(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -3863,8 +3814,7 @@ Function DAP_CheckProc_SyncCtrl(cba) : CheckBoxControl return 0 End -Function DAP_SetVarProc_SyncCtrl(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_SyncCtrl(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -3877,8 +3827,7 @@ Function DAP_SetVarProc_SyncCtrl(sva) : SetVariableControl return 0 End -Function DAP_ButtonProc_TPDAQ(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_TPDAQ(STRUCT WMButtonAction &ba) : ButtonControl string device variable testpulseRunMode @@ -3933,15 +3882,13 @@ Function DAP_ButtonProc_TPDAQ(ba) : ButtonControl End /// @brief Return the comment panel name -Function/S DAP_GetCommentPanel(device) - string device +Function/S DAP_GetCommentPanel(string device) return device + "#" + COMMENT_PANEL End /// @brief Return the full window path to the comment notebook -Function/S DAP_GetCommentNotebook(device) - string device +Function/S DAP_GetCommentNotebook(string device) return DAP_GetCommentPanel(device) + "#" + COMMENT_PANEL_NOTEBOOK End @@ -3970,8 +3917,7 @@ static Function DAP_OpenCommentPanel(device) ReplaceNotebookText(commentNotebook, userComment) End -Function DAP_ButtonProc_OpenCommentNB(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_OpenCommentNB(STRUCT WMButtonAction &ba) : ButtonControl string device @@ -4048,8 +3994,7 @@ static Function DAP_AddUserComment(device) End /// @brief Make the comment notebook read-only -Function DAP_LockCommentNotebook(device) - string device +Function DAP_LockCommentNotebook(string device) string commentPanel, commentNotebook @@ -4064,8 +4009,7 @@ Function DAP_LockCommentNotebook(device) End /// @brief Make the comment notebook writeable -Function DAP_UnlockCommentNotebook(device) - string device +Function DAP_UnlockCommentNotebook(string device) string commentPanel, commentNotebook @@ -4081,8 +4025,7 @@ Function DAP_UnlockCommentNotebook(device) End /// @brief Clear the comment notebook's content and the serialized string -Function DAP_ClearCommentNotebook(device) - string device +Function DAP_ClearCommentNotebook(string device) string commentPanel, commentNotebook @@ -4106,8 +4049,7 @@ Function DAP_SerializeAllCommentNBs() End /// @brief Copy the contents of the comment notebook to the user comment string -Function DAP_SerializeCommentNotebook(device) - string device +Function DAP_SerializeCommentNotebook(string device) string commentPanel, commentNotebook, text @@ -4131,8 +4073,7 @@ Function DAP_SerializeCommentNotebook(device) NotebookSelectionAtEnd(commentNotebook) End -Function DAP_CommentPanelHook(s) - STRUCT WMWinHookStruct &s +Function DAP_CommentPanelHook(STRUCT WMWinHookStruct &s) string device @@ -4183,8 +4124,7 @@ Function/S DAP_CreateDAEphysPanel() End /// @brief Sets the locked indexing logic checkbox states -Function DAP_CheckProc_LockedLogic(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_LockedLogic(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -4208,9 +4148,7 @@ End /// @return 0 if the control name could be parsed, one otherwise /// /// UTF_NOINSTRUMENTATION -Function DAP_ParsePanelControl(ctrl, channelIndex, channelType, controlType) - string ctrl - variable &channelIndex, &channelType, &controlType +Function DAP_ParsePanelControl(string ctrl, variable &channelIndex, variable &channelType, variable &controlType) string elem0, elem1, elem2 variable numUnderlines @@ -4323,14 +4261,12 @@ End /// @brief Query the device lock status /// /// @returns device lock status, 1 if unlocked, 0 if locked -Function DAP_DeviceIsUnlocked(device) - string device +Function DAP_DeviceIsUnlocked(string device) return WhichListItem(device, GetListOfLockedDevices(), ";", 0, 0) == -1 End -Function DAP_AbortIfUnlocked(device) - string device +Function DAP_AbortIfUnlocked(string device) if(DAP_DeviceIsUnlocked(device)) DoAbortNow("A device must be locked (see Hardware tab) to proceed") @@ -4339,8 +4275,7 @@ End /// @brief GUI procedure which has the only purpose /// of storing the control state in the GUI state wave -Function DAP_CheckProc_UpdateGuiState(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_UpdateGuiState(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -4351,8 +4286,7 @@ Function DAP_CheckProc_UpdateGuiState(cba) : CheckBoxControl return 0 End -Function DAP_SetVar_SetScale(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVar_SetScale(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -4369,8 +4303,7 @@ Function DAP_SetVar_SetScale(sva) : SetVariableControl return 0 End -Function DAP_SetVar_UpdateGuiState(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVar_UpdateGuiState(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -4384,8 +4317,7 @@ Function DAP_SetVar_UpdateGuiState(sva) : SetVariableControl return 0 End -Function DAP_CheckProc_Settings_PUser(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_Settings_PUser(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable headstage @@ -4407,8 +4339,7 @@ Function DAP_CheckProc_Settings_PUser(cba) : CheckBoxControl return 0 End -Function DAP_ButtonProc_LockDev(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_LockDev(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -4420,8 +4351,7 @@ Function DAP_ButtonProc_LockDev(ba) : ButtonControl return 0 End -Function DAP_ButProc_Hrdwr_UnlckDev(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButProc_Hrdwr_UnlckDev(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -4910,26 +4840,26 @@ static Function DAP_UpdateChanAmpAssignPanel(device) // VC DA settings channel = ChanAmpAssign[%VC_DA][HeadStageNo] Popupmenu Popup_Settings_VC_DA, win=$device, mode=(IsFinite(channel) ? channel : NUM_DA_TTL_CHANNELS) + 1 - Setvariable setvar_Settings_VC_DAgain, win=$device, value=_num:ChanAmpAssign[%VC_DAGain][HeadStageNo] - Setvariable SetVar_Hardware_VC_DA_Unit, win=$device, value=_str:ChanAmpAssignUnit[%VC_DAUnit][HeadStageNo] + Setvariable setvar_Settings_VC_DAgain, win=$device, value=_NUM:ChanAmpAssign[%VC_DAGain][HeadStageNo] + Setvariable SetVar_Hardware_VC_DA_Unit, win=$device, value=_STR:ChanAmpAssignUnit[%VC_DAUnit][HeadStageNo] // VC AD settings channel = ChanAmpAssign[%VC_AD][HeadStageNo] Popupmenu Popup_Settings_VC_AD, win=$device, mode=(IsFinite(channel) ? channel : NUM_MAX_CHANNELS) + 1 - Setvariable setvar_Settings_VC_ADgain, win=$device, value=_num:ChanAmpAssign[%VC_ADGain][HeadStageNo] - Setvariable SetVar_Hardware_VC_AD_Unit, win=$device, value=_str:ChanAmpAssignUnit[%VC_ADUnit][HeadStageNo] + Setvariable setvar_Settings_VC_ADgain, win=$device, value=_NUM:ChanAmpAssign[%VC_ADGain][HeadStageNo] + Setvariable SetVar_Hardware_VC_AD_Unit, win=$device, value=_STR:ChanAmpAssignUnit[%VC_ADUnit][HeadStageNo] // IC DA settings channel = ChanAmpAssign[%IC_DA][HeadStageNo] Popupmenu Popup_Settings_IC_DA, win=$device, mode=(IsFinite(channel) ? channel : NUM_DA_TTL_CHANNELS) + 1 - Setvariable setvar_Settings_IC_DAgain, win=$device, value=_num:ChanAmpAssign[%IC_DAGain][HeadStageNo] - Setvariable SetVar_Hardware_IC_DA_Unit, win=$device, value=_str:ChanAmpAssignUnit[%IC_DAUnit][HeadStageNo] + Setvariable setvar_Settings_IC_DAgain, win=$device, value=_NUM:ChanAmpAssign[%IC_DAGain][HeadStageNo] + Setvariable SetVar_Hardware_IC_DA_Unit, win=$device, value=_STR:ChanAmpAssignUnit[%IC_DAUnit][HeadStageNo] // IC AD settings channel = ChanAmpAssign[%IC_AD][HeadStageNo] Popupmenu Popup_Settings_IC_AD, win=$device, mode=(IsFinite(channel) ? channel : NUM_MAX_CHANNELS) + 1 - Setvariable setvar_Settings_IC_ADgain, win=$device, value=_num:ChanAmpAssign[%IC_ADGain][HeadStageNo] - Setvariable SetVar_Hardware_IC_AD_Unit, win=$device, value=_str:ChanAmpAssignUnit[%IC_ADUnit][HeadStageNo] + Setvariable setvar_Settings_IC_ADgain, win=$device, value=_NUM:ChanAmpAssign[%IC_ADGain][HeadStageNo] + Setvariable SetVar_Hardware_IC_AD_Unit, win=$device, value=_STR:ChanAmpAssignUnit[%IC_ADUnit][HeadStageNo] ampSerial = ChanAmpAssign[%AmpSerialNo][HeadStageNo] ampChannelID = ChanAmpAssign[%AmpChannelID][HeadStageNo] @@ -4945,9 +4875,7 @@ End /// /// @param device device /// @param updateFlag One of @ref UpdateControlsFlags -Function DAP_UpdateDAQControls(device, updateFlag) - string device - variable updateFlag +Function DAP_UpdateDAQControls(string device, variable updateFlag) DEBUGPRINT("updateFlag", var = updateFlag) @@ -5022,8 +4950,7 @@ static Function DAP_AllChanDASettings(device, headStage, [delayed]) endif End -Function DAP_ButtonProc_skipSweep(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_skipSweep(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: @@ -5034,8 +4961,7 @@ Function DAP_ButtonProc_skipSweep(ba) : ButtonControl return 0 End -Function DAP_ButtonProc_skipBack(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function DAP_ButtonProc_skipBack(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: @@ -5046,37 +4972,30 @@ Function DAP_ButtonProc_skipBack(ba) : ButtonControl return 0 End -Function DAP_GetskipAhead(device) - string device +Function DAP_GetskipAhead(string device) return GetDA_EphysGuiStateNum(device)[0][%SetVar_DataAcq_skipAhead] End -Function DAP_ResetskipAhead(device) - string device +Function DAP_ResetskipAhead(string device) WAVE guiState = GetDA_EphysGuiStateNum(device) guiState[0][%SetVar_DataAcq_skipAhead] = 0 PGC_SetAndActivateControl(device, "SetVar_DataAcq_skipAhead", val = 0) End -Function DAP_getFilteredSkipAhead(device, skipAhead) - string device - variable skipAhead +Function DAP_getFilteredSkipAhead(string device, variable skipAhead) variable maxSkipAhead = max(0, IDX_MinNoOfSweeps(device) - 1) return skipAhead > maxSkipAhead ? maxSkipAhead : skipAhead End -Function DAP_setSkipAheadLimit(device, filteredSkipAhead) - string device - variable filteredSkipAhead +Function DAP_setSkipAheadLimit(string device, variable filteredSkipAhead) SetSetVariableLimits(device, "SetVar_DataAcq_skipAhead", 0, max(0, filteredSkipAhead), 1) End -Function DAP_SetVarProc_skipAhead(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DAP_SetVarProc_skipAhead(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: @@ -5090,8 +5009,7 @@ Function DAP_SetVarProc_skipAhead(sva) : SetVariableControl return 0 End -Function DAP_CheckProc_RandomRA(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_RandomRA(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: @@ -5108,8 +5026,7 @@ Function DAP_CheckProc_RandomRA(cba) : CheckBoxControl return 0 End -Function DAP_CheckSkipAhead(device) - string device +Function DAP_CheckSkipAhead(string device) variable activeSkipAhead = DAG_GetNumericalValue(device, "SetVar_DataAcq_skipAhead") variable filteredSkipAhead = DAP_getFilteredSkipAhead(device, activeSkipAhead) @@ -5122,8 +5039,7 @@ Function DAP_CheckSkipAhead(device) DAP_setSkipAheadLimit(device, filteredSkipAhead) End -Function DAP_PopMenuProc_UpdateGuiState(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_UpdateGuiState(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -5142,8 +5058,7 @@ Function/S DAP_GetSamplingMultiplier() return "1;2;4;8;16;32;64" End -Function DAP_PopMenuProc_SampMult(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_SampMult(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -5161,8 +5076,7 @@ Function DAP_PopMenuProc_SampMult(pa) : PopupMenuControl return 0 End -Function DAP_CheckProc_RequireAmplifier(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_RequireAmplifier(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable checked string device @@ -5184,8 +5098,7 @@ Function/S DAP_GetSamplingFrequencies() return "Maximum;100;50;25;10" End -Function DAP_PopMenuProc_FixedSampInt(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_FixedSampInt(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -5213,8 +5126,7 @@ Function/S DAP_GetOsciUpdModes() return list End -Function DAP_PopMenuProc_OsciUpdMode(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DAP_PopMenuProc_OsciUpdMode(STRUCT WMPopupAction &pa) : PopupMenuControl string device @@ -5237,8 +5149,7 @@ Function DAP_PopMenuProc_OsciUpdMode(pa) : PopupMenuControl return 0 End -Function DAP_ApplyDelayedClampModeChange(device) - string device +Function DAP_ApplyDelayedClampModeChange(string device) variable i, mode @@ -5257,15 +5168,13 @@ Function DAP_ApplyDelayedClampModeChange(device) DAP_ClearDelayedClampModeChange(device) End -Function DAP_ClearDelayedClampModeChange(device) - string device +Function DAP_ClearDelayedClampModeChange(string device) WAVE GuiState = GetDA_EphysGuiStateNum(device) GuiState[][%HSmode_delayed] = NaN End -Function ButtonProc_Hardware_rescan(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_Hardware_rescan(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -5283,8 +5192,7 @@ Function ButtonProc_Hardware_rescan(ba) : ButtonControl return 0 End -Function DAP_CheckProc_PowerSpectrum(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DAP_CheckProc_PowerSpectrum(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable testPulseMode string device @@ -5305,8 +5213,7 @@ End /// @brief Update the popup menus and its #USER_DATA_MENU_EXP user data after stim set changes /// /// @param device [optional, defaults to all locked devices] device -Function DAP_UpdateDaEphysStimulusSetPopups([device]) - string device +Function DAP_UpdateDaEphysStimulusSetPopups([string device]) variable i, j, numPanels string ctrlWave, ctrlIndexEnd, ctrlSearch, DAlist, TTLlist, listOfPanels @@ -5414,6 +5321,7 @@ End /// /// Internal use only, outside callers should use ST_RemoveStimSet() Function DAP_DeleteStimulusSet(string setName, [string device]) + variable channelType if(ParamIsDefault(device)) @@ -5437,6 +5345,7 @@ End /// @brief Write all TP settings from the data acquisition/settings tab to the settings wave Function DAP_TPSettingsToWave(string device, WAVE TPSettings) + variable i, numEntries, headstage, col string ctrl, lbl @@ -5549,6 +5458,7 @@ End /// @param entry [optional, defaults to all] Only update one of the entries TPSettings. /// Accepted strings are the labels from DAP_TPControlToLabel(). Function DAP_TPSettingsToGUI(string device, [string entry]) + variable i, numEntries, val, headstage, col, originalHSAll string ctrl, lbl variable TPState diff --git a/Packages/MIES/MIES_DAEphys_GuiState.ipf b/Packages/MIES/MIES_DAEphys_GuiState.ipf index 49c4a2b414..e935fbf821 100644 --- a/Packages/MIES/MIES_DAEphys_GuiState.ipf +++ b/Packages/MIES/MIES_DAEphys_GuiState.ipf @@ -10,9 +10,7 @@ /// @brief __DAG__ Routines dealing with the DA_Ephys GUI state waves /// @brief Records the state of the DA_ephys panel into the numerical GUI state wave -Function DAG_RecordGuiStateNum(device, [GUIState]) - string device - WAVE GUIState +Function DAG_RecordGuiStateNum(string device, [WAVE GUIState]) variable i, numEntries string ctrlName, lbl @@ -103,9 +101,7 @@ Function DAG_RecordGuiStateNum(device, [GUIState]) End /// @brief Records the state of the DA_ephys panel into the textual GUI state wave -Function DAG_RecordGuiStateTxT(device, [GUIState]) - string device - WAVE GUIState +Function DAG_RecordGuiStateTxT(string device, [WAVE GUIState]) variable i, numEntries string ctrlName, lbl @@ -177,9 +173,7 @@ End /// entries per headstage/channel/etc. /// /// UTF_NOINSTRUMENTATION -Function DAG_GetNumericalValue(device, ctrl, [index]) - string device, ctrl - variable index +Function DAG_GetNumericalValue(string device, string ctrl, [variable index]) variable refValue, waveIndex, ctrlDim string msg @@ -235,9 +229,7 @@ End /// @param ctrl control name /// @param index [optional, default to NaN] Some control entries have multiple /// entries per headstage/channel/etc. -Function/S DAG_GetTextualValue(device, ctrl, [index]) - string device, ctrl - variable index +Function/S DAG_GetTextualValue(string device, string ctrl, [variable index]) string str, msg variable waveIndex, ctrlDim @@ -293,9 +285,7 @@ End /// /// @param type one of the type constants from @ref ChannelTypeAndControlConstants /// @param device panel title -Function/WAVE DAG_GetChannelState(device, type) - string device - variable type +Function/WAVE DAG_GetChannelState(string device, variable type) variable numEntries, col @@ -335,6 +325,7 @@ End /// @brief Return a wave with `NUM_HEADSTAGES` rows with `1` where /// the given headstages is active and in the given clamp mode. Function/WAVE DAG_GetActiveHeadstages(string device, variable clampMode) + AI_AssertOnInvalidClampMode(clampMode) WAVE statusHS = DAG_GetChannelState(device, CHANNEL_TYPE_HEADSTAGE) @@ -374,9 +365,7 @@ End /// @param device panel title /// @param channelType one of the channel type constants from @ref ChannelTypeAndControlConstants /// @param controlType one of the control type constants from @ref ChannelTypeAndControlConstants -Function/WAVE DAG_GetChannelTextual(device, channelType, controlType) - string device - variable channelType, controlType +Function/WAVE DAG_GetChannelTextual(string device, variable channelType, variable controlType) variable numEntries @@ -390,9 +379,7 @@ Function/WAVE DAG_GetChannelTextual(device, channelType, controlType) End /// @brief Returns the headstage State -Function DAG_GetHeadstageState(device, headStage) - string device - variable headStage +Function DAG_GetHeadstageState(string device, variable headStage) WAVE wv = GetDA_EphysGuiStateNum(device) return wv[headStage][%$GetSpecialControlLabel(CHANNEL_TYPE_HEADSTAGE, CHANNEL_CONTROL_CHECK)] @@ -400,9 +387,7 @@ End /// @returns the mode of the headstage defined in the locked DA_ephys panel, /// can be V_CLAMP_MODE or I_CLAMP_MODE or NC -Function DAG_GetHeadstageMode(device, headStage) - string device - variable headStage // range: [0, NUM_HEADSTAGES[ +Function DAG_GetHeadstageMode(string device, variable headStage) return GetDA_EphysGuiStateNum(device)[headStage][%HSMode] End @@ -415,11 +400,7 @@ End /// @param controlName control name /// @param val [optional] numerical value, 0-based index for popup menues /// @param str [optional] textual value -Function DAG_Update(device, controlName, [val, str]) - string device - string controlName - variable val - string str +Function DAG_Update(string device, string controlName, [variable val, string str]) variable col, channelIndex, channelType, controlType @@ -454,8 +435,7 @@ End /// @brief Returns a list of unique and type specific controls /// -Function/S DAG_GetUniqueSpecCtrlListNum(device) - string device +Function/S DAG_GetUniqueSpecCtrlListNum(string device) ASSERT(WindowExists(device), "Missing window") @@ -463,8 +443,7 @@ Function/S DAG_GetUniqueSpecCtrlListNum(device) End /// @brief Returns a list of unique and type specific controls with textual values -Function/S DAG_GetUniqueSpecCtrlListTxT(device) - string device +Function/S DAG_GetUniqueSpecCtrlListTxT(string device) ASSERT(WindowExists(device), "Missing window") diff --git a/Packages/MIES/MIES_DANDI.ipf b/Packages/MIES/MIES_DANDI.ipf index 8d1decc550..361ca125ae 100644 --- a/Packages/MIES/MIES_DANDI.ipf +++ b/Packages/MIES/MIES_DANDI.ipf @@ -108,6 +108,7 @@ static Function/WAVE DND_ParseSetReponse(string response) End Function/S DND_FetchAssetFromSet(variable setNumber) + string url, assetID, name, path, data, fname, assetFilePath variable numAssets, idx, i diff --git a/Packages/MIES/MIES_DataAcquisition.ipf b/Packages/MIES/MIES_DataAcquisition.ipf index de38cc89d9..9f8f262cc7 100644 --- a/Packages/MIES/MIES_DataAcquisition.ipf +++ b/Packages/MIES/MIES_DataAcquisition.ipf @@ -11,6 +11,7 @@ /// @brief Stop DAQ and TP on all locked devices Function DQ_StopOngoingDAQAllLocked(variable stopReason) + variable i, numDev, err string device @@ -116,8 +117,7 @@ End /// This function and DQ_StopDAQDeviceTimer are used to correct the ITI for the /// time it took to collect data, and pre and post processing of data. It /// allows for a real time, start to start, ITI -Function DQ_StartDAQDeviceTimer(device) - string device +Function DQ_StartDAQDeviceTimer(string device) string msg @@ -143,8 +143,7 @@ End /// @brief Stop the per-device timer associated with a particular device /// /// @return time in seconds -Function DQ_StopDAQDeviceTimer(device) - string device +Function DQ_StopDAQDeviceTimer(string device) variable timerID string msg @@ -170,6 +169,7 @@ End /// Assumes that single device and multi device do not run at the same time. /// @return One of @ref DAQRunModes Function DQ_StopDAQ(string device, variable stopReason, [variable startTPAfterDAQ]) + variable runMode startTPAfterDAQ = ParamIsDefault(startTPAfterDAQ) ? 1 : !!startTPAfterDAQ @@ -191,9 +191,7 @@ Function DQ_StopDAQ(string device, variable stopReason, [variable startTPAfterDA return DAQ_NOT_RUNNING End -Function DQ_RestartDAQ(device, dataAcqRunMode) - string device - variable dataAcqRunMode +Function DQ_RestartDAQ(string device, variable dataAcqRunMode) switch(dataAcqRunMode) case DAQ_NOT_RUNNING: @@ -224,9 +222,7 @@ End /// /// @param device Locked panel with test pulse running occasionally /// @param TPResults Data from TP_ROAnalysis() -Function DQ_ApplyAutoBias(device, TPResults) - string device - WAVE TPResults +Function DQ_ApplyAutoBias(string device, WAVE TPResults) variable headStage, actualcurrent, current, targetVoltage, targetVoltageTol, setVoltage variable resistance, maximumAutoBiasCurrent, lastInvocation, curTime diff --git a/Packages/MIES/MIES_DataAcquisition_Multi.ipf b/Packages/MIES/MIES_DataAcquisition_Multi.ipf index d75ed83f68..76ebc4a133 100644 --- a/Packages/MIES/MIES_DataAcquisition_Multi.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Multi.ipf @@ -12,8 +12,7 @@ /// @brief Fifo monitor for DAQ Multi Device /// /// @ingroup BackgroundFunctions -Function DQM_FIFOMonitor(s) - STRUCT BackgroundStruct &s +Function DQM_FIFOMonitor(STRUCT BackgroundStruct &s) variable deviceID, isFinished, hardwareType variable i, j, err, fifoLatest, result, channel, lastTP, gotTPChannels, newSamplesCount @@ -176,8 +175,7 @@ Function DQM_FIFOMonitor(s) End /// @brief Stop ongoing multi device DAQ -Function DQM_TerminateOngoingDAQHelper(device) - string device +Function DQM_TerminateOngoingDAQHelper(string device) variable returnedHardwareType @@ -219,9 +217,7 @@ End /// @param device device /// @param initialSetupReq [optional, defaults to true] performs initialization routines /// at the very beginning of DAQ, turn off for RA -Function DQM_StartDAQMultiDevice(device, [initialSetupReq]) - string device - variable initialSetupReq +Function DQM_StartDAQMultiDevice(string device, [variable initialSetupReq]) ASSERT(WhichListItem(GetRTStackInfo(2), DAQ_ALLOWED_FUNCTIONS) != -1, \ "Calling this function directly is not supported, please use PGC_SetAndActivateControl.") @@ -264,9 +260,7 @@ End /// @param device device /// @param runTime left over time to wait in seconds /// @param funcList list of functions to execute at the end of the ITI -Function DQM_StartBackgroundTimer(device, runTime, funcList) - string device, funcList - variable runTime +Function DQM_StartBackgroundTimer(string device, variable runTime, string funcList) ASSERT(!isEmpty(funcList), "Empty funcList does not makse sense") @@ -281,8 +275,7 @@ Function DQM_StartBackgroundTimer(device, runTime, funcList) End /// @brief Stop the background timer used for ITI tracking -Function DQM_StopBackgroundTimer(device) - string device +Function DQM_StopBackgroundTimer(string device) WAVE/SDFR=GetActiveDAQDevicesTimerFolder() ActiveDevTimeParam @@ -296,8 +289,7 @@ End /// @brief Background function for tracking ITI /// /// @ingroup BackgroundFunctions -Function DQM_Timer(s) - STRUCT WMBackgroundStruct &s +Function DQM_Timer(STRUCT WMBackgroundStruct &s) WAVE/SDFR=GetActiveDAQDevicesTimerFolder() ActiveDevTimeParam // column 0 = deviceID; column 1 = Start time; column 2 = run time; column 3 = end time diff --git a/Packages/MIES/MIES_DataAcquisition_Single.ipf b/Packages/MIES/MIES_DataAcquisition_Single.ipf index d8f2941f1f..c1039a1158 100644 --- a/Packages/MIES/MIES_DataAcquisition_Single.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Single.ipf @@ -16,9 +16,7 @@ /// @param device device /// @param useBackground [optional, defaults to background checkbox setting in the DA_Ephys /// panel] -Function DQS_StartDAQSingleDevice(device, [useBackground]) - string device - variable useBackground +Function DQS_StartDAQSingleDevice(string device, [variable useBackground]) ASSERT(WhichListItem(GetRTStackInfo(2), DAQ_ALLOWED_FUNCTIONS) != -1, \ "Calling this function directly is not supported, please use PGC_SetAndActivateControl.") @@ -48,8 +46,7 @@ Function DQS_StartDAQSingleDevice(device, [useBackground]) endif End -Function DQS_DataAcq(device) - string device +Function DQS_DataAcq(string device) variable fifoPos, gotTPChannels, moreData string oscilloscopeSubwindow = SCOPE_GetGraph(device) @@ -90,8 +87,7 @@ End /// @brief Fifo monitor for DAQ Single Device /// /// @ingroup BackgroundFunctions -Function DQS_BkrdDataAcq(device) - string device +Function DQS_BkrdDataAcq(string device) NVAR deviceID = $GetDAQDeviceID(device) HW_PrepareAcq(HARDWARE_ITC_DAC, deviceID, DATA_ACQUISITION_MODE, flags = HARDWARE_ABORT_ON_ERROR) @@ -126,14 +122,14 @@ static Function DQS_StopDataAcq(string device, variable stopReason, [variable fo End Function DQS_StartBackgroundFifoMonitor() + CtrlNamedBackground $TASKNAME_FIFOMON, start End /// @brief Fifo monitor for DAQ Single Device /// /// @ingroup BackgroundFunctions -Function DQS_FIFOMonitor(s) - STRUCT WMBackgroundStruct &s +Function DQS_FIFOMonitor(STRUCT WMBackgroundStruct &s) variable fifoPos, moreData, anaFuncReturn, result @@ -170,6 +166,7 @@ Function DQS_FIFOMonitor(s) End Function DQS_StopBackgroundFifoMonitor() + CtrlNamedBackground $TASKNAME_FIFOMON, stop End @@ -178,9 +175,7 @@ End /// @param device device /// @param runTime left over time to wait in seconds /// @param funcList list of functions to execute at the end of the ITI -Function DQS_StartBackgroundTimer(device, runTime, funcList) - string device, funcList - variable runTime +Function DQS_StartBackgroundTimer(string device, variable runTime, string funcList) ASSERT(!isEmpty(funcList), "Empty funcList does not makse sense") @@ -204,8 +199,7 @@ End /// @brief Keep track of time during ITI /// /// @ingroup BackgroundFunctions -Function DQS_Timer(s) - STRUCT WMBackgroundStruct &s +Function DQS_Timer(STRUCT WMBackgroundStruct &s) variable timeLeft, elapsedTime diff --git a/Packages/MIES/MIES_DataBrowser.ipf b/Packages/MIES/MIES_DataBrowser.ipf index 599c11a629..1a28499348 100644 --- a/Packages/MIES/MIES_DataBrowser.ipf +++ b/Packages/MIES/MIES_DataBrowser.ipf @@ -10,6 +10,7 @@ /// @brief __DB__ Panel for browsing acquired data during acquisition Function/S DB_OpenDataBrowser([variable mode]) + string win, device, devicesWithData, bsPanel if(ParamIsDefault(mode)) @@ -44,6 +45,7 @@ End /// @brief Utility function to generate new window recreation macro of DataBrowser (also used for SweepBrowser) /// after GUI editor adapted controls in development process Function DB_ResetAndStoreCurrentDBPanel() + string device, bsPanel, scPanel, shPanel, recreationCode string sfJSON, descNB, helpNBWin @@ -261,8 +263,7 @@ Function DB_ResetAndStoreCurrentDBPanel() CleanupOperationQueueResult() End -Function/S DB_GetMainGraph(win) - string win +Function/S DB_GetMainGraph(string win) return GetMainWindow(win) End @@ -340,8 +341,7 @@ static Function DB_SetUserData(win, device) BSP_SetFolder(win, dfr, MIES_BSP_PANEL_FOLDER) End -Function/WAVE DB_GetPlainSweepList(win) - string win +Function/WAVE DB_GetPlainSweepList(string win) string device @@ -354,9 +354,7 @@ Function/WAVE DB_GetPlainSweepList(win) return AFH_GetSweeps(device) End -Function DB_UpdateLastSweepControls(win, first, last) - string win - variable first, last +Function DB_UpdateLastSweepControls(string win, variable first, variable last) variable formerLast string scPanel @@ -385,8 +383,7 @@ End /// /// Only outside callers are generic external panels which must update the graph. /// @param win locked databrowser -Function DB_UpdateSweepPlot(win) - string win +Function DB_UpdateSweepPlot(string win) variable numEntries, i, sweepNo, highlightSweep, referenceTime, traceIndex string device, lbPanel, scPanel, graph, experiment @@ -407,7 +404,7 @@ Function DB_UpdateSweepPlot(win) WAVE axesProps = GetAxesProperties(graph) - WAVE/T/Z cursorInfos = GetCursorInfos(graph) + WAVE/Z/T cursorInfos = GetCursorInfos(graph) RemoveTracesFromGraph(graph) RemoveFreeAxisFromGraph(graph) TUD_Clear(graph, recursive = 0) @@ -486,6 +483,7 @@ End /// @param win panel /// @param type One of @ref LabnotebookWaveTypes Function/WAVE DB_GetLBNWave(string win, variable type) + string device device = BSP_GetDevice(win) @@ -553,8 +551,7 @@ static Function DB_UpdateToLastSweepWrapper(string win, variable force) LBV_UpdateTagsForTextualLBNEntries(win, last) End -Function DB_PopMenuProc_LockDBtoDevice(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DB_PopMenuProc_LockDBtoDevice(STRUCT WMPopupAction &pa) : PopupMenuControl string mainPanel @@ -568,8 +565,7 @@ Function DB_PopMenuProc_LockDBtoDevice(pa) : PopupMenuControl return 0 End -Function DB_SetVarProc_SweepNo(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function DB_SetVarProc_SweepNo(STRUCT WMSetVariableAction &sva) : SetVariableControl string win variable sweepNo @@ -607,6 +603,7 @@ End /// @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]) + STRUCT TiledGraphSettings tgs variable sweepNo, traceIndex @@ -618,7 +615,7 @@ Function DB_AddSweepToGraph(string win, variable index, [STRUCT BufferedDrawInfo WAVE/Z numericalValues = DB_GetLBNWave(win, LBN_NUMERICAL_VALUES) WAVE/Z textualValues = DB_GetLBNWave(win, LBN_TEXTUAL_VALUES) - [tgs] = BSP_GatherTiledGraphSettings(graph) + [tgs] = BSP_GatherTiledGraphSettings(graph) [sweepNo, experiment] = OVS_GetSweepAndExperiment(win, index) DFREF dfr = GetDeviceDataPath(device) @@ -677,7 +674,7 @@ Function/S DB_FindDataBrowser(string device, [variable mode]) ASSERT(mode == BROWSER_MODE_USER || mode == BROWSER_MODE_AUTOMATION || mode == BROWSER_MODE_ALL, "Invalid mode") endif - WAVE/T/Z matches = DB_FindAllDataBrowser(device, mode = mode) + WAVE/Z/T matches = DB_FindAllDataBrowser(device, mode = mode) if(!WaveExists(matches)) return "" @@ -738,6 +735,7 @@ End /// /// Creates a new one, if none is found nor bound. Function/S DB_GetBoundDataBrowser(string device, [variable mode]) + string databrowser, bsPanel if(ParamIsDefault(mode)) diff --git a/Packages/MIES/MIES_DataConfiguratonRecreation.ipf b/Packages/MIES/MIES_DataConfiguratonRecreation.ipf index 66d6c21f7c..b646d0384c 100644 --- a/Packages/MIES/MIES_DataConfiguratonRecreation.ipf +++ b/Packages/MIES/MIES_DataConfiguratonRecreation.ipf @@ -705,9 +705,9 @@ static Function DCR_RecreateDataConfigurationResultFromLNB_TP(STRUCT DataConfigu TP_UpdateTPSettingsCalculatedImpl(TPSettings, samplingIntervals, tpCalculated) [totalLengthPoints, pulseStartPoints, pulseLengthPoints] = TP_GetCreationPropertiesInPoints(tpCalculated, s.dataAcqOrTP) - s.testPulseLength = totalLengthPoints - s.tpPulseStartPoint = pulseStartPoints - s.tpPulseLengthPoints = pulseLengthPoints + s.testPulseLength = totalLengthPoints + s.tpPulseStartPoint = pulseStartPoints + s.tpPulseLengthPoints = pulseLengthPoints WAVE s.testPulse = GetTestPulseAsFree() TP_CreateTestPulseWaveImpl(s.testPulse, s.testPulseLength, s.tpPulseStartPoint, s.tpPulseLengthPoints) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 1ada660442..c153fea149 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -41,9 +41,7 @@ End /// @param multiDevice [optional: defaults to false] Fine tune data handling for single device (false) or multi device (true) /// /// @exception Abort configuration failure -Function DC_Configure(device, dataAcqOrTP, [multiDevice]) - string device - variable dataAcqOrTP, multiDevice +Function DC_Configure(string device, variable dataAcqOrTP, [variable multiDevice]) variable numActiveChannels ASSERT(dataAcqOrTP == DATA_ACQUISITION_MODE || dataAcqOrTP == TEST_PULSE_MODE, "invalid mode") @@ -726,9 +724,7 @@ End /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE /// @param channelType one of the channel type constants from @ref ChannelTypeAndControlConstants /// @param DAQChannelType only return channels as active if they have the desired DAQChannel type (only respected for DA channel) -Function/WAVE DC_GetFilteredChannelState(device, dataAcqOrTP, channelType, [DAQChannelType]) - string device - variable dataAcqOrTP, channelType, DAQChannelType +Function/WAVE DC_GetFilteredChannelState(string device, variable dataAcqOrTP, variable channelType, [variable DAQChannelType]) if(ParamIsDefault(DAQChannelType)) DAQChannelType = DAQ_CHANNEL_TYPE_UNKOWN @@ -952,10 +948,7 @@ End /// @param stimSet stimset wave /// @param device device /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE -Function DC_CalculateStimsetLength(stimSet, device, dataAcqOrTP) - WAVE stimSet - string device - variable dataAcqOrTP +Function DC_CalculateStimsetLength(WAVE stimSet, string device, variable dataAcqOrTP) return DC_CalculateGeneratedDataSize(device, dataAcqOrTP, DimSize(stimSet, ROWS)) End @@ -1599,9 +1592,9 @@ static Function [STRUCT DataConfigurationResult s] DC_GetConfiguration(string de // test pulse length is calculated for dataAcqOrTP @ref TP_CreateTestPulseWave WAVE TPSettingsCalc = GetTPsettingsCalculated(device) [testPulseLength, tpPulseStartPoint, tpPulseLengthPoints] = TP_GetCreationPropertiesInPoints(TPSettingsCalc, dataAcqOrTP) - s.testPulseLength = testPulseLength - s.tpPulseStartPoint = tpPulseStartPoint - s.tpPulseLengthPoints = tpPulseLengthPoints + s.testPulseLength = testPulseLength + s.tpPulseStartPoint = tpPulseStartPoint + s.tpPulseLengthPoints = tpPulseLengthPoints s.headstageDAC[] = channelClampMode[s.DACList[p]][%DAC][%Headstage] s.headstageADC[] = channelClampMode[s.ADCList[p]][%ADC][%Headstage] @@ -1650,8 +1643,8 @@ static Function [STRUCT DataConfigurationResult s] DC_GetConfiguration(string de elseif(config[i][%DAQChannelType] == DAQ_CHANNEL_TYPE_DAQ) // only call DC_CalculateChannelColumnNo for real data acquisition [ret, setCycleCountLocal] = DC_CalculateChannelColumnNo(device, s.setName[i], channel, CHANNEL_TYPE_DAC) - s.setColumn[i] = ret - s.setCycleCount[i] = setCycleCountLocal + s.setColumn[i] = ret + s.setCycleCount[i] = setCycleCountLocal endif if(IsFinite(headstage)) @@ -1805,8 +1798,8 @@ static Function DC_SetupConfigurationTTLstimSets(string device, STRUCT DataConfi s.TTLsetLength[i] = DC_CalculateStimsetLength(s.TTLstimSet[i], device, s.dataAcqOrTP) [col, setCycleCount] = DC_CalculateChannelColumnNo(device, s.TTLsetName[i], i, CHANNEL_TYPE_TTL) - s.TTLsetColumn[i] = col - s.TTLcycleCount[i] = setCycleCount + s.TTLsetColumn[i] = col + s.TTLcycleCount[i] = setCycleCount endfor DC_MakeTTLWave(device, s) @@ -1978,11 +1971,7 @@ End /// @param channelType type of the channel /// @param var [optional] numeric value /// @param str [optional] string value -Function DC_DocumentChannelProperty(device, entry, headstage, channelNumber, channelType, [var, str]) - string device, entry - variable headstage, channelNumber, channelType - variable var - string str +Function DC_DocumentChannelProperty(string device, string entry, variable headstage, variable channelNumber, variable channelType, [variable var, string str]) variable colData, colKey, numCols string ua_entry @@ -2312,8 +2301,7 @@ End /// @brief Returns 1 if a channel is set to TP, the check is through the /// stimset name from the GUI -Function DC_GotTPChannelWhileDAQ(device) - string device +Function DC_GotTPChannelWhileDAQ(string device) variable i, numEntries WAVE statusDAFiltered = DC_GetFilteredChannelState(device, DATA_ACQUISITION_MODE, CHANNEL_TYPE_DAC) @@ -2341,9 +2329,7 @@ End /// @param headstage head stage /// /// @return One of @ref DaqChannelTypeConstants -Function DC_GetChannelTypefromHS(device, headstage) - string device - variable headstage +Function DC_GetChannelTypefromHS(string device, variable headstage) variable dac, row WAVE config = GetDAQConfigWave(device) diff --git a/Packages/MIES/MIES_DebugPanel.ipf b/Packages/MIES/MIES_DebugPanel.ipf index 3262ea314b..281d943583 100644 --- a/Packages/MIES/MIES_DebugPanel.ipf +++ b/Packages/MIES/MIES_DebugPanel.ipf @@ -12,8 +12,7 @@ static StrConstant PANEL = "DebugPanel" -Function DP_DebuggingEnabledForFile(file) - string file +Function DP_DebuggingEnabledForFile(string file) if(!WindowExists(PANEL)) return 1 @@ -107,8 +106,7 @@ static Function DP_FillDebugPanelWaves() listSelWave[] = listSelWave[p] | 0x20 End -Function DP_WindowHook(s) - STRUCT WMWinHookStruct &s +Function DP_WindowHook(STRUCT WMWinHookStruct &s) variable debugMode @@ -122,8 +120,7 @@ Function DP_WindowHook(s) return 0 End -Function DP_CheckProc_Debug(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function DP_CheckProc_Debug(STRUCT WMCheckboxAction &cba) : CheckBoxControl string ctrl variable checked @@ -148,8 +145,7 @@ Function DP_CheckProc_Debug(cba) : CheckBoxControl return 0 End -Function DP_PopMenuProc_Selection(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function DP_PopMenuProc_Selection(STRUCT WMPopupAction &pa) : PopupMenuControl string popStr diff --git a/Packages/MIES/MIES_Debugging.ipf b/Packages/MIES/MIES_Debugging.ipf index b33dda1bb4..c49f0604cc 100644 --- a/Packages/MIES/MIES_Debugging.ipf +++ b/Packages/MIES/MIES_Debugging.ipf @@ -64,9 +64,7 @@ static StrConstant functionReturnMessage = "return value" /// ///@param var numerical argument for debug output ///@param format optional format string to override the default of "%g" -Function DEBUGPRINTv(var, [format]) - variable var - string format +Function DEBUGPRINTv(variable var, [string format]) if(ParamIsDefault(format)) DEBUGPRINT(functionReturnMessage, var = var) @@ -100,9 +98,7 @@ End /// ///@param wv wave argument for debug output ///@param format optional format string to override the default of "%g" -Function/WAVE DEBUGPRINTw(wv, [format]) - WAVE/Z wv - string format +Function/WAVE DEBUGPRINTw(WAVE/Z wv, [string format]) if(ParamIsDefault(format)) DEBUGPRINT(functionReturnMessage, wv = wv) @@ -135,8 +131,7 @@ End /// ///@param str string argument for debug output ///@param format optional format string to override the default of "%s" -Function/S DEBUGPRINTs(str, [format]) - string str, format +Function/S DEBUGPRINTs(string str, [string format]) if(ParamIsDefault(format)) DEBUGPRINT(functionReturnMessage, str = str) @@ -169,11 +164,7 @@ End /// @param str string /// @param wv wave (can be null) /// @param format format string overrides the default of "%g" for variables and "%s" for strings -Function DEBUGPRINT(msg, [var, str, wv, format]) - string msg - variable var - WAVE/Z wv - string str, format +Function DEBUGPRINT(string msg, [variable var, string str, WAVE/Z wv, string format]) string file, line, func, caller, stacktrace, formatted = "" variable numSuppliedOptParams, idx, numCallers @@ -260,10 +251,7 @@ End /// @param var variable /// @param str string /// @param format format string overrides the default of "%g" for variables and "%s" for strings -threadsafe Function DEBUGPRINT_TS(msg, [var, str, format]) - string msg - variable var - string str, format +threadsafe Function DEBUGPRINT_TS(string msg, [variable var, string str, string format]) string formatted = "" variable numSuppliedOptParams @@ -357,8 +345,7 @@ End /// @brief Prints a message to the command history in debug mode, /// aborts with dialog in release mode -Function DEBUGPRINT_OR_ABORT(msg) - string msg +Function DEBUGPRINT_OR_ABORT(string msg) DEBUGPRINT(msg) End @@ -382,71 +369,57 @@ End /// @brief Print the elapsed time for performance measurements in seconds /// @see DEBUG_TIMER_START() -Function DEBUGPRINT_ELAPSED(referenceTime) - variable referenceTime +Function DEBUGPRINT_ELAPSED(variable referenceTime) DEBUGPRINT("timestamp: ", var = GetElapsedTime(referenceTime)) End /// @brief Print and store the elapsed time for performance measurements /// @see DEBUG_TIMER_START() -Function DEBUGPRINT_ELAPSED_WAVE(referenceTime) - variable referenceTime +Function DEBUGPRINT_ELAPSED_WAVE(variable referenceTime) StoreElapsedTime(referenceTime) End #else -Function DEBUGPRINTv(var, [format]) - variable var - string format +Function DEBUGPRINTv(variable var, [string format]) // do nothing return var End -Function/S DEBUGPRINTs(str, [format]) - string str, format +Function/S DEBUGPRINTs(string str, [string format]) // do nothing return str End -Function/WAVE DEBUGPRINTw(wv, [format]) - WAVE/Z wv - string format +Function/WAVE DEBUGPRINTw(WAVE/Z wv, [string format]) // do nothing return wv End -Function DEBUGPRINT(msg, [var, str, wv, format]) - string msg - variable var - WAVE/Z wv - string str, format +Function DEBUGPRINT(string msg, [variable var, string str, WAVE/Z wv, string format]) // do nothing End -threadsafe Function DEBUGPRINT_TS(msg, [var, str, format]) - string msg - variable var - string str, format +threadsafe Function DEBUGPRINT_TS(string msg, [variable var, string str, string format]) // do nothing End Function DEBUGPRINTSTACKINFO() + // do nothing End -Function DEBUGPRINT_OR_ABORT(msg) - string msg +Function DEBUGPRINT_OR_ABORT(string msg) DoAbortNow(msg) End @@ -455,58 +428,66 @@ Function DEBUG_TIMER_START() End -Function DEBUGPRINT_ELAPSED(referenceTime) - variable referenceTime +Function DEBUGPRINT_ELAPSED(variable referenceTime) + End -Function DEBUGPRINT_ELAPSED_WAVE(referenceTime) - variable referenceTime +Function DEBUGPRINT_ELAPSED_WAVE(variable referenceTime) + End #endif ///@brief Enable debug mode Function EnableDebugMode() + Execute/P/Q "SetIgorOption poundDefine=DEBUGGING_ENABLED" Execute/P/Q "COMPILEPROCEDURES " End ///@brief Disable debug mode Function DisableDebugMode() + Execute/P/Q "SetIgorOption poundUnDefine=DEBUGGING_ENABLED" Execute/P/Q "COMPILEPROCEDURES " End ///@brief Enable evil mode Function EnableEvilMode() + Execute/P/Q "SetIgorOption poundDefine=EVIL_KITTEN_EATING_MODE" Execute/P/Q "COMPILEPROCEDURES " End ///@brief Disable evil mode Function DisableEvilMode() + Execute/P/Q "SetIgorOption poundUnDefine=EVIL_KITTEN_EATING_MODE" Execute/P/Q "COMPILEPROCEDURES " End /// @brief Disable threadsafe support Function DisableThreadsafeSupport() + Execute/P/Q "SetIgorOption poundDefine=THREADING_DISABLED" Execute/P/Q "SetIgorOption DisableThreadsafe=1" End /// @brief Enable threadsafe support again (default on IP startup) Function EnableThreadsafeSupport() + Execute/P/Q "SetIgorOption poundUnDefine=THREADING_DISABLED" Execute/P/Q "SetIgorOption DisableThreadsafe=0" End /// @brief Disable wave caching support Function DisableWaveCache() + Execute/P/Q "SetIgorOption poundDefine=WAVECACHE_DISABLED" End /// @brief Enable wave caching support again Function EnableWaveCache() + Execute/P/Q "SetIgorOption poundUnDefine=WAVECACHE_DISABLED" End @@ -517,8 +498,7 @@ Function EnableDangerousDebugging() End // Return the status of an `SetIgorOption` setting -Function QueryIgorOption(option) - string option +Function QueryIgorOption(string option) variable state @@ -531,7 +511,7 @@ Function QueryIgorOption(option) return state End -threadsafe static Function ReportBugToLogfile(string msg, WAVE/T/Z keys, WAVE/T/Z values) +threadsafe static Function ReportBugToLogfile(string msg, WAVE/Z/T keys, WAVE/Z/T values) variable size @@ -587,6 +567,7 @@ End /// @brief Threadsafe variant of BUG() threadsafe Function BUG_TS(string msg, [WAVE/T keys, WAVE/T values]) + variable bugCount msg = RemoveEnding(msg, "\r") @@ -638,6 +619,7 @@ End /// /// @return Number of waves not matching Function CheckAllDimensionLabels() + string msg, path variable i, numWaves, failures @@ -724,6 +706,7 @@ End // see tools/functionprofiling.sh Function DEBUG_STOREFUNCTION() + string funcName = GetRTStackInfo(2) string callchain = GetRTStackInfo(0) string caller = StringFromList(0, callchain) diff --git a/Packages/MIES/MIES_Downsample.ipf b/Packages/MIES/MIES_Downsample.ipf index 6db1e3376f..9cc4c0a387 100644 --- a/Packages/MIES/MIES_Downsample.ipf +++ b/Packages/MIES/MIES_Downsample.ipf @@ -41,7 +41,7 @@ End static Function/WAVE GetDownsampleDataRefWave() DFREF dfr = GetDownsampleDataFolder() - WAVE/WAVE/Z/SDFR=dfr dataRef + WAVE/Z/WAVE/SDFR=dfr dataRef if(WaveExists(dataRef)) return dataRef @@ -440,8 +440,7 @@ Function CreateDownsamplePanel() UpdatePopupMenuWindowFunction(panel) End -Function DownsampleWindowHook(s) - STRUCT WMWinHookStruct &s +Function DownsampleWindowHook(STRUCT WMWinHookStruct &s) string win @@ -463,8 +462,7 @@ Function DownsampleWindowHook(s) return 0 End -Function CheckBoxInterpolation(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function CheckBoxInterpolation(STRUCT WMCheckboxAction &cba) : CheckBoxControl string win switch(cba.eventCode) @@ -478,8 +476,7 @@ Function CheckBoxInterpolation(cba) : CheckBoxControl return 0 End -Function PopupMenuTargetRate(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PopupMenuTargetRate(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 1: @@ -495,8 +492,7 @@ Function PopupMenuTargetRate(pa) : PopupMenuControl return 0 End -Function ButtonRestoreBackup(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonRestoreBackup(STRUCT WMButtonAction &ba) : ButtonControl string win variable numWaves, i, success @@ -533,8 +529,7 @@ Function ButtonRestoreBackup(ba) : ButtonControl return 0 End -Function ButtonDoIt(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonDoIt(STRUCT WMButtonAction &ba) : ButtonControl variable backupWaves, decimationMethod, i, numWaves, downsampleFactor, upsampleFactor variable targetRate, channel, ret @@ -631,8 +626,7 @@ static Function UpdatePanel(win, [deviceSelectionString]) UpdateCurrentSize(win) End -Function PopupMenuDeviceSelection(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PopupMenuDeviceSelection(STRUCT WMPopupAction &pa) : PopupMenuControl string popStr, win switch(pa.eventCode) @@ -646,8 +640,7 @@ Function PopupMenuDeviceSelection(pa) : PopupMenuControl return 0 End -Function PopupMenuDecimationMethod(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PopupMenuDecimationMethod(STRUCT WMPopupAction &pa) : PopupMenuControl string win switch(pa.eventCode) @@ -660,8 +653,7 @@ Function PopupMenuDecimationMethod(pa) : PopupMenuControl return 0 End -Function CheckBoxEqualizeDown(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function CheckBoxEqualizeDown(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable checked string win diff --git a/Packages/MIES/MIES_EnhancedWMRoutines.ipf b/Packages/MIES/MIES_EnhancedWMRoutines.ipf index 32b49c2f15..ad8500583b 100644 --- a/Packages/MIES/MIES_EnhancedWMRoutines.ipf +++ b/Packages/MIES/MIES_EnhancedWMRoutines.ipf @@ -84,7 +84,7 @@ threadsafe Function/WAVE MIES_fWaveAverage(WAVE/Z yWaves, variable ignoreNaNs, v thisDeltax = deltax(w) thisXMin = leftx(w) thisXMax = pnt2x(w, numpnts(w) - 1) - XWavesAreSame = 0 // at least 1 y wave has no x wave + XWavesAreSame = 0 // at least 1 y wave has no x wave // 6.35: point-for-point averaging requires the deltaX of all waves to be identical. if(numtype(rawDeltaX) != 0) rawDeltaX = thisDeltaX // remember first deltaX before abs() below diff --git a/Packages/MIES/MIES_Epochs.ipf b/Packages/MIES/MIES_Epochs.ipf index cf71f829d9..88777fa0ce 100644 --- a/Packages/MIES/MIES_Epochs.ipf +++ b/Packages/MIES/MIES_Epochs.ipf @@ -903,7 +903,7 @@ static Function [variable err, variable stimsetEndIndex] EP_AddEpochsFromStimSet [WAVE wbStimsetEpochOffset, WAVE wbStimsetEpochLength] = EP_GetStimEpochsOffsetAndLength(ec) if(WaveExists(wbStimsetEpochOffset)) - ec.wbEffectiveStimsetSize = sum(wbStimsetEpochLength) + ec.wbEffectiveStimsetSize = sum(wbStimsetEpochLength) [WAVE stimepochOffsetTime, WAVE stimepochDuration] = EP_GetStimEpochsOffsetTimeAndDuration(ec, wbStimsetEpochOffset, wbStimsetEpochLength) else Make/FREE stimepochDuration = {ec.dwStimsetSize * ec.samplingInterval} @@ -1237,6 +1237,7 @@ End /// @param acquiredTime if acquisition was stopped early time of last acquired point in AD wave, NaN otherwise /// @param plannedTime time of one point after the end of the DA wave Function EP_WriteEpochInfoIntoSweepSettings(string device, variable sweepNo, variable acquiredTime, variable plannedTime) + variable i, numDACEntries, channel, headstage string entry @@ -1276,6 +1277,7 @@ End /// @param channel DA/TTL channel number /// @param channelType channel type (DA or TTL) threadsafe Function/S EP_EpochWaveToStr(WAVE epochsWave, variable channel, variable channelType) + Duplicate/FREE/RMD=[][][channel][channelType] epochsWave, epochChannel Redimension/N=(-1, -1, 0, 0) epochChannel @@ -1437,9 +1439,9 @@ Function/WAVE EP_GetEpochs(WAVE numericalValues, WAVE textualValues, variable sw if(!midsweep) if(DataFolderExistsDFR(sweepDFR)) - WAVE/T/Z epochInfoChannel = EP_FetchEpochs(numericalValues, textualValues, sweepNo, sweepDFR, channelNumber, channelType) + WAVE/Z/T epochInfoChannel = EP_FetchEpochs(numericalValues, textualValues, sweepNo, sweepDFR, channelNumber, channelType) else - WAVE/T/Z epochInfoChannel = EP_FetchEpochs_TS(numericalValues, textualValues, sweepNo, channelNumber, channelType) + WAVE/Z/T epochInfoChannel = EP_FetchEpochs_TS(numericalValues, textualValues, sweepNo, channelNumber, channelType) endif if(!WaveExists(epochInfoChannel)) return $"" @@ -1509,7 +1511,7 @@ End /// @param channelType Type of channel @sa XopChannelConstants /// /// @return epochs wave, see GetEpochsWave() for the wave layout -threadsafe Function/WAVE EP_FetchEpochs_TS(WAVE numericalValues, WAVE/T/Z textualValues, variable sweep, variable channelNumber, variable channelType) +threadsafe Function/WAVE EP_FetchEpochs_TS(WAVE numericalValues, WAVE/Z/T textualValues, variable sweep, variable channelNumber, variable channelType) WAVE/Z epochs = EP_FetchEpochsFromLNB(numericalValues, textualValues, sweep, channelNumber, channelType) @@ -1526,7 +1528,7 @@ End /// @param channelType Type of channel @sa XopChannelConstants /// /// @return epochs wave, see GetEpochsWave() for the wave layout -Function/WAVE EP_FetchEpochs(WAVE numericalValues, WAVE/T/Z textualValues, variable sweep, DFREF singleSweepDFR, variable channelNumber, variable channelType) +Function/WAVE EP_FetchEpochs(WAVE numericalValues, WAVE/Z/T textualValues, variable sweep, DFREF singleSweepDFR, variable channelNumber, variable channelType) WAVE/Z epochs = EP_FetchEpochsFromLNB(numericalValues, textualValues, sweep, channelNumber, channelType) if(WaveExists(epochs)) @@ -1538,7 +1540,7 @@ Function/WAVE EP_FetchEpochs(WAVE numericalValues, WAVE/T/Z textualValues, varia return epochs End -static Function/WAVE EP_FetchEpochsFromRecreation(WAVE numericalValues, WAVE/T/Z textualValues, variable sweep, DFREF singleSweepDFR, variable channelNumber, variable channelType) +static Function/WAVE EP_FetchEpochsFromRecreation(WAVE numericalValues, WAVE/Z/T textualValues, variable sweep, DFREF singleSweepDFR, variable channelNumber, variable channelType) string epochList @@ -1570,7 +1572,7 @@ static Function/WAVE EP_FetchEpochsFromRecreation(WAVE numericalValues, WAVE/T/Z return epChannel End -threadsafe static Function/WAVE EP_FetchEpochsFromLNB(WAVE numericalValues, WAVE/T/Z textualValues, variable sweep, variable channelNumber, variable channelType) +threadsafe static Function/WAVE EP_FetchEpochsFromLNB(WAVE numericalValues, WAVE/Z/T textualValues, variable sweep, variable channelNumber, variable channelType) variable index @@ -1618,6 +1620,7 @@ End /// @brief Append epoch information from the labnotebook to the newly cleared epoch wave Function EP_CopyLBNEpochsToEpochsWave(string device, variable sweepNo) + variable i, j, epochCnt, epochChannelCnt, chanType EP_ClearEpochs(device) @@ -1631,7 +1634,7 @@ Function EP_CopyLBNEpochsToEpochsWave(string device, variable sweepNo) for(i = 0; i < NUM_DA_TTL_CHANNELS; i += 1) for(chanType : channelTypes) - WAVE/T/Z epochChannel = EP_FetchEpochs_TS(numericalValues, textualValues, sweepNo, i, chanType) + WAVE/Z/T epochChannel = EP_FetchEpochs_TS(numericalValues, textualValues, sweepNo, i, chanType) if(!WaveExists(epochChannel)) continue @@ -1781,8 +1784,8 @@ static Function EP_AddRecreatedUserEpochs(WAVE numericalValues, WAVE/T textualVa variable DAC, headstage, index, type, waMode string key, anaFuncName - DAC = s.DACList[0] - key = "Generic function" + DAC = s.DACList[0] + key = "Generic function" [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, key, DAC, XOP_CHANNEL_TYPE_DAC, DATA_ACQUISITION_MODE) if(!WaveExists(settings)) return NaN @@ -1795,7 +1798,7 @@ static Function EP_AddRecreatedUserEpochs(WAVE numericalValues, WAVE/T textualVa anaFuncName = settingsT[index] WAVE anaFuncTypes = LBN_GetNumericWave(defValue = INVALID_ANALYSIS_FUNCTION) anaFuncTypes[headstage] = MapAnaFuncToConstant(anaFuncName) - [type, waMode] = AD_GetAnalysisFunctionType(numericalValues, anaFuncTypes, sweepNo, headstage) + [type, waMode] = AD_GetAnalysisFunctionType(numericalValues, anaFuncTypes, sweepNo, headstage) switch(type) case PSQ_CHIRP: @@ -1906,7 +1909,7 @@ static Function EP_AddRecreatedUserEpochs_Baseline(WAVE numericalValues, WAVE/T DAScale = s.DACAmp[0][%DASCALE] PSQ_SE_CreateEpochsImpl(epochWave, DAC, totalOnsetDelayMS, setName, testpulseGroupSel, DAScale, numEpochs, chunkLength) endif - WAVE/T/Z userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, PSQ_BASELINE_SELECTION_SHORT_NAME_RE_MATCHER, treelevel = EPOCH_USER_LEVEL, epochsWave = epochWave) + WAVE/Z/T userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, PSQ_BASELINE_SELECTION_SHORT_NAME_RE_MATCHER, treelevel = EPOCH_USER_LEVEL, epochsWave = epochWave) if(WaveExists(userChunkEpochs)) numBLS = DimSize(userChunkEpochs, ROWS) for(chunk = 0; chunk < numBLS; chunk += 1) @@ -1965,8 +1968,8 @@ static Function EP_AddRecreatedUserEpochs_PSQ_Ramp(WAVE numericalValues, WAVE/T EP_AddRecreatedUserEpochs_Baseline(numericalValues, textualValues, waMode, sweepDFR, PSQ_RAMP, sweepNo, s, epochWave) - DAC = s.DACList[0] - key = CreateAnaFuncLBNKey(PSQ_RAMP, PSQ_FMT_LBN_SPIKE_DETECT, query = 1, waMode = waMode) + DAC = s.DACList[0] + key = CreateAnaFuncLBNKey(PSQ_RAMP, PSQ_FMT_LBN_SPIKE_DETECT, query = 1, waMode = waMode) [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, key, DAC, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) if(!(WaveExists(settings) && settings[index] == 1)) return NaN @@ -2072,7 +2075,7 @@ static Function EP_AddRecreatedUserEpochs_PSQ_Chirp(WAVE numericalValues, WAVE/T ASSERT(IsFinite(spikeCheck), "Invalid SpikeCheck param") totalOnsetDelayMS = s.onsetDelay * s.samplingIntervalDA * MICRO_TO_MILLI if(spikeCheck) - headstage = s.headstageDAC[0] + headstage = s.headstageDAC[0] [epBegin, epEnd] = PSQ_CR_AddSpikeEvaluationEpoch(epochWave, DAC, headStage, durations, totalOnsetDelayMS) endif diff --git a/Packages/MIES/MIES_ExperimentDocumentation.ipf b/Packages/MIES/MIES_ExperimentDocumentation.ipf index 24e8f750ca..a1af098e3d 100644 --- a/Packages/MIES/MIES_ExperimentDocumentation.ipf +++ b/Packages/MIES/MIES_ExperimentDocumentation.ipf @@ -13,6 +13,7 @@ /// /// @see ED_createTextNotes, ED_createWaveNote Function ED_AddEntriesToLabnotebook(WAVE vals, WAVE/T keys, variable sweepNo, string device, variable entrySourceType) + ED_CheckValuesAndKeys(vals, keys) if(IsTextWave(vals)) @@ -24,6 +25,7 @@ End /// @brief Add numerical/textual entries to results Function ED_AddEntriesToResults(WAVE vals, WAVE/T keys, variable entrySourceType) + ED_CheckValuesAndKeys(vals, keys) if(IsTextWave(vals)) @@ -259,11 +261,7 @@ End /// given sweep number. Mostly useful for adding /// labnotebook entries during #MID_SWEEP_EVENT for /// analysis functions. -Function ED_AddEntryToLabnotebook(device, key, values, [unit, tolerance, overrideSweepNo]) - string device, key - WAVE values - string unit - variable tolerance, overrideSweepNo +Function ED_AddEntryToLabnotebook(string device, string key, WAVE values, [string unit, variable tolerance, variable overrideSweepNo]) string toleranceStr variable sweepNo, headstageCont @@ -501,7 +499,7 @@ static Function [WAVE colIndizes, variable rowIndex] ED_FindIndizesAndRedimensio Make/FREE/D/N=(DimSize(incomingKey, COLS)) indizes = NaN - WAVE/T/ZZ desc + WAVE/ZZ/T desc numCols = DimSize(incomingKey, COLS) for(i = 0; i < numCols; i += 1) @@ -644,8 +642,7 @@ End /// @brief Remember the "exact" start of the sweep /// /// Should be called immediately after HW_StartAcq(). -Function ED_MarkSweepStart(device) - string device +Function ED_MarkSweepStart(string device) WAVE/T sweepSettingsTxtWave = GetSweepSettingsTextWave(device) @@ -653,9 +650,7 @@ Function ED_MarkSweepStart(device) End /// @brief Add sweep specific information to the labnotebook -Function ED_createWaveNoteTags(device, sweepCount) - string device - variable sweepCount +Function ED_createWaveNoteTags(string device, variable sweepCount) variable i, j, refITI, ITI @@ -697,10 +692,7 @@ Function ED_createWaveNoteTags(device, sweepCount) End /// @brief Write the user comment from the DA_Ephys panel to the labnotebook -Function ED_WriteUserCommentToLabNB(device, comment, sweepNo) - string device - string comment - variable sweepNo +Function ED_WriteUserCommentToLabNB(string device, string comment, variable sweepNo) Make/FREE/N=(3, 1)/T keys @@ -801,8 +793,7 @@ static Function ED_createAsyncWaveNoteTags(device, sweepCount) End /// @brief Stores test pulse related data in the labnotebook -Function ED_TPDocumentation(device) - string device +Function ED_TPDocumentation(string device) variable sweepNo, RTolerance variable i, j @@ -816,8 +807,8 @@ Function ED_TPDocumentation(device) Make/FREE/N=(1, 12, LABNOTEBOOK_LAYER_COUNT) TPSettingsWave = NaN // add data to TPKeyWave - TPKeyWave[0][0] = "TP Baseline Vm" // current clamp - TPKeyWave[0][1] = "TP Baseline pA" // voltage clamp + TPKeyWave[0][0] = "TP Baseline Vm" // current clamp + TPKeyWave[0][1] = "TP Baseline pA" // voltage clamp TPKeyWave[0][2] = "TP Peak Resistance" TPKeyWave[0][3] = "TP Steady State Resistance" // same names as in GetAmplifierSettingsKeyWave @@ -844,9 +835,9 @@ Function ED_TPDocumentation(device) TPKeyWave[1][11] = "" RTolerance = TPSettings[%resistanceTol][INDEP_HEADSTAGE] - TPKeyWave[2][0] = "1" // Assume a tolerance of 1 mV for V rest - TPKeyWave[2][1] = "50" // Assume a tolerance of 50pA for I rest - TPKeyWave[2][2] = num2str(RTolerance) // applies the same R tolerance for the instantaneous and steady state resistance + TPKeyWave[2][0] = "1" // Assume a tolerance of 1 mV for V rest + TPKeyWave[2][1] = "50" // Assume a tolerance of 50pA for I rest + TPKeyWave[2][2] = num2str(RTolerance) // applies the same R tolerance for the instantaneous and steady state resistance TPKeyWave[2][3] = num2str(RTolerance) TPKeyWave[2][4] = "1e-12" TPKeyWave[2][5] = "1e-12" diff --git a/Packages/MIES/MIES_ForeignFunctionInterface.ipf b/Packages/MIES/MIES_ForeignFunctionInterface.ipf index f7f8cda5a5..fb2974e277 100644 --- a/Packages/MIES/MIES_ForeignFunctionInterface.ipf +++ b/Packages/MIES/MIES_ForeignFunctionInterface.ipf @@ -15,6 +15,7 @@ /// The function will pull the values (PeakResistance, SteadyStateResistance, and TimeStamp) out of /// the TP storage wave and put them in a 3x8 wave, in a designated location where ACQ4 can then find them Function/WAVE FFI_ReturnTPValues() + string lockedDevList variable noLockedDevs variable n diff --git a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf index 966b8bbc3d..25cfe216e8 100644 --- a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf +++ b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf @@ -109,8 +109,7 @@ End /// @brief Helper function to get read-only access to a global variable /// /// @param path absolute path to a global variable -threadsafe Function ROVar(path) - string path +threadsafe Function ROVar(string path) NVAR/Z var = $path ASSERT_TS(NVAR_Exists(var), "Could not recreate " + path) @@ -121,8 +120,7 @@ End /// @brief Helper function to get read-only access to a global string /// /// @param path absolute path to a global string -threadsafe Function/S ROStr(path) - string path +threadsafe Function/S ROStr(string path) SVAR/Z str = $path ASSERT_TS(SVAR_Exists(str), "Could not recreate " + path) @@ -349,15 +347,13 @@ End /// @brief Returns the absolute path to the variable `runMode` /// /// The variable holds one of @ref DAQRunModes. -Function/S GetDataAcqRunMode(device) - string device +Function/S GetDataAcqRunMode(string device) return GetNVARAsString(GetDevicePath(device), "runMode", initialValue = DAQ_NOT_RUNNING) End /// @brief Returns the absolute path to the device ID -Function/S GetDAQDeviceID(device) - string device +Function/S GetDAQDeviceID(string device) return GetNVARAsString(GetDevicePath(device), "deviceID", initialValue = NaN) End @@ -366,22 +362,21 @@ End /// number of data acquisition cycles performed. /// /// Count equals zero on the first sweep. -Function/S GetCount(device) - string device +Function/S GetCount(string device) return GetNVARAsString(GetDevicePath(device), "count", initialValue = 0) End /// @brief Returns the list of locked devices Function/S GetLockedDevices() + string device return GetSVARAsString(GetDAQDevicesFolder(), "lockedDevices", initialValue = "") End /// @brief Return the absolute path to the user comment string -Function/S GetUserComment(device) - string device +Function/S GetUserComment(string device) return GetSVARAsString(GetDevicePath(device), "userComment") End @@ -395,8 +390,7 @@ End /// StopCollectionPoint CAN NOT be used to determine the length of the ADC input wave. /// /// @sa GetFifoPosition() -Function/S GetStopCollectionPoint(device) - string device +Function/S GetStopCollectionPoint(string device) return GetNVARAsString(GetDevicePath(device), "stopCollectionPoint", initialValue = NaN) End @@ -404,8 +398,7 @@ End /// @brief Return the ADC to monitor /// /// This is the first actice AD channel in DAQDataWave and DAQConfigWave. -Function/S GetADChannelToMonitor(device) - string device +Function/S GetADChannelToMonitor(string device) return GetNVARAsString(GetDevicePath(device), "ADChannelToMonitor", initialValue = NaN) End @@ -422,8 +415,7 @@ End /// Active set count keeps track of how many steps of the largest currently /// selected set on all active channels still have to be done. Not counting the /// currently acquiring sweep. -Function/S GetActiveSetCount(device) - string device +Function/S GetActiveSetCount(string device) return GetNVARAsString(GetDevicePath(device), "activeSetCount", initialValue = NaN) End @@ -440,8 +432,7 @@ threadsafe Function/S GetInteractiveMode() End /// @brief Returns the absolute path to the testpulse running modes, holds one of @ref TestPulseRunModes -Function/S GetTestpulseRunMode(device) - string device +Function/S GetTestpulseRunMode(string device) return GetNVARAsString(GetDeviceTestPulse(device), "runMode", initialValue = TEST_PULSE_NOT_RUNNING) End @@ -480,43 +471,37 @@ Function/S GetITCDeviceList() End /// @brief Returns the last time stamp HW_NI_RepeatAcqHook was called -Function/S GetLastAcqHookCallTimeStamp(device) - string device +Function/S GetLastAcqHookCallTimeStamp(string device) return GetNVARAsString(GetDeviceTestPulse(device), "acqHookTimeStamp", initialValue = DateTime) End /// @brief Returns FIFO file reference -Function/S GetFIFOFileRef(device) - string device +Function/S GetFIFOFileRef(string device) return GetNVARAsString(GetDeviceTestPulse(device), "FIFOFileRef", initialValue = 0) End /// @brief Returns TestPulse Counter for Background Task -Function/S GetNITestPulseCounter(device) - string device +Function/S GetNITestPulseCounter(string device) return GetNVARAsString(GetDeviceTestPulse(device), "NITestPulseCounter", initialValue = 0) End /// @brief Returns the current NI setup string for analog in through DAQmx_Scan -Function/S GetNI_AISetup(device) - string device +Function/S GetNI_AISetup(string device) return GetSVARAsString(GetDevicePath(device), "NI_AI_setupStr0") End /// @brief Returns the ADC task ID set after DAQmx_Scan in HW_NI_StartAcq -Function/S GetNI_ADCTaskID(device) - string device +Function/S GetNI_ADCTaskID(string device) return GetNVARAsString(GetDevicePath(device), "NI_ADC_taskID", initialValue = NaN) End /// @brief Returns the DAC task ID set after DAQmx_WaveFormGen in HW_NI_PrepareAcq -Function/S GetNI_DACTaskID(device) - string device +Function/S GetNI_DACTaskID(string device) return GetNVARAsString(GetDevicePath(device), "NI_DAC_taskID", initialValue = NaN) End @@ -534,8 +519,7 @@ Function/S GetSU_AcquisitionError(string device) End /// @brief Returns the TTL task ID set by DAQmx_DIO_Config in HW_NI_PrepareAcq -Function/S GetNI_TTLTaskID(device) - string device +Function/S GetNI_TTLTaskID(string device) return GetNVARAsString(GetDevicePath(device), "NI_TTL_taskID", initialValue = NaN) End @@ -568,8 +552,7 @@ Function/S GetSessionStartTimeReadBack(string device) End /// @brief Return the thread group ID for the FIFO monitor/resetting daemon -threadsafe Function/S GetThreadGroupIDFIFO(device) - string device +threadsafe Function/S GetThreadGroupIDFIFO(string device) return GetNVARAsString(GetDevicePath(device), "threadGroupIDFifo", initialValue = NaN) End @@ -604,15 +587,13 @@ End /// rngSeed += 1 /// variable val = GetReproducibleRandonNumber() /// \endrst -Function/S GetRNGSeed(device) - string device +Function/S GetRNGSeed(string device) return GetNVARAsString(GetDevicePath(device), "rngSeed", initialValue = NaN) End /// @brief Return the absolute path to the repeated acquisition cycle ID -Function/S GetRepeatedAcquisitionCycleID(device) - string device +Function/S GetRepeatedAcquisitionCycleID(string device) return GetNVARAsString(GetDevicePath(device), "raCycleID", initialValue = NaN) End @@ -625,8 +606,7 @@ End /// value to have a shorter ITI than what is left over in the sweep. /// /// @sa LeftOverSweepTime() -Function/S GetRepurposedSweepTime(device) - string device +Function/S GetRepurposedSweepTime(string device) return GetNVARAsString(GetDevicePath(device), "additionalITI", initialValue = 0) End @@ -654,8 +634,7 @@ End /// Only valid if called during DAQ with DATA_ACQUISITION_MODE. /// This value is relative to first row of the rawDACWave, so an /// possible offset is already included in it. -Function/S GetFifoPosition(device) - string device +Function/S GetFifoPosition(string device) return GetNVARAsString(GetDevicePath(device), "fifoPosition", initialValue = NaN) End @@ -663,8 +642,7 @@ End /// @brief Return the error counter for the analysis function management /// /// Mainly used during testing to ensure that no RTE was thrown. -Function/S GetAnalysisFuncErrorCounter(device) - string device +Function/S GetAnalysisFuncErrorCounter(string device) return GetNVARAsString(GetDevicePath(device), "analysisFunctionErrorCounter", initialValue = 0) End @@ -672,29 +650,27 @@ End /// @brief Return the maximum ITI of all active sets /// /// Only meaningful after preparing DAQ in DC_Configure() -Function/S GetMaxIntertrialInterval(device) - string device +Function/S GetMaxIntertrialInterval(string device) return GetNVARAsString(GetDevicePath(device), "maxIntertrialInterval", initialValue = 0) End /// @brief Return the version number of the Igor experiment Function/S GetPxPVersion() + return GetNVARAsString(GetMiesPath(), "pxpVersion", initialValue = EXPERIMENT_VERSION) End /// @brief Return the version number of the Igor experiment loaded into the analysis browser /// /// @param dfr experiment folder, @sa GetAnalysisExpFolder() -Function/S GetPxPVersionForAB(dfr) - DFREF dfr +Function/S GetPxPVersionForAB(DFREF dfr) return GetNVARAsString(dfr, "pxpVersion", initialValue = NaN) End /// @brief Return the JSON ID for the sweep formula -Function/S GetSweepFormulaJSONid(dfr) - DFREF dfr +Function/S GetSweepFormulaJSONid(DFREF dfr) return GetNVARAsString(dfr, "sweepFormulaJSONid", initialValue = NaN) End @@ -709,6 +685,7 @@ End /// /// Loads the stored settings on disc if required. Function/S GetSettingsJSONid() + string path = GetNVARAsString(GetMiesPath(), "settingsJSONid", initialValue = NaN) NVAR JSONid = $path @@ -727,6 +704,7 @@ End /// /// Holds one of @ref AcquisitionStates Function/S GetAcquisitionState(string device) + return GetNVARAsString(GetDevicePath(device), "acquisitionState", initialValue = AS_INACTIVE) End @@ -734,6 +712,7 @@ End /// /// Mostly used for testing. Function/S GetBugCount() + return GetNVARAsString(GetMiesPath(), "bugCount", initialValue = 0) End @@ -741,42 +720,48 @@ End /// /// Used for reexporting from NWBv1 into NWBv2, see AB_ReExport() Function/S GetNWBOverrideHistoryAndLogFile() + return GetSVARAsString(GetNwBFolder(), "overrideHistoryAndLogFile") End /// @brief Return the absolute path to the test pulse cycle ID -Function/S GetTestpulseCycleID(device) - string device +Function/S GetTestpulseCycleID(string device) return GetNVARAsString(GetDeviceTestPulse(device), "tpCycleID", initialValue = NaN) End /// @brief Returns the path to the "called once" variable of the given name Function/S GetCalledOnceVariable(string name) + return GetNVARAsString(GetCalledOncePath(), name, initialValue = 0) End /// @brief Returns string path to the thread group id Function/S GetThreadGroupID() + return GetNVARAsString(getAsyncHomeDF(), "threadGroupID", initialValue = NaN) End /// @brief Returns string path to the number of threads Function/S GetNumThreads() + return GetNVARAsString(getAsyncHomeDF(), "numThreads", initialValue = 0) End /// @brief Returns string path to flag if background task was disabled Function/S GetTaskDisableStatus() + return GetNVARAsString(getAsyncHomeDF(), "disableTask", initialValue = 0) End /// @brief Returns the string path to the last successfully executed SweepFormula code Function/S GetLastSweepFormulaCode(DFREF dfr) + return GetSVARAsString(dfr, "lastSweepFormulaCode", initialValue = "") End /// @brief Returns the reference count variable of the given DF Function/S GetDFReferenceCount(DFREF dfr) + return GetNVARAsString(dfr, MEMORY_REFCOUNTER_DF, initialValue = 0) End diff --git a/Packages/MIES/MIES_GuiPopupMenuExt.ipf b/Packages/MIES/MIES_GuiPopupMenuExt.ipf index 9a37581391..61c33308ab 100644 --- a/Packages/MIES/MIES_GuiPopupMenuExt.ipf +++ b/Packages/MIES/MIES_GuiPopupMenuExt.ipf @@ -396,8 +396,7 @@ End /// where PEXT_SubMenuName is used. /// /// @param subMenuNr number of current sub menu -Function/S PEXT_SubMenuName(subMenuNr) - variable subMenuNr +Function/S PEXT_SubMenuName(variable subMenuNr) string s @@ -423,8 +422,7 @@ End /// Callled very often (MAX_SUBMENUS^2/2). /// /// @param subMenuNr number of current sub menu -Function/S PEXT_PopupMenuItems(subMenuNr) - variable subMenuNr +Function/S PEXT_PopupMenuItems(variable subMenuNr) variable modifiedBefore @@ -485,16 +483,16 @@ End /// @brief Prototype for the menu item getter that is compatible with the /// former popupmenu value=procedure definition. /// -Function/WAVE PEXT_ITEMGETTER_WAVE_PROTO(device) - string device +Function/WAVE PEXT_ITEMGETTER_WAVE_PROTO(string device) + End /// @brief Prototype for the former popupaction procedure, that is only /// called virtually now through the PopupContextualMenu callback. /// /// @param pa WMPopupAction structure -Function PEXT_POPUPACTION_PROTO(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PEXT_POPUPACTION_PROTO(STRUCT WMPopupAction &pa) : PopupMenuControl + End /// @brief Generic procedure for button actions from popup extension controls @@ -503,8 +501,7 @@ End /// This getter function can either return a string or 1D text wave. /// /// @param ba WMButtonAction structure -Function PEXT_ButtonProc(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function PEXT_ButtonProc(STRUCT WMButtonAction &ba) : ButtonControl string itemGetter, itemList @@ -529,7 +526,7 @@ Function PEXT_ButtonProc(ba) : ButtonControl else FUNCREF PEXT_ITEMGETTER_WAVE_PROTO GetItemWave = $itemGetter ASSERT(FuncRefIsAssigned(FuncRefInfo(GetItemWave)), "Popup extension item getter has wrong function template format") - WAVE/T/Z itemWave = GetItemWave(ba.win) + WAVE/Z/T itemWave = GetItemWave(ba.win) PEXT_VerifyAndSetMenuWave(itemWave) endif @@ -541,7 +538,7 @@ End /// @brief Verifies menu data input wave and transfers it to global static Function PEXT_VerifyAndSetMenuWave(menuWave) - WAVE/T/Z menuWave + WAVE/Z/T menuWave variable subMenuCnt, i string subItem @@ -583,9 +580,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]) - WAVE/T/Z menuList - variable method +Function/WAVE PEXT_SplitToSubMenus(WAVE/Z/T menuList, [variable method]) variable subMenuCnt, beginitem, endItem, i, j, numPerSubEntry variable numItems, remainItems, menuPos, subIndex, subMenuLength @@ -662,9 +657,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]) - WAVE/T/Z splitMenu - variable method +Function PEXT_GenerateSubMenuNames(WAVE/Z/T splitMenu, [variable method]) string subItemList, subItem variable subMenuCnt, i, j diff --git a/Packages/MIES/MIES_GuiUtilities.ipf b/Packages/MIES/MIES_GuiUtilities.ipf index 483332384b..7d86a90b77 100644 --- a/Packages/MIES/MIES_GuiUtilities.ipf +++ b/Packages/MIES/MIES_GuiUtilities.ipf @@ -15,8 +15,7 @@ static StrConstant USERDATA_SUFFIX = ")" static Constant AXIS_MODE_NO_LOG = 0 /// @brief Show a GUI control in the given window -Function ShowControl(win, control) - string win, control +Function ShowControl(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -29,8 +28,7 @@ Function ShowControl(win, control) End /// @brief Show a list of GUI controls in the given window -Function ShowControls(win, controlList) - string win, controlList +Function ShowControls(string win, string controlList) variable i variable numItems = ItemsInList(controlList) @@ -42,8 +40,7 @@ Function ShowControls(win, controlList) End /// @brief Hide a GUI control in the given window -Function HideControl(win, control) - string win, control +Function HideControl(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -56,8 +53,7 @@ Function HideControl(win, control) End /// @brief Hide a list of GUI controls in the given window -Function HideControls(win, controlList) - string win, controlList +Function HideControls(string win, string controlList) variable i variable numItems = ItemsInList(controlList) @@ -69,8 +65,7 @@ Function HideControls(win, controlList) End /// @brief Enable a GUI control in the given window -Function EnableControl(win, control) - string win, control +Function EnableControl(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -83,8 +78,7 @@ Function EnableControl(win, control) End /// @brief Enable a list of GUI controls in the given window -Function EnableControls(win, controlList) - string win, controlList +Function EnableControls(string win, string controlList) variable i variable numItems = ItemsInList(controlList) @@ -96,8 +90,7 @@ Function EnableControls(win, controlList) End /// @brief Disable a GUI control in the given window -Function DisableControl(win, control) - string win, control +Function DisableControl(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -110,8 +103,7 @@ Function DisableControl(win, control) End /// @brief Disable a list of GUI controls in the given window -Function DisableControls(win, controlList) - string win, controlList +Function DisableControls(string win, string controlList) variable i variable numItems = ItemsInList(controlList) @@ -123,8 +115,7 @@ Function DisableControls(win, controlList) End /// @brief Set the title of a list of controls -Function SetControlTitles(win, controlList, controlTitleList) - string win, controlList, controlTitleList +Function SetControlTitles(string win, string controlList, string controlTitleList) variable i variable numItems = ItemsInList(controlList) @@ -138,8 +129,7 @@ Function SetControlTitles(win, controlList, controlTitleList) End /// @brief Set the title of a control -Function SetControlTitle(win, controlName, newTitle) - string win, controlName, newTitle +Function SetControlTitle(string win, string controlName, string newTitle) ControlInfo/W=$win $controlName ASSERT(V_flag != 0, "Non-existing control or window") @@ -148,8 +138,7 @@ Function SetControlTitle(win, controlName, newTitle) End /// @brief Set the procedure of a list of controls -Function SetControlProcedures(win, controlList, newProcedure) - string win, controlList, newProcedure +Function SetControlProcedures(string win, string controlList, string newProcedure) variable i string controlName @@ -162,8 +151,7 @@ Function SetControlProcedures(win, controlList, newProcedure) End /// @brief Set the procedure of a control -Function SetControlProcedure(win, controlName, newProcedure) - string win, controlName, newProcedure +Function SetControlProcedure(string win, string controlName, string newProcedure) ControlInfo/W=$win $controlName ASSERT(V_flag != 0, "Non-existing control or window") @@ -176,9 +164,7 @@ End /// @param recMacro recreation macro for ctrl /// @param supress supress assertion that ctrl must have a title /// @return Returns the title or an empty string -Function/S GetTitle(recMacro, [supress]) - string recMacro - variable supress +Function/S GetTitle(string recMacro, [variable supress]) string title, errorMessage @@ -201,9 +187,7 @@ Function/S GetTitle(recMacro, [supress]) End /// @brief Change color of the title of mulitple controls -Function SetControlTitleColors(win, controlList, R, G, B) - string win, controlList - variable R, G, B +Function SetControlTitleColors(string win, string controlList, variable R, variable G, variable B) variable i variable numItems = ItemsInList(controlList) @@ -215,9 +199,7 @@ Function SetControlTitleColors(win, controlList, R, G, B) End /// @brief Change color of a control -Function SetControlTitleColor(win, controlName, R, G, B) ///@todo store color in control user data, check for color change before applying change - string win, controlName - variable R, G, B +Function SetControlTitleColor(string win, string controlName, variable R, variable G, variable B) ///@todo store color in control user data, check for color change before applying change ControlInfo/W=$win $controlName ASSERT(V_flag != 0, "Non-existing control or window") @@ -226,9 +208,7 @@ Function SetControlTitleColor(win, controlName, R, G, B) ///@todo store color in End /// @brief Change color of a control -Function ChangeControlColor(win, controlName, R, G, B) - string win, controlName - variable R, G, B +Function ChangeControlColor(string win, string controlName, variable R, variable G, variable B) ControlInfo/W=$win $controlName ASSERT(V_flag != 0, "Non-existing control or window") @@ -238,9 +218,7 @@ Function ChangeControlColor(win, controlName, R, G, B) End /// @brief Change the font color of a control -Function ChangeControlValueColor(win, controlName, R, G, B) - string win, controlName - variable R, G, B +Function ChangeControlValueColor(string win, string controlName, variable R, variable G, variable B) ControlInfo/W=$win $controlName ASSERT(V_flag != 0, "Non-existing control or window") @@ -250,9 +228,8 @@ Function ChangeControlValueColor(win, controlName, R, G, B) End /// @brief Change the font color of a list of controls -Function ChangeControlValueColors(win, controlList, R, G, B) - string win, controlList - variable R, G, B +Function ChangeControlValueColors(string win, string controlList, variable R, variable G, variable B) + variable i variable numItems = ItemsInList(controlList) string ctrl @@ -275,9 +252,7 @@ End /// @param G green /// @param B blue /// @param Alpha defaults to opaque if not provided -Function SetControlBckgColor(win, controlName, R, G, B, [Alpha]) - string win, controlName - variable R, G, B, Alpha +Function SetControlBckgColor(string win, string controlName, variable R, variable G, variable B, [variable Alpha]) if(paramIsDefault(Alpha)) Alpha = 1 @@ -291,9 +266,8 @@ Function SetControlBckgColor(win, controlName, R, G, B, [Alpha]) End /// @brief Change the background color of a list of controls -Function ChangeControlBckgColors(win, controlList, R, G, B) - string win, controlList - variable R, G, B +Function ChangeControlBckgColors(string win, string controlList, variable R, variable G, variable B) + variable i variable numItems = ItemsInList(controlList) string ctrl @@ -309,8 +283,8 @@ Function ChangeControlBckgColors(win, controlList, R, G, B) End /// @brief Returns one if the checkbox is selected or zero if it is unselected -Function GetCheckBoxState(win, control) - string win, control +Function GetCheckBoxState(string win, string control) + variable allowMissingControl ControlInfo/W=$win $control @@ -320,10 +294,7 @@ Function GetCheckBoxState(win, control) End /// @brief Set the internal number in a setvariable control -Function SetSetVariable(win, Control, newValue, [respectLimits]) - string win, control - variable newValue - variable respectLimits +Function SetSetVariable(string win, string Control, variable newValue, [variable respectLimits]) if(ParamIsDefault(respectLimits)) respectLimits = 0 @@ -371,9 +342,7 @@ Function SetSetVariableString(string win, string control, string str, [variable End /// @brief Set the state of the checkbox -Function SetCheckBoxState(win, control, state) - string win, control - variable state +Function SetCheckBoxState(string win, string control, variable state) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -388,9 +357,7 @@ Function SetCheckBoxState(win, control, state) End /// @brief Set the input limits for a setVariable control -Function SetSetVariableLimits(win, Control, low, high, increment) - string win, control - variable low, high, increment +Function SetSetVariableLimits(string win, string Control, variable low, variable high, variable increment) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -402,8 +369,7 @@ End /// @brief Returns the contents of a SetVariable /// /// UTF_NOINSTRUMENTATION -Function GetSetVariable(win, control) - string win, control +Function GetSetVariable(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -412,8 +378,7 @@ Function GetSetVariable(win, control) End /// @brief Returns the contents of a SetVariable with an internal string -Function/S GetSetVariableString(win, control) - string win, control +Function/S GetSetVariableString(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -426,8 +391,7 @@ Function/S GetSetVariableString(win, control) End /// @brief Returns the current PopupMenu item as string -Function/S GetPopupMenuString(win, control) - string win, control +Function/S GetPopupMenuString(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -440,8 +404,7 @@ Function/S GetPopupMenuString(win, control) End /// @brief Returns the zero-based index of a PopupMenu -Function GetPopupMenuIndex(win, control) - string win, control +Function GetPopupMenuIndex(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -451,9 +414,8 @@ Function GetPopupMenuIndex(win, control) End /// @brief Sets the zero-based index of the PopupMenu -Function SetPopupMenuIndex(win, control, index) - string win, control - variable index +Function SetPopupMenuIndex(string win, string control, variable index) + index += 1 ControlInfo/W=$win $control @@ -465,6 +427,7 @@ End /// @brief Sets the popupmenu value Function SetPopupMenuVal(string win, string control, [string list, string func]) + string output, allEntries ControlInfo/W=$win $control @@ -490,9 +453,7 @@ End /// @param str popupmenu string to select. Supports wildcard character(*) /// /// @return set string with wildcard expanded -Function/S SetPopupMenuString(win, control, str) - string win, control - string str +Function/S SetPopupMenuString(string win, string control, string str) string result @@ -509,8 +470,7 @@ Function/S SetPopupMenuString(win, control, str) End /// @brief Returns the contents of a ValDisplay -Function/S GetValDisplayAsString(win, control) - string win, control +Function/S GetValDisplayAsString(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -523,8 +483,7 @@ Function/S GetValDisplayAsString(win, control) End /// @brief Returns the contents of a ValDisplay as a number -Function GetValDisplayAsNum(win, control) - string win, control +Function GetValDisplayAsNum(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -533,8 +492,7 @@ Function GetValDisplayAsNum(win, control) End /// @brief Returns the slider position -Function GetSliderPositionIndex(win, control) - string win, control +Function GetSliderPositionIndex(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -543,9 +501,7 @@ Function GetSliderPositionIndex(win, control) End /// @brief Sets the slider position -Function SetSliderPositionIndex(win, control, index) - string win, control - variable index +Function SetSliderPositionIndex(string win, string control, variable index) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -565,10 +521,7 @@ End /// - `var` /// - `var` and `format` /// - `str` -Function SetValDisplay(win, control, [var, str, format]) - string win, control - variable var - string str, format +Function SetValDisplay(string win, string control, [variable var, string str, string format]) string formattedString @@ -597,16 +550,14 @@ Function SetValDisplay(win, control, [var, str, format]) End /// @brief Check if a given control exists -Function ControlExists(win, control) - string win, control +Function ControlExists(string win, string control) ControlInfo/W=$win $control return V_flag != 0 End /// @brief Return the full subwindow path to the windows the control belongs to -Function/S FindControl(control) - string control +Function/S FindControl(string control) string windows, childWindows, childWindow, win variable i, j, numWindows, numChildWindows @@ -635,8 +586,7 @@ Function/S FindControl(control) End /// @brief Return the full subwindow path to the given notebook -Function/S FindNotebook(nb) - string nb +Function/S FindNotebook(string nb) string windows, childWindows, childWindow, win, leaf variable i, j, numWindows, numChildWindows @@ -670,8 +620,7 @@ End /// /// @param win window name /// @param ctrl name of the control -Function GetTabID(win, ctrl) - string win, ctrl +Function GetTabID(string win, string ctrl) ControlInfo/W=$win $ctrl ASSERT(V_flag != 0, "Non-existing control or window") @@ -685,8 +634,7 @@ End /// @param control name of the control /// @param key user data identifier /// @param value user data value -Function SetControlUserData(win, control, key, value) - string win, control, key, value +Function SetControlUserData(string win, string control, string key, string value) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -859,6 +807,7 @@ End /// /// @return minimum and maximum value of the axis range Function [variable minimum, variable maximum] GetAxisRange(string graph, string axis, [variable mode]) + string info if(!windowExists(graph)) @@ -901,8 +850,7 @@ End /// @brief Return the orientation of the axis as numeric value /// @returns one of @ref AxisOrientationConstants -Function GetAxisOrientation(graph, axes) - string graph, axes +Function GetAxisOrientation(string graph, string axes) string orientation @@ -943,6 +891,7 @@ End /// /// @return One of @ref ModifyGraphLogModes Function GetAxisLogMode(string graph, string axis) + string info info = AxisInfo(graph, axis) @@ -971,9 +920,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]) - string graph, axesRegexp - variable orientation, mode +Function/WAVE GetAxesProperties(string graph, [string axesRegexp, variable orientation, variable mode]) string list, axis, recMacro, info variable numAxes, i, countAxes, minimum, maximum, axisOrientation, logMode @@ -1006,7 +953,7 @@ Function/WAVE GetAxesProperties(graph, [axesRegexp, orientation, mode]) info = AxisInfo(graph, axis) - [minimum, maximum] = GetAxisRangeFromInfo(graph, info, axis, mode) + [minimum, maximum] = GetAxisRangeFromInfo(graph, info, axis, mode) props[countAxes][%axisType] = axisOrientation props[countAxes][%minimum] = minimum props[countAxes][%maximum] = maximum @@ -1036,11 +983,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]) - string graph - WAVE props - string axesRegexp - variable orientation, mode +Function SetAxesProperties(string graph, WAVE props, [string axesRegexp, variable orientation, variable mode]) variable numRows, numAxes, i, minimum, maximum, axisOrientation variable col, row, prevAxisMin, prevAxisMax, logMode @@ -1118,8 +1061,7 @@ End /// @brief Returns the next axis name in a row of *consecutive* /// and already existing axis names -Function/S GetNextFreeAxisName(graph, axesBaseName) - string graph, axesBaseName +Function/S GetNextFreeAxisName(string graph, string axesBaseName) variable numAxes @@ -1129,8 +1071,7 @@ Function/S GetNextFreeAxisName(graph, axesBaseName) End /// @brief Return a unique axis name -Function/S GetUniqueAxisName(graph, axesBaseName) - string graph, axesBaseName +Function/S GetUniqueAxisName(string graph, string axesBaseName) variable numAxes, count, i string list, axis @@ -1151,9 +1092,7 @@ End /// @brief Generic wrapper for setting a control's value /// pass in the value as a string, and then decide whether to change to a number based on the type of control -Function SetGuiControlValue(win, control, value) - string win, control - string value +Function SetGuiControlValue(string win, string control, string value) variable controlType, variableType string recMacro @@ -1181,8 +1120,7 @@ Function SetGuiControlValue(win, control, value) End /// @brief Generic wrapper for getting a control's value -Function/S GetGuiControlValue(win, control) - string win, control +Function/S GetGuiControlValue(string win, string control) string value variable controlType, variableType @@ -1216,8 +1154,7 @@ Function/S GetGuiControlValue(win, control) End /// @brief Generic wrapper for getting a controls state (enabled, hidden, disabled) -Function/S GetGuiControlState(win, control) - string win, control +Function/S GetGuiControlState(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -1226,9 +1163,8 @@ Function/S GetGuiControlState(win, control) End /// @brief Generic wrapper for setting a controls state (enabled, hidden, disabled) -Function SetGuiControlState(win, control, controlState) - string win, control - string controlState +Function SetGuiControlState(string win, string control, string controlState) + variable controlType ControlInfo/W=$win $control @@ -1239,8 +1175,7 @@ End /// @brief Return one if the given control is disabled, /// zero otherwise -Function IsControlDisabled(win, control) - string win, control +Function IsControlDisabled(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -1250,8 +1185,7 @@ End /// @brief Return one if the given control is hidden, /// zero otherwise -Function IsControlHidden(win, control) - string win, control +Function IsControlHidden(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -1264,8 +1198,7 @@ End /// @param subwindow window name including subwindows, e.g. `panel#subWin1#subWin2` /// /// UTF_NOINSTRUMENTATION -Function/S GetMainWindow(subwindow) - string subwindow +Function/S GetMainWindow(string subwindow) return StringFromList(0, subwindow, "#") End @@ -1285,8 +1218,7 @@ End /// to RestoreCursors(). /// /// The data is sorted like `CURSOR_NAMES`. -Function/WAVE GetCursorInfos(graph) - string graph +Function/WAVE GetCursorInfos(string graph) Make/T/FREE/N=(ItemsInList(CURSOR_NAMES)) wv = CsrInfo($StringFromList(p, CURSOR_NAMES), graph) @@ -1298,9 +1230,7 @@ Function/WAVE GetCursorInfos(graph) End /// @brief Restore the cursors from the info of GetCursorInfos(). -Function RestoreCursors(graph, cursorInfos) - string graph - WAVE/T/Z cursorInfos +Function RestoreCursors(string graph, WAVE/Z/T cursorInfos) string traceList, cursorTrace, info, replacementTrace variable i, numEntries, numTraces @@ -1411,8 +1341,7 @@ Function/WAVE FilterAnnotations(WAVE/T annoInfo, string regexp) End /// @brief Autoscale all vertical axes in the visible x range -Function AutoscaleVertAxisVisXRange(graph) - string graph +Function AutoscaleVertAxisVisXRange(string graph) string axList, axis variable i, numAxes, axisOrient @@ -1432,8 +1361,7 @@ End /// @brief Return the type of the variable of the SetVariable control /// /// @return one of @ref GetInternalSetVariableTypeReturnTypes -Function GetInternalSetVariableType(recMacro) - string recMacro +Function GetInternalSetVariableType(string recMacro) ASSERT(strsearch(recMacro, "SetVariable", 0) != -1, "recreation macro is not from a SetVariable") @@ -1452,6 +1380,7 @@ Function GetInternalSetVariableType(recMacro) End Function ExtractLimitsFromRecMacro(string recMacro, variable &minVal, variable &maxVal, variable &incVal) + string minStr, maxStr, incStr minVal = NaN @@ -1477,6 +1406,7 @@ End /// /// @sa ExtractLimitsFromRecMacro for a faster way if you already have the recreation macro Function ExtractLimits(string win, string control, variable &minVal, variable &maxVal, variable &incVal) + string minStr, maxStr, incStr string recMacro @@ -1492,9 +1422,7 @@ End /// - 1: inside limits, i.e. val lies in the range [min, max] /// - NaN: no limits could be found /// -Function CheckIfValueIsInsideLimits(win, control, val) - string win, control - variable val +Function CheckIfValueIsInsideLimits(string win, string control, variable val) variable minVal, maxVal, incVal @@ -1522,9 +1450,7 @@ End /// /// @param func name of the function /// @param paramIndex index of the parameter -Function GetFunctionParameterType(func, paramIndex) - string func - variable paramIndex +Function GetFunctionParameterType(string func, variable paramIndex) string funcInfo, param variable numParams @@ -1551,8 +1477,7 @@ End /// /// @param key non-empty string (must be followed by `=` in the recreation macro) /// @param recMacro GUI control recreation macro as returned by `ControlInfo` -Function/S GetValueFromRecMacro(key, recMacro) - string key, recMacro +Function/S GetValueFromRecMacro(string key, string recMacro) variable last, first variable comma, cr @@ -1595,9 +1520,7 @@ End /// but can have one. /// /// @returns 1 on error, 0 if everything is fine. -Function SearchForInvalidControlProcs(win, [warnOnEmpty]) - string win - variable warnOnEmpty +Function SearchForInvalidControlProcs(string win, [variable warnOnEmpty]) string controlList, control, controlProc string subTypeStr, helpEntry, recMacro @@ -1683,8 +1606,7 @@ End /// @brief Convert the function subType names for GUI control procedures /// to a numeric value as used by `ControlInfo` -Function GetNumericSubType(subType) - string subType +Function GetNumericSubType(string subType) strswitch(subType) case "ButtonControl": @@ -1717,8 +1639,7 @@ End /// @brief Return the numeric control type /// /// @return one of @ref GUIControlTypes -Function GetControlType(win, control) - string win, control +Function GetControlType(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -1727,12 +1648,12 @@ End /// @brief Determines if control stores numeric or text data Function DoesControlHaveInternalString(string recMacro) + return strsearch(recMacro, "_STR:", 0) != -1 End /// @brief Returns checkbox mode -Function GetCheckBoxMode(win, checkBoxName) - string win, checkBoxName +Function GetCheckBoxMode(string win, string checkBoxName) variable first, mode string modeString @@ -1750,8 +1671,7 @@ End /// @brief Returns the selected row of the ListBox for some modes /// without selection waves -Function GetListBoxSelRow(win, ctrl) - string win, ctrl +Function GetListBoxSelRow(string win, string ctrl) ControlInfo/W=$win $ctrl ASSERT(V_flag == 11, "Not a listbox control") @@ -1790,9 +1710,7 @@ Function SetListBoxSelection(string win, string ctrl, variable val, variable row End /// @brief Check if the location `loc` is inside the rectangle `r` -Function IsInsideRect(loc, r) - STRUCT Point &loc - STRUCT RectF &r +Function IsInsideRect(STRUCT Point &loc, STRUCT RectF &r) return loc.h >= r.left \ && loc.h <= r.right \ @@ -1802,9 +1720,7 @@ End /// @brief Return the coordinates of the control borders /// relative to the top left corner in pixels -Function GetControlCoordinates(win, ctrl, s) - string win, ctrl - STRUCT RectF &s +Function GetControlCoordinates(string win, string ctrl, STRUCT RectF &s) ControlInfo/W=$win $ctrl ASSERT(V_flag != 0, "Not an existing control") @@ -1830,8 +1746,7 @@ Function/S GetNotebookText(string win, [variable mode]) End /// @brief Replace the contents of the notebook -Function ReplaceNotebookText(win, text) - string win, text +Function ReplaceNotebookText(string win, string text) ASSERT(WinType(win) == 5, "Passed win is not a notebook") @@ -1842,8 +1757,7 @@ Function ReplaceNotebookText(win, text) End /// @brief Append to a notebook -Function AppendToNotebookText(win, text) - string win, text +Function AppendToNotebookText(string win, string text) ASSERT(WinType(win) == 5, "Passed win is not a notebook") @@ -1856,8 +1770,7 @@ End /// @brief Select the end in the given notebook. /// /// The selection is the place where the user would naïvely enter new text. -Function NotebookSelectionAtEnd(win) - string win +Function NotebookSelectionAtEnd(string win) ASSERT(WinType(win) == 5, "Passed win is not a notebook") @@ -1905,8 +1818,7 @@ End /// /// @param ctrlType ctrl type of Igor control /// @returns Igor name of control type -Function/S ControlTypeToName(ctrlType) - variable ctrlType +Function/S ControlTypeToName(variable ctrlType) variable pos if(numtype(ctrlType) == 2) @@ -1923,8 +1835,7 @@ End /// /// @param ctrlName Name of Igor control /// @returns Igor control type number -Function Name2ControlType(ctrlName) - string ctrlName +Function Name2ControlType(string ctrlName) variable pos pos = WhichListItem(ctrlName, EXPCONFIG_GUI_CTRLLIST) @@ -1940,8 +1851,7 @@ End /// /// @param wName window name that should be checked to be a valid host for subwindows /// @returns 1 if window is a valid host, 0 otherwise -Function WindowTypeCanHaveChildren(wName) - string wName +Function WindowTypeCanHaveChildren(string wName) Make/FREE/I typeCanHaveChildren = {WINTYPE_GRAPH, WINTYPE_PANEL} FindValue/I=(WinType(wName)) typeCanHaveChildren @@ -1955,8 +1865,7 @@ End /// @param wName parent window name to start with /// @return A string containing names of windows. This list is a semicolon separated list. It will include the window /// wName and all of its children and children of children, etc. -Function/S GetAllWindows(wName) - string wName +Function/S GetAllWindows(string wName) string windowList = "" GetAllWindowsImpl(wName, windowList) @@ -2008,9 +1917,7 @@ End /// @param[in] device Window name to check /// @param[in] typeTag one of PANELTAG_* constants @sa panelTags /// returns 1 if window is a DA_Ephys panel -Function PanelIsType(device, typeTag) - string device - string typeTag +Function PanelIsType(string device, string typeTag) if(!WindowExists(device)) return 0 @@ -2023,8 +1930,7 @@ End /// /// - Expects the ctrl to have the named user data "DefaultIncrement" /// - Works only on right mouse click on the title or the value field, *not* the up/down arrow buttons -Function ShowSetVariableLimitsSelectionPopup(sva) - STRUCT WMSetVariableAction &sva +Function ShowSetVariableLimitsSelectionPopup(STRUCT WMSetVariableAction &sva) string win, ctrl, items, defaultIncrementStr, elem variable minVal, maxVal, incVal, defaultIncrement, index @@ -2198,6 +2104,7 @@ End /// @param value String with a list or function (what you enter with PopupMenu value=\#XXX) /// @param type One of @ref PopupMenuListTypes Function/S GetPopupMenuList(string value, variable type) + string path, cmd switch(type) @@ -2264,6 +2171,7 @@ End /// @brief Query a numeric GUI control property Function GetControlSettingVar(string recMacro, string setting, [variable defValue]) + string match variable found @@ -2282,6 +2190,7 @@ End /// @brief Query a string GUI control property Function/S GetControlSettingStr(string recMacro, string setting, [string defValue]) + string match variable found @@ -2387,6 +2296,7 @@ End /// @brief Adjust the "Normal" ruler in the notebook so that all text is visible. Function ReflowNotebookText(string win) + variable width GetWindow $win, wsizeDC diff --git a/Packages/MIES/MIES_IVSCC.ipf b/Packages/MIES/MIES_IVSCC.ipf index 39ffce8f39..b46b4f7121 100644 --- a/Packages/MIES/MIES_IVSCC.ipf +++ b/Packages/MIES/MIES_IVSCC.ipf @@ -24,6 +24,7 @@ static Constant IVS_DEFAULT_HEADSTAGE = 0 static StrConstant IVS_DEFAULT_DEVICE = "ITC18USB_Dev_0" Function IVS_ConfigureMCC() + string device variable headstage @@ -183,6 +184,7 @@ End /// /// @sa PSQ_PipetteInBath Function IVS_runBaselineCheckQC() + string device, ctrl variable headstage @@ -198,6 +200,7 @@ End /// @brief Run the initial access resistance smoke from the WSE Function IVS_runInitAccessResisQC() + string device, ctrl variable headstage @@ -212,6 +215,7 @@ End /// @brief Run PSQ_SealEvaluation() Function IVS_RunGigOhmSealQC() + string device, ctrl variable headstage @@ -225,16 +229,13 @@ Function IVS_RunGigOhmSealQC() End /// @brief Loads a single stimulus for the user when using the ZMQ Proxy -Function IVS_Load_StimSet(stim_filename) - - string stim_filename +Function IVS_Load_StimSet(string stim_filename) print "Stimulus loading...." + stim_filename NWB_LoadAllStimSets(overwrite = 1, fileName = stim_filename) End -Function IVS_ExportAllData(filePath) - string filePath +Function IVS_ExportAllData(string filePath) printf "Saving experiment data in NWB format to %s\r", filePath @@ -253,8 +254,7 @@ Function/S IVS_ReturnNWBFileLocation() return path End -Function IVS_SaveExperiment(filename) - string filename +Function IVS_SaveExperiment(string filename) variable err @@ -271,9 +271,7 @@ End /// /// @param stimWaveName stimWaveName to be used /// @param scaleFactor scale factor to run the stim wave at -Function IVS_runStimWave(stimWaveName, scaleFactor) - string stimWaveName - variable scaleFactor +Function IVS_runStimWave(string stimWaveName, variable scaleFactor) variable headstage string device, ctrl @@ -291,8 +289,7 @@ Function IVS_runStimWave(stimWaveName, scaleFactor) PGC_SetAndActivateControl(device, "DataAcquireButton") End -Function IVS_ButtonProc_Setup(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function IVS_ButtonProc_Setup(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -303,8 +300,7 @@ Function IVS_ButtonProc_Setup(ba) : ButtonControl return 0 End -Function IVS_ButtonProc_BaselineQC(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function IVS_ButtonProc_BaselineQC(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -315,8 +311,7 @@ Function IVS_ButtonProc_BaselineQC(ba) : ButtonControl return 0 End -Function IVS_ButtonProc_AccessResist(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function IVS_ButtonProc_AccessResist(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -327,8 +322,7 @@ Function IVS_ButtonProc_AccessResist(ba) : ButtonControl return 0 End -Function IVS_ButtonProc_GOhmSeal(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function IVS_ButtonProc_GOhmSeal(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -340,6 +334,7 @@ Function IVS_ButtonProc_GOhmSeal(ba) : ButtonControl End Function IVS_CreatePanel() + Execute "IVSCCControlPanel()" End @@ -347,9 +342,7 @@ End /// /// @return 1 if passed, 0 if not (or not yet) and /// asserts out on all other errors. -Function IVS_GetSetQCForSweep(device, sweepNo) - string device - variable sweepNo +Function IVS_GetSetQCForSweep(string device, variable sweepNo) string key variable headstage, anaFuncType @@ -381,9 +374,11 @@ Function IVS_GetSetQCForSweep(device, sweepNo) End Function IVS_EnableStoringEveryTP(string device) + PGC_SetAndActivateControl(device, "check_Settings_TP_SaveTP", val = CHECKBOX_SELECTED) End Function IVS_DisableStoringEveryTP(string device) + PGC_SetAndActivateControl(device, "check_Settings_TP_SaveTP", val = CHECKBOX_UNSELECTED) End diff --git a/Packages/MIES/MIES_IgorHooks.ipf b/Packages/MIES/MIES_IgorHooks.ipf index 2c3044ce34..df174788ef 100644 --- a/Packages/MIES/MIES_IgorHooks.ipf +++ b/Packages/MIES/MIES_IgorHooks.ipf @@ -355,6 +355,7 @@ End #endif Function IH_ResetScaling(STRUCT WMWinHookStruct &s) + string activeSW, graph, list, win variable i, numEntries diff --git a/Packages/MIES/MIES_Indexing.ipf b/Packages/MIES/MIES_Indexing.ipf index 21ea069825..d27312bf1a 100644 --- a/Packages/MIES/MIES_Indexing.ipf +++ b/Packages/MIES/MIES_Indexing.ipf @@ -9,8 +9,7 @@ /// @file MIES_Indexing.ipf /// @brief __IDX__ Indexing related functionality -Function IDX_StoreStartFinishForIndexing(device) - string device +Function IDX_StoreStartFinishForIndexing(string device) variable i, j, waveIdx, indexIdx, channelType @@ -21,7 +20,7 @@ Function IDX_StoreStartFinishForIndexing(device) for(j = 0; j < 2; j += 1) channelType = channelTypes[j] - [waveIdx, indexIdx] = IDX_GetCurrentSets(device, channelType, i) + [waveIdx, indexIdx] = IDX_GetCurrentSets(device, channelType, i) IndexingStorageWave[channelType][%CHANNEL_CONTROL_WAVE][i] = waveIdx IndexingStorageWave[channelType][%CHANNEL_CONTROL_INDEX_END][i] = indexIdx endfor @@ -29,8 +28,7 @@ Function IDX_StoreStartFinishForIndexing(device) End /// @brief Resets the selected set popupmenus stored by #IDX_StoreStartFinishForIndexing -Function IDX_ResetStartFinishForIndexing(device) - string device +Function IDX_ResetStartFinishForIndexing(string device) variable i, j, idx, channelType string ctrl, stimset @@ -135,8 +133,7 @@ static Function IDX_IndexSingleChannel(device, channelType, channel) End /// @brief Sum of the largest sets for each indexing step -Function IDX_MaxSweepsLockedIndexing(device) - string device +Function IDX_MaxSweepsLockedIndexing(string device) variable i, maxSteps variable MaxCycleIndexSteps = max(IDX_MaxSets(device, CHANNEL_TYPE_DAC), \ @@ -145,7 +142,7 @@ Function IDX_MaxSweepsLockedIndexing(device) do MaxSteps += max(IDX_StepsInSetWithMaxSweeps(device, i, CHANNEL_TYPE_DAC), \ IDX_StepsInSetWithMaxSweeps(device, i, CHANNEL_TYPE_TTL)) - i += 1 + i += 1 while(i < MaxCycleIndexSteps) return MaxSteps @@ -234,9 +231,7 @@ End /// @param IndexOverRide index override is the same as indexing off. some /// Functions that call this function only want the max number of steps in the /// start (active) set, when indexing is on. 1 = over ride ON -Function IDX_MaxNoOfSweeps(device, IndexOverRide) - string device - variable IndexOverRide +Function IDX_MaxNoOfSweeps(string device, variable IndexOverRide) variable MaxNoOfSweeps variable i @@ -278,8 +273,7 @@ End /// @brief Returns the number of sweeps in the stimulus set with the smallest number of sweeps (across all active stimulus sets). /// /// @param device device -Function IDX_MinNoOfSweeps(device) - string device +Function IDX_MinNoOfSweeps(string device) variable MinNoOfSweeps = Inf variable i @@ -316,9 +310,7 @@ End /// @param lockedIndexing defaults to false, true returns just the DAC/TTL setname /// /// Constants are defined at @ref ChannelTypeAndControlConstants -Function/WAVE IDX_GetSetsInRange(device, channel, channelType, lockedIndexing) - string device - variable channel, channelType, lockedIndexing +Function/WAVE IDX_GetSetsInRange(string device, variable channel, variable channelType, variable lockedIndexing) variable listOffset, first, last, indexStart, indexEnd string waveCtrl, lastCtrl, list, msg @@ -374,8 +366,7 @@ static Function IDX_NumberOfSweepsAcrossSets(device, channel, channelType, locke End /// @brief Return the number of sweeps -Function IDX_NumberOfSweepsInSet(setName) - string setName +Function IDX_NumberOfSweepsInSet(string setName) if(isEmpty(setName)) return 0 @@ -456,9 +447,7 @@ static Function IDX_TotalIndexingListSteps(device, channelNumber, channelType) return totalListSteps End -Function IDX_UnlockedIndexingStepNo(device, channelNumber, channelType, count) - string device - variable channelNumber, channelType, count +Function IDX_UnlockedIndexingStepNo(string device, variable channelNumber, variable channelType, variable count) variable i, stepsInSummedSets, totalListSteps, direction variable first, last @@ -514,8 +503,7 @@ static Function IDX_DetIfCountIsAtSetBorder(device, count, channelNumber, channe End /// @brief Calculate the active set count -Function IDX_CalculcateActiveSetCount(device) - string device +Function IDX_CalculcateActiveSetCount(string device) variable value diff --git a/Packages/MIES/MIES_InputDialog.ipf b/Packages/MIES/MIES_InputDialog.ipf index 25cc3fc9a2..72e4469f0d 100644 --- a/Packages/MIES/MIES_InputDialog.ipf +++ b/Packages/MIES/MIES_InputDialog.ipf @@ -24,6 +24,7 @@ /// /// @return 0 on success, 1 if the user cancelled the dialog Function ID_AskUserForSettings(variable mode, string title, WAVE data, WAVE mock) + string win, ctrl variable i, state_var @@ -134,6 +135,7 @@ Function ID_ButtonProc(STRUCT WMButtonAction &ba) : ButtonControl End Function ID_SetVarProc(STRUCT WMSetVariableAction &sva) : SetVariableControl + variable idx switch(sva.eventCode) @@ -149,8 +151,7 @@ Function ID_SetVarProc(STRUCT WMSetVariableAction &sva) : SetVariableControl endswitch End -Function ID_PopMenuProc(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function ID_PopMenuProc(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -165,6 +166,7 @@ Function ID_PopMenuProc(pa) : PopupMenuControl End Function/S ID_GetPopupEntries() + string win win = GetCurrentWindow() diff --git a/Packages/MIES/MIES_JSONWaveNotes.ipf b/Packages/MIES/MIES_JSONWaveNotes.ipf index 088e68a74f..53a0e9b045 100644 --- a/Packages/MIES/MIES_JSONWaveNotes.ipf +++ b/Packages/MIES/MIES_JSONWaveNotes.ipf @@ -102,7 +102,7 @@ threadsafe Function/WAVE JWN_GetTextWaveFromWaveNote(WAVE wv, string jsonPath) ASSERT_TS(WaveExists(wv), "Missing wave") jsonID = JWN_GetWaveNoteAsJSON(wv) - WAVE/T/Z textWave = JSON_GetTextWave(jsonID, jsonPath, ignoreErr = 1) + WAVE/Z/T textWave = JSON_GetTextWave(jsonID, jsonPath, ignoreErr = 1) JSON_Release(jsonID) return textWave diff --git a/Packages/MIES/MIES_Labnotebook.ipf b/Packages/MIES/MIES_Labnotebook.ipf index aeae26b94b..c5195e0589 100644 --- a/Packages/MIES/MIES_Labnotebook.ipf +++ b/Packages/MIES/MIES_Labnotebook.ipf @@ -8,6 +8,7 @@ /// @brief Set column dimension labels from the first row of the key wave Function LBN_SetDimensionLabels(WAVE/T keys, WAVE values, [variable start]) + variable i, numCols string text @@ -38,7 +39,8 @@ End /// @retval result one on error, zero otherwise /// @retval unit unit of the result [empty if not found] /// @retval col column of the result into the keyWave [NaN if not found] -threadsafe Function [variable result, string unit, variable col] LBN_GetEntryProperties(WAVE/T/Z keyWave, string key) +threadsafe Function [variable result, string unit, variable col] LBN_GetEntryProperties(WAVE/Z/T keyWave, string key) + variable row unit = "" diff --git a/Packages/MIES/MIES_LogbookViewer.ipf b/Packages/MIES/MIES_LogbookViewer.ipf index 80ed207fae..199f62bd30 100644 --- a/Packages/MIES/MIES_LogbookViewer.ipf +++ b/Packages/MIES/MIES_LogbookViewer.ipf @@ -35,8 +35,8 @@ Function/S LBV_GetDescriptionNotebook(string win) return LBV_GetSettingsHistoryPanel(win) + "#Description" End -static Function/WAVE LBV_PopupExtFormatEntries(WAVE/T/Z entries) - WAVE/T/Z splittedMenu = PEXT_SplitToSubMenus(entries, method = PEXT_SUBSPLIT_ALPHA) +static Function/WAVE LBV_PopupExtFormatEntries(WAVE/Z/T entries) + WAVE/Z/T splittedMenu = PEXT_SplitToSubMenus(entries, method = PEXT_SUBSPLIT_ALPHA) PEXT_GenerateSubMenuNames(splittedMenu) @@ -45,6 +45,7 @@ End /// @brief Returns the list of TPStorage keys Function/WAVE LBV_PopupExtGetTPStorageKeys(string win) + DFREF dfr = LBV_GetTPStorageLocation(win) if(!DataFolderExistsDFR(dfr)) @@ -88,7 +89,8 @@ End /// @brief Returns the combined parameter names (non-empty) from the numerical /// and textual MD key loogbook waves as 1D text wave -Function/WAVE LBV_GetAllLogbookParamNames(WAVE/T/Z textualValues, WAVE/T/Z numericalValues) +Function/WAVE LBV_GetAllLogbookParamNames(WAVE/Z/T textualValues, WAVE/Z/T numericalValues) + string key if(!WaveExists(textualValues) && !WaveExists(numericalValues)) @@ -108,7 +110,7 @@ Function/WAVE LBV_GetAllLogbookParamNames(WAVE/T/Z textualValues, WAVE/T/Z numer return result End -static Function/WAVE LBV_GetAllLogbookParamNames_NoCache(WAVE/T/Z textualValues, WAVE/T/Z numericalValues) +static Function/WAVE LBV_GetAllLogbookParamNames_NoCache(WAVE/Z/T textualValues, WAVE/Z/T numericalValues) variable existText, existNum WAVE/Z/T textualNames = LBV_GetFilledLabnotebookEntries(textualValues) @@ -143,6 +145,7 @@ End /// @brief Return a text wave with all entries from all TPStorage waves which are candidates for plotting Function/WAVE LBV_GetTPStorageEntries(DFREF dfr) + variable i, numEntries string list @@ -204,6 +207,7 @@ Function LBV_ButtonProc_ClearGraph(STRUCT WMButtonAction &ba) : ButtonControl End Function LBV_ButtonProc_SwitchXAxis(STRUCT WMButtonAction &ba) : ButtonControl + string lbGraph switch(ba.eventCode) @@ -217,6 +221,7 @@ Function LBV_ButtonProc_SwitchXAxis(STRUCT WMButtonAction &ba) : ButtonControl End Function LBV_PopMenuProc_LabNotebookAndResults(STRUCT WMPopupAction &pa) : PopupMenuControl + string key, win, lbGraph switch(pa.eventCode) @@ -287,6 +292,7 @@ Function [WAVE keys, WAVE values] LBV_GetLogbookWavesForEntry(string win, string End Function LBV_PopMenuProc_TPStorage(STRUCT WMPopupAction &pa) : PopupMenuControl + string lbGraph, key, win switch(pa.eventCode) @@ -317,6 +323,7 @@ Function/S LBV_GetExperiments(string win) End Function/S LBV_GetAllDevicesForExperiment(string win) + string dataFolder, shPanel variable index @@ -532,7 +539,7 @@ static Function LBV_AddTraceToLBGraph(string graph, WAVE keys, WAVE values, stri num2str(i < NUM_HEADSTAGES ? i : NaN), \ axis}) - [s] = GetHeadstageColor(i) + [s] = GetHeadstageColor(i) marker = i == 0 ? 39 : i ModifyGraph/W=$graph rgb($trace)=(s.red, s.green, s.blue, IsTextData ? 0 : Inf), marker($trace)=marker SetAxis/W=$graph/A=2 $axis @@ -573,6 +580,7 @@ Function LBV_Update(string win) End Function LBV_UpdateTagsForTextualLBNEntries(string win, variable sweepNo) + string lbGraph, traceList, key, trace variable i, numTraces @@ -712,7 +720,7 @@ static Function LBV_AddTraceToLBGraphTPStorage(string graph, DFREF dfr, string k axis \ }) - [s] = GetHeadstageColor(headstage) + [s] = GetHeadstageColor(headstage) marker = headstage == 0 ? 39 : headstage ModifyGraph/W=$graph rgb($trace)=(s.red, s.green, s.blue), marker($trace)=marker SetAxis/W=$graph/A=2 $axis @@ -733,7 +741,7 @@ static Function LBV_AddTraceToLBGraphTPStorage(string graph, DFREF dfr, string k EquallySpaceAxis(graph, axisRegExp = ".*" + VERT_AXIS_BASE_NAME + ".*", sortOrder = 16) End -static Function [WAVE/T/Z traces, string name, string unit, variable col] LBV_GetPropertiesForLabnotebookEntry(WAVE/T keys, string key) +static Function [WAVE/Z/T traces, string name, string unit, variable col] LBV_GetPropertiesForLabnotebookEntry(WAVE/T keys, string key) variable result [result, unit, col] = LBN_GetEntryProperties(keys, key) @@ -970,6 +978,7 @@ End // @brief Pre-select an entry if we only have one experiment and one device Function LBV_SelectExperimentAndDevice(string win) + string experiments, devices, shPanel shPanel = LBV_GetSettingsHistoryPanel(win) @@ -995,7 +1004,7 @@ Function LBV_SelectExperimentAndDevice(string win) endif End -static Function/S LBV_FormatDescription(WAVE/T/Z keys, string name) +static Function/S LBV_FormatDescription(WAVE/Z/T keys, string name) variable idx, i, numEntries string template, result, str, text @@ -1025,6 +1034,7 @@ static Function/S LBV_FormatDescription(WAVE/T/Z keys, string name) End Function LBV_EntryDescription(STRUCT WMWinHookStruct &s) + string win, info, list, axis, descNB, key variable numEntries, i, axisOrientation, first, last, relYPos, width, yAxisHorizPos @@ -1070,13 +1080,13 @@ Function LBV_EntryDescription(STRUCT WMWinHookStruct &s) relYPos = 1 - (s.mouseloc.v / (s.winRect.bottom - s.winRect.top)) if(first < relYPos && relYPos < last) - WAVE/T/Z matches = TUD_GetUserDataAsWave(win, LBV_UD_KEY, keys = {LBV_UD_YAXIS}, values = {axis}) + WAVE/Z/T matches = TUD_GetUserDataAsWave(win, LBV_UD_KEY, keys = {LBV_UD_YAXIS}, values = {axis}) ASSERT(WaveExists(matches), "Invalid key") key = matches[0] - WAVE/T/Z matches = TUD_GetUserDataAsWave(win, LBV_UD_KEYS_WAVE, keys = {LBV_UD_YAXIS, LBV_UD_KEY}, values = {axis, key}) + WAVE/Z/T matches = TUD_GetUserDataAsWave(win, LBV_UD_KEYS_WAVE, keys = {LBV_UD_YAXIS, LBV_UD_KEY}, values = {axis, key}) ASSERT(WaveExists(matches), "Invalid keys") - WAVE/T/Z keys = $matches[0] + WAVE/Z/T keys = $matches[0] descNB = LBV_GetDescriptionNotebook(win) ReplaceNotebookText(descNB, LBV_FormatDescription(keys, key)) @@ -1094,13 +1104,14 @@ Function LBV_EntryDescription(STRUCT WMWinHookStruct &s) End Function LBV_PlotAllAnalysisFunctionLBNKeys(string browser, variable anaFuncType) + string key, graph, axes, prefix variable i, numEntries - WAVE/T/Z textualKeys = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_TEXTUAL_KEYS, selectedExpDevice = 1) - WAVE/T/Z numericalKeys = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_NUMERICAL_KEYS, selectedExpDevice = 1) + WAVE/Z/T textualKeys = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_TEXTUAL_KEYS, selectedExpDevice = 1) + WAVE/Z/T numericalKeys = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_NUMERICAL_KEYS, selectedExpDevice = 1) - WAVE/T/Z allKeys = LBV_GetAllLogbookParamNames(numericalkeys, textualKeys) + WAVE/Z/T allKeys = LBV_GetAllLogbookParamNames(numericalkeys, textualKeys) if(!WaveExists(allKeys)) printf "Could not find any labnotebook keys.\r" @@ -1112,7 +1123,7 @@ Function LBV_PlotAllAnalysisFunctionLBNKeys(string browser, variable anaFuncType prefix = CreateAnaFuncLBNKey(anaFuncType, "%s", query = 1) Make/FREE/T ignoredKeys = {prefix + " cycle x values"} - WAVE/T/Z anaFuncKeys = GrepTextWave(allKeys, prefix + "*") + WAVE/Z/T anaFuncKeys = GrepTextWave(allKeys, prefix + "*") if(!WaveExists(anaFuncKeys)) printf "Could not find any labnotebook keys for analysis function.\r" @@ -1120,7 +1131,7 @@ Function LBV_PlotAllAnalysisFunctionLBNKeys(string browser, variable anaFuncType return NaN endif - WAVE/T/Z keys = GetSetDifference(anaFuncKeys, ignoredKeys) + WAVE/Z/T keys = GetSetDifference(anaFuncKeys, ignoredKeys) STRUCT WMPopupAction pa pa.win = LBV_GetSettingsHistoryPanel(browser) @@ -1172,7 +1183,7 @@ static Function LBV_LimitXRangeToSelected(string browser) maxSweep = maxSweep + 1 if(LBV_CheckIfXAxisIsTime(graph)) - WAVE/T/Z numericalValues = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, selectedExpDevice = 1) + WAVE/Z/T numericalValues = BSP_GetLogbookWave(browser, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, selectedExpDevice = 1) ASSERT(WaveExists(numericalValues), "numericalValues can not be found") // get the timestamps of minSweep/maxSweep, moving inwards if they are empty @@ -1205,8 +1216,7 @@ static Function LBV_LimitXRangeToSelected(string browser) SetAxis/W=$graph bottom, first, last End -Function LBV_CheckProc_XRangeSelected(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function LBV_CheckProc_XRangeSelected(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up diff --git a/Packages/MIES/MIES_Logging.ipf b/Packages/MIES/MIES_Logging.ipf index 98660f0063..57c505b504 100644 --- a/Packages/MIES/MIES_Logging.ipf +++ b/Packages/MIES/MIES_Logging.ipf @@ -15,6 +15,7 @@ /// @brief Get the absolute path to the log file threadsafe Function/S LOG_GetFile(string package) + string folder folder = PS_GetSettingsFolder_TS(package) @@ -29,7 +30,7 @@ End /// - `exp`: Name of the Igor Pro experiment /// - `id`: Igor Pro instance identifier, see also GetIgorInstanceID() threadsafe static Function LOG_HasRequiredKeys(variable JSONid) - WAVE/T/Z keys = JSON_GetKeys(JSONid, "", ignoreErr = 1) + WAVE/Z/T keys = JSON_GetKeys(JSONid, "", ignoreErr = 1) if(!WaveExists(keys)) return 0 @@ -46,6 +47,7 @@ End /// /// Caller is responsible for the JSON text memory. threadsafe Function LOG_GenerateEntryTemplate(string source) + variable JSONid JSONid = JSON_New() @@ -125,7 +127,8 @@ End /// values. Either both `keys` and `values` are present or none. /// @param values [optional, defaults to $""] Additional key-value pairs to be written into the log file. Same size as /// keys. Either both `keys` and `values` are present or none. -threadsafe Function LOG_AddEntry(string package, string action, [variable stacktrace, WAVE/T/Z keys, WAVE/T/Z values]) +threadsafe Function LOG_AddEntry(string package, string action, [variable stacktrace, WAVE/Z/T keys, WAVE/Z/T values]) + variable JSONid, numAdditionalEntries string caller diff --git a/Packages/MIES/MIES_Menu.ipf b/Packages/MIES/MIES_Menu.ipf index 07a192eecd..ff363923f5 100644 --- a/Packages/MIES/MIES_Menu.ipf +++ b/Packages/MIES/MIES_Menu.ipf @@ -163,6 +163,7 @@ End /// /// Opens a prefilled new issue on github. Function MEN_CreateIssueOnGithub() + string url, body, title, version, str variable ref @@ -222,6 +223,7 @@ Function MEN_CreateIssueOnGithub() End Function MEN_ClearPackageSettings() + NVAR JSONid = $GetSettingsJSONid() JSON_Release(JSONId) @@ -231,6 +233,7 @@ Function MEN_ClearPackageSettings() End Function MEN_OpenPackageSettingsAsNotebook() + NVAR JSONid = $GetSettingsJSONid() PS_OpenNotebook(PACKAGE_MIES, JSONid) JSONid = NaN @@ -278,6 +281,7 @@ Function MEN_OpenITCXOP2LogFile() End Function MEN_DownloadStimsets() + string path path = DND_FetchAssetFromSet(DND_STIMSET_DANDI_SET) diff --git a/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf b/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf index d42e5852fb..aa0c6d8404 100644 --- a/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf @@ -25,12 +25,7 @@ /// together with `MIES_fWaveAverage`. /// /// @return wave reference to the average wave -Function/WAVE CalculateAverage(waveRefs, averageDataFolder, averageWaveName, [skipCRC, writeSourcePaths, inputAverage]) - WAVE/WAVE waveRefs - DFREF averageDataFolder - string averageWaveName - variable skipCRC, writeSourcePaths - WAVE inputAverage +Function/WAVE CalculateAverage(WAVE/WAVE waveRefs, DFREF averageDataFolder, string averageWaveName, [variable skipCRC, variable writeSourcePaths, WAVE inputAverage]) variable crc string key, wvName, dataUnit @@ -94,8 +89,7 @@ End /// \rst /// See :ref:`CalculateTPLikePropsFromSweep_doc` for the full documentation. /// \endrst -Function CalculateTPLikePropsFromSweep(numericalValues, textualValues, sweep, deltaI, deltaV, resistance) - WAVE numericalValues, textualValues, sweep, deltaI, deltaV, resistance +Function CalculateTPLikePropsFromSweep(WAVE numericalValues, WAVE textualValues, WAVE sweep, WAVE deltaI, WAVE deltaV, WAVE resistance) variable i variable DAcol, ADcol, level, low, high, baseline, elevated, firstEdge, secondEdge, sweepNo @@ -222,12 +216,7 @@ End /// @param lastColOut [optional, defaults to lastColInp] last col in *output* coordinates /// @param factor [optional, defaults to none] factor which is applied to /// all input columns and written into the output columns -Function DecimateWithMethod(input, output, decimationFactor, method, [firstRowInp, lastRowInp, firstColInp, lastColInp, firstColOut, lastColOut, factor]) - WAVE input - WAVE output - variable decimationFactor, method - variable firstRowInp, lastRowInp, firstColInp, lastColInp, firstColOut, lastColOut - WAVE/Z factor +Function DecimateWithMethod(WAVE input, WAVE output, variable decimationFactor, variable method, [variable firstRowInp, variable lastRowInp, variable firstColInp, variable lastColInp, variable firstColOut, variable lastColOut, WAVE/Z factor]) variable numRowsInp, numColsInp, numRowsOut, numColsOut, targetFirst, targetLast, numOutputPairs, usedColumns, usedRows variable numRowsDecimated, first, last @@ -415,24 +404,19 @@ End /// /// @returns A wave with the row indizes of the found values. An invalid wave reference if the /// value could not be found. -threadsafe Function/WAVE FindIndizes(numericOrTextWave, [col, colLabel, var, str, prop, startRow, endRow, startLayer, endLayer]) - WAVE numericOrTextWave - variable col, var, prop - string str, colLabel - variable startRow, endRow - variable startLayer, endLayer +threadsafe Function/WAVE FindIndizes(WAVE numericOrTextWave, [variable col, string colLabel, variable var, string str, variable prop, variable startRow, variable endRow, variable startLayer, variable endLayer]) variable numCols, numRows, numLayers, maskedProp string key - ASSERT_TS(ParamIsDefault(prop) + ParamIsDefault(var) + ParamIsDefault(str) == 2 \ - || (!ParamIsDefault(prop) \ - && ( \ - prop == PROP_NOT \ - || ((prop & PROP_MATCHES_VAR_BIT_MASK) && (ParamIsDefault(var) + ParamIsDefault(str)) == 1) \ - || (prop & PROP_GREP && !ParamIsDefault(str) && ParamIsDefault(var)) \ - || (prop & PROP_WILDCARD && !ParamIsDefault(str) && ParamIsDefault(var)) \ - )), \ + ASSERT_TS(ParamIsDefault(prop) + ParamIsDefault(var) + ParamIsDefault(str) == 2 \ + || (!ParamIsDefault(prop) \ + && ( \ + prop == PROP_NOT \ + || ((prop & PROP_MATCHES_VAR_BIT_MASK) && (ParamIsDefault(var) + ParamIsDefault(str)) == 1) \ + || (prop & PROP_GREP && !ParamIsDefault(str) && ParamIsDefault(var)) \ + || (prop & PROP_WILDCARD && !ParamIsDefault(str) && ParamIsDefault(var)) \ + )), \ "Invalid combination of var/str/prop arguments") ASSERT_TS(WaveExists(numericOrTextWave), "numericOrTextWave does not exist") @@ -462,7 +446,7 @@ threadsafe Function/WAVE FindIndizes(numericOrTextWave, [col, colLabel, var, str WAVE/T wvText = numericOrTextWave WAVE/Z wv = $"" else - WAVE/T/Z wvText = $"" + WAVE/Z/T wvText = $"" WAVE wv = numericOrTextWave endif diff --git a/Packages/MIES/MIES_MiesUtilities_BackupWaves.ipf b/Packages/MIES/MIES_MiesUtilities_BackupWaves.ipf index 2f09cb9c37..25211ec456 100644 --- a/Packages/MIES/MIES_MiesUtilities_BackupWaves.ipf +++ b/Packages/MIES/MIES_MiesUtilities_BackupWaves.ipf @@ -65,9 +65,7 @@ End /// appended. If the backup wave exists and the main type of the backup wave can be overridden by Duplicate/O /// then the wave reference of the backup wave is kept. Otherwise the main type is changed and the wave reference /// is not kept (e.g. backup wave is numerical, original wave is text) -threadsafe Function/WAVE CreateBackupWave(wv, [forceCreation]) - WAVE wv - variable forceCreation +threadsafe Function/WAVE CreateBackupWave(WAVE wv, [variable forceCreation]) string backupname @@ -97,8 +95,7 @@ threadsafe Function/WAVE CreateBackupWave(wv, [forceCreation]) End /// @brief Return a wave reference to the possibly not existing backup wave -Function/WAVE GetBackupWave(wv) - WAVE wv +Function/WAVE GetBackupWave(WAVE wv) string backupname diff --git a/Packages/MIES/MIES_MiesUtilities_Channels.ipf b/Packages/MIES/MIES_MiesUtilities_Channels.ipf index 88f0e0eedc..31b780cd77 100644 --- a/Packages/MIES/MIES_MiesUtilities_Channels.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Channels.ipf @@ -10,22 +10,19 @@ /// @brief This file holds MIES utility functions for Channels /// @brief Return a list of the AD channels from the DAQ config -threadsafe Function/WAVE GetADCListFromConfig(config) - WAVE config +threadsafe Function/WAVE GetADCListFromConfig(WAVE config) return GetChanneListFromDAQConfigWave(config, XOP_CHANNEL_TYPE_ADC) End /// @brief Return a list of the DA channels from the DAQ config -threadsafe Function/WAVE GetDACListFromConfig(config) - WAVE config +threadsafe Function/WAVE GetDACListFromConfig(WAVE config) return GetChanneListFromDAQConfigWave(config, XOP_CHANNEL_TYPE_DAC) End /// @brief Return a list of the TTL channels from the DAQ config -threadsafe Function/WAVE GetTTLListFromConfig(config) - WAVE config +threadsafe Function/WAVE GetTTLListFromConfig(WAVE config) return GetChanneListFromDAQConfigWave(config, XOP_CHANNEL_TYPE_TTL) End @@ -66,9 +63,7 @@ End /// @param type to count, one of @ref DaqChannelTypeConstants /// /// @return number of types present in chanTypes -Function GetNrOfTypedChannels(chanTypes, type) - WAVE chanTypes - variable type +Function GetNrOfTypedChannels(WAVE chanTypes, variable type) variable i, numChannels, count @@ -84,22 +79,19 @@ Function GetNrOfTypedChannels(chanTypes, type) End /// @brief Return a types of the AD channels from the ITC config -Function/WAVE GetTTLTypesFromConfig(config) - WAVE config +Function/WAVE GetTTLTypesFromConfig(WAVE config) return GetTypeListFromITCConfig(config, XOP_CHANNEL_TYPE_TTL) End /// @brief Return a types of the AD channels from the ITC config -Function/WAVE GetADCTypesFromConfig(config) - WAVE config +Function/WAVE GetADCTypesFromConfig(WAVE config) return GetTypeListFromITCConfig(config, XOP_CHANNEL_TYPE_ADC) End /// @brief Return a types of the DA channels from the ITC config -Function/WAVE GetDACTypesFromConfig(config) - WAVE config +Function/WAVE GetDACTypesFromConfig(WAVE config) return GetTypeListFromITCConfig(config, XOP_CHANNEL_TYPE_DAC) End @@ -138,8 +130,7 @@ End /// @param device device /// /// @return 1 if TP type present, 0 otherwise -Function GotTPChannelsOnADCs(device) - string device +Function GotTPChannelsOnADCs(string device) WAVE config = GetDAQConfigWave(device) WAVE ADCmode = GetADCTypesFromConfig(config) @@ -151,9 +142,7 @@ End /// @param numericalValues Numerical labnotebook values /// @param sweep Sweep number /// @param channel TTL hardware channel -threadsafe Function GetTTLBits(numericalValues, sweep, channel) - WAVE numericalValues - variable sweep, channel +threadsafe Function GetTTLBits(WAVE numericalValues, variable sweep, variable channel) variable index = GetIndexForHeadstageIndepData(numericalValues) @@ -200,7 +189,7 @@ threadsafe static Function/WAVE GetActiveChannelsTTL(WAVE numericalValues, WAVE if(hwDACType == HARDWARE_NI_DAC || hwDACType == HARDWARE_SUTTER_DAC) // present since 2f56481a (DC_MakeNITTLWave: Document TTL settings and rework it completely, 2018-09-06) - WAVE/T/Z ttlChannels = GetLastSetting(textualValues, sweep, "TTL channels", DATA_ACQUISITION_MODE) + WAVE/Z/T ttlChannels = GetLastSetting(textualValues, sweep, "TTL channels", DATA_ACQUISITION_MODE) if(!WaveExists(ttlChannels)) return $"" endif diff --git a/Packages/MIES/MIES_MiesUtilities_Checks.ipf b/Packages/MIES/MIES_MiesUtilities_Checks.ipf index 910b037c46..c6042024ff 100644 --- a/Packages/MIES/MIES_MiesUtilities_Checks.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Checks.ipf @@ -10,8 +10,7 @@ /// @brief This file holds MIES utility functions for checks /// @brief Check if the given epoch number is valid -Function IsValidEpochNumber(epochNo) - variable epochNo +Function IsValidEpochNumber(variable epochNo) return IsInteger(epochNo) && epochNo >= 0 && epochNo < WB_TOTAL_NUMBER_OF_EPOCHS End @@ -21,9 +20,7 @@ End /// @param sweep sweep wave /// @param config config wave /// @param configVersion [optional, defaults to #DAQ_CONFIG_WAVE_VERSION] minimum required version of the config wave -threadsafe Function IsValidSweepAndConfig(sweep, config, [configVersion]) - WAVE/Z sweep, config - variable configVersion +threadsafe Function IsValidSweepAndConfig(WAVE/Z sweep, WAVE/Z config, [variable configVersion]) if(ParamIsDefault(configVersion)) configVersion = DAQ_CONFIG_WAVE_VERSION @@ -51,8 +48,7 @@ End /// @brief Check if the given multiplier is a valid sampling interval multiplier /// /// UTF_NOINSTRUMENTATION -Function IsValidSamplingMultiplier(multiplier) - variable multiplier +Function IsValidSamplingMultiplier(variable multiplier) return IsFinite(multiplier) && WhichListItem(num2str(multiplier), DAP_GetSamplingMultiplier()) != -1 End diff --git a/Packages/MIES/MIES_MiesUtilities_Config.ipf b/Packages/MIES/MIES_MiesUtilities_Config.ipf index cfabba2a96..6ba3f1ef33 100644 --- a/Packages/MIES/MIES_MiesUtilities_Config.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Config.ipf @@ -17,8 +17,8 @@ threadsafe Function GetSamplingInterval(WAVE config, variable channelType) ASSERT_TS(IsValidConfigWave(config, version = 0), "Expected a valid config wave") [colChannelType, colChannelNumber] = GetConfigWaveDims(config) - colSamplingInterval = FindDimLabel(config, COLS, "SamplingInterval") - colSamplingInterval = colSamplingInterval == -2 ? 2 : colSamplingInterval + colSamplingInterval = FindDimLabel(config, COLS, "SamplingInterval") + colSamplingInterval = colSamplingInterval == -2 ? 2 : colSamplingInterval numChannels = DimSize(config, ROWS) for(i = 0; i < numChannels; i += 1) @@ -31,8 +31,7 @@ threadsafe Function GetSamplingInterval(WAVE config, variable channelType) End /// @brief Returns the data offset of the sweep in points -threadsafe Function GetDataOffset(config) - WAVE config +threadsafe Function GetDataOffset(WAVE config) ASSERT_TS(IsValidConfigWave(config, version = 1), "Expected a valid config wave") @@ -48,17 +47,14 @@ End /// @note Please add new properties as required /// @param config configuration wave /// @param samplingInterval sampling interval in microseconds (1e-6s) -Function UpdateSweepConfig(config, [samplingInterval]) - WAVE config - variable samplingInterval +Function UpdateSweepConfig(WAVE config, [variable samplingInterval]) ASSERT(IsFinite(samplingInterval), "samplingInterval must be finite") config[][2] = samplingInterval End /// @brief Return the default name of a electrode -threadsafe Function/S GetDefaultElectrodeName(headstage) - variable headstage +threadsafe Function/S GetDefaultElectrodeName(variable headstage) ASSERT_TS(IsValidHeadstage(headstage), "Invalid headstage") @@ -94,9 +90,7 @@ End /// /// @param version [optional, default=DAQ_CONFIG_WAVE_VERSION], check against a specific version /// current versions known are 0 (equals NaN), 1, 2, 3 -threadsafe Function IsValidConfigWave(config, [version]) - WAVE/Z config - variable version +threadsafe Function IsValidConfigWave(WAVE/Z config, [variable version]) variable waveVersion diff --git a/Packages/MIES/MIES_MiesUtilities_Conversion.ipf b/Packages/MIES/MIES_MiesUtilities_Conversion.ipf index 4640ef4839..92e3c2e513 100644 --- a/Packages/MIES/MIES_MiesUtilities_Conversion.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Conversion.ipf @@ -64,10 +64,7 @@ End /// @param var numeric channel types /// @param str string channel types /// @param xopVar numeric XOP channel types -threadsafe Function GetNumberFromType([var, str, xopVar]) - variable var - string str - variable xopVar +threadsafe Function GetNumberFromType([variable var, string str, variable xopVar]) ASSERT_TS(ParamIsDefault(var) + ParamIsDefault(str) + ParamIsDefault(xopVar) == 2, "Expected exactly one parameter") @@ -135,8 +132,7 @@ End /// @param type One of @ref ParameterWaveTypes /// /// @return name as string -Function/S GetWaveBuilderParameterTypeName(type) - variable type +Function/S GetWaveBuilderParameterTypeName(variable type) string shortname @@ -158,8 +154,7 @@ Function/S GetWaveBuilderParameterTypeName(type) End /// @brief Stringified short version of the clamp mode -Function/S ConvertAmplifierModeShortStr(mode) - variable mode +Function/S ConvertAmplifierModeShortStr(variable mode) switch(mode) case V_CLAMP_MODE: @@ -178,8 +173,7 @@ Function/S ConvertAmplifierModeShortStr(mode) End /// @brief Stringified version of the clamp mode -Function/S ConvertAmplifierModeToString(mode) - variable mode +Function/S ConvertAmplifierModeToString(variable mode) switch(mode) case V_CLAMP_MODE: @@ -234,8 +228,7 @@ End /// /// @return One of @ref SpecialAnalysisFunctionTypes which includes /// #INVALID_ANALYSIS_FUNCTION and for CI testing #TEST_ANALYSIS_FUNCTION -Function MapAnaFuncToConstant(anaFunc) - string anaFunc +Function MapAnaFuncToConstant(string anaFunc) strswitch(anaFunc) case "PSQ_Ramp": diff --git a/Packages/MIES/MIES_MiesUtilities_DataManagement.ipf b/Packages/MIES/MIES_MiesUtilities_DataManagement.ipf index 401afceacb..fee97b6e61 100644 --- a/Packages/MIES/MIES_MiesUtilities_DataManagement.ipf +++ b/Packages/MIES/MIES_MiesUtilities_DataManagement.ipf @@ -10,9 +10,7 @@ /// @brief This file holds MIES utility functions for data handling. /// @brief Convenience wrapper for KillOrMoveToTrashPath() -threadsafe Function KillOrMoveToTrash([wv, dfr]) - WAVE/Z wv - DFREF dfr +threadsafe Function KillOrMoveToTrash([WAVE/Z wv, DFREF dfr]) if(!ParamIsDefault(wv) && WaveExists(wv)) if(IsFreeWave(wv)) @@ -38,8 +36,7 @@ End /// The trash folders will be removed, if possible, from KillTemporaries(). /// /// @param path absolute path to a datafolder or wave -threadsafe Function KillOrMoveToTrashPath(path) - string path +threadsafe Function KillOrMoveToTrashPath(string path) string dest @@ -65,9 +62,7 @@ threadsafe Function KillOrMoveToTrashPath(path) endif End -threadsafe Function MoveToTrash([wv, dfr]) - WAVE/Z wv - DFREF dfr +threadsafe Function MoveToTrash([WAVE/Z wv, DFREF dfr]) string dest variable err diff --git a/Packages/MIES/MIES_MiesUtilities_Device.ipf b/Packages/MIES/MIES_MiesUtilities_Device.ipf index d25d7bdaac..4a337697c8 100644 --- a/Packages/MIES/MIES_MiesUtilities_Device.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Device.ipf @@ -92,8 +92,7 @@ End /// /// @param contentType [optional, defaults to CONTENT_TYPE_SWEEP] type of /// content to look for, one of @ref CONTENT_TYPES -Function/S GetAllDevicesWithContent([contentType]) - variable contentType +Function/S GetAllDevicesWithContent([variable contentType]) variable i, numDevices string deviceList, device, dataPath, testPulsePath @@ -140,8 +139,7 @@ End /// @return One of @ref HardwareDACTypeConstants /// /// UTF_NOINSTRUMENTATION -threadsafe Function GetHardwareType(device) - string device +threadsafe Function GetHardwareType(string device) string deviceType, deviceNumber ASSERT_TS(ParseDeviceString(device, deviceType, deviceNumber), "Error parsing device string!") @@ -182,9 +180,7 @@ End /// @returns one on successfull parsing, zero on error /// /// UTF_NOINSTRUMENTATION -threadsafe Function ParseDeviceString(device, deviceType, deviceNumber) - string device - string &deviceType, &deviceNumber +threadsafe Function ParseDeviceString(string device, string &deviceType, string &deviceNumber) if(isEmpty(device)) return 0 @@ -224,12 +220,12 @@ End /// @brief Return the list of locked ITC1600 devices Function/S GetListOfLockedITC1600Devices() + return ListMatch(GetListOfLockedDevices(), "ITC1600*") End /// @brief Check that the device is of type ITC1600 -Function IsITC1600(device) - string device +Function IsITC1600(string device) string deviceType, deviceNumber variable ret @@ -242,8 +238,7 @@ End /// @brief Check wether the given background task is running and that the /// device is active in multi device mode. -Function IsDeviceActiveWithBGTask(device, task) - string device, task +Function IsDeviceActiveWithBGTask(string device, string task) if(!IsBackgroundTaskRunning(task)) return 0 @@ -283,8 +278,7 @@ Function IsDeviceActiveWithBGTask(device, task) End /// @brief Return the next random number using the device specific RNG seed -Function GetNextRandomNumberForDevice(device) - string device +Function GetNextRandomNumberForDevice(string device) NVAR rngSeed = $GetRNGSeed(device) ASSERT(IsFinite(rngSeed), "Invalid rngSeed") diff --git a/Packages/MIES/MIES_MiesUtilities_GUI.ipf b/Packages/MIES/MIES_MiesUtilities_GUI.ipf index f16cdc9f98..a0b4fad69d 100644 --- a/Packages/MIES/MIES_MiesUtilities_GUI.ipf +++ b/Packages/MIES/MIES_MiesUtilities_GUI.ipf @@ -12,8 +12,7 @@ /// @brief This file holds MIES utility functions for GUI /// @brief Return the dimension label for the special, aka non-unique, controls -Function/S GetSpecialControlLabel(channelType, controlType) - variable channelType, controlType +Function/S GetSpecialControlLabel(variable channelType, variable controlType) return RemoveEnding(GetPanelControl(0, channelType, controlType), "_00") End @@ -21,8 +20,7 @@ End /// @brief Returns the name of a control from the DA_EPHYS panel /// /// Constants are defined at @ref ChannelTypeAndControlConstants -Function/S GetPanelControl(channelIndex, channelType, controlType) - variable channelIndex, channelType, controlType +Function/S GetPanelControl(variable channelIndex, variable channelType, variable controlType) string ctrl @@ -91,6 +89,7 @@ End /// @brief Return a trace name prefix suitable for GetNextTraceIndex() Function/S GetTraceNamePrefix(variable traceIndex) + string name sprintf name, "T%0*d", TRACE_NAME_NUM_DIGITS, traceIndex @@ -139,9 +138,7 @@ End /// /// @param graph graph with sweep traces /// @param pps settings -Function TimeAlignMainWindow(graph, pps) - string graph - STRUCT PostPlotSettings &pps +Function TimeAlignMainWindow(string graph, STRUCT PostPlotSettings &pps) variable csrAx, csrBx @@ -152,10 +149,9 @@ Function TimeAlignMainWindow(graph, pps) End /// @brief return a list of all traces relevant for TimeAlignment -Function/S TimeAlignGetAllTraces(graph) - string graph +Function/S TimeAlignGetAllTraces(string graph) - WAVE/T/Z traces = GetAllSweepTraces(graph) + WAVE/Z/T traces = GetAllSweepTraces(graph) if(!WaveExists(traces)) return "" @@ -168,8 +164,7 @@ End /// panel settings /// /// @param win main DB/SB graph or any subwindow panel. -Function TimeAlignHandleCursorDisplay(win) - string win +Function TimeAlignHandleCursorDisplay(string win) string graphtrace, graph, graphs, trace, traceList, bsPanel, csrA, csrB variable length, posA, posB @@ -223,8 +218,8 @@ Function TimeAlignHandleCursorDisplay(win) End /// @brief Enable/Disable TimeAlignment Controls and Cursors -Function TimeAlignUpdateControls(win) - string win +Function TimeAlignUpdateControls(string win) + variable alignMode string bsPanel, graph @@ -250,8 +245,7 @@ Function TimeAlignUpdateControls(win) TimeAlignHandleCursorDisplay(graph) End -Function TimeAlignCursorMovedHook(s) - STRUCT WMWinHookStruct &s +Function TimeAlignCursorMovedHook(STRUCT WMWinHookStruct &s) string trace, graphtrace, graphtraces, xAxis, yAxis, bsPanel, mainPanel variable numTraces, i @@ -307,6 +301,7 @@ End /// /// @returns graph#trace named patterns Function/WAVE GetAllSweepTraces(string graphs, [variable region, variable channelType, variable prefixTraces]) + string graph variable i, idx, numGraphs @@ -413,9 +408,7 @@ End /// @param pos1x specify start range for feature position /// @param pos2x specify end range for feature position /// @param force [optional, defaults to false] redo time aligment regardless of wave note -Function TimeAlignmentIfReq(graphtrace, mode, level, pos1x, pos2x, [force]) - string graphtrace - variable mode, level, pos1x, pos2x, force +Function TimeAlignmentIfReq(string graphtrace, variable mode, variable level, variable pos1x, variable pos2x, [variable force]) if(ParamIsDefault(force)) force = 0 @@ -519,10 +512,7 @@ End /// cross the given level in the visible range /// @param level [optional, defaults to zero] level to be used for `ignoreAxesWithLevelCrossing=1` /// @param rangePerClampMode [optional, defaults to false] use separate Y ranges per clamp mode -Function EqualizeVerticalAxesRanges(graph, [ignoreAxesWithLevelCrossing, level, rangePerClampMode]) - string graph - variable ignoreAxesWithLevelCrossing - variable level, rangePerClampMode +Function EqualizeVerticalAxesRanges(string graph, [variable ignoreAxesWithLevelCrossing, variable level, variable rangePerClampMode]) string axList, axis, trace variable i, j, numAxes, axisOrient, xRangeBegin, xRangeEnd @@ -557,7 +547,7 @@ Function EqualizeVerticalAxesRanges(graph, [ignoreAxesWithLevelCrossing, level, xRangeEnd = NaN endif - WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "traceName") + WAVE/Z/T traces = TUD_GetUserDataAsWave(graph, "traceName") if(!WaveExists(traces)) return NaN @@ -671,8 +661,7 @@ Function EqualizeVerticalAxesRanges(graph, [ignoreAxesWithLevelCrossing, level, endfor End -Function UpdateSweepPlot(win) - string win +Function UpdateSweepPlot(string win) if(BSP_IsDataBrowser(win)) DB_UpdateSweepPlot(win) @@ -682,8 +671,7 @@ Function UpdateSweepPlot(win) End /// @brief update of panel elements and related displayed graphs in BSP -Function UpdateSettingsPanel(win) - string win +Function UpdateSettingsPanel(string win) string bsPanel @@ -693,8 +681,7 @@ Function UpdateSettingsPanel(win) BSP_ScaleAxes(bsPanel) End -Function/WAVE GetPlainSweepList(win) - string win +Function/WAVE GetPlainSweepList(string win) if(BSP_IsDataBrowser(win)) return DB_GetPlainSweepList(win) @@ -751,6 +738,7 @@ End /// @param win graph /// @param index overlay sweeps listbox index Function RemoveSweepFromGraph(string win, variable index) + string device, graph, dataFolder, experiment string trace variable sweepNo, i, numTraces @@ -769,7 +757,7 @@ Function RemoveSweepFromGraph(string win, variable index) [sweepNo, experiment] = OVS_GetSweepAndExperiment(graph, index) - WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "tracename", keys = {"traceType", "sweepNumber", "experiment"}, \ + WAVE/Z/T traces = TUD_GetUserDataAsWave(graph, "tracename", keys = {"traceType", "sweepNumber", "experiment"}, \ values = {"sweep", num2str(sweepNo), experiment}) if(!WaveExists(traces)) @@ -828,7 +816,7 @@ Function UpdateSweepInGraph(string win, variable index) graph = GetMainWindow(win) WAVE axesProps = GetAxesProperties(graph) - WAVE/T/Z cursorInfos = GetCursorInfos(graph) + WAVE/Z/T cursorInfos = GetCursorInfos(graph) RemoveSweepFromGraph(win, index) AddSweepToGraph(win, index) @@ -839,8 +827,7 @@ End /// @brief Generic window hooks for storing the window /// coordinates in the JSON settings file. -Function StoreWindowCoordinatesHook(s) - STRUCT WMWinHookStruct &s +Function StoreWindowCoordinatesHook(STRUCT WMWinHookStruct &s) string win diff --git a/Packages/MIES/MIES_MiesUtilities_Getter.ipf b/Packages/MIES/MIES_MiesUtilities_Getter.ipf index 8b2eadb245..fa198a5db8 100644 --- a/Packages/MIES/MIES_MiesUtilities_Getter.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Getter.ipf @@ -10,10 +10,9 @@ /// @brief This file holds MIES utility functions that get names/objects /// @brief Returns the config wave for a given sweep wave -Function/WAVE GetConfigWave(sweepWave) - WAVE sweepWave +Function/WAVE GetConfigWave(WAVE sweepWave) - WAVE/SDFR=GetWavesDataFolderDFR(sweepWave)/Z config = $GetConfigWaveName(ExtractSweepNumber(NameOfWave(sweepWave))) + WAVE/Z/SDFR=GetWavesDataFolderDFR(sweepWave) config = $GetConfigWaveName(ExtractSweepNumber(NameOfWave(sweepWave))) return config End @@ -40,9 +39,7 @@ End /// To convert a text sweep wave to a waveRef sweep wave use @ref TextSweepToWaveRef /// The programmer has to consider if pure references to channels are good enough (TextSweepToWaveRef) or if the channels /// should be duplicated. -Function/WAVE GetSweepWave(device, sweepNo) - string device - variable sweepNo +Function/WAVE GetSweepWave(string device, variable sweepNo) WAVE/Z/SDFR=GetDeviceDataPath(device) wv = $GetSweepWaveName(sweepNo) @@ -50,15 +47,13 @@ Function/WAVE GetSweepWave(device, sweepNo) End /// @brief Return the config wave name -Function/S GetConfigWaveName(sweepNo) - variable sweepNo +Function/S GetConfigWaveName(variable sweepNo) return "Config_" + GetSweepWaveName(sweepNo) End /// @brief Return the sweep wave name -Function/S GetSweepWaveName(sweepNo) - variable sweepNo +Function/S GetSweepWaveName(variable sweepNo) return "Sweep_" + num2str(sweepNo) End @@ -66,8 +61,7 @@ End /// @brief constructs a fifo name for NI device ADC operations from the deviceID /// /// UTF_NOINSTRUMENTATION -Function/S GetNIFIFOName(deviceID) - variable deviceID +Function/S GetNIFIFOName(variable deviceID) return HARDWARE_NI_ADC_FIFO + num2str(deviceID) End @@ -127,5 +121,6 @@ Function [WAVE sweepWave, WAVE config] GetSweepAndConfigWaveFromDevice(string de End Function/S GetWorkLoadName(string workload, string device) + return workload + "_" + device End diff --git a/Packages/MIES/MIES_MiesUtilities_Logbook.ipf b/Packages/MIES/MIES_MiesUtilities_Logbook.ipf index f93dfa056a..cb2f0533a4 100644 --- a/Packages/MIES/MIES_MiesUtilities_Logbook.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Logbook.ipf @@ -32,6 +32,7 @@ static StrConstant MSQ_SC_LBN_PREFIX = "Spike Control" /// @brief Return the logbook type, one of @ref LogbookTypes Function GetLogbookType(WAVE wv) + string name name = NameOfWave(wv) @@ -274,11 +275,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function GetLastSettingIndep(numericalValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE numericalValues - variable sweepNo - string setting - variable defValue, entrySourceType +threadsafe Function GetLastSettingIndep(WAVE numericalValues, variable sweepNo, string setting, variable entrySourceType, [variable defValue]) if(ParamIsDefault(defValue)) defValue = NaN @@ -300,11 +297,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/S GetLastSettingTextIndep(textualValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE/T textualValues - variable sweepNo - string setting, defValue - variable entrySourceType +threadsafe Function/S GetLastSettingTextIndep(WAVE/T textualValues, variable sweepNo, string setting, variable entrySourceType, [string defValue]) ASSERT_TS(IsTextWave(textualValues), "Can only work with text waves") @@ -312,7 +305,7 @@ threadsafe Function/S GetLastSettingTextIndep(textualValues, sweepNo, setting, e defValue = "" endif - WAVE/T/Z settings = GetLastSetting(textualValues, sweepNo, setting, entrySourceType) + WAVE/Z/T settings = GetLastSetting(textualValues, sweepNo, setting, entrySourceType) if(WaveExists(settings)) EnforceIndependentSetting(settings) @@ -329,11 +322,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function GetLastSettingIndepRAC(numericalValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE numericalValues - variable sweepNo - string setting - variable defValue, entrySourceType +threadsafe Function GetLastSettingIndepRAC(WAVE numericalValues, variable sweepNo, string setting, variable entrySourceType, [variable defValue]) if(ParamIsDefault(defValue)) defValue = NaN @@ -356,11 +345,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function GetLastSettingIndepSCI(numericalValues, sweepNo, setting, headstage, entrySourceType, [defValue]) - WAVE numericalValues - variable sweepNo - string setting - variable defValue, headstage, entrySourceType +threadsafe Function GetLastSettingIndepSCI(WAVE numericalValues, variable sweepNo, string setting, variable headstage, variable entrySourceType, [variable defValue]) if(ParamIsDefault(defValue)) defValue = NaN @@ -383,19 +368,13 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/S GetLastSettingTextIndepSCI(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType, [defValue]) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable headstage, entrySourceType - string defValue +threadsafe Function/S GetLastSettingTextIndepSCI(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable headstage, variable entrySourceType, [string defValue]) if(ParamIsDefault(defValue)) defValue = "" endif - WAVE/T/Z settings = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType) + WAVE/Z/T settings = GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType) if(WaveExists(settings)) EnforceIndependentSetting(settings) @@ -411,18 +390,13 @@ End /// @return the headstage independent setting or `defValue` /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/S GetLastSettingTextIndepRAC(numericalValues, textualValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting, defValue - variable entrySourceType +threadsafe Function/S GetLastSettingTextIndepRAC(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable entrySourceType, [string defValue]) if(ParamIsDefault(defValue)) defValue = "" endif - WAVE/T/Z settings = GetLastSettingTextRAC(numericalValues, textualValues, sweepNo, setting, entrySourceType) + WAVE/Z/T settings = GetLastSettingTextRAC(numericalValues, textualValues, sweepNo, setting, entrySourceType) if(WaveExists(settings)) EnforceIndependentSetting(settings) @@ -440,7 +414,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSettingChannelInternal() -threadsafe Function [WAVE/Z settings, variable index] GetLastSettingChannel(WAVE numericalValues, WAVE/T/Z textualValues, variable sweepNo, string setting, variable channelNumber, variable channelType, variable entrySourceType) +threadsafe Function [WAVE/Z settings, variable index] GetLastSettingChannel(WAVE numericalValues, WAVE/Z/T textualValues, variable sweepNo, string setting, variable channelNumber, variable channelType, variable entrySourceType) [settings, index] = GetLastSettingChannelInternal(numericalValues, numericalValues, sweepNo, setting, channelNumber, channelType, entrySourceType) @@ -603,11 +577,7 @@ End /// the setting could not be found an invalid wave reference is returned. /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/WAVE GetLastSetting(values, sweepNo, setting, entrySourceType) - WAVE values - variable sweepNo - string setting - variable entrySourceType +threadsafe Function/WAVE GetLastSetting(WAVE values, variable sweepNo, string setting, variable entrySourceType) variable first, last, rowIndex, entrySourceTypeIndex, settingCol @@ -896,12 +866,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextRAC(numericalValues, textualValues, sweepNo, setting, entrySourceType) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable entrySourceType +threadsafe Function/WAVE GetLastSettingTextRAC(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable entrySourceType) variable i, numSweeps @@ -926,11 +891,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingRAC(numericalValues, sweepNo, setting, entrySourceType) - WAVE numericalValues - variable sweepNo - string setting - variable entrySourceType +threadsafe Function/WAVE GetLastSettingRAC(WAVE numericalValues, variable sweepNo, string setting, variable entrySourceType) variable i, numSweeps @@ -959,11 +920,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingIndepEachRAC(numericalValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE numericalValues - variable sweepNo - string setting - variable entrySourceType, defValue +threadsafe Function/WAVE GetLastSettingIndepEachRAC(WAVE numericalValues, variable sweepNo, string setting, variable entrySourceType, [variable defValue]) variable settings, numSweeps @@ -995,13 +952,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextIndepEachRAC(numericalValues, textualValues, sweepNo, setting, entrySourceType, [defValue]) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable entrySourceType - string defValue +threadsafe Function/WAVE GetLastSettingTextIndepEachRAC(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable entrySourceType, [string defValue]) variable settings, numSweeps @@ -1033,11 +984,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting -threadsafe Function/WAVE GetLastSettingEachRAC(numericalValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingEachRAC(WAVE numericalValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1074,12 +1021,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingTextEachRAC(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1113,12 +1055,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextSCI(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingTextSCI(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1143,11 +1080,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingSCI(numericalValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingSCI(WAVE numericalValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1176,11 +1109,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingIndepEachSCI(numericalValues, sweepNo, setting, headstage, entrySourceType, [defValue]) - WAVE numericalValues - variable sweepNo - string setting - variable headstage, entrySourceType, defValue +threadsafe Function/WAVE GetLastSettingIndepEachSCI(WAVE numericalValues, variable sweepNo, string setting, variable headstage, variable entrySourceType, [variable defValue]) variable settings, numSweeps @@ -1212,13 +1141,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextIndepEachSCI(numericalValues, textualValues, sweepNo, headstage, setting, entrySourceType, [defValue]) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable headstage, entrySourceType - string defValue +threadsafe Function/WAVE GetLastSettingTextIndepEachSCI(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, variable headstage, string setting, variable entrySourceType, [string defValue]) variable settings, numSweeps @@ -1250,11 +1173,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting -threadsafe Function/WAVE GetLastSettingEachSCI(numericalValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingEachSCI(WAVE numericalValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1291,12 +1210,7 @@ End /// /// @ingroup LabnotebookQueryFunctions /// @sa GetLastSetting() -threadsafe Function/WAVE GetLastSettingTextEachSCI(numericalValues, textualValues, sweepNo, setting, headstage, entrySourceType) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - string setting - variable headstage, entrySourceType +threadsafe Function/WAVE GetLastSettingTextEachSCI(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, string setting, variable headstage, variable entrySourceType) variable i, numSweeps @@ -1480,8 +1394,7 @@ End /// @brief Returns the numerical index for the sweep number column /// in the settings history waves (numeric and text) -threadsafe Function GetSweepColumn(labnotebookValues) - WAVE labnotebookValues +threadsafe Function GetSweepColumn(WAVE labnotebookValues) variable sweepCol @@ -1517,9 +1430,7 @@ End /// the setting could not be found an invalid wave reference is returned. /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/WAVE GetSweepsWithSetting(labnotebookValues, setting) - WAVE labnotebookValues - string setting +threadsafe Function/WAVE GetSweepsWithSetting(WAVE labnotebookValues, string setting) variable sweepCol, settingsCol @@ -1601,10 +1512,7 @@ End /// the setting could not be found an invalid wave reference is returned. /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/WAVE GetLastSweepWithSetting(numericalValues, setting, sweepNo) - WAVE numericalValues - string setting - variable &sweepNo +threadsafe Function/WAVE GetLastSweepWithSetting(WAVE numericalValues, string setting, variable &sweepNo) variable idx, settingsCol @@ -1633,11 +1541,7 @@ End /// to return in case nothing could be found /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function GetLastSweepWithSettingIndep(numericalValues, setting, sweepNo, [defValue]) - WAVE numericalValues - string setting - variable &sweepNo - variable defValue +threadsafe Function GetLastSweepWithSettingIndep(WAVE numericalValues, string setting, variable &sweepNo, [variable defValue]) if(ParamIsDefault(defValue)) defValue = NaN @@ -1664,10 +1568,7 @@ End /// the setting could not be found an invalid wave reference is returned. /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/WAVE GetLastSweepWithSettingText(textualValues, setting, sweepNo) - WAVE/T textualValues - string setting - variable &sweepNo +threadsafe Function/WAVE GetLastSweepWithSettingText(WAVE/T textualValues, string setting, variable &sweepNo) variable idx, settingsCol @@ -1696,17 +1597,13 @@ End /// to return in case nothing could be found /// /// @ingroup LabnotebookQueryFunctions -threadsafe Function/S GetLastSweepWithSettingTextI(numericalValues, setting, sweepNo, [defValue]) - WAVE numericalValues - string setting - variable &sweepNo - string defValue +threadsafe Function/S GetLastSweepWithSettingTextI(WAVE numericalValues, string setting, variable &sweepNo, [string defValue]) if(ParamIsDefault(defValue)) defValue = "" endif - WAVE/T/Z settings = GetLastSweepWithSettingText(numericalValues, setting, sweepNo) + WAVE/Z/T settings = GetLastSweepWithSettingText(numericalValues, setting, sweepNo) if(WaveExists(settings)) EnforceIndependentSetting(settings) @@ -1721,8 +1618,7 @@ End /// Before dfe2d862 (Make the function AB_SplitTTLWaveIntoComponents available for all, 2015-10-07) /// we stored headstage independent data in either all entries or only the first one. /// Since that commit we store the data in `INDEP_HEADSTAGE`. -threadsafe Function GetIndexForHeadstageIndepData(values) - WAVE values +threadsafe Function GetIndexForHeadstageIndepData(WAVE values) return DimSize(values, LAYERS) == NUM_HEADSTAGES ? 0 : INDEP_HEADSTAGE End @@ -1736,9 +1632,7 @@ End /// /// New style have the format "$Name u_(AD|DA)$ChannelNumber", these include /// the channel type to make them more self explaining. -threadsafe Function/S CreateLBNUnassocKey(setting, channelNumber, channelType) - string setting - variable channelNumber, channelType +threadsafe Function/S CreateLBNUnassocKey(string setting, variable channelNumber, variable channelType) ASSERT_TS(!IsEmpty(setting), "Expected non empty string") ASSERT_TS(IsFinite(channelNumber), "Expected finite channel number") @@ -1778,6 +1672,7 @@ End /// /// @sa CreateLBNUnassocKey() Function/S RemoveUnassocLBNKeySuffix(string name) + string result, suffix SplitString/E=(LBN_UNASSOC_REGEXP) name, result, suffix @@ -1797,9 +1692,7 @@ End /// a valid wave index. /// /// UTF_NOINSTRUMENTATION -threadsafe Function EntrySourceTypeMapper(entrySourceType) - - variable entrySourceType +threadsafe Function EntrySourceTypeMapper(variable entrySourceType) return IsFinite(entrySourceType) ? ++entrySourceType : 0 End @@ -1808,6 +1701,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function ReverseEntrySourceTypeMapper(variable mapped) + return (mapped == 0 ? NaN : --mapped) End @@ -1818,9 +1712,7 @@ End /// @param chunk [optional] Some format strings expect a chunk number /// @param query [optional, defaults to false] If the key is to be used for setting or querying the labnotebook /// @param waMode [optional, defaults to PSQ_LBN_WA_NONE] One of @ref LBNWorkAroundFlags -Function/S CreateAnaFuncLBNKey(type, formatString, [chunk, query, waMode]) - variable type, chunk, query, waMode - string formatString +Function/S CreateAnaFuncLBNKey(variable type, string formatString, [variable chunk, variable query, variable waMode]) if(ParamIsDefault(waMode)) waMode = PSQ_LBN_WA_NONE @@ -1948,13 +1840,14 @@ End /// @param name One of @ref LabnotebookTTLNames /// @param sweep Sweep number threadsafe Function/WAVE GetTTLLabnotebookEntry(WAVE/T textualValues, string name, variable sweep) + variable index index = GetIndexForHeadstageIndepData(textualValues) - WAVE/T/Z ttlEntry = GetLastSetting(textualValues, sweep, "TTL " + name, DATA_ACQUISITION_MODE) - WAVE/T/Z ttlEntryRackZero = GetLastSetting(textualValues, sweep, "TTL rack zero " + name, DATA_ACQUISITION_MODE) - WAVE/T/Z ttlEntryRackOne = GetLastSetting(textualValues, sweep, "TTL rack one " + name, DATA_ACQUISITION_MODE) + WAVE/Z/T ttlEntry = GetLastSetting(textualValues, sweep, "TTL " + name, DATA_ACQUISITION_MODE) + WAVE/Z/T ttlEntryRackZero = GetLastSetting(textualValues, sweep, "TTL rack zero " + name, DATA_ACQUISITION_MODE) + WAVE/Z/T ttlEntryRackOne = GetLastSetting(textualValues, sweep, "TTL rack one " + name, DATA_ACQUISITION_MODE) if(WaveExists(ttlEntry)) // NI hardware @@ -2011,7 +1904,7 @@ Function [variable type, variable waMode, variable headstage] GetAnalysisFunctio endif DAC = settings[index] - key = "Generic function" + key = "Generic function" [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, key, DAC, XOP_CHANNEL_TYPE_DAC, DATA_ACQUISITION_MODE) if(!WaveExists(settings)) return [NaN, NaN, NaN] @@ -2025,7 +1918,7 @@ Function [variable type, variable waMode, variable headstage] GetAnalysisFunctio WAVE anaFuncTypes = LBN_GetNumericWave(defValue = INVALID_ANALYSIS_FUNCTION) anaFuncTypes[headstage] = MapAnaFuncToConstant(anaFuncName) - [type, waMode] = AD_GetAnalysisFunctionType(numericalValues, anaFuncTypes, sweepNo, headstage) + [type, waMode] = AD_GetAnalysisFunctionType(numericalValues, anaFuncTypes, sweepNo, headstage) return [type, waMode, headstage] End diff --git a/Packages/MIES/MIES_MiesUtilities_Recreation.ipf b/Packages/MIES/MIES_MiesUtilities_Recreation.ipf index 4164c1fe31..af3078afbc 100644 --- a/Packages/MIES/MIES_MiesUtilities_Recreation.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Recreation.ipf @@ -134,6 +134,7 @@ End /// /// @return $"" if reconstruction failed or a free wave with the sweep data and correct metadata Function/WAVE RecreateSweepWaveFromBackupAndLBN(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, DFREF deviceDataDFR) + string path variable samplingInterval, numChannels, channelOffset @@ -145,8 +146,8 @@ Function/WAVE RecreateSweepWaveFromBackupAndLBN(WAVE numericalValues, WAVE/T tex DFREF singleSweepFolder = $path - [WAVE DAChans, WAVE/WAVE DAWaves] = GetSingleSweepWaves(singleSweepFolder, XOP_CHANNEL_TYPE_DAC) - [WAVE ADChans, WAVE/WAVE ADWaves] = GetSingleSweepWaves(singleSweepFolder, XOP_CHANNEL_TYPE_ADC) + [WAVE DAChans, WAVE/WAVE DAWaves] = GetSingleSweepWaves(singleSweepFolder, XOP_CHANNEL_TYPE_DAC) + [WAVE ADChans, WAVE/WAVE ADWaves] = GetSingleSweepWaves(singleSweepFolder, XOP_CHANNEL_TYPE_ADC) [WAVE TTLChans, WAVE/WAVE TTLWaves] = GetSingleSweepWaves(singleSweepFolder, XOP_CHANNEL_TYPE_TTL) // check that we have found all 1D waves of one sweep @@ -347,11 +348,11 @@ static Function AddDAQChannelTypeFromLBN(WAVE numericalValues, WAVE textualValue switch(configWave[i][%ChannelType]) case XOP_CHANNEL_TYPE_DAC: [WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, "DA ChannelType", configWave[i][%ChannelNumber], configWave[i][%ChannelType], DATA_ACQUISITION_MODE) - channelType = setting[index] + channelType = setting[index] break case XOP_CHANNEL_TYPE_ADC: [WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, "AD ChannelType", configWave[i][%ChannelNumber], configWave[i][%ChannelType], DATA_ACQUISITION_MODE) - channelType = setting[index] + channelType = setting[index] break case XOP_CHANNEL_TYPE_TTL: channelType = DAQ_CHANNEL_TYPE_DAQ @@ -408,7 +409,7 @@ static Function AddChannelUnitFromLBN(WAVE numericalValues, WAVE/T textualValues break endif - key = StringFromList(configWave[i][%ChannelType], XOP_CHANNEL_NAMES) + " Unit" + key = StringFromList(configWave[i][%ChannelType], XOP_CHANNEL_NAMES) + " Unit" [WAVE setting, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, key, configWave[i][%ChannelNumber], configWave[i][%ChannelType], DATA_ACQUISITION_MODE) WAVE/T settingText = setting diff --git a/Packages/MIES/MIES_MiesUtilities_Settings.ipf b/Packages/MIES/MIES_MiesUtilities_Settings.ipf index 660723bd6e..2c28d08465 100644 --- a/Packages/MIES/MIES_MiesUtilities_Settings.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Settings.ipf @@ -67,8 +67,7 @@ Function GenerateSettingsDefaults() return JSONid End -Function UpgradeSettings(JSONid) - variable JSONid +Function UpgradeSettings(variable JSONid) string oldPath, jsonPath string documentsFolder = GetUserDocumentsFolderPath() diff --git a/Packages/MIES/MIES_MiesUtilities_Sweep.ipf b/Packages/MIES/MIES_MiesUtilities_Sweep.ipf index 236d0d91a2..3d87798f5a 100644 --- a/Packages/MIES/MIES_MiesUtilities_Sweep.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Sweep.ipf @@ -17,9 +17,7 @@ /// @param channelType One of @ref XopChannelConstants /// /// @see GetDAQDataSingleColumnWave() or SplitSweepIntoComponents() -Function/WAVE GetDAQDataSingleColumnWaves(sweepDFR, channelType) - DFREF sweepDFR - variable channelType +Function/WAVE GetDAQDataSingleColumnWaves(DFREF sweepDFR, variable channelType) ASSERT(DataFolderExistsDFR(sweepDFR), "sweepDFR is invalid") @@ -73,10 +71,7 @@ End /// @param channelNumber hardware channel number /// @param splitTTLBits [optional, defaults to false] return a single bit of the TTL wave /// @param ttlBit [optional] number specifying the TTL bit -threadsafe Function/WAVE GetDAQDataSingleColumnWave(sweepDFR, channelType, channelNumber, [splitTTLBits, ttlBit]) - DFREF sweepDFR - variable channelType, channelNumber - variable splitTTLBits, ttlBit +threadsafe Function/WAVE GetDAQDataSingleColumnWave(DFREF sweepDFR, variable channelType, variable channelNumber, [variable splitTTLBits, variable ttlBit]) string wvName @@ -103,8 +98,7 @@ End /// @brief Check if the given sweep number is valid /// /// UTF_NOINSTRUMENTATION -threadsafe Function IsValidSweepNumber(sweepNo) - variable sweepNo +threadsafe Function IsValidSweepNumber(variable sweepNo) return IsInteger(sweepNo) && sweepNo >= 0 End @@ -116,10 +110,7 @@ End /// @param index index into `sweep`, can be queried with #AFH_GetDAQDataColumn /// /// @returns a reference to a free wave with the single channel data -threadsafe Function/WAVE ExtractOneDimDataFromSweep(config, sweep, index) - WAVE config - WAVE sweep - variable index +threadsafe Function/WAVE ExtractOneDimDataFromSweep(WAVE config, WAVE sweep, variable index) ASSERT_TS(IsValidSweepAndConfig(sweep, config, configVersion = 0), "Sweep and config are not compatible") @@ -272,7 +263,7 @@ threadsafe static Function SplitSweepWave(WAVE numericalValues, variable sweep, WAVE/WAVE sweepRef = CopySweepToWRef(sweepWave, configWave) [dChannelType, dChannelNumber] = GetConfigWaveDims(configWave) - numRows = DimSize(configWave, ROWS) + numRows = DimSize(configWave, ROWS) for(i = 0; i < numRows; i += 1) WAVE/Z wv = targetDFR:$componentNames[i] KillOrMoveToTrash(wv = wv) @@ -424,7 +415,7 @@ threadsafe Function/S GetSweepComponentWaveName(WAVE config, variable channelInd variable channelNumber, dChannelType, dChannelNumber [dChannelType, dChannelNumber] = GetConfigWaveDims(config) - channelType = StringFromList(config[channelIndex][dChannelType], XOP_CHANNEL_NAMES) + channelType = StringFromList(config[channelIndex][dChannelType], XOP_CHANNEL_NAMES) ASSERT_TS(!isEmpty(channelType), "empty channel type") channelNumber = config[channelIndex][dChannelNumber] ASSERT_TS(IsFinite(channelNumber), "non-finite channel number") @@ -435,9 +426,7 @@ End /// @brief Update the repurposed sweep time global variable /// /// Currently only useful for handling mid sweep analysis functions. -Function UpdateLeftOverSweepTime(device, fifoPos) - string device - variable fifoPos +Function UpdateLeftOverSweepTime(string device, variable fifoPos) string msg @@ -476,8 +465,7 @@ Function LeftOverSweepTime(string device, variable fifoPos) End /// @brief Check if the given wave is a valid DAQDataWave -threadsafe Function IsValidSweepWave(sweep) - WAVE/Z sweep +threadsafe Function IsValidSweepWave(WAVE/Z sweep) if(!WaveExists(sweep)) return 0 @@ -505,9 +493,7 @@ End /// @brief Return the total onset delay of the given sweep from the labnotebook /// /// UTF_NOINSTRUMENTATION -Function GetTotalOnsetDelay(numericalValues, sweepNo) - WAVE numericalValues - variable sweepNo +Function GetTotalOnsetDelay(WAVE numericalValues, variable sweepNo) // present since 778969b0 (DC_PlaceDataInITCDataWave: Document all other settings from the DAQ groupbox, 2015-11-26) return GetLastSettingIndep(numericalValues, sweepNo, "Delay onset auto", DATA_ACQUISITION_MODE) + \ @@ -545,8 +531,7 @@ Function/WAVE TextSweepToWaveRef(WAVE sweepWave) End /// @brief Extract the sweep number from a `$something_*` string -threadsafe Function ExtractSweepNumber(str) - string str +threadsafe Function ExtractSweepNumber(string str) variable numElements, sweepNo diff --git a/Packages/MIES/MIES_MiesUtilities_System.ipf b/Packages/MIES/MIES_MiesUtilities_System.ipf index e0cae220be..4df92b2900 100644 --- a/Packages/MIES/MIES_MiesUtilities_System.ipf +++ b/Packages/MIES/MIES_MiesUtilities_System.ipf @@ -8,6 +8,7 @@ // @brief Common setup routine for all MIES background tasks for DAQ, TP and pressure control Function SetupBackgroundTasks() + CtrlNamedBackground $TASKNAME_TIMERMD, dialogsOK=0, period=6, proc=DQM_Timer CtrlNamedBackground $TASKNAME_FIFOMONMD, dialogsOK=0, period=1, proc=DQM_FIFOMonitor CtrlNamedBackground $TASKNAME_FIFOMON, dialogsOK=0, period=5, proc=DQS_FIFOMonitor @@ -22,8 +23,7 @@ End /// @brief Save the current experiment under a new name and clear all/some data /// @param mode mode for generating the experiment name, one of @ref SaveExperimentModes -Function SaveExperimentSpecial(mode) - variable mode +Function SaveExperimentSpecial(variable mode) variable numDevices, i, ret, pos variable zeroSweepCounter, keepOtherData, showSaveDialog, useNewNWBFile @@ -164,9 +164,7 @@ End /// @param filename filename of the experiment *including* suffix, usually #PACKED_FILE_EXPERIMENT_SUFFIX /// @param overrideInteractiveMode [optional, defaults to GetInteractiveMode()] Overrides the current setting of /// the interactive mode -Function SaveExperimentWrapper(path, filename, [overrideInteractiveMode]) - string path, filename - variable overrideInteractiveMode +Function SaveExperimentWrapper(string path, string filename, [variable overrideInteractiveMode]) variable refNum, pathNeedsKilling @@ -219,6 +217,7 @@ End /// @brief Return if the function results are overriden for testing purposes Function TestOverrideActive() + variable numberOfOverrideWarnings WAVE/Z overrideResults = GetOverrideResults() @@ -237,6 +236,7 @@ Function TestOverrideActive() End Function HandleOutOfMemory(string device, string name) + printf "The amount of free memory is too low to increase the %s wave, please create a new experiment.\r", name ControlWindowToFront() diff --git a/Packages/MIES/MIES_MiesUtilities_Uploads.ipf b/Packages/MIES/MIES_MiesUtilities_Uploads.ipf index a9e5bde05d..7550654c20 100644 --- a/Packages/MIES/MIES_MiesUtilities_Uploads.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Uploads.ipf @@ -46,6 +46,7 @@ End /// @brief Call UploadLogFiles() if we haven't called it since at least a day. Function UploadLogFilesDaily() + string ts variable lastWrite, now, first, last diff --git a/Packages/MIES/MIES_MiesUtilities_ZeroMQ.ipf b/Packages/MIES/MIES_MiesUtilities_ZeroMQ.ipf index b26fcdb294..1fca8f8505 100644 --- a/Packages/MIES/MIES_MiesUtilities_ZeroMQ.ipf +++ b/Packages/MIES/MIES_MiesUtilities_ZeroMQ.ipf @@ -10,6 +10,7 @@ /// @brief This file holds MIES utility functions for ZeroMQ Function GetZeroMQXOPFlags() + return ZeroMQ_SET_FLAGS_DEFAULT | ZeroMQ_SET_FLAGS_LOGGING | ZeroMQ_SET_FLAGS_NOBUSYWAITRECV End @@ -22,6 +23,7 @@ End /// @return NaN if already running, otherwise it returns the number of trials /// it had to iterate for an unused port. Function StartZeroMQSockets([variable forceRestart]) + variable i, port, err, numBinds, flags, numTrials if(ParamIsDefault(forceRestart)) @@ -88,6 +90,7 @@ End /// @brief Update the logging template used by the ZeroMQ-XOP and ITCXOP2 Function UpdateXOPLoggingTemplate() + variable JSONid string str diff --git a/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf b/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf index dd2acfa9db..b06b0674a1 100644 --- a/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf +++ b/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf @@ -343,6 +343,7 @@ threadsafe static Function/S NWB_GenerateDeviceDescription(string device, WAVE n End threadsafe Function/DF NWB_ASYNC_Worker(DFREF dfr) + string deviceDesc STRUCT NWBAsyncParameters s @@ -471,6 +472,7 @@ static Function NWB_AddDeviceSpecificData(STRUCT NWBAsyncParameters &s, variable End Function NWB_WriteTestpulseData(STRUCT NWBAsyncParameters &s, variable writeStoredTestPulses) + variable groupID, i, numEntries, compressionModeStoredTP string path, list, name, deviceDesc @@ -785,6 +787,7 @@ Function NWB_ASYNC_FinishWriting(string device) End Function NWB_CheckForMissingSweeps(string device, WAVE/T sweepNames) + WAVE numericalValues = GetLBNumericalValues(device) WAVE/Z sweepsFromLBN = GetSweepsWithSetting(numericalValues, "SweepNum") @@ -1037,6 +1040,7 @@ Function NWB_PrepareExport(variable nwbVersion, string device) End Function NWB_AppendSweepDuringDAQ(string device, WAVE DAQDataWave, WAVE DAQConfigWave, variable sweep, variable nwbVersion) + variable locationID, createdNewNWBFile string workload @@ -1109,10 +1113,10 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) ASSERT_TS(WaveExists(DACs), "Labnotebook is too old for NWB export.") // 5872e556 (Modified files: DR_MIES_TangoInteract: changes recommended by Thomas ..., 2014-09-11) - WAVE/D/Z ADCs = GetLastSetting(s.numericalValues, s.sweep, "ADC", DATA_ACQUISITION_MODE) + WAVE/Z/D ADCs = GetLastSetting(s.numericalValues, s.sweep, "ADC", DATA_ACQUISITION_MODE) if(!WaveExists(ADCs)) - WAVE/D/Z statusHS = GetLastSetting(s.numericalValues, s.sweep, "Headstage Active", DATA_ACQUISITION_MODE) + WAVE/Z/D statusHS = GetLastSetting(s.numericalValues, s.sweep, "Headstage Active", DATA_ACQUISITION_MODE) ASSERT_TS(WaveExists(statusHS), "Labnotebook is too old for NWB export (ADCs is missing and statusHS fixup is also broken.") WAVE configADCs = GetADCListFromConfig(s.DAQConfigWave) @@ -1130,7 +1134,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) endif // 602debb9 (Record the active headstage in the settingsHistory, 2014-11-04) - WAVE/D/Z statusHS = GetLastSetting(s.numericalValues, s.sweep, "Headstage Active", DATA_ACQUISITION_MODE) + WAVE/Z/D statusHS = GetLastSetting(s.numericalValues, s.sweep, "Headstage Active", DATA_ACQUISITION_MODE) if(!WaveExists(statusHS)) WAVE statusHS = LBN_GetNumericWave() statusHS[] = IsFinite(ADCs[p]) && IsFinite(DACs[p]) @@ -1175,7 +1179,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) ASSERT_TS(Sum(statusHS, 0, NUM_HEADSTAGES - 1) >= 1, "Expected at least one active headstage.") // 1a4b8e59 (Changes to Tango Interact, 2014-09-03) - WAVE/T/Z stimSets = GetLastSetting(s.textualValues, s.sweep, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T stimSets = GetLastSetting(s.textualValues, s.sweep, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) ASSERT_TS(WaveExists(stimSets), "Labnotebook is too old for NWB export.") // b1575214 (NWB: Allow documenting the physical electrode, 2016-08-05) @@ -1245,7 +1249,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) WAVE params.data = GetDAQDataSingleColumnWaveNG(s.numericalValues, s.textualValues, s.sweep, sweepDFR, params.channelType, params.channelNumber) NWB_GetTimeSeriesProperties(s.nwbVersion, s.numericalKeys, s.numericalValues, params, tsp) params.groupIndex = IsFinite(params.groupIndex) ? params.groupIndex : GetNextFreeGroupIndex(s.locationID, path) - WAVE/T/Z params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, params.channelNumber, params.channelType) + WAVE/Z/T params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, params.channelNumber, params.channelType) s.locationID = WriteSingleChannel(s.locationID, path, s.nwbVersion, params, tsp, compressionMode = s.compressionMode, nwbFilePath = s.nwbFilePath) endif @@ -1288,7 +1292,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) NWB_GetTimeSeriesProperties(s.nwbVersion, s.numericalKeys, s.numericalValues, params, tsp) params.groupIndex = IsFinite(params.groupIndex) ? params.groupIndex : GetNextFreeGroupIndex(s.locationID, path) WAVE params.data = GetDAQDataSingleColumnWaveNG(s.numericalValues, s.textualValues, s.sweep, sweepDFR, params.channelType, i) - WAVE/T/Z params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, i, params.channelType) + WAVE/Z/T params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, i, params.channelType) s.locationID = WriteSingleChannel(s.locationID, path, s.nwbVersion, params, tsp, compressionMode = s.compressionMode, nwbFilePath = s.nwbFilePath) @@ -1306,14 +1310,14 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) endif // unassociated channel data - params.clampMode = NaN - params.electrodeNumber = NaN - params.electrodeName = "" + params.clampMode = NaN + params.electrodeNumber = NaN + params.electrodeName = "" [dChannelType, dChannelNumber] = GetConfigWaveDims(s.DAQConfigWave) - params.channelType = s.DAQConfigWave[i][dChannelType] - params.channelNumber = s.DAQConfigWave[i][dChannelNumber] - params.samplingRate = ConvertSamplingIntervalToRate(GetSamplingInterval(s.DAQConfigWave, params.channelType)) * KILO_TO_ONE - params.stimSet = IPNWB_PLACEHOLDER + params.channelType = s.DAQConfigWave[i][dChannelType] + params.channelNumber = s.DAQConfigWave[i][dChannelNumber] + params.samplingRate = ConvertSamplingIntervalToRate(GetSamplingInterval(s.DAQConfigWave, params.channelType)) * KILO_TO_ONE + params.stimSet = IPNWB_PLACEHOLDER switch(params.channelType) case IPNWB_CHANNEL_TYPE_ADC: @@ -1321,7 +1325,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) break case IPNWB_CHANNEL_TYPE_DAC: path = "/stimulus/presentation" - WAVE/T/Z params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, params.channelNumber, params.channelType) + WAVE/Z/T params.epochs = EP_FetchEpochs_TS(s.numericalValues, s.textualValues, s.sweep, params.channelNumber, params.channelType) break default: ASSERT_TS(0, "Unexpected channel type") @@ -1592,9 +1596,7 @@ End /// @param overwrite indicate whether the stored custom wave should be deleted if it exists /// /// @return 1 on error and 0 on success -Function NWB_LoadCustomWave(locationID, fullPath, overwrite) - variable locationID, overwrite - string fullPath +Function NWB_LoadCustomWave(variable locationID, string fullPath, variable overwrite) string pathInNWB @@ -1664,10 +1666,7 @@ End /// @param overwrite [optional, defaults to false] indicate if the stored stimset should be deleted before the load. /// @param loadOnlyBuiltins [optional, defaults to false] load only builtin stimsets /// @return 1 on error and 0 on success -Function NWB_LoadAllStimsets([overwrite, fileName, loadOnlyBuiltins]) - variable overwrite - string fileName - variable loadOnlyBuiltins +Function NWB_LoadAllStimsets([variable overwrite, string fileName, variable loadOnlyBuiltins]) variable fileID, groupID, error, numStimsets, i, refNum string stimsets, stimset, suffix, fullPath @@ -1745,9 +1744,7 @@ End /// @param overwrite indicate whether the stored stimsets should be deleted if they exist /// /// @return 1 on error and 0 on success -Function NWB_LoadStimsets(groupID, stimsets, overwrite, [processedStimsets]) - variable groupID, overwrite - string stimsets, processedStimsets +Function NWB_LoadStimsets(variable groupID, string stimsets, variable overwrite, [string processedStimsets]) string stimset, totalStimsets, newStimsets, oldStimsets variable numBefore, numMoved, numAfter, numNewStimsets, i @@ -1789,9 +1786,7 @@ End /// see AB_LoadCustomWaves() for similar structure /// /// @return 1 on error and 0 on success -Function NWB_LoadCustomWaves(groupID, stimsets, overwrite) - variable groupID, overwrite - string stimsets +Function NWB_LoadCustomWaves(variable groupID, string stimsets, variable overwrite) string custom_waves variable numWaves, i @@ -1905,10 +1900,7 @@ End /// @param locationID id of nwb file or notebooks folder /// @param notebook name of notebook to be loaded /// @param dfr igor data folder where data should be loaded into -Function NWB_LoadLabNoteBook(locationID, notebook, dfr) - variable locationID - string notebook - DFREF dfr +Function NWB_LoadLabNoteBook(variable locationID, string notebook, DFREF dfr) string deviceList, path @@ -1949,9 +1941,9 @@ static Function NWB_AppendLogFileToString(string path, string &str) WAVE/Z/T logData = LoadTextFileToWave(path, LOG_FILE_LINE_END) if(WaveExists(logData)) - now = GetISO8601TimeStamp() - firstDate = ParseISO8601TimeStamp(now[0, 9] + "T00:00:00Z") - lastDate = Inf + now = GetISO8601TimeStamp() + firstDate = ParseISO8601TimeStamp(now[0, 9] + "T00:00:00Z") + lastDate = Inf [WAVE/T partData, lastIndex] = FilterByDate(logData, firstDate, lastDate) if(WaveExists(partData)) WAVE/WAVE splitContents = SplitLogDataBySize(partData, LOG_FILE_LINE_END, STRING_MAX_SIZE - MEGABYTE) diff --git a/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf b/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf index 2a9177c4d0..666d8d5f31 100644 --- a/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf +++ b/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf @@ -304,15 +304,13 @@ End /// @param[in] device title of the device panel /// @param[in] params OOdDAQParams structure with the initial settings /// @return one dimensional numberic wave with the offsets in points for each stimset -Function/WAVE OOD_GetResultWaves(device, params) - string device - STRUCT OOdDAQParams ¶ms +Function/WAVE OOD_GetResultWaves(string device, STRUCT OOdDAQParams ¶ms) string key key = CA_DistDAQCreateCacheKey(params) - WAVE/WAVE/Z cache = CA_TryFetchingEntryFromCache(key) + WAVE/Z/WAVE cache = CA_TryFetchingEntryFromCache(key) if(WaveExists(cache)) WAVE params.offsets = cache[%offsets] diff --git a/Packages/MIES/MIES_Oscilloscope.ipf b/Packages/MIES/MIES_Oscilloscope.ipf index 6d7c701c44..c73af5ae7f 100644 --- a/Packages/MIES/MIES_Oscilloscope.ipf +++ b/Packages/MIES/MIES_Oscilloscope.ipf @@ -15,20 +15,17 @@ static Constant SCOPE_BLUE = 39168 static StrConstant RES_FORMAT_STR = "\\[1\\K(%d, %d, %d)\\{\"%%s\", FloatWithMinSigDigits(%s[%%%s][%d], numMinSignDigits = 2)}\\]1\\K(0, 0, 0)" static Constant PRESSURE_SPECTRUM_PERCENT = 0.05 -Function/S SCOPE_GetGraph(device) - string device +Function/S SCOPE_GetGraph(string device) return SCOPE_GetPanel(device) + "#oscilloscope" End -Function/S SCOPE_GetPanel(device) - string device +Function/S SCOPE_GetPanel(string device) return device + "#Scope" End -Function SCOPE_OpenScopeWindow(device) - string device +Function SCOPE_OpenScopeWindow(string device) string win, graph @@ -48,8 +45,7 @@ Function SCOPE_OpenScopeWindow(device) SetActiveSubWindow $device End -Function SCOPE_KillScopeWindowIfRequest(device) - string device +Function SCOPE_KillScopeWindowIfRequest(string device) string win = SCOPE_GetPanel(device) @@ -62,9 +58,7 @@ End // @param[in] device title of panel // @param[out] axisMin suggested new axis minimum // @return 1 if axisMin has changed, 0 otherwise -Function SCOPE_GetTPTopAxisStart(device, axisMin) - string device - variable &axisMin +Function SCOPE_GetTPTopAxisStart(string device, variable &axisMin) string graph variable count, latest @@ -93,9 +87,7 @@ Function SCOPE_GetTPTopAxisStart(device, axisMin) endif End -Function SCOPE_UpdateGraph(device, dataAcqOrTP) - string device - variable dataAcqOrTP +Function SCOPE_UpdateGraph(string device, variable dataAcqOrTP) variable i, numADCs, range, numDACs, statsMin, statsMax variable axisMin, axisMax, spacing, additionalSpacing @@ -193,9 +185,7 @@ static Function [variable showSteadyStateResistance, variable showPeakResistance showPowerSpectrum = DAG_GetNumericalValue(device, "check_settings_show_power") End -Function SCOPE_CreateGraph(device, dataAcqOrTP) - string device - variable dataAcqOrTP +Function SCOPE_CreateGraph(string device, variable dataAcqOrTP) string graph, color, style variable i, adc, numActiveDACs, numADChannels, oneTimeInitDone, chanTPmode, scopeScaleMode @@ -389,9 +379,7 @@ Function SCOPE_CreateGraph(device, dataAcqOrTP) endif End -Function SCOPE_SetADAxisLabel(device, dataAcqOrTP, activeHeadStage) - string device - variable dataAcqOrTP, activeHeadStage +Function SCOPE_SetADAxisLabel(string device, variable dataAcqOrTP, variable activeHeadStage) variable adc, i, headStage variable numADChannels @@ -473,9 +461,7 @@ End /// @param fifoPos Position of the hardware DAQ fifo to keep track of /// the position which will be written next /// @param deviceID device ID -Function SCOPE_UpdateOscilloscopeData(device, dataAcqOrTP, [chunk, fifoPos, deviceID]) - string device - variable dataAcqOrTP, chunk, fifoPos, deviceID +Function SCOPE_UpdateOscilloscopeData(string device, variable dataAcqOrTP, [variable chunk, variable fifoPos, variable deviceID]) STRUCT TPAnalysisInput tpInput variable i, j diff --git a/Packages/MIES/MIES_OverlaySweeps.ipf b/Packages/MIES/MIES_OverlaySweeps.ipf index 5627e6a2fc..6a0b77e488 100644 --- a/Packages/MIES/MIES_OverlaySweeps.ipf +++ b/Packages/MIES/MIES_OverlaySweeps.ipf @@ -15,6 +15,7 @@ static StrConstant OVS_FULL_UPDATE_NOTE = "FullUpdate" /// @brief This user trace menu function allows the user to select a trace /// in overlay sweeps mode which should be ignored. Function OVS_IgnoreHeadstageInOverlay() + string graph, trace, extPanel, str, folder variable headstage, sweepNo, index @@ -65,8 +66,7 @@ End /// @brief Return a list of choices for the sweep selection popup /// /// Includes a unique list of the DA stimsets of all available sweeps -Function/S OVS_GetSweepSelectionChoices(win) - string win +Function/S OVS_GetSweepSelectionChoices(string win) if(!OVS_IsActive(win)) return NONE @@ -165,8 +165,7 @@ End /// Requires the user data `PANEL_FOLDER` of the BrowserSettings panel /// /// @return a valid DFREF or an invalid one in case the external panel could not be found -Function/DF OVS_GetFolder(win) - string win +Function/DF OVS_GetFolder(string win) DFREF dfr = BSP_GetFolder(win, MIES_BSP_PANEL_FOLDER) if(!DataFolderExistsDFR(dfr)) @@ -301,7 +300,7 @@ Function OVS_UpdateSweepSelectionChoices(string win, WAVE/T sweepSelectionChoice for(i = 0; i < numEntries; i += 1) WAVE/T stimsets = GetLastSetting(allTextualValues[i], sweeps[i], STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) sweepSelectionChoices[i][][%Stimset] = stimsets[q] - WAVE/T/Z TTLStimSets = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_STIMSETS, sweeps[i]) + WAVE/Z/T TTLStimSets = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_STIMSETS, sweeps[i]) if(WaveExists(TTLStimSets)) sweepSelectionChoices[i][][%TTLStimSet] = TTLStimSets[q] endif @@ -320,7 +319,7 @@ Function OVS_UpdateSweepSelectionChoices(string win, WAVE/T sweepSelectionChoice sweepSelectionChoices[i][][%DAStimsetAndSetSweepCount] = SelectString(IsFinite(setSweepCount[q]), "", stimsets[q] + " (" + num2str(setSweepCount[q]) + ")") - WAVE/T/Z TTLsetSweepCount = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_SETSWEEPCOUNTS, sweeps[i]) + WAVE/Z/T TTLsetSweepCount = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_SETSWEEPCOUNTS, sweeps[i]) if(WaveExists(TTLsetSweepCount)) sweepSelectionChoices[i][][%TTLStimsetAndSetSweepCount] = SelectString(strlen(TTLsetSweepCount[q]) > 0, "", TTLStimsets[q] + " (" + TTLsetSweepCount[q] + ")") endif @@ -332,7 +331,7 @@ Function OVS_UpdateSweepSelectionChoices(string win, WAVE/T sweepSelectionChoice sweepSelectionChoices[i][][%DAStimsetAndSetCycleCount] = SelectString(IsFinite(setCycleCount[q]), "", stimsets[q] + " (C" + num2str(setCycleCount[q]) + ")") endif - WAVE/T/Z TTLsetCycleCount = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_SETCYCLECOUNTS, sweeps[i]) + WAVE/Z/T TTLsetCycleCount = GetTTLLabnotebookEntry(allTextualValues[i], LABNOTEBOOK_TTL_SETCYCLECOUNTS, sweeps[i]) if(WaveExists(TTLsetCycleCount)) sweepSelectionChoices[i][][%TTLStimsetAndSetCycleCount] = SelectString(strlen(TTLsetCycleCount[q]) > 0, "", TTLStimsets[q] + " (C" + TTLsetCycleCount[q] + ")") endif @@ -350,9 +349,7 @@ End /// - #OVS_SWEEP_ALL_SWEEPNO /// /// @return invalid wave reference in case nothing is selected or numeric indizes/sweep numbers depending on mode parameter -Function/WAVE OVS_GetSelectedSweeps(win, mode) - string win - variable mode +Function/WAVE OVS_GetSelectedSweeps(string win, variable mode) ASSERT(mode == OVS_SWEEP_SELECTION_INDEX || \ mode == OVS_SWEEP_SELECTION_SWEEPNO || \ @@ -398,10 +395,7 @@ End /// @param invertOthers [optional, default to false] set the other sweeps to !newState if true /// /// One of `sweepNo`/`index` is required. -Function OVS_ChangeSweepSelectionState(win, newState, [sweepNo, index, sweeps, invertOthers]) - string win - variable sweepNo, index, newState, invertOthers - WAVE/Z sweeps +Function OVS_ChangeSweepSelectionState(string win, variable newState, [variable sweepNo, variable index, WAVE/Z sweeps, variable invertOthers]) variable i, numEntries @@ -473,8 +467,7 @@ Function OVS_ChangeSweepSelectionState(win, newState, [sweepNo, index, sweeps, i End /// checks if OVS is active. -Function OVS_IsActive(win) - string win +Function OVS_IsActive(string win) return BSP_IsActive(win, MIES_BSP_OVS) End @@ -621,8 +614,7 @@ static Function/WAVE OVS_ParseIgnoreList(string ignoreList, variable sweepNo) return activeHS End -Function OVS_CheckBoxProc_HS_Select(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function OVS_CheckBoxProc_HS_Select(STRUCT WMCheckboxAction &cba) : CheckBoxControl string win @@ -658,14 +650,14 @@ static Function OVS_HighlightSweep(win, index) ASSERT(OVS_IsActive(win), "Highlighting is only supported if OVS is enabled") graph = GetMainWindow(win) - WAVE/T/Z traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Sweep"}) + WAVE/Z/T traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"Sweep"}) if(!WaveExists(traces)) return NaN endif if(IsFinite(index)) [sweepNo, experiment] = OVS_GetSweepAndExperiment(win, index) - WAVE/T/Z highlightTraces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType", "sweepNumber", "experiment"}, values = {"Sweep", num2str(sweepNo), experiment}) + WAVE/Z/T highlightTraces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType", "sweepNumber", "experiment"}, values = {"Sweep", num2str(sweepNo), experiment}) if(!WaveExists(highlightTraces)) // the to-be-highlighted traces are not plotted @@ -682,7 +674,7 @@ static Function OVS_HighlightSweep(win, index) numTraces = DimSize(traces, ROWS) for(i = 0; i < numTraces; i += 1) trace = traces[i] - [c] = ParseColorSpec(TUD_GetUserData(graph, trace, "TRACECOLOR")) + [c] = ParseColorSpec(TUD_GetUserData(graph, trace, "TRACECOLOR")) if(IsFinite(index) && IsNaN(GetRowIndex(highlightTraces, str = trace))) c.alpha = c.alpha * 0.05 @@ -951,8 +943,7 @@ static Function OVS_EndIncrementalUpdate(string win, WAVE/WAVE updateHandle) endif End -Function OVS_MainListBoxProc(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function OVS_MainListBoxProc(STRUCT WMListboxAction &lba) : ListBoxControl string win variable index @@ -987,8 +978,7 @@ Function OVS_MainListBoxProc(lba) : ListBoxControl return 0 End -Function OVS_PopMenuProc_Select(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function OVS_PopMenuProc_Select(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -999,8 +989,7 @@ Function OVS_PopMenuProc_Select(pa) : PopupMenuControl return 0 End -Function OVS_SetVarProc_SelectionRange(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function OVS_SetVarProc_SelectionRange(STRUCT WMSetVariableAction &sva) : SetVariableControl string popStr, win diff --git a/Packages/MIES/MIES_PackageSettings.ipf b/Packages/MIES/MIES_PackageSettings.ipf index d84cb69b0b..d13775299b 100644 --- a/Packages/MIES/MIES_PackageSettings.ipf +++ b/Packages/MIES/MIES_PackageSettings.ipf @@ -15,6 +15,7 @@ static StrConstant PS_COORDINATE_SAVING_HOOK = "windowCoordinateSaving" /// @brief Initialize the `PackageFolder` symbolic path Function PS_Initialize(string package) + string folder = SpecialDirPath("Igor Preferences", 0, 0, 1) + "Packages:" + CleanupName(package, 0) if(!FolderExists(folder)) @@ -26,15 +27,14 @@ End /// @brief This functions should return a JSON ID with the default settings Function PS_GenerateSettingsDefaults() + ASSERT(0, "Can not call prototype") End /// @brief Return a JSON ID with an opened JSON settings file /// /// Caller is responsible for releasing the document. -Function PS_ReadSettings(package, generateDefaults) - string package - FUNCREF PS_GenerateSettingsDefaults generateDefaults +Function PS_ReadSettings(string package, FUNCREF PS_GenerateSettingsDefaults generateDefaults) string filepath, data, fName variable JSONid @@ -43,7 +43,7 @@ Function PS_ReadSettings(package, generateDefaults) if(FileExists(filepath)) [data, fName] = LoadTextFile(filepath) - JSONid = JSON_Parse(data, ignoreErr = 1) + JSONid = JSON_Parse(data, ignoreErr = 1) if(IsFinite(JSONid)) return JSONid @@ -58,9 +58,7 @@ End /// @brief Write the settings from `JSONid` for `package` to disc /// /// Call this function in `BeforeExperimentSaveHook` to write the settings to disc -Function PS_WriteSettings(package, JSONid) - string package - variable JSONid +Function PS_WriteSettings(string package, variable JSONid) string filepath @@ -76,8 +74,7 @@ End /// PS_Initialize() to exist. /// /// The returned folder location includes a trailing colon (":") -threadsafe Function/S PS_GetSettingsFolder_TS(package) - string package +threadsafe Function/S PS_GetSettingsFolder_TS(string package) PathInfo PackageFolder ASSERT_TS(V_flag, "Missing initialization") @@ -89,8 +86,7 @@ End /// creating it when necessary. /// /// The returned folder location includes a trailing colon (":") -Function/S PS_GetSettingsFolder(package) - string package +Function/S PS_GetSettingsFolder(string package) PathInfo PackageFolder if(V_flag) @@ -279,6 +275,7 @@ End /// Caller *must* invalidate JSONid after return. Function PS_OpenNotebook(string package, variable JSONid) + string name, path PS_SerializeSettings(package, JSONid) @@ -303,6 +300,7 @@ End /// - Incorrect is moved to the correct location only if the correct does not exists /// - If the correct does exist as well, the incorrect is read and appened to to the correct one Function PS_FixPackageLocation(string package) + string folder, incorrectFolder, incorrectPackageFile, incorrectLogFile string correctPackageFile, correctLogFile, incorrectData, correctData, fName, data @@ -334,8 +332,8 @@ Function PS_FixPackageLocation(string package) else // read the incorrect log file and append it to the correct one [incorrectData, fName] = LoadTextFile(incorrectLogFile) - [correctData, fName] = LoadTextFile(correctLogFile) - data = RemoveEnding(correctData, "\n") + "\n" + incorrectData + [correctData, fName] = LoadTextFile(correctLogFile) + data = RemoveEnding(correctData, "\n") + "\n" + incorrectData SaveTextFile(data, correctLogFile) DeleteFile incorrectLogFile endif diff --git a/Packages/MIES/MIES_PressureControl.ipf b/Packages/MIES/MIES_PressureControl.ipf index 2d451ab731..ff4805298e 100644 --- a/Packages/MIES/MIES_PressureControl.ipf +++ b/Packages/MIES/MIES_PressureControl.ipf @@ -30,8 +30,8 @@ static StrConstant HIGH_COLOR_HILITE = "65278;0;0" static StrConstant LOW_COLOR = "65535;65535;65535" static StrConstant ZERO_COLOR = "49151;53155;65535" static StrConstant HIGH_COLOR = "65535;49000;49000" -static Constant NEG_PRESSURE_PULSE_INCREMENT = 0.2 // psi -static Constant POS_PRESSURE_PULSE_INCREMENT = 0.1 // psi +static Constant NEG_PRESSURE_PULSE_INCREMENT = 0.2 // psi +static Constant POS_PRESSURE_PULSE_INCREMENT = 0.1 // psi static Constant PRESSURE_PULSE_ENDpt = 70000 static Constant PRESSURE_TTL_HIGH_START = 20000 static Constant GIGA_SEAL = 1000 @@ -43,9 +43,9 @@ static Constant PRESSURE_CHANGE = 1 static Constant P_NEGATIVE_PULSE = 0x0 static Constant P_POSITIVE_PULSE = 0x1 static Constant P_MANUAL_PULSE = 0x2 -static Constant SEAL_POTENTIAL = -70 // mV -static Constant SEAL_RESISTANCE_THRESHOLD = 100 // MΩ -static Constant ACCESS_ATM = 0 // Access constants are used to set TTL valve configuration +static Constant SEAL_POTENTIAL = -70 // mV +static Constant SEAL_RESISTANCE_THRESHOLD = 100 // MΩ +static Constant ACCESS_ATM = 0 // Access constants are used to set TTL valve configuration static Constant ACCESS_REGULATOR = 1 static Constant ACCESS_USER = 2 ///@} @@ -61,8 +61,7 @@ EndStructure /// /// This function gets called by TP_RecordTP. It also gets called when the approach button is pushed. /// A key point is that data acquisition used to run pressure pulses cannot be active if the TP is inactive. -Function P_PressureControl(device) - string device +Function P_PressureControl(string device) variable headStage, manPressureAll @@ -261,7 +260,7 @@ static Function P_MethodSeal(device, headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable RSlope - variable RSlopeThreshold = 4 // with a slope of 8 MΩ/s it will take two minutes for a seal to form. + variable RSlopeThreshold = 4 // with a slope of 8 MΩ/s it will take two minutes for a seal to form. variable lastRSlopeCheck = PressureDataWv[headStage][%TimeOfLastRSlopeCheck] / 60 variable timeInSec = ticks / 60 variable ElapsedTimeInSeconds = timeInSec - LastRSlopeCheck @@ -664,9 +663,7 @@ static Function/S P_GetListOfPressureCtrlDevices(device) End /// @brief Sets the pressure on a headStage -Function P_SetAndGetPressure(device, headStage, psi) - string device - variable headStage, psi +Function P_SetAndGetPressure(string device, variable headStage, variable psi) variable hwType, deviceID, channel, scale, CalPsi string msg @@ -697,10 +694,7 @@ End /// @param device The DAQ device for which user access is being queried /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// @param pressureMode One of the pressure modes defined in @ref PRESSURE_CONSTANTS -Function P_GetUserAccess(device, headStage, pressureMode) - string device - variable headStage - variable pressureMode +Function P_GetUserAccess(string device, variable headStage, variable pressureMode) WAVE pressureDataWv = P_GetPressureDataWaveRef(device) @@ -757,10 +751,7 @@ Function P_GetUserAccess(device, headStage, pressureMode) End /// @brief Maps the access (defined in @ref PRESSURE_CONSTANTS) to the TTL settings -Function P_SetPressureValves(device, headStage, Access) - string device - variable headStage - variable Access +Function P_SetPressureValves(string device, variable headStage, variable Access) variable ONorOFFA, ONorOFFB WAVE pressureDataWv = P_GetPressureDataWaveRef(device) @@ -797,9 +788,7 @@ End /// NI hardware: /// There are no dedicated input or output channels for DIO. The last written value /// is read according to documentation. -Function P_UpdateTTLstate(device, headStage, ONorOFFA, ONorOFFB) - string device - variable headStage, ONorOFFA, ONorOFFB +Function P_UpdateTTLstate(string device, variable headStage, variable ONorOFFA, variable ONorOFFB) variable outputDecimal, val, idxA, idxB, channel variable hwType, deviceID, ttlBitA, ttlBitB @@ -908,8 +897,7 @@ static Function P_UpdateSSRSlopeAndSSR(device) End /// @brief Updates the pressure state (approach, seal, break in, or clear) from DA_Ephys panel to the pressureData wave -Function P_UpdatePressureDataStorageWv(device) /// @todo Needs to be reworked for specific controls and allow the value to be directly passed in with an optional parameter - string device +Function P_UpdatePressureDataStorageWv(string device) /// @todo Needs to be reworked for specific controls and allow the value to be directly passed in with an optional parameter variable idx variable settingHS = GetPopupMenuIndex(device, "Popup_Settings_HeadStage") // get the active headstage @@ -948,9 +936,7 @@ End /// @brief Retrieves the parameters stored in the PressureData wave and passes them to the GUI controls // based on the headStage selected in the device associations of the Hardware tab on the DA_Ephys panel -Function P_UpdatePressureControls(device, headStageNo) - string device - variable headStageNo +Function P_UpdatePressureControls(string device, variable headStageNo) variable ttl WAVE PressureDataWv = P_GetPressureDataWaveRef(device) @@ -1060,8 +1046,7 @@ static Function P_ITC_SetChannels(device, headstage) End /// @brief Check wether the given device is used as pressure device already -Function P_DeviceIsUsedForPressureCtrl(device, pressureDevice) - string device, pressureDevice +Function P_DeviceIsUsedForPressureCtrl(string device, string pressureDevice) variable i, hwType, deviceID @@ -1159,8 +1144,7 @@ End /// @brief Monitor the device FIFO and terminates acquisition when sufficient data has been collected /// /// @ingroup BackgroundFunctions -Function P_ITC_FIFOMonitorProc(s) - STRUCT WMBackgroundStruct &s +Function P_ITC_FIFOMonitorProc(STRUCT WMBackgroundStruct &s) string device variable hwType, moreData, deviceID, headstage @@ -1187,9 +1171,7 @@ Function P_ITC_FIFOMonitorProc(s) return 0 End -Function P_NI_StopDAQ(device, headStage) - string device - variable headStage +Function P_NI_StopDAQ(string device, variable headStage) variable hwType, deviceID, TTL @@ -1344,7 +1326,7 @@ static Function/WAVE P_NI_GetDAWave(device, headStage) wvName = "NI_DA" + num2str(DAC) - WAVE/SDFR=dfr/Z wv = $wvName + WAVE/Z/SDFR=dfr wv = $wvName if(WaveExists(wv)) return wv @@ -1368,7 +1350,7 @@ static Function/WAVE P_NI_GetADWave(device, headStage) wvName = "NI_AD" + num2str(ADC) - WAVE/SDFR=dfr/Z wv = $wvName + WAVE/Z/SDFR=dfr wv = $wvName if(WaveExists(wv)) return wv @@ -1559,11 +1541,7 @@ static Function P_UpdateTTLdecimal(pressureDevice, dec, ttlBit, ONorOFF) End /// @brief Updates the pressure mode button state in the DA_Ephys Data Acq tab -Function P_UpdatePressureMode(device, pressureMode, pressureControlName, checkALL) - string device - variable pressureMode - string pressureControlName - variable checkAll +Function P_UpdatePressureMode(string device, variable pressureMode, string pressureControlName, variable checkALL) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable headStageNo = PressureDataWv[0][%UserSelectedHeadStage] @@ -1656,10 +1634,7 @@ static Function P_CheckAll(device, pressureMode, SavedPressureMode) P_UpdatePressureType(device) End -Function P_SetPressureOffset(device, headstage, userOffset) - string device - variable headstage - variable userOffset +Function P_SetPressureOffset(string device, variable headstage, variable userOffset) variable method, val @@ -1717,8 +1692,7 @@ Function P_SetPressureOffset(device, headstage, userOffset) endswitch End -Function P_InitBeforeTP(device) - string device +Function P_InitBeforeTP(string device) variable headstage @@ -1730,8 +1704,7 @@ Function P_InitBeforeTP(device) End /// @brief Colors and changes the title of the pressure buttons based on the saved pressure mode. -Function P_LoadPressureButtonState(device) - string device +Function P_LoadPressureButtonState(string device) variable headStageNo @@ -1804,9 +1777,7 @@ static Function P_EnableButtonsIfValid(device, headStageNo) End ///@brief updates the tablabels for the pressure tabControl according to the pressure mode -Function P_UpdatePressureModeTabs(device, headStage) - string device - variable headStage +Function P_UpdatePressureModeTabs(string device, variable headStage) WAVE pressureWave = P_GetPressureDataWaveRef(device) variable pressureMode = PressureWave[headStage][%Approach_Seal_BrkIn_Clear] @@ -1831,9 +1802,7 @@ End /// @brief Checks if all the pressure settings for a headStage are valid /// /// @returns 1 if all settings are valid, 0 otherwise -Function P_ValidatePressureSetHeadstage(device, headStageNo) - string device - variable headStageNo +Function P_ValidatePressureSetHeadstage(string device, variable headStageNo) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) WAVE/T PressureDataTxtWv = P_PressureDataTxtWaveRef(device) @@ -1960,9 +1929,7 @@ static Function P_ResetAll_P_ButtonsToBaseState(device) endfor End -Function P_PressureDisplayHighlite(device, hilite) - string device - variable hilite +Function P_PressureDisplayHighlite(string device, variable hilite) variable RGB string Zero, Low, High @@ -2096,6 +2063,7 @@ End /// @brief Disables devices for all locked DA_Ephys panels. Sets the correct pressure button state for all locked DA_Ephys panels. Function P_Disable() + string ListOfLockedDA_Ephys = GetListOfLockedDevices() variable i, numPressureDevices, numLocked string lockedDevice, listOfPressureCtrlDevices, device @@ -2162,17 +2130,15 @@ End /// @brief Saves user seleted headstage in pressureData wave /// -Function P_SaveUserSelectedHeadstage(device, headStage) - string device - variable headStage +Function P_SaveUserSelectedHeadstage(string device, variable headStage) + WAVE PressureDataWv = P_GetPressureDataWaveRef(device) PressureDataWv[][%UserSelectedHeadStage] = headStage End /// @brief Sets all headstage to atmospheric pressure /// -Function P_SetAllHStoAtmospheric(device) - string device +Function P_SetAllHStoAtmospheric(string device) DFREF dfr = P_DeviceSpecificPressureDFRef(device) WAVE/Z/SDFR=dfr PressureData @@ -2187,9 +2153,7 @@ End /// @brief Gets the pressure mode for a headstage /// -Function P_GetPressureMode(device, headStage) - string device - variable headstage +Function P_GetPressureMode(string device, variable headStage) return P_GetPressureDataWaveRef(device)[headStage][%Approach_Seal_BrkIn_Clear] End @@ -2201,11 +2165,7 @@ End /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// @param pressureMode One of the pressure modes defined in @ref PressureModeConstants /// @param pressure [optional, ignored by default. Sets pressure of manual mode] -Function P_SetPressureMode(device, headStage, pressureMode, [pressure]) - string device - variable headstage - variable pressureMode - variable pressure +Function P_SetPressureMode(string device, variable headStage, variable pressureMode, [variable pressure]) ASSERT(IsValidHeadstage(headStage), "Select headstage number between 0 and 7") ASSERT(pressureMode >= PRESSURE_METHOD_ATM && pressureMode <= PRESSURE_METHOD_MANUAL, "Select a pressure mode between -1 and 4") @@ -2244,8 +2204,7 @@ End // PRESSURE CONTROLS; DA_ePHYS PANEL; DATA ACQUISTION TAB /// @brief Approach button. -Function ButtonProc_Approach(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_Approach(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2259,15 +2218,14 @@ End /// @brief Sets approach state /// /// Handles the TP depency of the approach pressure application -Function P_SetApproach(device, cntrlName) - string device, cntrlName +Function P_SetApproach(string device, string cntrlName) + P_UpdatePressureMode(device, PRESSURE_METHOD_APPROACH, cntrlName, 1) P_RunP_ControlIfTPOFF(device) End /// @brief Seal button. -Function ButtonProc_Seal(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_Seal(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2279,8 +2237,7 @@ Function ButtonProc_Seal(ba) : ButtonControl End /// @brief Break in button. -Function ButtonProc_BreakIn(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_BreakIn(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2292,8 +2249,7 @@ Function ButtonProc_BreakIn(ba) : ButtonControl End /// @brief Clear button. -Function ButtonProc_Clear(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_Clear(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2312,8 +2268,7 @@ static Function P_SetManual(device, cntrlName) End /// @brief Clear all check box. -Function CheckProc_ClearEnable(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function CheckProc_ClearEnable(STRUCT WMCheckboxAction &cba) : CheckBoxControl variable headstage @@ -2337,8 +2292,7 @@ Function CheckProc_ClearEnable(cba) : CheckBoxControl End /// @brief Update DAC list button. -Function ButtonProc_Hrdwr_P_UpdtDAClist(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_Hrdwr_P_UpdtDAClist(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2364,8 +2318,7 @@ Function ButtonProc_Hrdwr_P_UpdtDAClist(ba) : ButtonControl End /// @brief Pressure control device Enable button in Hardware tab of DA_Ephys panel -Function P_ButtonProc_Enable(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function P_ButtonProc_Enable(STRUCT WMButtonAction &ba) : ButtonControl string device, msg variable result @@ -2393,8 +2346,7 @@ Function P_ButtonProc_Enable(ba) : ButtonControl End /// @brief Pressure control device Disable button in Hardware tab of DA_Ephys panel -Function P_ButtonProc_Disable(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function P_ButtonProc_Disable(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2406,8 +2358,7 @@ Function P_ButtonProc_Disable(ba) : ButtonControl End /// @brief Set pressure button. -Function ButtonProc_DataAcq_ManPressSet(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_DataAcq_ManPressSet(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2419,8 +2370,7 @@ Function ButtonProc_DataAcq_ManPressSet(ba) : ButtonControl End /// @brief Manual pressure pulse button. -Function ButtonProc_ManPP(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_ManPP(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -2432,8 +2382,7 @@ Function ButtonProc_ManPP(ba) : ButtonControl return 0 End -Function P_Check_ApproachNear(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function P_Check_ApproachNear(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -2447,8 +2396,7 @@ Function P_Check_ApproachNear(cba) : CheckBoxControl return 0 End -Function P_Check_SealAtm(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function P_Check_SealAtm(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -2461,8 +2409,7 @@ Function P_Check_SealAtm(cba) : CheckBoxControl return 0 End -Function P_ButtonProc_UserPressure(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function P_ButtonProc_UserPressure(STRUCT WMButtonAction &ba) : ButtonControl string userPressureDevice, device, msg variable hardwareType, deviceID, ADC, flags, result @@ -2534,8 +2481,7 @@ Function P_ButtonProc_UserPressure(ba) : ButtonControl End /// @brief Runs P_PressureControl if the TP is OFF -Function P_RunP_ControlIfTPOFF(device) - string device +Function P_RunP_ControlIfTPOFF(string device) if(!TP_CheckIfTestpulseIsRunning(device)) // P_PressureControl will be called from TP functions when the TP is running P_PressureControl(device) @@ -2544,8 +2490,8 @@ End /// @brief If auto-user-OFF is checked, then user access is turned off /// this function is run by the active headstage slider control -Function P_GetAutoUserOff(device) - string device +Function P_GetAutoUserOff(string device) + WAVE pressureDataWv = P_GetPressureDataWaveRef(device) if(DAG_GetNumericalValue(device, "check_DataACq_Pressure_AutoOFF") && DAG_GetNumericalValue(device, "check_DataACq_Pressure_User")) @@ -2583,8 +2529,7 @@ End /// @brief Encodes the pressure type for each headstage /// /// See also @ref PressureTypeConstants -Function P_UpdatePressureType(device) - string device +Function P_UpdatePressureType(string device) variable headstage diff --git a/Packages/MIES/MIES_ProgrammaticGUIControl.ipf b/Packages/MIES/MIES_ProgrammaticGUIControl.ipf index 2577caf509..da266ee969 100644 --- a/Packages/MIES/MIES_ProgrammaticGUIControl.ipf +++ b/Packages/MIES/MIES_ProgrammaticGUIControl.ipf @@ -76,60 +76,50 @@ End /// @name Prototype functions for #PGC_SetAndActivateControl /// @anchor PGC_SetAndActivateControlPrototypeFunctions ///@{ -Function PGC_ButtonControlProcedure(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function PGC_ButtonControlProcedure(STRUCT WMButtonAction &ba) : ButtonControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_PopupActionControlProcedure(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PGC_PopupActionControlProcedure(STRUCT WMPopupAction &pa) : PopupMenuControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_CheckboxControlProcedure(cba) : CheckBoxControl - STRUCT WMCheckBoxAction &cba +Function PGC_CheckboxControlProcedure(STRUCT WMCheckBoxAction &cba) : CheckBoxControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_TabControlProcedure(tca) : TabControl - STRUCT WMTabControlAction &tca +Function PGC_TabControlProcedure(STRUCT WMTabControlAction &tca) : TabControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_SetVariableControlProcedure(tca) : SetVariableControl - STRUCT WMSetVariableAction &tca +Function PGC_SetVariableControlProcedure(STRUCT WMSetVariableAction &tca) : SetVariableControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_SliderControlProcedure(sla) : SliderControl - STRUCT WMSliderAction &sla +Function PGC_SliderControlProcedure(STRUCT WMSliderAction &sla) : SliderControl ASSERT(0, "Prototype function which must not be called") End -Function PGC_ListBoxControlProcedure(lba) : ListBoxControl - STRUCT WMListBoxAction &lba +Function PGC_ListBoxControlProcedure(STRUCT WMListBoxAction &lba) : ListBoxControl ASSERT(0, "Prototype function which must not be called") End ///@} /// @brief Wrapper for PGC_SetAndActivateControl() -Function PGC_SetAndActivateControlStr(win, control, str) - string win, control, str +Function PGC_SetAndActivateControlStr(string win, string control, string str) return PGC_SetAndActivateControl(win, control, str = str) End /// @brief Wrapper for PGC_SetAndActivateControl() -Function PGC_SetAndActivateControlVar(win, control, var) - string win, control - variable var +Function PGC_SetAndActivateControlVar(string win, string control, variable var) return PGC_SetAndActivateControl(win, control, val = var) End @@ -170,6 +160,7 @@ End /// @hidecallgraph /// @hidecallergraph Function PGC_SetAndActivateControl(string win, string control, [variable val, string str, variable switchTab, variable mode]) + string procedure, popupMenuList, popupMenuValue variable paramType, controlType, variableType, inputWasModified, limitedVal variable isCheckbox, checkBoxMode, popupMenuType, index @@ -404,13 +395,13 @@ Function PGC_SetAndActivateControl(string win, string control, [variable val, st case CONTROL_TYPE_LISTBOX: ASSERT(!ParamIsDefault(val) && ParamIsDefault(str), "Needs a variable argument") - WAVE/T/Z listWave = $GetValueFromRecMacro("listWave", S_recreation) + WAVE/Z/T listWave = $GetValueFromRecMacro("listWave", S_recreation) ASSERT(WaveExists(listWave), "Can't call ListBox without list wave") // all optional WAVE/Z selWave = $GetValueFromRecMacro("selWave", S_recreation) WAVE/Z colorWave = $GetValueFromRecMacro("colorWave", S_recreation) - WAVE/T/Z titleWave = $GetValueFromRecMacro("titleWave", S_recreation) + WAVE/Z/T titleWave = $GetValueFromRecMacro("titleWave", S_recreation) ASSERT(val >= 0 && val < DimSize(listWave, ROWS), "val is out of range") @@ -423,11 +414,11 @@ Function PGC_SetAndActivateControl(string win, string control, [variable val, st STRUCT WMListBoxAction lba lba.ctrlName = control lba.win = win - lba.eventCode = 3 // double click + lba.eventCode = 3 // double click WAVE/Z lba.colorWave = colorWave - WAVE/T/Z lba.listWave = listWave + WAVE/Z/T lba.listWave = listWave WAVE/Z lba.selWave = selWave - WAVE/T/Z lba.titleWave = titleWave + WAVE/Z/T lba.titleWave = titleWave lba.row = val lba.col = -1 diff --git a/Packages/MIES/MIES_Publish.ipf b/Packages/MIES/MIES_Publish.ipf index 534719401e..873ef16805 100644 --- a/Packages/MIES/MIES_Publish.ipf +++ b/Packages/MIES/MIES_Publish.ipf @@ -88,6 +88,7 @@ End /// /// \endrst Function PUB_AutoBridgeBalance(string device, variable headstage, variable resistance) + variable jsonID jsonID = PUB_GetJSONTemplate(device, headstage) @@ -153,6 +154,7 @@ End /// /// \endrst Function PUB_PipetteInBath(string device, variable sweepNo, variable headstage) + variable jsonID string key @@ -219,6 +221,7 @@ End /// /// \endrst Function PUB_SealEvaluation(string device, variable sweepNo, variable headstage) + variable jsonID string key @@ -275,6 +278,7 @@ End /// /// \endrst Function PUB_TrueRestingMembranePotential(string device, variable sweepNo, variable headstage) + variable jsonID string key @@ -314,6 +318,7 @@ End /// /// \endrst Function PUB_ClampModeChange(string device, variable headstage, variable oldClampMode, variable newClampMode) + variable jsonID string payload @@ -349,6 +354,7 @@ End /// /// \endrst Function PUB_PressureMethodChange(string device, variable headstage, variable oldMethod, variable newMethod) + variable jsonID if(EqualValuesOrBothNaN(oldMethod, newMethod)) @@ -380,6 +386,7 @@ End /// /// \endrst Function PUB_PressureSealedState(string device, variable headstage) + variable jsonID jsonID = PUB_GetJSONTemplate(device, headstage) @@ -405,6 +412,7 @@ End /// /// \endrst Function PUB_PressureBreakin(string device, variable headstage) + variable jsonID jsonID = PUB_GetJSONTemplate(device, headstage) @@ -521,6 +529,7 @@ End /// /// The strings for `daq`/`tp` are either `starting` or `stopping`. Function PUB_DAQStateChange(string device, variable mode, variable oldState, variable newState) + variable jsonID string name, name_null @@ -615,6 +624,7 @@ End /// /// \endrst Function PUB_AccessResistanceSmoke(string device, variable sweepNo, variable headstage) + variable jsonID string key diff --git a/Packages/MIES/MIES_PulseAveraging.ipf b/Packages/MIES/MIES_PulseAveraging.ipf index bfe019d5fb..5da5f7f545 100644 --- a/Packages/MIES/MIES_PulseAveraging.ipf +++ b/Packages/MIES/MIES_PulseAveraging.ipf @@ -128,6 +128,7 @@ End /// /// Only present for #PA_DISPLAYMODE_IMAGES graphs. Function/S PA_GetColorScalePanel(string win) + return win + "#P0" End @@ -135,6 +136,7 @@ End /// /// Only present for #PA_DISPLAYMODE_IMAGES graphs. Function/S PA_GetColorScaleGraph(string win) + return PA_GetColorScalePanel(win) + "#G0" End @@ -340,10 +342,7 @@ End /// @param channelTypeStr Type of the channel, one of @ref XOP_CHANNEL_NAMES /// /// @return invalid wave reference if no pulses could be found or 2D wave see GetPulseInfoWave() -Function/WAVE PA_GetPulseInfos(traceData, idx, region, channelTypeStr) - WAVE/T traceData - variable idx, region - string channelTypeStr +Function/WAVE PA_GetPulseInfos(WAVE/T traceData, variable idx, variable region, string channelTypeStr) variable sweepNo, totalOnsetDelay, channel string str, fullPath @@ -638,8 +637,8 @@ static Function [WAVE/D sweeps, WAVE/T experiments] PA_GetSweepsAndExperimentsFr for(i = 0; i < numIndices; i += 1) [sweepNo, experiment] = OVS_GetSweepAndExperiment(win, additionalData[i]) - sweeps[i] = sweepNo - experiments[i] = experiment + sweeps[i] = sweepNo + experiments[i] = experiment endfor return [sweeps, experiments] @@ -677,7 +676,7 @@ static Function [STRUCT PulseAverageSetIndices pasi] PA_GenerateAllPulseWaves(st string channelTypeStr, channelList, regionChannelList, channelNumberStr, key, regionList, sweepList, sweepNoStr, experiment string oldRegionList, oldChannelList - WAVE/T/Z traceData = GetTraceInfos(GetMainWindow(win), addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"AD", "1"}) + WAVE/Z/T traceData = GetTraceInfos(GetMainWindow(win), addFilterKeys = {"channelType", "AssociatedHeadstage"}, addFilterValues = {"AD", "1"}) if(!WaveExists(traceData)) KillorMoveToTrash(dfr = GetDevicePulseAverageHelperFolder(pa.dfr)) return [pasi] @@ -761,7 +760,7 @@ static Function [STRUCT PulseAverageSetIndices pasi] PA_GenerateAllPulseWaves(st totalPulseCounter = GetNumberFromWaveNote(properties, NOTE_INDEX) SetNumberInWaveNote(properties, NOTE_PA_NEW_PULSES_START, totalPulseCounter) - WAVE/WAVE/Z setIndices + WAVE/Z/WAVE setIndices WAVE/Z junk1, junk2, indexHelper [setIndices, junk1, junk2, indexHelper] = PA_GetSetIndicesHelper(pulseAverageHelperDFR, 0) if(WaveExists(setIndices)) @@ -1010,7 +1009,7 @@ static Function [STRUCT PulseAverageSetIndices pasi] PA_InitPASIInParts(STRUCT P WAVE pasi.properties = GetPulseAverageProperties(pasi.pulseAverageHelperDFR) WAVE/WAVE pasi.propertiesWaves = GetPulseAveragePropertiesWaves(pasi.pulseAverageHelperDFR) - WAVE/WAVE/Z setIndices + WAVE/Z/WAVE setIndices WAVE/Z channels, regions, indexHelper [setIndices, channels, regions, indexHelper] = PA_GetSetIndicesHelper(pasi.pulseAverageHelperDFR, 0) if(!WaveExists(setIndices)) @@ -1119,7 +1118,7 @@ End static Function PA_UpdateIndiceNotes(WAVE currentDisplayMapping, WAVE prevDisplayMapping, STRUCT PulseAverageSetIndices &pasi, variable layoutChanged) if(layoutChanged) - WAVE/WAVE/Z setIndices + WAVE/Z/WAVE setIndices WAVE/Z channels, regions, indexHelper [setIndices, channels, regions, indexHelper] = PA_GetSetIndicesHelper(pasi.pulseAverageHelperDFR, 1) if(WaveExists(setIndices)) @@ -1663,8 +1662,8 @@ static Function/S PA_ShowPulses(string win, STRUCT PulseAverageSettings &pa, STR alpha = 65535 else hideTrace = 0 - [s] = GetTraceColor(properties[idx][PA_PROPERTIES_INDEX_HEADSTAGE]) - alpha = 65535 * 0.2 + [s] = GetTraceColor(properties[idx][PA_PROPERTIES_INDEX_HEADSTAGE]) + alpha = 65535 * 0.2 endif WAVE plotWave = propertiesWaves[idx][PA_PROPERTIESWAVES_INDEX_PULSE] @@ -1754,9 +1753,9 @@ static Function/S PA_ShowPulses(string win, STRUCT PulseAverageSettings &pa, STR sprintf traceName, "Ovl_%s%s", PA_AVERAGE_WAVE_PREFIX, baseName if(WaveExists(averageTraceNames)) - WAVE/T/Z foundTraces = GrepTextWave(averageTraceNames, "^.*" + PA_AVERAGE_WAVE_PREFIX + basename + "$") + WAVE/Z/T foundTraces = GrepTextWave(averageTraceNames, "^.*" + PA_AVERAGE_WAVE_PREFIX + basename + "$") else - WAVE/T/Z foundTraces = $"" + WAVE/Z/T foundTraces = $"" endif if(!(cs.showAverage && cs.multipleGraphs) || graphWasReset) @@ -1795,9 +1794,9 @@ static Function/S PA_ShowPulses(string win, STRUCT PulseAverageSettings &pa, STR sprintf traceName, "Ovl_%s%s", PA_DECONVOLUTION_WAVE_PREFIX, baseName if(WaveExists(deconvolutionTraceNames)) - WAVE/T/Z foundTraces = GrepTextWave(deconvolutionTraceNames, "^.*" + PA_DECONVOLUTION_WAVE_PREFIX + basename + "$") + WAVE/Z/T foundTraces = GrepTextWave(deconvolutionTraceNames, "^.*" + PA_DECONVOLUTION_WAVE_PREFIX + basename + "$") else - WAVE/T/Z foundTraces = $"" + WAVE/Z/T foundTraces = $"" endif if(WaveExists(foundTraces)) @@ -2097,14 +2096,14 @@ static Function PA_CalculateAllAverages(STRUCT PulseAverageSettings &pa, STRUCT Multithread/NT=(numThreads) setWaves2AllNewOld[][] = PA_GetSetWaves_TS(pasi.properties, pasi.propertiesWaves, pasi.setIndices[p][q], PA_GETSETWAVES_ALL | PA_GETSETWAVES_NEW | PA_GETSETWAVES_OLD, 1) Multithread/NT=(numThreads) setWavesAll[][] = PA_ExtractPulseSetFromSetWaves2(WaveRef(setWaves2AllNewOld[p][q], row = 0)) keyAll = CA_AveragingWaveModKey(setWavesAll) - WAVE/WAVE/Z cache = CA_TryFetchingEntryFromCache(keyAll, options = CA_OPTS_NO_DUPLICATE) + WAVE/Z/WAVE cache = CA_TryFetchingEntryFromCache(keyAll, options = CA_OPTS_NO_DUPLICATE) if(!WaveExists(cache)) DEBUGPRINT("Cache miss all data:", str = keyAll) // we have to calculate if(mode == POST_PLOT_ADDED_SWEEPS) Multithread/NT=(numThreads) setWavesOld[][] = PA_ExtractPulseSetFromSetWaves2(WaveRef(setWaves2AllNewOld[p][q], row = 2)) keyOld = CA_AveragingWaveModKey(setWavesOld) - WAVE/WAVE/Z cache = CA_TryFetchingEntryFromCache(keyOld, options = CA_OPTS_NO_DUPLICATE) + WAVE/Z/WAVE cache = CA_TryFetchingEntryFromCache(keyOld, options = CA_OPTS_NO_DUPLICATE) if(WaveExists(cache)) DEBUGPRINT("Cache hit old data (for incremental):", str = keyOld) Multithread/NT=(numThreads) setWavesNew[][] = PA_ExtractPulseSetFromSetWaves2(WaveRef(setWaves2AllNewOld[p][q], row = 1)) @@ -2180,7 +2179,7 @@ static Function PA_MakeAverageWavePermanent(DFREF dfr, WAVE/Z avg, variable chan endif End -threadsafe static Function/WAVE PA_ExtractPulseSetFromSetWaves2(WAVE/WAVE/Z setWave2) +threadsafe static Function/WAVE PA_ExtractPulseSetFromSetWaves2(WAVE/Z/WAVE setWave2) if(!WaveExists(setWave2)) return $"" @@ -2225,6 +2224,7 @@ End /// want to update only after the mouse wheel triggered the axis range change. /// And that is only possible with the operation queue. Function PA_UpdateScaleBars(string win, variable resetToUserLength) + variable displayMode string bsPanel STRUCT PulseAverageSetIndices pasi @@ -2393,15 +2393,15 @@ static Function PA_DrawScaleBarsHelper(string win, variable axisMode, variable d break case PA_DISPLAYMODE_IMAGES: [vert_min, vert_max, horiz_min, horiz_max] = PA_GetMinAndMax(setWaves2) - vert_min = -0.5 - vert_max = NaN + vert_min = -0.5 + vert_max = NaN break default: ASSERT(0, "Invalid display mode") endswitch break case PA_USE_AXIS_SCALES: - [vert_min, vert_max] = GetAxisRange(graph, vertAxis, mode = AXIS_RANGE_INC_AUTOSCALED) + [vert_min, vert_max] = GetAxisRange(graph, vertAxis, mode = AXIS_RANGE_INC_AUTOSCALED) [horiz_min, horiz_max] = GetAxisRange(graph, horizAxis, mode = AXIS_RANGE_INC_AUTOSCALED) break default: @@ -2430,8 +2430,8 @@ static Function PA_DrawScaleBarsHelper(string win, variable axisMode, variable d userLength = ylength yLength = sign(userLength) * CalculateNiceLength(0.10 * abs(vert_max - vert_min), abs(userLength)) - name = PA_USER_DATA_CALC_YLENGTH + "_" + vertAxis - userLengthName = PA_USER_DATA_USER_YLENGTH + "_" + vertAxis + name = PA_USER_DATA_CALC_YLENGTH + "_" + vertAxis + userLengthName = PA_USER_DATA_USER_YLENGTH + "_" + vertAxis [forceScaleBar, yLength] = PA_NeedsForcedScaleBar(win, name, ylength, vert_min, vert_max, userLength = userLength, userLengthName = userLengthName, resetToUserLength = resetToUserLength) xBarBottom = str2num(GetUserData(win, "", PA_USER_DATA_X_START_RELATIVE_PREFIX + horizAxis)) @@ -2476,7 +2476,7 @@ static Function PA_DrawScaleBarsHelper(string win, variable axisMode, variable d sprintf msg, "X: (R%d, C%d)\r", activeRegionCount, activeChanCount DEBUGPRINT(msg) - name = PA_USER_DATA_CALC_XLENGTH + "_" + horizAxis + name = PA_USER_DATA_CALC_XLENGTH + "_" + horizAxis [forceScaleBar, xLength] = PA_NeedsForcedScaleBar(win, name, xlength, horiz_min, horiz_max) drawLength = forceScaleBar || ((activeChanCount == numActive) && (activeRegionCount == numActive)) @@ -2591,6 +2591,7 @@ End /// @brief Generate the wave name for a single pulse Function/S PA_GeneratePulseWaveName(variable channelType, variable channelNumber, variable region, variable pulseIndex) + ASSERT(channelType < ItemsInList(XOP_CHANNEL_NAMES), "Invalid channel type") ASSERT(channelNumber < GetNumberFromType(xopVar = channelType), "Invalid channel number") ASSERT(IsInteger(pulseIndex) && pulseIndex >= 0, "Invalid pulseIndex") @@ -2600,8 +2601,7 @@ Function/S PA_GeneratePulseWaveName(variable channelType, variable channelNumber End /// @brief Generate a static base name for objects in the current averaging folder -Function/S PA_BaseName(channelNumber, headStage) - variable channelNumber, headStage +Function/S PA_BaseName(variable channelNumber, variable headStage) string baseName baseName = "AD" + num2str(channelNumber) @@ -2703,8 +2703,7 @@ static Function/WAVE PA_Deconvolution(average, outputDFR, outputWaveName, deconv return wv End -Function PA_CheckProc_Common(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function PA_CheckProc_Common(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -2715,8 +2714,7 @@ Function PA_CheckProc_Common(cba) : CheckBoxControl return 0 End -Function PA_SetVarProc_Common(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function PA_SetVarProc_Common(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -2735,8 +2733,7 @@ Function PA_SetVarProc_Common(sva) : SetVariableControl return 0 End -Function PA_PopMenuProc_ColorScale(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PA_PopMenuProc_ColorScale(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -2747,8 +2744,7 @@ Function PA_PopMenuProc_ColorScale(pa) : PopupMenuControl return 0 End -Function PA_PopMenuProc_Common(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PA_PopMenuProc_Common(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -3087,8 +3083,8 @@ static Function PA_AddColorScales(string win, STRUCT PulseAverageSettings &pa, S for(i = 0; i < numActive; i += 1) [minimum, maximum] = SymmetrizeRangeAroundZero(minimumRows[i], maximumRows[i]) - minimumRows[i] = minimum - maximumRows[i] = maximum + minimumRows[i] = minimum + maximumRows[i] = maximum endfor endif @@ -3519,7 +3515,7 @@ static Function/S PA_ShowImage(string win, STRUCT PulseAverageSettings &pa, STRU colStart = numPulses colEnd = numPulses + specialEntryHeight AssertOnAndClearRTError() - Multithread img[][colStart, colEnd - 1] = averageWave(x); err = GetRTError(1) // see developer docu section Preventing Debugger Popup + Multithread img[][colStart, colEnd - 1] = averageWave(x); err = GetRTError(1) // see developer docu section Preventing Debugger Popup val = leftx(averageWave) if(refScaleLeft != val && val > refScaleLeft + refScaleDelta) img[0, ScaleToIndexWrapper(img, val, ROWS)][colStart, colEnd - 1] = NaN @@ -3689,8 +3685,7 @@ static Function PA_ResizeColorScalePanel(string imageGraph) MoveSubWindow/W=$colorScalePanel fnum=(0, 0, PA_COLORSCALE_PANEL_WIDTH, graphHeight) End -Function PA_TraceWindowHook(s) - STRUCT WMWinHookStruct &s +Function PA_TraceWindowHook(STRUCT WMWinHookStruct &s) string traceGraph @@ -3713,8 +3708,7 @@ Function PA_TraceWindowHook(s) return 0 End -Function PA_ImageWindowHook(s) - STRUCT WMWinHookStruct &s +Function PA_ImageWindowHook(STRUCT WMWinHookStruct &s) string imageGraph diff --git a/Packages/MIES/MIES_RepeatedAcquisition.ipf b/Packages/MIES/MIES_RepeatedAcquisition.ipf index 8d612a3058..b021c9f76c 100644 --- a/Packages/MIES/MIES_RepeatedAcquisition.ipf +++ b/Packages/MIES/MIES_RepeatedAcquisition.ipf @@ -157,8 +157,7 @@ static Function RA_GetTotalNumberOfSweeps(device) End /// @brief Update the "Sweeps remaining" control -Function RA_StepSweepsRemaining(device) - string device +Function RA_StepSweepsRemaining(string device) if(DAG_GetNumericalValue(device, "Check_DataAcq1_RepeatAcq")) variable numTotalSweeps = RA_GetTotalNumberOfSweeps(device) @@ -191,8 +190,7 @@ static Function RA_Start(device) RA_HandleITI(device) End -Function RA_Counter(device) - string device +Function RA_Counter(string device) variable numTotalSweeps, runMode string str @@ -289,8 +287,7 @@ static Function RA_StartMD(device) RA_HandleITI_MD(device) End -Function RA_CounterMD(device) - string device +Function RA_CounterMD(string device) variable numTotalSweeps NVAR count = $GetCount(device) @@ -346,8 +343,7 @@ End /// @brief Return one if we are acquiring currently the very first sweep of a /// possible repeated acquisition cycle. Zero means that we acquire a later /// sweep than the first one in a repeated acquisition cycle. -Function RA_IsFirstSweep(device) - string device +Function RA_IsFirstSweep(string device) NVAR count = $GetCount(device) return !count @@ -362,9 +358,7 @@ End /// @param limitToSetBorder [optional, defaults to false] Limits skipCount so /// that we don't skip further than after the last sweep of the /// stimset with the most number of sweeps. -Function RA_SkipSweeps(device, skipCount, source, [limitToSetBorder]) - string device - variable source, skipCount, limitToSetBorder +Function RA_SkipSweeps(string device, variable skipCount, variable source, [variable limitToSetBorder]) variable sweepsInSet, recalculatedCount string msg @@ -510,9 +504,7 @@ End /// /// @param device device /// @param multiDevice [optional, defaults to false] DAQ mode -Function RA_ContinueOrStop(device, [multiDevice]) - string device - variable multiDevice +Function RA_ContinueOrStop(string device, [variable multiDevice]) if(ParamIsDefault(multiDevice)) multiDevice = 0 diff --git a/Packages/MIES/MIES_SamplingInterval.ipf b/Packages/MIES/MIES_SamplingInterval.ipf index d6fbf1f138..8ca67e41f6 100644 --- a/Packages/MIES/MIES_SamplingInterval.ipf +++ b/Packages/MIES/MIES_SamplingInterval.ipf @@ -212,9 +212,7 @@ static Function/WAVE SI_LoadMinSampIntFromDisk(string deviceType) End /// @brief Store the lookup wave on disc -Function/WAVE SI_StoreMinSampIntOnDisk(wv, deviceType) - WAVE wv - string deviceType +Function/WAVE SI_StoreMinSampIntOnDisk(WAVE wv, string deviceType) Duplicate wv, $("SampInt_" + deviceType)/WAVE=storedWave @@ -259,9 +257,7 @@ End /// /// @param device device, must be locked /// @param ignoreChannelOrder [optional: defaults to false] ignore the order of the active channels -Function SI_CreateLookupWave(device, [ignoreChannelOrder]) - string device - variable ignoreChannelOrder +Function SI_CreateLookupWave(string device, [variable ignoreChannelOrder]) variable i, j, k, numChannels, numPerms, ret, idx, numRows variable totalNumDA, totalNumAD, totalNumTTL, totalNumRacks, calcSampInt @@ -484,9 +480,7 @@ End #else -Function SI_CreateLookupWave(device, [ignoreChannelOrder]) - string device - variable ignoreChannelOrder +Function SI_CreateLookupWave(string device, [variable ignoreChannelOrder]) DEBUGPRINT("Unimplemented") End @@ -601,7 +595,7 @@ static Function/WAVE SI_GetMinSampIntWave(device) strswitch(deviceType) case "ITC18USB": case "ITC18": - WAVE/SDFR=dfr/Z wv = SampInt_ITC18USB + WAVE/Z/SDFR=dfr wv = SampInt_ITC18USB if(!WaveExists(wv)) return SI_LoadMinSampIntFromDisk("ITC18USB") @@ -611,7 +605,7 @@ static Function/WAVE SI_GetMinSampIntWave(device) break case "ITC16USB": case "ITC16": - WAVE/SDFR=dfr/Z wv = SampInt_ITC16USB + WAVE/Z/SDFR=dfr wv = SampInt_ITC16USB if(!WaveExists(wv)) return SI_LoadMinSampIntFromDisk("ITC16USB") @@ -620,7 +614,7 @@ static Function/WAVE SI_GetMinSampIntWave(device) return wv break case "ITC1600": - WAVE/SDFR=dfr/Z wv = SampInt_ITC1600 + WAVE/Z/SDFR=dfr wv = SampInt_ITC1600 if(!WaveExists(wv)) return SI_LoadMinSampIntFromDisk(deviceType) endif diff --git a/Packages/MIES/MIES_StimsetAPI.ipf b/Packages/MIES/MIES_StimsetAPI.ipf index 168ff46942..eb468be947 100644 --- a/Packages/MIES/MIES_StimsetAPI.ipf +++ b/Packages/MIES/MIES_StimsetAPI.ipf @@ -96,7 +96,7 @@ static Function [variable resultColumn, variable resultLayer] ST_GetResultWaveCo endif epochType = SegWvType[epochIndex] - WAVE/T/Z existingParams = ST_GetStimsetParametersEpochType(setName, epochType) + WAVE/Z/T existingParams = ST_GetStimsetParametersEpochType(setName, epochType) if(!WaveExists(existingParams)) // no such epoch type @@ -193,6 +193,7 @@ End /// /// @ingroup StimsetAPIFunctions Function/S ST_GetStimsetList([variable channelType, string searchString, string &WBstimSetList, string &thirdPartyStimSetList]) + string listAll = "" string listInternal = "" string listThirdParty = "" @@ -292,6 +293,7 @@ End /// /// @ingroup StimsetAPIFunctions Function ST_RemoveStimSet(string setName) + variable i, numPanels, channelType string lockedDevices, device @@ -337,6 +339,7 @@ End /// /// @ingroup StimsetAPIFunctions Function ST_GetStimsetParameterAsVariable(string setName, string entry, [variable epochIndex]) + variable row, col, layer if(ParamIsDefault(epochIndex)) @@ -366,6 +369,7 @@ End /// /// @ingroup StimsetAPIFunctions Function/S ST_GetStimsetParameterAsString(string setName, string entry, [variable epochIndex]) + variable row, col, layer string entryStringValues @@ -381,7 +385,7 @@ Function/S ST_GetStimsetParameterAsString(string setName, string entry, [variabl [WAVE wv, row, col, layer] = ST_GetStimsetParameterWaveIndexTuple(setName, entry, epochIndex) - WAVE/T/Z wvText = wv + WAVE/Z/T wvText = wv if(WaveExists(wvText)) if(IsTextWave(wvText)) @@ -414,6 +418,7 @@ End /// /// @ingroup StimsetAPIFunctions Function ST_SetStimsetParameter(string setName, string entry, [variable epochIndex, variable var, string str]) + variable numEpochs, epochType, row, col, layer, stimulusType variable strIsGiven, varIsGiven string entryStringValues diff --git a/Packages/MIES/MIES_Structures.ipf b/Packages/MIES/MIES_Structures.ipf index be82e0798c..e3919d424f 100644 --- a/Packages/MIES/MIES_Structures.ipf +++ b/Packages/MIES/MIES_Structures.ipf @@ -44,8 +44,7 @@ Structure PostPlotSettings STRUCT PulseAverageSettings pulseAverSett EndStructure -Function InitPulseAverageSettings(pa) - STRUCT PulseAverageSettings &pa +Function InitPulseAverageSettings(STRUCT PulseAverageSettings &pa) pa.enabled = 0 pa.showIndividualPulses = NaN @@ -174,8 +173,7 @@ Structure FormulaProperties variable numRows, numCols /// minimum number of rows and colums in the referenced sets EndStructure -Function InitFormulaProperties(fp) - STRUCT FormulaProperties &fp +Function InitFormulaProperties(STRUCT FormulaProperties &fp) fp.formula = "" fp.stimsetList = "" @@ -191,11 +189,7 @@ Structure WaveLocationMod string newName ///< new name of the wave (can be null/empty) EndStructure -Function InitOOdDAQParams(params, stimSets, setColumns, preFeatureTime, postFeatureTime) - STRUCT OOdDAQParams ¶ms - WAVE/WAVE stimSets - WAVE setColumns - variable preFeatureTime, postFeatureTime +Function InitOOdDAQParams(STRUCT OOdDAQParams ¶ms, WAVE/WAVE stimSets, WAVE setColumns, variable preFeatureTime, variable postFeatureTime) ASSERT(DimSize(stimSets, ROWS) >= 1, "Stimsets wave is empty") ASSERT(preFeatureTime >= 0, "Unexpected pre feature time") @@ -286,8 +280,7 @@ Structure AnalysisFunction_V3 variable sampleIntervalAD EndStructure -Function InitDeltaControlNames(s) - STRUCT DeltaControlNames &s +Function InitDeltaControlNames(STRUCT DeltaControlNames &s) s.main = "" s.delta = "" @@ -324,8 +317,7 @@ Structure RectD double right EndStructure -Function InitRectD(s) - STRUCT RectD &s +Function InitRectD(STRUCT RectD &s) s.left = NaN s.right = NaN diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index 081d0d4614..fa9e649cd1 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -224,6 +224,7 @@ Menu "GraphPopup" End Function SF_BringBrowserToFront() + string browser, graph graph = GetMainWindow(GetCurrentWindow()) @@ -394,11 +395,11 @@ static Function SF_FormulaParser(string formula, [variable &createdArray, variab endfor if(lastAction != SF_ACTION_UNINITIALIZED) - SFH_ASSERT(state != SF_STATE_ADDITION && \ - state != SF_STATE_SUBTRACTION && \ - state != SF_STATE_MULTIPLICATION && \ - state != SF_STATE_DIVISION \ - , "Expected value after +, -, * or /", jsonId = jsonId) + SFH_ASSERT(state != SF_STATE_ADDITION && \ + state != SF_STATE_SUBTRACTION && \ + state != SF_STATE_MULTIPLICATION && \ + state != SF_STATE_DIVISION, \ + "Expected value after +, -, * or /", jsonId = jsonId) endif SFH_ASSERT(state != SF_STATE_ARRAYELEMENT, "Expected value after \",\"", jsonId = jsonId) @@ -445,11 +446,11 @@ static Function [variable jsonId, string jsonPath, variable lastCalculation, var switch(action) case SF_ACTION_FUNCTION: - parenthesisStart = strsearch(buffer, "(", 0, 0) - functionName = buffer[0, parenthesisStart - 1] + parenthesisStart = strsearch(buffer, "(", 0, 0) + functionName = buffer[0, parenthesisStart - 1] [functionName, jsonPath] = SF_ParserEvaluatePossibleSign(jsonId, indentLevel) - tempPath = SF_ParserAdaptSubPath(jsonId, jsonPath, functionName) - subId = SF_FormulaParser(buffer[parenthesisStart + 1, Inf], createdArray = wasArrayCreated, indentLevel = indentLevel + 1) + tempPath = SF_ParserAdaptSubPath(jsonId, jsonPath, functionName) + subId = SF_FormulaParser(buffer[parenthesisStart + 1, Inf], createdArray = wasArrayCreated, indentLevel = indentLevel + 1) SF_FPAddArray(jsonId, tempPath, subId, wasArrayCreated) break case SF_ACTION_PARENTHESIS: @@ -872,7 +873,7 @@ static Function/WAVE SF_FormulaExecutor(string graph, variable jsonID, [string j Make/FREE/D/N=0 indicesOfOperationsWithScalarResult WAVE/ZZ out - WAVE/T/ZZ outT + WAVE/ZZ/T outT // Get indices of Objects, Arrays and Strings on current level EXTRACT/FREE/INDX types, arrElemAt, (types[p] == JSON_OBJECT) || (types[p] == JSON_ARRAY) || (types[p] == JSON_STRING) || (types[p] == JSON_NUMERIC) @@ -1229,7 +1230,7 @@ static Function [WAVE/WAVE formulaResults, STRUCT SF_PlotMetaData plotMetaData] WAVE/WAVE formulaResults = GetFormulaGatherWave() - WAVE/WAVE/Z wvXRef = $"" + WAVE/Z/WAVE wvXRef = $"" if(!IsEmpty(xFormula)) WAVE/WAVE wvXRef = SF_ExecuteFormula(xFormula, graph, useVariables = 0) SFH_ASSERT(WaveExists(wvXRef), "x part of formula returned no result.") @@ -1523,7 +1524,7 @@ Function [STRUCT RGBColor s] SF_GetTraceColor(string graph, string opStack, WAVE [s] = GetHeadstageColor(NaN, channelType = channelType, channelNumber = channelNumber) else headstage = GetHeadstageForChannel(numericalValues, sweepNo, channelType, channelNumber, DATA_ACQUISITION_MODE) - [s] = GetHeadstageColor(headstage) + [s] = GetHeadstageColor(headstage) endif return [s] @@ -1638,9 +1639,9 @@ static Function [WAVE/T plotGraphs, WAVE/WAVE infos] SF_PreparePlotter(string wi endif if(WindowExists(win)) - WAVE/T/Z axes = GetAxesProperties(win) - WAVE/T/Z cursors = GetCursorInfos(win) - WAVE/T/Z annoInfo = GetAnnotationInfo(win) + WAVE/Z/T axes = GetAxesProperties(win) + WAVE/Z/T cursors = GetCursorInfos(win) + WAVE/Z/T annoInfo = GetAnnotationInfo(win) if(WaveExists(cursors) && winDisplayMode == SF_DM_SUBWINDOWS) restoreCursorInfo = 1 @@ -1731,7 +1732,7 @@ static Function SF_CommonWindowSetup(string win, string graph) DoWindow/T $win, newTitle End -static Function/WAVE SF_GatherYUnits(WAVE/WAVE formulaResults, string explicitLbl, WAVE/T/Z yUnits) +static Function/WAVE SF_GatherYUnits(WAVE/WAVE formulaResults, string explicitLbl, WAVE/Z/T yUnits) variable i, size, numData @@ -1853,7 +1854,7 @@ static Function SF_FormulaPlotter(string graph, string formula, [variable dmMode showLegend = 1 formulaCounter = 0 WAVE/Z wvX = $"" - WAVE/T/Z yUnits = $"" + WAVE/Z/T yUnits = $"" formulasRemain = graphCode[j] @@ -1877,7 +1878,7 @@ static Function SF_FormulaPlotter(string graph, string formula, [variable dmMode [xFormula, yFormula] = SF_SplitGraphsToFormula(yAndXFormula) SFH_ASSERT(!IsEmpty(yFormula), "Could not determine y [vs x] formula pair.") - WAVE/WAVE/Z formulaResults = $"" + WAVE/Z/WAVE formulaResults = $"" try [formulaResults, plotMetaData] = SF_GatherFormulaResults(xFormula, yFormula, graph) catch @@ -2478,7 +2479,7 @@ static Function/WAVE SF_GetSelectData(string graph, STRUCT SF_SelectParameters & endif if(fromDisplayed) - WAVE/T/Z traces = GetTraceInfos(graph) + WAVE/Z/T traces = GetTraceInfos(graph) if(!WaveExists(traces)) return $"" endif @@ -2529,13 +2530,13 @@ static Function/WAVE SF_GetSelectData(string graph, STRUCT SF_SelectParameters & WAVE textualValues = $traces[j][dimPosTTextualValues] if(!IsNaN(filter.setCycleCount)) [WAVE setting, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, "Set Cycle Count", channelNumber, channelType, DATA_ACQUISITION_MODE) - setCycleCount = WaveExists(setting) ? setting[index] : NaN + setCycleCount = WaveExists(setting) ? setting[index] : NaN else setCycleCount = NaN endif if(!IsNaN(filter.setSweepCount)) [WAVE setting, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, "Set Sweep Count", channelNumber, channelType, DATA_ACQUISITION_MODE) - setSweepCount = WaveExists(setting) ? setting[index] : NaN + setSweepCount = WaveExists(setting) ? setting[index] : NaN else setSweepCount = NaN endif @@ -2655,15 +2656,15 @@ static Function/WAVE SF_GetSelectData(string graph, STRUCT SF_SelectParameters & if(SF_FilterByClampModeEnabled(filter.clampMode, channelType)) [WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, CLAMPMODE_ENTRY_KEY, l, channelType, DATA_ACQUISITION_MODE) - clampCode = WaveExists(setting) ? SF_MapClampModeToSelectCM(setting[index]) : SF_OP_SELECT_CLAMPCODE_NONE + clampCode = WaveExists(setting) ? SF_MapClampModeToSelectCM(setting[index]) : SF_OP_SELECT_CLAMPCODE_NONE endif if(!IsNaN(filter.setCycleCount)) [WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, "Set Cycle Count", l, channelType, DATA_ACQUISITION_MODE) - setCycleCount = WaveExists(setting) ? setting[index] : NaN + setCycleCount = WaveExists(setting) ? setting[index] : NaN endif if(!IsNaN(filter.setSweepCount)) [WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, "Set Sweep Count", l, channelType, DATA_ACQUISITION_MODE) - setSweepCount = WaveExists(setting) ? setting[index] : NaN + setSweepCount = WaveExists(setting) ? setting[index] : NaN endif if(!SF_IsValidSingleSelection(filter, numericalValues, textualValues, sweepNo, channelNumber, channelType, sweepNo, l, channelType, clampCode, setCycleCount, setSweepCount, doStimsetMatching)) @@ -2929,6 +2930,7 @@ static Function SF_ParseFormulaToJSON(string formula) End Function SF_Update(string graph) + string bsPanel = BSP_GetPanel(graph) if(!SF_IsActive(bsPanel)) @@ -2946,6 +2948,7 @@ End /// @brief Return the sweep formula code in raw and with all necessary preprocesssing Function [string raw, string preProc] SF_GetCode(string win) + string formula_nb, code formula_nb = BSP_GetSFFormula(win) @@ -3196,15 +3199,15 @@ static Function SF_GetTPFitQuality(WAVE residuals, WAVE sweepData, variable begi return sum(residuals, beginTrail, endTrail) / (endTrailIndex - beginTrailIndex) End -static Function/WAVE SF_OperationTPIterate(string graph, WAVE/WAVE mode, WAVE/WAVE/Z selectDataArray, WAVE/Z ignoreTPs, string opShort) +static Function/WAVE SF_OperationTPIterate(string graph, WAVE/WAVE mode, WAVE/Z/WAVE selectDataArray, WAVE/Z ignoreTPs, string opShort) if(!WaveExists(selectDataArray)) return $"" endif - WAVE/WAVE/Z result = $"" + WAVE/Z/WAVE result = $"" - for(WAVE/WAVE/Z selectDataComp : selectDataArray) + for(WAVE/Z/WAVE selectDataComp : selectDataArray) if(!WaveExists(selectDataComp)) continue @@ -3317,7 +3320,7 @@ static Function/WAVE SF_OperationTPImpl(string graph, WAVE/WAVE mode, WAVE/Z sel // drop TPs which should be ignored // relies on ascending sorting of start times in epochMatches - WAVE/T/Z epochMatches = SF_FilterEpochs(epochMatchesAll, ignoreTPs) + WAVE/Z/T epochMatches = SF_FilterEpochs(epochMatchesAll, ignoreTPs) if(!WaveExists(epochMatches)) continue @@ -3603,11 +3606,11 @@ static Function/WAVE SF_OperationEpochs(variable jsonId, string jsonPath, string epType = EPOCHS_TYPE_RANGE endif - WAVE/WAVE/Z selectData = $"" - WAVE/WAVE/Z selectDataArray = SFH_GetArgumentSelect(jsonID, jsonPath, graph, SF_OP_EPOCHS, 1) + WAVE/Z/WAVE selectData = $"" + WAVE/Z/WAVE selectDataArray = SFH_GetArgumentSelect(jsonID, jsonPath, graph, SF_OP_EPOCHS, 1) if(WaveExists(selectDataArray)) SFH_ASSERT(DimSize(selectDataArray, ROWS) == 1, "Expected a single select specification") - WAVE/WAVE/Z selectDataComp = selectDataArray[0] + WAVE/Z/WAVE selectDataComp = selectDataArray[0] if(WaveExists(selectDataComp)) WAVE/Z selectData = selectDataComp[%SELECTION] endif @@ -4287,7 +4290,7 @@ static Function/WAVE SF_OperationDerivativeImpl(WAVE/Z input) SFH_ASSERT(IsNumericWave(input), "derivative requires numeric input data.") SFH_ASSERT(DimSize(input, ROWS) > 1, "Can not differentiate single point waves") WAVE out = NewFreeWave(IGOR_TYPE_64BIT_FLOAT, 0) - Differentiate/DIM=(ROWS) input / D=out + Differentiate/DIM=(ROWS) input/D=out CopyScales input, out SetScale/P x, DimOffset(out, ROWS), DimDelta(out, ROWS), "d/dx", out @@ -4322,7 +4325,7 @@ static Function/WAVE SF_OperationIntegrateImpl(WAVE/Z input) SFH_ASSERT(IsNumericWave(input), "integrate requires numeric input data.") SFH_ASSERT(DimSize(input, ROWS) > 0, "integrate input must have at least one data point") WAVE out = NewFreeWave(IGOR_TYPE_64BIT_FLOAT, 0) - Integrate/METH=1/DIM=(ROWS) input / D=out + Integrate/METH=1/DIM=(ROWS) input/D=out CopyScales input, out SetScale/P x, DimOffset(out, ROWS), DimDelta(out, ROWS), "dx", out @@ -4365,7 +4368,7 @@ static Function/WAVE SF_OperationAreaImpl(WAVE/Z input, variable zero) SFH_ASSERT(DimSize(input, ROWS) >= 1, "integrate requires at least one data point.") WAVE out_integrate = NewFreeWave(IGOR_TYPE_64BIT_FLOAT, 0) - Integrate/METH=1/DIM=(ROWS) input / D=out_integrate + Integrate/METH=1/DIM=(ROWS) input/D=out_integrate Make/FREE/N=(max(1, DimSize(out_integrate, COLS)), DimSize(out_integrate, LAYERS)) out Multithread out = out_integrate[DimSize(input, ROWS) - 1][p][q] @@ -4610,7 +4613,7 @@ static Function/WAVE SF_OperationSelectSweeps(variable jsonId, string jsonPath, numArgs = SFH_GetNumberOfArguments(jsonId, jsonPath) if(!numArgs) - WAVE/D/Z sweeps = OVS_GetSelectedSweeps(graph, OVS_SWEEP_ALL_SWEEPNO) + WAVE/Z/D sweeps = OVS_GetSelectedSweeps(graph, OVS_SWEEP_ALL_SWEEPNO) else for(i = 0; i < numArgs; i += 1) WAVE data = SFH_GetArgumentAsWave(jsonId, jsonPath, graph, SF_OP_SELECTSWEEPS, i, singleResult = 1, expectedWaveType = IGOR_TYPE_64BIT_FLOAT) @@ -4813,6 +4816,7 @@ static Function/WAVE SF_PowerSpectrumRatio(WAVE/Z input, variable ratioFreq, var End Function SF_LineNoiseFit(WAVE w, variable x) : FitFunc + // Formula: linear + gauss fit // y0 + m * x + A * exp(-((x - x0) / sigma)^2) // Coefficients: @@ -5453,8 +5457,8 @@ static Function/WAVE SF_GetSelectDataWithRACorSCIIndex(string graph, WAVE select if(mode == SELECTDATA_MODE_RAC) cycleIds[i] = GetLastSettingIndep(numericalValues, sweepNo, RA_ACQ_CYCLE_ID_KEY, DATA_ACQUISITION_MODE, defValue = NaN) elseif(mode == SELECTDATA_MODE_SCI) - channelNumber = selectData[i][%CHANNELNUMBER] - channelType = selectData[i][%CHANNELTYPE] + channelNumber = selectData[i][%CHANNELNUMBER] + channelType = selectData[i][%CHANNELTYPE] [WAVE settings, headstage] = GetLastSettingChannel(numericalValues, $"", sweepNo, STIMSET_ACQ_CYCLE_ID_KEY, channelNumber, channelType, DATA_ACQUISITION_MODE) if(WaveExists(settings)) cycleIds[i] = settings[headstage] @@ -5643,7 +5647,7 @@ static Function/WAVE SF_GetSelectDataWithSCIorRAC(string graph, WAVE selectData, ASSERT(mode == SELECTDATA_MODE_SCI || mode == SELECTDATA_MODE_RAC, "Unknown SCI/RAC mode") [STRUCT SF_SelectParameters filterDup] = SF_DuplicateSelectFilter(filter) - filterDup.vis = SF_OP_SELECTVIS_ALL + filterDup.vis = SF_OP_SELECTVIS_ALL isSweepBrowser = BSP_IsSweepBrowser(graph) if(isSweepBrowser) @@ -5826,15 +5830,15 @@ static Function/WAVE SF_OperationAnaFuncParam(variable jsonId, string jsonPath, return SFH_GetOutputForExecutor(output, graph, SF_OP_ANAFUNCPARAM) End -static Function/WAVE SF_OperationAnaFuncParamIterate(string graph, WAVE/T names, WAVE/WAVE/Z selectDataArray, string opShort) +static Function/WAVE SF_OperationAnaFuncParamIterate(string graph, WAVE/T names, WAVE/Z/WAVE selectDataArray, string opShort) if(!WaveExists(selectDataArray)) return $"" endif - WAVE/WAVE/Z result = $"" + WAVE/Z/WAVE result = $"" - for(WAVE/WAVE/Z selectDataComp : selectDataArray) + for(WAVE/Z/WAVE selectDataComp : selectDataArray) if(!WaveExists(selectDataComp)) continue @@ -5913,7 +5917,7 @@ static Function/WAVE SF_OperationAnaFuncParamImpl(string graph, WAVE/T names, WA endif WAVE/WAVE allParams = SF_OperationLabnotebookImpl(graph, {ANALYSIS_FUNCTION_PARAMS_LBN}, selectData, DATA_ACQUISITION_MODE, opShort) - WAVE/T/Z allReqNames = SF_OperationAnaFuncParamImplAllNames(names, allParams) + WAVE/Z/T allReqNames = SF_OperationAnaFuncParamImplAllNames(names, allParams) if(!WaveExists(allReqNames)) WAVE/WAVE output = SFH_CreateSFRefWave(graph, opShort, 0) @@ -6015,15 +6019,15 @@ static Function/WAVE SF_OperationLabnotebook(variable jsonId, string jsonPath, s return SFH_GetOutputForExecutor(output, graph, SF_OP_LABNOTEBOOK) End -static Function/WAVE SF_OperationLabnotebookIterate(string graph, WAVE/T lbnKeys, WAVE/WAVE/Z selectDataArray, variable mode, string opShort) +static Function/WAVE SF_OperationLabnotebookIterate(string graph, WAVE/T lbnKeys, WAVE/Z/WAVE selectDataArray, variable mode, string opShort) if(!WaveExists(selectDataArray)) return $"" endif - WAVE/WAVE/Z result = $"" + WAVE/Z/WAVE result = $"" - for(WAVE/WAVE/Z selectDataComp : selectDataArray) + for(WAVE/Z/WAVE selectDataComp : selectDataArray) if(!WaveExists(selectDataComp)) continue @@ -6058,7 +6062,7 @@ static Function/WAVE SF_OperationLabnotebookImpl(string graph, WAVE/T LBNKeys, W return output endif - WAVE/T/Z allLBNKeys = SFH_OperationLabnotebookExpandKeys(graph, LBNKeys, selectData, mode) + WAVE/Z/T allLBNKeys = SFH_OperationLabnotebookExpandKeys(graph, LBNKeys, selectData, mode) if(!WaveExists(allLBNKeys)) WAVE/WAVE output = SFH_CreateSFRefWave(graph, opShort, 0) @@ -6092,7 +6096,7 @@ static Function/WAVE SF_OperationLabnotebookImpl(string graph, WAVE/T LBNKeys, W refUnit = units[0] if(!cmpstr(refUnit, LABNOTEBOOK_BINARY_UNIT)) - WAVE/T/Z matches = GrepTextWave(allLBNKeys, "^.* QC$") + WAVE/Z/T matches = GrepTextWave(allLBNKeys, "^.* QC$") Make/FREE/D yTickPositions = {0, 1} Make/FREE/T/N=2 yTickLabels @@ -6203,7 +6207,7 @@ static Function/WAVE SF_GetLabnotebookEntryUnits(string graph, WAVE/T allLBNKeys Make/FREE/T/N=(DimSize(allLBNKeys, ROWS)) units = SF_GetLabnotebookEntryUnits_Impl(numericalKeys, textualKeys, allLBNKeys[p]) - WAVE/T/Z unitsUnique = GetUniqueEntries(units) + WAVE/Z/T unitsUnique = GetUniqueEntries(units) return unitsUnique End @@ -6228,7 +6232,7 @@ static Function/WAVE SFH_OperationLabnotebookExpandKeys(string graph, WAVE/T LBN WAVE/Z textualValues = BSP_GetLogbookWave(graph, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES, sweepNumber = sweepNo) WAVE/Z numericalValues = BSP_GetLogbookWave(graph, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, sweepNumber = sweepNo) - WAVE/T/Z entries = LBV_GetAllLogbookParamNames(textualValues, numericalValues) + WAVE/Z/T entries = LBV_GetAllLogbookParamNames(textualValues, numericalValues) if(!WaveExists(entries)) continue @@ -6751,7 +6755,8 @@ static Function SF_AverageTPFromSweepImpl(WAVE tpData, WAVE tpStart, WAVE sweepD End Function/WAVE SF_GetAllOldCodeForGUI(string win) // parameter required for popup menu ext - WAVE/T/Z entries = SF_GetAllOldCode() + + WAVE/Z/T entries = SF_GetAllOldCode() if(!WaveExists(entries)) return $"" @@ -6759,7 +6764,7 @@ Function/WAVE SF_GetAllOldCodeForGUI(string win) // parameter required for popup entries[] = num2str(p) + ": " + ElideText(ReplaceString("\n", entries[p], " "), 60) - WAVE/T/Z splittedMenu = PEXT_SplitToSubMenus(entries, method = PEXT_SUBSPLIT_ALPHA) + WAVE/Z/T splittedMenu = PEXT_SplitToSubMenus(entries, method = PEXT_SUBSPLIT_ALPHA) PEXT_GenerateSubMenuNames(splittedMenu) @@ -6786,7 +6791,7 @@ Function SF_PopMenuProc_OldCode(STRUCT WMPopupAction &pa) : PopupMenuControl bsPanel = BSP_GetPanel(pa.win) sweepFormulaNB = BSP_GetSFFormula(bsPanel) - WAVE/T/Z entries = SF_GetAllOldCode() + WAVE/Z/T entries = SF_GetAllOldCode() // -2 as we have NONE index = str2num(pa.popStr) code = entries[index] @@ -7163,7 +7168,7 @@ Function/WAVE SF_OperationMerge(variable jsonId, string jsonPath, string graph) SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_MERGE, 1, maxArgs = 1) WAVE/WAVE inputWithNull = SF_ResolveDatasetFromJSON(jsonID, jsonPath, graph, 0) - WAVE/WAVE/ZZ input = ZapNullRefs(inputWithNull) + WAVE/ZZ/WAVE input = ZapNullRefs(inputWithNull) WaveClear inputWithNull numElements = WaveExists(input) ? DimSize(input, ROWS) : 0 @@ -7210,7 +7215,7 @@ Function/WAVE SF_OperationDataset(variable jsonId, string jsonPath, string graph return SFH_GetOutputForExecutor(output, graph, SF_OP_DATASET) End -static Function [WAVE/D holdWave, WAVE/D initialValues] SF_ParseFitConstraints(WAVE/T/Z constraints, variable numParameters) +static Function [WAVE/D holdWave, WAVE/D initialValues] SF_ParseFitConstraints(WAVE/Z/T constraints, variable numParameters) variable i, numElements, index, value string indexStr, valueStr, entry @@ -7243,7 +7248,7 @@ Function/WAVE SF_OperationFitLine(variable jsonId, string jsonPath, string graph SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_FITLINE, 0, maxArgs = 1) - WAVE/T/Z constraints = SFH_GetArgumentAsWave(jsonId, jsonPath, graph, SF_OP_FITLINE, 0, defWave = $"", singleResult = 1) + WAVE/Z/T constraints = SFH_GetArgumentAsWave(jsonId, jsonPath, graph, SF_OP_FITLINE, 0, defWave = $"", singleResult = 1) [WAVE holdWave, WAVE initialValues] = SF_ParseFitConstraints(constraints, 2) @@ -7349,7 +7354,7 @@ threadsafe static Function SF_ConvertNonFiniteElementsImpl(string element) return 0 End -static Function [WAVE outNum, WAVE/T outText] SF_ExecutorCreateOrCheckNumeric(WAVE/D/Z out, WAVE/T/Z outT, variable size0, variable size1, variable size2, variable size3) +static Function [WAVE outNum, WAVE/T outText] SF_ExecutorCreateOrCheckNumeric(WAVE/Z/D out, WAVE/Z/T outT, variable size0, variable size1, variable size2, variable size3) SFH_ASSERT(!WaveExists(outT), "mixed array types") if(!WaveExists(out)) @@ -7359,7 +7364,7 @@ static Function [WAVE outNum, WAVE/T outText] SF_ExecutorCreateOrCheckNumeric(WA return [out, outT] End -static Function [WAVE outNum, WAVE/T outText] SF_ExecutorCreateOrCheckTextual(WAVE/Z out, WAVE/T/Z outT, variable size0, variable size1, variable size2, variable size3) +static Function [WAVE outNum, WAVE/T outText] SF_ExecutorCreateOrCheckTextual(WAVE/Z out, WAVE/Z/T outT, variable size0, variable size1, variable size2, variable size3) SFH_ASSERT(!WaveExists(out), "mixed array types") if(!WaveExists(outT)) diff --git a/Packages/MIES/MIES_SweepFormula_Helpers.ipf b/Packages/MIES/MIES_SweepFormula_Helpers.ipf index 1d7ce7efb6..8e44a32440 100644 --- a/Packages/MIES/MIES_SweepFormula_Helpers.ipf +++ b/Packages/MIES/MIES_SweepFormula_Helpers.ipf @@ -16,10 +16,12 @@ static StrConstant SFH_ARGSETUP_EMPTY_OPERATION_VALUE = "NOOP" static StrConstant SFH_DEFAULT_SELECT_FORMULA = "select()" threadsafe Function SFH_StringChecker_Prototype(string str) + ASSERT_TS(0, "Can't call prototype function") End threadsafe Function SFH_NumericChecker_Prototype(variable var) + ASSERT_TS(0, "Can't call prototype function") End @@ -123,7 +125,7 @@ End /// The second argument `type` is optional with `steam train` as default and a list of allowed values. /// /// The text argument can be abbreviated as long as it is unique, the unabbreviated result is returned in all cases. -Function/S SFH_GetArgumentAsText(variable jsonId, string jsonPath, string graph, string opShort, variable argNum, [string defValue, WAVE/T/Z allowedValues, FUNCREF SFH_StringChecker_Prototype checkFunc, variable checkDefault]) +Function/S SFH_GetArgumentAsText(variable jsonId, string jsonPath, string graph, string opShort, variable argNum, [string defValue, WAVE/Z/T allowedValues, FUNCREF SFH_StringChecker_Prototype checkFunc, variable checkDefault]) string msg, result, sep, allowedValuesAsStr variable checkExist, numArgs, idx, ret @@ -143,14 +145,14 @@ Function/S SFH_GetArgumentAsText(variable jsonId, string jsonPath, string graph, numArgs = SFH_GetNumberOfArguments(jsonId, jsonPath) if(argNum < numArgs) - WAVE/WAVE/Z input = SF_ResolveDatasetFromJSON(jsonId, jsonPath, graph, argNum) + WAVE/Z/WAVE input = SF_ResolveDatasetFromJSON(jsonId, jsonPath, graph, argNum) sprintf msg, "Argument #%d of operation %s: input is a NULL wave reference", argNum, opShort SFH_ASSERT(WaveExists(input), msg) sprintf msg, "Argument #%d of operation %s: Expected only one dataset", argNum, opShort SFH_ASSERT(DimSize(input, ROWS) == 1, msg) - WAVE/T/Z data = input[0] + WAVE/Z/T data = input[0] SFH_CleanUpInput(input) sprintf msg, "Argument #%d of operation %s: Is a NULL wave reference", argNum, opShort SFH_ASSERT(WaveExists(data), msg) @@ -177,7 +179,7 @@ Function/S SFH_GetArgumentAsText(variable jsonId, string jsonPath, string graph, ASSERT(WaveExists(allowedValues) && IsTextWave(allowedValues), "allowedValues must be a text wave") // search are allowed entries and try to match a unique abbreviation - WAVE/T/Z matches = GrepTextWave(allowedValues, "(?i)^\\Q" + result + "\\E.*$") + WAVE/Z/T matches = GrepTextWave(allowedValues, "(?i)^\\Q" + result + "\\E.*$") if(!WaveExists(matches)) sep = ", " allowedValuesAsStr = TextWaveToList(allowedValues, sep, trailSep = 0) @@ -436,7 +438,7 @@ Function/WAVE SFH_GetRangeFromEpoch(string graph, string epochName, variable swe SFH_ASSERT(DataFolderExistsDFR(sweepDFR), "Could not determine sweepDFR") regex = "^" + epochName + "$" - WAVE/T/Z epochs = EP_GetEpochs(numericalValues, textualValues, sweep, chanType, channel, regex, sweepDFR = sweepDFR) + WAVE/Z/T epochs = EP_GetEpochs(numericalValues, textualValues, sweep, chanType, channel, regex, sweepDFR = sweepDFR) if(!WaveExists(epochs)) return range endif @@ -458,7 +460,7 @@ Function/WAVE SFH_GetSweepsForFormula(string graph, WAVE/Z/WAVE selectDataArray, return $"" endif - WAVE/WAVE/Z result = $"" + WAVE/Z/WAVE result = $"" for(WAVE/Z/WAVE selectDataComp : selectDataArray) @@ -563,7 +565,7 @@ static Function/WAVE SFH_GetSweepsForFormulaImpl(string graph, WAVE/WAVE selectD endif WAVE/ZZ adaptedRange - WAVE/T/ZZ epochRangeNames + WAVE/ZZ/T epochRangeNames [adaptedRange, epochRangeNames] = SFH_GetNumericRangeFromEpoch(graph, numericalValues, textualValues, setRange, sweepNo, chanType, chanNr, mapIndex) if(!WaveExists(adaptedRange) && !WaveExists(epochRangeNames)) @@ -1030,9 +1032,9 @@ Function [WAVE/T keys, WAVE/T values] SFH_CreateResultsWaveWithCode(string graph values[0][%$"Sweep Formula code"][INDEP_HEADSTAGE] = NormalizeToEOL(TrimString(code), "\n") - WAVE/T/Z cursorInfos = GetCursorInfos(graph) + WAVE/Z/T cursorInfos = GetCursorInfos(graph) - WAVE/WAVE/Z selectData = SF_ExecuteFormula(SFH_DEFAULT_SELECT_FORMULA, graph, useVariables = 0) + WAVE/Z/WAVE selectData = SF_ExecuteFormula(SFH_DEFAULT_SELECT_FORMULA, graph, useVariables = 0) if(WaveExists(selectData) && WaveExists(selectData[0])) values[0][%$"Sweep Formula sweeps/channels"][INDEP_HEADSTAGE] = NumericWaveToList(selectData[0], ",", colSep = ";") endif @@ -1507,7 +1509,7 @@ Function [WAVE adaptedRange, WAVE/T epochRangeNames] SFH_GetNumericRangeFromEpoc DFREF sweepDFR = GetSingleSweepFolder(deviceDFR, sweepNo) endif SFH_ASSERT(DataFolderExistsDFR(sweepDFR), "Could not determine sweepDFR") - WAVE/T/Z epochInfo = EP_GetEpochs(numericalValues, textualValues, sweepNo, chanType, chanNr, allEpochsRegex, sweepDFR = sweepDFR) + WAVE/Z/T epochInfo = EP_GetEpochs(numericalValues, textualValues, sweepNo, chanType, chanNr, allEpochsRegex, sweepDFR = sweepDFR) if(!WaveExists(epochInfo)) return [$"", $""] endif diff --git a/Packages/MIES/MIES_SweepFormula_PSX.ipf b/Packages/MIES/MIES_SweepFormula_PSX.ipf index 8886eb95af..784dc6b5ca 100644 --- a/Packages/MIES/MIES_SweepFormula_PSX.ipf +++ b/Packages/MIES/MIES_SweepFormula_PSX.ipf @@ -716,7 +716,7 @@ static Function PSX_OperationSweepGathering(string graph, WAVE/WAVE psxKernelDat psxParametersAnalyzePeaks = PSX_GetPSXParameters(parameterJSONID, PSX_CACHE_KEY_ANALYZE_PEAKS) cacheKey = CA_PSXAnalyzePeaks(comboKey, psxParametersAnalyzePeaks) - WAVE/WAVE/Z psxAnalyzePeaksFromCache = CA_TryFetchingEntryFromCache(cacheKey) + WAVE/Z/WAVE psxAnalyzePeaksFromCache = CA_TryFetchingEntryFromCache(cacheKey) if(WaveExists(psxAnalyzePeaksFromCache)) WAVE sweepDataFiltOff = psxAnalyzePeaksFromCache[%sweepDataFiltOff] @@ -768,7 +768,7 @@ static Function PSX_OperationImpl(string graph, variable parameterJSONID, string psxParametersEvents = PSX_GetPSXParameters(parameterJSONID, PSX_CACHE_KEY_EVENTS) psxOperationKey = CA_PSXOperationKey(comboKey, psxParametersEvents) - WAVE/WAVE/Z psxOperationFromCache = CA_TryFetchingEntryFromCache(psxOperationKey) + WAVE/Z/WAVE psxOperationFromCache = CA_TryFetchingEntryFromCache(psxOperationKey) if(WaveExists(psxOperationFromCache)) WAVE peakX = psxOperationFromCache[%peakX] @@ -869,7 +869,7 @@ static Function/WAVE PSX_GetPSXKernel(variable riseTau, variable decayTau, varia key = CA_PSXKernelOperationKey(riseTau, decayTau, amp, numPoints, dt, range) - WAVE/WAVE/Z result = CA_TryFetchingEntryFromCache(key) + WAVE/Z/WAVE result = CA_TryFetchingEntryFromCache(key) if(WaveExists(result)) return result @@ -1719,7 +1719,7 @@ static Function PSX_UpdateOffsetInAllEventGraph(string win) endif DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return NaN @@ -1738,7 +1738,7 @@ static Function PSX_UpdateOffsetInAllEventGraph(string win) DFREF singleEventDFR = GetPSXSingleEventFolder(comboDFR) for(i = 0; i < numEvents; i += 1) - WAVE/SDFR=singleEventDFR/Z singleEvent = $GetIndexedObjNameDFR(singleEventDFR, COUNTOBJECTS_WAVES, i) + WAVE/Z/SDFR=singleEventDFR singleEvent = $GetIndexedObjNameDFR(singleEventDFR, COUNTOBJECTS_WAVES, i) ASSERT(WaveExists(singleEvent), "Non-existing single event wave") [first, last] = PSX_GetSingleEventRange(psxEvent, i) @@ -1802,7 +1802,7 @@ static Function PSX_AdaptColorsInAllEventGraph(string win, [variable forceAverag DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return NaN @@ -1817,7 +1817,7 @@ static Function PSX_AdaptColorsInAllEventGraph(string win, [variable forceAverag // indexMapper[i]: psx event index used inside a specific combo (psxEventRefWave and psxColorsRefWave) // all indexed by i - WAVE/T/Z traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) + WAVE/Z/T traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) ASSERT(WaveExists(traceNames), "Expected at least one entry") WAVE/T hideTracesFromTraces = TUD_GetUserDataAsWave(extAllGraph, PSX_TUD_TRACE_HIDDEN_KEY, keys = keys, values = values) @@ -1961,7 +1961,7 @@ static Function PSX_UpdateAverageTraces(string win, WAVE/T eventIndexFromTraces, // single event waves are zeroed in x-direction to extractStartAbs [extractStartAbs, extractStopAbs] = PSX_GetSingleEventRange(psxEvent, idx) - fitStartAbs = psxEvent[idx][%peak_t] + fitStartAbs = psxEvent[idx][%peak_t] ASSERT(fitStartAbs > extractStartAbs, "Unexpected fit/extraction start positions") eventStartTime[acceptIndex] = fitStartAbs - extractStartAbs @@ -2263,7 +2263,7 @@ static Function PSX_UpdateHideStateInAllEventGraphImpl(string win, string traceT extAllGraph = PSX_GetAllEventGraph(win) - WAVE/T/Z traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) + WAVE/Z/T traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) ASSERT(WaveExists(traceNames), "Expected at least one entry") numEntries = DimSize(traceNames, ROWS) @@ -2295,7 +2295,7 @@ static Function PSX_UpdateBlockIndizes(string win) [WAVE/T keys, WAVE/T values] = PSX_GetTraceSelectionWaves(extAllGraph, PSX_TUD_TYPE_SINGLE, respectBlock = 0) - WAVE/T/Z traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) + WAVE/Z/T traceNames = TUD_GetUserDataAsWave(extAllGraph, "tracename", keys = keys, values = values) ASSERT(WaveExists(traceNames), "Expected at least one entry") numEntries = DimSize(traceNames, ROWS) @@ -2366,6 +2366,7 @@ static Function PSX_CalculateNumberOfBlocks(string win) End Function/S PSX_GetAllEventBlockNumbers(string win) + string specialEventPanel variable numBlocks @@ -2405,7 +2406,7 @@ static Function PSX_AppendTracesToAllEventGraph(string win) [WAVE acceptColors, WAVE rejectColors, WAVE undetColors] = PSX_GetEventColors() DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return NaN @@ -2426,7 +2427,7 @@ static Function PSX_AppendTracesToAllEventGraph(string win) DFREF singleEventDFR = GetPSXSingleEventFolder(comboDFR) for(i = 0; i < numEvents; i += 1) - WAVE/SDFR=singleEventDFR/Z singleEvent = $GetIndexedObjNameDFR(singleEventDFR, COUNTOBJECTS_WAVES, i) + WAVE/Z/SDFR=singleEventDFR singleEvent = $GetIndexedObjNameDFR(singleEventDFR, COUNTOBJECTS_WAVES, i) ASSERT(WaveExists(singleEvent), "Non-existing single event wave") trace = GetTraceNamePrefix(idx) @@ -2667,7 +2668,7 @@ static Function PSX_MoveCursor(string win, string trace, variable index, variabl if(minWrapAround || maxWrapAround) DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) ASSERT(WaveExists(comboFolders), "Missing comboFolders") comboIndex = PSX_GetCurrentComboIndex(win) @@ -3056,7 +3057,7 @@ static Function/WAVE PSX_GetEventContainer(string graph, [string requestID]) DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return $"" @@ -3089,7 +3090,7 @@ static Function/WAVE PSX_GetEventContainerFromResults(string id) return $"" endif - WAVE/WAVE/Z container = JSONToWave(entry) + WAVE/Z/WAVE container = JSONToWave(entry) ASSERT(WaveExists(container), "Could not parse stored results as JSON") for(WAVE/Z psxEvent : container) @@ -3101,7 +3102,7 @@ static Function/WAVE PSX_GetEventContainerFromResults(string id) return container End -static Function/WAVE PSX_FilterEventContainer(WAVE/WAVE/Z eventContainer, string refComboKey) +static Function/WAVE PSX_FilterEventContainer(WAVE/Z/WAVE eventContainer, string refComboKey) string comboKey if(!WaveExists(eventContainer)) @@ -3372,7 +3373,7 @@ End /// Takes care of existing combination data due to other `psx` calls in the same code. /// /// @return Number of combinations without event data -static Function PSX_MoveWavesToDataFolders(DFREF workDFR, WAVE/WAVE/Z results, variable offset, variable numCombos) +static Function PSX_MoveWavesToDataFolders(DFREF workDFR, WAVE/Z/WAVE results, variable offset, variable numCombos) variable i, idx, numEvents, psxEventJSON, numFailures string key @@ -3455,7 +3456,7 @@ static Function/S PSX_CheckForUniqueIDs(DFREF workDFR) variable checkID - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return "" @@ -3686,7 +3687,7 @@ static Function PSX_AddLegend(string win, WAVE/WAVE results) sprintf line, "%s: %s", param, str break case JSON_ARRAY: - WAVE/T/Z wvText = JSON_GetTextWave(jsonID, jsonPathParam, ignoreErr = 1) + WAVE/Z/T wvText = JSON_GetTextWave(jsonID, jsonPathParam, ignoreErr = 1) if(WaveExists(wvText)) str = TextWaveToList(wvText, sep) WaveClear wvText @@ -3892,7 +3893,7 @@ Function PSX_PlotInteractionHook(STRUCT WMWinHookStruct &s) // that new eventIndex might be something totally different as a stats plot will usually // only display a subset of the event data or combine multiple combos - direction = PSX_GetDirectionFromKeyCode(psxGraph, s.keyCode) + direction = PSX_GetDirectionFromKeyCode(psxGraph, s.keyCode) [eventIndex, waveIndex, comboIndex] = PSX_GetEventIndexAndComboIndex(win, direction = direction) ASSERT(IsFinite(eventIndex) && IsFinite(waveIndex) && IsFinite(comboIndex), "Invalid event index") @@ -4143,7 +4144,7 @@ static Function PSX_GetNumberOfCombinations(WAVE/WAVE results) End /// @brief High-level function responsible for `psx` data and plot management -Function PSX_Plot(string win, string graph, WAVE/WAVE/Z results, STRUCT SF_PlotMetaData &plotMetaData) +Function PSX_Plot(string win, string graph, WAVE/Z/WAVE results, STRUCT SF_PlotMetaData &plotMetaData) variable numCombos, i, offset, firstOp, numFailures @@ -4197,7 +4198,7 @@ End Function PSX_PostPlot(string win) DFREF workDFR = PSX_GetWorkingFolder(win) - WAVE/DF/Z comboFolders = PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = PSX_GetAllCombinationFolders(workDFR) if(!WaveExists(comboFolders)) return NaN @@ -4445,7 +4446,7 @@ Function/WAVE PSX_OperationStats(variable jsonId, string jsonPath, string graph) id = SFH_GetArgumentAsText(jsonID, jsonPath, graph, SF_OP_PSX, 0, checkFunc = IsValidObjectName) - WAVE/WAVE/Z selectDataCompArray = SFH_GetArgumentSelect(jsonID, jsonPath, graph, SF_OP_PSX_STATS, 1) + WAVE/Z/WAVE selectDataCompArray = SFH_GetArgumentSelect(jsonID, jsonPath, graph, SF_OP_PSX_STATS, 1) SFH_Assert(WaveExists(selectDataCompArray), "Missing select data") SFH_ASSERT(DimSize(selectDataCompArray, ROWS) == 1, "Only supports a single selection at the moment") @@ -4584,7 +4585,7 @@ Function PSX_MouseEventSelection(variable newState, variable stateType) endif // now check wether the y-coordinates of the events are inside for either axis - [filtOffBottom, filtOffTop] = GetMarqueeHelper("leftFiltOff", vert = 1, doAssert = 0) + [filtOffBottom, filtOffTop] = GetMarqueeHelper("leftFiltOff", vert = 1, doAssert = 0) [filtOffDeconvBottom, filtOffDeconvTop] = GetMarqueeHelper("leftFiltOffDeconv", vert = 1, doAssert = 0, kill = 1) if(IsNaN(filtOffTop) || IsNaN(filtOffBottom) || IsNaN(filtOffDeconvTop) || IsNaN(filtOffDeconvBottom)) @@ -4615,7 +4616,7 @@ Function PSX_MouseEventSelection(variable newState, variable stateType) indexOrient = PSX_GetIndexOrientation(bottomLabel) - WAVE/WAVE/Z result = PSX_GetEventsInsideMarqueeForStatsPlot(win, indexOrient, left, top, right, bottom) + WAVE/Z/WAVE result = PSX_GetEventsInsideMarqueeForStatsPlot(win, indexOrient, left, top, right, bottom) if(!WaveExists(result)) return NaN @@ -4783,7 +4784,7 @@ Function PSX_JumpToEvents() indexOrient = PSX_GetIndexOrientation(bottomLabel) - WAVE/WAVE/Z result = PSX_GetEventsInsideMarqueeForStatsPlot(win, indexOrient, left, top, right, bottom) + WAVE/Z/WAVE result = PSX_GetEventsInsideMarqueeForStatsPlot(win, indexOrient, left, top, right, bottom) if(!WaveExists(result)) return NaN @@ -5133,7 +5134,7 @@ Function PSX_PlotStartupSettings() HideTools/W=$subwin - WAVE/T/Z userDataKeys = GetUserdataKeys(WinRecreation(subWin, 0)) + WAVE/Z/T userDataKeys = GetUserdataKeys(WinRecreation(subWin, 0)) for(ud : userDataKeys) if(!GrepString(ud, "^ResizeControls.*$")) diff --git a/Packages/MIES/MIES_SweepSaving.ipf b/Packages/MIES/MIES_SweepSaving.ipf index f641999334..fa719c6430 100644 --- a/Packages/MIES/MIES_SweepSaving.ipf +++ b/Packages/MIES/MIES_SweepSaving.ipf @@ -13,9 +13,7 @@ /// /// @param device device /// @param forcedStop [optional, defaults to false] if DAQ was aborted (true) or stopped by itself (false) -Function SWS_SaveAcquiredData(device, [forcedStop]) - string device - variable forcedStop +Function SWS_SaveAcquiredData(string device, [variable forcedStop]) variable sweepNo, plannedTime, acquiredTime string sweepName, configName @@ -37,11 +35,11 @@ Function SWS_SaveAcquiredData(device, [forcedStop]) DFREF dfr = GetDeviceDataPath(device) configName = GetConfigWaveName(sweepNo) - WAVE/SDFR=dfr/Z configWave = $configName + WAVE/Z/SDFR=dfr configWave = $configName ASSERT(!WaveExists(configWave), "The config wave must not exist, name=" + configName) sweepName = GetSweepWaveName(sweepNo) - WAVE/SDFR=dfr/Z sweepWave = $sweepName + WAVE/Z/SDFR=dfr sweepWave = $sweepName ASSERT(!WaveExists(sweepWave), "The sweep wave must not exist, name=" + sweepName) [plannedTime, acquiredTime] = SWS_ProcessDATTLChannelsOnEarlyAcqStop(device, scaledDataWave, hardwareConfigWave) @@ -170,7 +168,7 @@ End /// @param device device name static Function SWS_AfterSweepDataChangeHook(string device) - WAVE/T/Z allDBs = DB_FindAllDataBrowser(device, mode = BROWSER_MODE_ALL) + WAVE/Z/T allDBs = DB_FindAllDataBrowser(device, mode = BROWSER_MODE_ALL) if(!WaveExists(allDBs)) return NaN @@ -223,9 +221,7 @@ End /// @param timing One of @ref GainTimeParameter /// /// @see GetDAQDataWave() -Function/WAVE SWS_GetChannelGains(device, [timing]) - string device - variable timing +Function/WAVE SWS_GetChannelGains(string device, [variable timing]) variable numDACs, numADCs, numTTLs variable numCols, hardwareType @@ -293,8 +289,7 @@ End /// @brief Return the floating point type for storing the raw data /// /// The returned values are the same as for `WaveType` -Function SWS_GetRawDataFPType(device) - string device +Function SWS_GetRawDataFPType(string device) return DAG_GetNumericalValue(device, "Check_Settings_UseDoublePrec") ? IGOR_TYPE_64BIT_FLOAT : IGOR_TYPE_32BIT_FLOAT End diff --git a/Packages/MIES/MIES_TestPulse.ipf b/Packages/MIES/MIES_TestPulse.ipf index 3bc62f89f0..4408d11fa0 100644 --- a/Packages/MIES/MIES_TestPulse.ipf +++ b/Packages/MIES/MIES_TestPulse.ipf @@ -37,6 +37,7 @@ static Constant TP_SET_PRECISION = 2 /// @brief Check if the value is a valid baseline fraction Function TP_IsValidBaselineFraction(variable value) + return value >= TP_BASELINE_FRACTION_LOW && value <= TP_BASELINE_FRACTION_HIGH End @@ -57,6 +58,7 @@ End /// /// Can be used when reconstructing the baseline fraction from epoch information. Function TP_CalculateBaselineFraction(variable pulseDuration, variable totalLength) + return (pulseDuration / totalLength - 1) / -2 End @@ -68,11 +70,7 @@ End /// @param hsList list of headstage numbers in the same order as the columns of TPWave /// /// The stored test pulse waves will have column dimension labels in the format `HS_X`. -Function TP_StoreTP(device, TPWave, tpMarker, hsList) - string device - WAVE TPWave - variable tpMarker - string hsList +Function TP_StoreTP(string device, WAVE TPWave, variable tpMarker, string hsList) variable index, ret @@ -153,8 +151,7 @@ End /// @brief Split the stored testpulse wave reference wave into single waves /// for easier handling -Function TP_SplitStoredTestPulseWave(device) - string device +Function TP_SplitStoredTestPulseWave(string device) variable numEntries, i @@ -306,7 +303,7 @@ End /// - Active headstages static Function/WAVE TP_GetTPWaveForAutoTP(string device, variable marker) - WAVE/WAVE/Z TPs = TP_GetStoredTPs(device, marker, 2) + WAVE/Z/WAVE TPs = TP_GetStoredTPs(device, marker, 2) if(!WaveExists(TPs)) return $"" @@ -673,6 +670,7 @@ static Function TP_AutoAmplitudeAndBaseline(string device, WAVE TPResults, varia End Function TP_AutoTPActive(string device) + WAVE settings = GetTPSettings(device) WAVE statusHS = DAG_GetActiveHeadstages(device, I_CLAMP_MODE) @@ -798,6 +796,7 @@ End /// @param numReqEntries Number of entries to return, supports integer values and inf /// @param options [optional, default to nothing] One of @ref TPStorageQueryingOptions Function/WAVE TP_GetValuesFromTPStorage(WAVE TPStorage, variable headstage, string entry, variable numReqEntries, [variable options]) + variable i, idx, value, entryLayer, lastValidEntry, numValidEntries, currentAutoTPCycleID, latestAutoTPCycleID if(ParamIsDefault(options)) @@ -875,8 +874,7 @@ End /// /// @param dfrInp input data folder from the ASYNC framework, parameter input order therein follows the setup in TP_SendToAnalysis() /// -threadsafe Function/DF TP_TSAnalysis(dfrInp) - DFREF dfrInp +threadsafe Function/DF TP_TSAnalysis(DFREF dfrInp) variable evalRange, refTime, refPoint, tpStartPoint variable sampleInt @@ -1196,15 +1194,13 @@ Function TP_StopTestPulseOnAllDevices() End /// @sa TP_StopTestPulseWrapper -Function TP_StopTestPulseFast(device) - string device +Function TP_StopTestPulseFast(string device) return TP_StopTestPulseWrapper(device, fast = 1) End /// @sa TP_StopTestPulseWrapper -Function TP_StopTestPulse(device) - string device +Function TP_StopTestPulse(string device) return TP_StopTestPulseWrapper(device, fast = 0) End @@ -1251,9 +1247,7 @@ static Function TP_StopTestPulseWrapper(device, [fast]) End /// @brief Restarts a test pulse previously stopped with #TP_StopTestPulse -Function TP_RestartTestPulse(device, testPulseMode, [fast]) - string device - variable testPulseMode, fast +Function TP_RestartTestPulse(string device, variable testPulseMode, [variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -1280,10 +1274,7 @@ End /// @param device device /// @param runMode Testpulse running mode, one of @ref TestPulseRunModes /// @param fast [optional, defaults to false] Performs only the totally necessary steps for setup -Function TP_Setup(device, runMode, [fast]) - string device - variable runMode - variable fast +Function TP_Setup(string device, variable runMode, [variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -1323,8 +1314,7 @@ Function TP_Setup(device, runMode, [fast]) End /// @brief Common setup calls for TP and TP during DAQ -Function TP_SetupCommon(device) - string device +Function TP_SetupCommon(string device) variable now, index @@ -1360,9 +1350,7 @@ Function TP_SetupCommon(device) End /// @brief Perform common actions after the testpulse -Function TP_Teardown(device, [fast]) - string device - variable fast +Function TP_Teardown(string device, [variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -1396,8 +1384,7 @@ Function TP_Teardown(device, [fast]) End /// @brief Common teardown calls for TP and TP during DAQ -Function TP_TeardownCommon(device) - string device +Function TP_TeardownCommon(string device) P_LoadPressureButtonState(device) @@ -1424,8 +1411,7 @@ End /// @brief Check if the testpulse is running /// /// Can not be used to check for foreground TP as during foreground TP/DAQ nothing else runs. -Function TP_CheckIfTestpulseIsRunning(device) - string device +Function TP_CheckIfTestpulseIsRunning(string device) NVAR runMode = $GetTestpulseRunMode(device) @@ -1436,9 +1422,7 @@ End /// /// @param device DA_Ephys panel name /// @param cycles number of cycles that test pulse must run -Function TP_TestPulseHasCycled(device, cycles) - string device - variable cycles +Function TP_TestPulseHasCycled(string device, variable cycles) variable index, indexOnTPStart @@ -1450,9 +1434,7 @@ Function TP_TestPulseHasCycled(device, cycles) End /// @brief Save the amplifier holding command in the TPStorage wave -Function TP_UpdateHoldCmdInTPStorage(device, headStage) - string device - variable headStage +Function TP_UpdateHoldCmdInTPStorage(string device, variable headStage) variable count, clampMode @@ -1479,9 +1461,7 @@ Function TP_UpdateHoldCmdInTPStorage(device, headStage) End /// @brief Create the testpulse wave with the current settings -Function TP_CreateTestPulseWave(device, dataAcqOrTP) - string device - variable dataAcqOrTP +Function TP_CreateTestPulseWave(string device, variable dataAcqOrTP) variable totalLengthPoints, pulseStartPoints, pulseLengthPoints @@ -1577,7 +1557,7 @@ Function TP_UpdateTPSettingsCalculatedImpl(WAVE TPSettings, WAVE samplingInterva // update the calculated values tpCalculated[%baselineFrac] = TPSettings[%baselinePerc][INDEP_HEADSTAGE] * PERCENT_TO_ONE - tpCalculated[%pulseLengthMS] = TPSettings[%durationMS][INDEP_HEADSTAGE] // here for completeness + tpCalculated[%pulseLengthMS] = TPSettings[%durationMS][INDEP_HEADSTAGE] // here for completeness tpCalculated[%pulseLengthPointsTP] = trunc(TPSettings[%durationMS][INDEP_HEADSTAGE] / interTPDAC) tpCalculated[%pulseLengthPointsDAQ] = trunc(TPSettings[%durationMS][INDEP_HEADSTAGE] / interDAQDAC) tpCalculated[%pulseLengthPointsTP_ADC] = trunc(tpCalculated[%pulseLengthPointsTP] * factorTP) @@ -1633,6 +1613,7 @@ End /// /// @see DAP_TPGUISettingToWave() for the special auto TP entry handling. Function TP_UpdateTPLBNSettings(string device) + variable i, value string lbl, entry @@ -1699,5 +1680,6 @@ End /// @brief Return the length in points of the power spectrum generated via FFT threadsafe Function TP_GetPowerSpectrumLength(variable tpLength) + return 2^FindNextPower(tpLength, 2) End diff --git a/Packages/MIES/MIES_TestPulse_Multi.ipf b/Packages/MIES/MIES_TestPulse_Multi.ipf index 68c6d49011..e49522e4bb 100644 --- a/Packages/MIES/MIES_TestPulse_Multi.ipf +++ b/Packages/MIES/MIES_TestPulse_Multi.ipf @@ -18,10 +18,7 @@ static Constant TPM_NI_FIFO_THRESHOLD_SIZE = 1073741824 /// @brief __TPM__ Multi device background test pulse functionality /// @brief Start the test pulse when MD support is activated. -Function TPM_StartTPMultiDeviceLow(device, [runModifier, fast]) - string device - variable runModifier - variable fast +Function TPM_StartTPMultiDeviceLow(string device, [variable runModifier, variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -47,9 +44,7 @@ Function TPM_StartTPMultiDeviceLow(device, [runModifier, fast]) End /// @brief Start a multi device test pulse, always done in background mode -Function TPM_StartTestPulseMultiDevice(device, [fast]) - string device - variable fast +Function TPM_StartTestPulseMultiDevice(string device, [variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -107,8 +102,7 @@ End /// @brief Background TP Multi Device /// /// @ingroup BackgroundFunctions -Function TPM_BkrdTPFuncMD(s) - STRUCT BackgroundStruct &s +Function TPM_BkrdTPFuncMD(STRUCT BackgroundStruct &s) variable i, j, deviceID, fifoPos, hardwareType, checkAgain, updateInt, endOfPulse variable fifoLatest, lastTP, now @@ -266,9 +260,7 @@ Function TPM_BkrdTPFuncMD(s) return 0 End -Function TPM_StopTestPulseMultiDevice(device, [fast]) - string device - variable fast +Function TPM_StopTestPulseMultiDevice(string device, [variable fast]) if(ParamIsDefault(fast)) fast = 0 diff --git a/Packages/MIES/MIES_TestPulse_Single.ipf b/Packages/MIES/MIES_TestPulse_Single.ipf index 3152ae0fb4..8d311c2ce7 100644 --- a/Packages/MIES/MIES_TestPulse_Single.ipf +++ b/Packages/MIES/MIES_TestPulse_Single.ipf @@ -9,15 +9,12 @@ /// @file MIES_TestPulse_Single.ipf /// @brief __TPS__ Single device background test pulse functionality -Function TPS_StartBackgroundTestPulse(device) - string device +Function TPS_StartBackgroundTestPulse(string device) CtrlNamedBackground $TASKNAME_TP, start End -Function TPS_StopTestPulseSingleDevice(device, [fast]) - string device - variable fast +Function TPS_StopTestPulseSingleDevice(string device, [variable fast]) if(ParamIsDefault(fast)) fast = 0 @@ -32,8 +29,7 @@ End /// @brief Background TP Single Device /// /// @ingroup BackgroundFunctions -Function TPS_TestPulseFunc(s) - STRUCT BackgroundStruct &s +Function TPS_TestPulseFunc(STRUCT BackgroundStruct &s) SVAR runningDevice = $GetRunningSingleDevice() // create a copy as runningDevice is killed in TPS_StopTestPulseSingleDevice @@ -76,9 +72,7 @@ End /// @param device device /// @param fast [optional, defaults to false] Starts TP without any checks or /// setup. Can be called after stopping it with TP_StopTestPulseFast(). -Function TPS_StartTestPulseSingleDevice(device, [fast]) - string device - variable fast +Function TPS_StartTestPulseSingleDevice(string device, [variable fast]) variable bkg @@ -135,9 +129,7 @@ End /// @param elapsedTime [defaults to infinity] allow to run the testpulse for the given amount /// of seconds only. /// @return zero if time elapsed, one if the Testpulse was manually stopped -Function TPS_StartTestPulseForeground(device, [elapsedTime]) - string device - variable elapsedTime +Function TPS_StartTestPulseForeground(string device, [variable elapsedTime]) variable i, refTime, timeLeft string oscilloscopeSubwindow diff --git a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf index b4581f6e5f..0c3edfb150 100644 --- a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf +++ b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf @@ -19,15 +19,13 @@ static Constant TFH_STOP_ACQ = 0x2 ///< DAQ stopping ///@} /// @brief Start the FIFO reset daemon used for TP MD -Function TFH_StartFIFOResetDeamon(hwType, deviceID) - variable hwType, deviceID +Function TFH_StartFIFOResetDeamon(variable hwType, variable deviceID) TFH_StartFIFODeamonInternal(hwType, deviceID, TFH_RESTART_ACQ) End /// @brief Start the FIFO stop daemon used for DAQ MD -Function TFH_StartFIFOStopDaemon(hwType, deviceID) - variable hwType, deviceID +Function TFH_StartFIFOStopDaemon(variable hwType, variable deviceID) TFH_StartFIFODeamonInternal(hwType, deviceID, TFH_STOP_ACQ) End @@ -63,8 +61,7 @@ End /// @brief Stop the FIFO daemon if required /// /// Sets the global `threadGroupIDFifo` to NaN afterwards. -Function TFH_StopFIFODaemon(hwType, deviceID) - variable hwType, deviceID +Function TFH_StopFIFODaemon(variable hwType, variable deviceID) string device diff --git a/Packages/MIES/MIES_ThreadsafeUtilities.ipf b/Packages/MIES/MIES_ThreadsafeUtilities.ipf index d4af7436a6..4e6559ef61 100644 --- a/Packages/MIES/MIES_ThreadsafeUtilities.ipf +++ b/Packages/MIES/MIES_ThreadsafeUtilities.ipf @@ -17,9 +17,7 @@ static Constant TS_ERROR_INVALID_TGID = 980 // Invalid Thread Group ID or /// Return `NaN` if the thread is not running anymore. /// /// Throws away anything else in the datafolder from the thread queue. -Function TS_GetNewestFromThreadQueue(tgID, varName, [timeout_default, timeout_tries]) - variable tgID, timeout_default, timeout_tries - string varName +Function TS_GetNewestFromThreadQueue(variable tgID, string varName, [variable timeout_default, variable timeout_tries]) variable var, err, i @@ -77,9 +75,7 @@ End /// Return an invalid wave reference if the thread is not running anymore. /// /// Throws away anything else in the datafolder from the thread queue. -Function/WAVE TS_GetNewestFromThreadQueueMult(tgID, varNames, [timeout_default, timeout_tries]) - variable tgID, timeout_default, timeout_tries - WAVE/T varNames +Function/WAVE TS_GetNewestFromThreadQueueMult(variable tgID, WAVE/T varNames, [variable timeout_default, variable timeout_tries]) variable numEntries, i, j, oneValidEntry, err string varName @@ -148,9 +144,7 @@ End /// if there is none. /// /// Throws away anything else in the datafolder from the thread queue. -threadsafe Function TS_ThreadGroupGetVariable(tgID, varName) - variable tgID - string varName +threadsafe Function TS_ThreadGroupGetVariable(variable tgID, string varName) variable err @@ -178,10 +172,7 @@ End /// @brief Push a single variable named `varName` with value `varValue` to the /// thread queue -threadsafe Function TS_ThreadGroupPutVariable(tgID, varName, varValue) - variable tgID - string varName - variable varValue +threadsafe Function TS_ThreadGroupPutVariable(variable tgID, string varName, variable varValue) DFREF dfrSave = GetDataFolderDFR() SetDataFolder NewFreeDataFolder() @@ -196,9 +187,7 @@ End /// /// Works on a duplicate of the input DF to remove all references. /// dfr can be a free DF -threadsafe Function TS_ThreadGroupPutDFR(tgID, dfr) - variable tgID - DFREF dfr +threadsafe Function TS_ThreadGroupPutDFR(variable tgID, DFREF dfr) string dfrName @@ -218,6 +207,7 @@ End /// @brief Returns 1 if all worker threads have finished Function TS_ThreadGroupFinished(variable tgID) + variable err, ret AssertOnAndClearRTError() @@ -230,8 +220,7 @@ End /// /// Assumes that the running worker functions finish on getting the `abort` /// variable sent. -Function TS_StopThreadGroup(tgID) - variable tgID +Function TS_StopThreadGroup(variable tgID) variable numThreadsRunning string msg diff --git a/Packages/MIES/MIES_TraceUserData.ipf b/Packages/MIES/MIES_TraceUserData.ipf index 88554f784c..d1c8657511 100644 --- a/Packages/MIES/MIES_TraceUserData.ipf +++ b/Packages/MIES/MIES_TraceUserData.ipf @@ -14,8 +14,7 @@ /// receiving window hook events. /// @brief Window hook for clearing the user data of the attached graph -Function TUD_RemoveUserDataWave(s) - STRUCT WMWinHookStruct &s +Function TUD_RemoveUserDataWave(STRUCT WMWinHookStruct &s) switch(s.eventCode) case EVENT_WINDOW_HOOK_KILL: @@ -32,6 +31,7 @@ End /// /// Works recursively on all child windows and calls TUD_ClearImpl on each graph. Function TUD_Clear(string graph, [variable recursive]) + string windows, win variable numEntries, i @@ -197,6 +197,7 @@ End /// @brief Set the given user data for the trace of the graph Function TUD_SetUserData(string graph, string trace, string key, string value) + variable keyCol, row WAVE/T graphUserData = GetGraphUserData(graph) @@ -222,6 +223,7 @@ End /// /// The `keys`/`values` must span a consecutive range. Function TUD_SetUserDataFromWaves(string graph, string trace, WAVE/T keys, WAVE/T values) + variable row, numCols, first, last, numExistingCols ASSERT(EqualWaves(keys, values, EQWAVES_DIMSIZE) == 1, "Unexpected size") @@ -276,6 +278,7 @@ End /// @brief Check if the given trace is displayed on the graph Function TUD_TraceIsOnGraph(string graph, string trace) + WAVE/T graphUserData = GetGraphUserData(graph) return TUD_ConvertTraceNameToRowIndex(graphUserData, trace, create = 0, allowMissing = 1) >= 0 End @@ -286,6 +289,7 @@ End /// with TUD_Clear() and the window is gone, this function can be used to reattach /// the cleanup hook to the newly created graph. Function TUD_Init(string graph) + string win ASSERT(WinType(graph) == 1, "Expected graph") diff --git a/Packages/MIES/MIES_Utilities_Algorithm.ipf b/Packages/MIES/MIES_Utilities_Algorithm.ipf index 6a80ef2aba..8ecfae80c2 100644 --- a/Packages/MIES/MIES_Utilities_Algorithm.ipf +++ b/Packages/MIES/MIES_Utilities_Algorithm.ipf @@ -26,10 +26,7 @@ /// @param winFunction Windowing function for @ref DECIMATION_BY_SMOOTHING mode, /// must be one of @ref FFT_WINF. /// @returns One on error, zero otherwise -Function Downsample(wv, downsampleFactor, upsampleFactor, mode, [winFunction]) - WAVE/Z wv - variable downsampleFactor, upsampleFactor, mode - string winFunction +Function Downsample(WAVE/Z wv, variable downsampleFactor, variable upsampleFactor, variable mode, [string winFunction]) variable numReconstructionSamples = -1 @@ -96,8 +93,7 @@ Function Downsample(wv, downsampleFactor, upsampleFactor, mode, [winFunction]) End /// @brief Compute the least common multiplier of all entries in the 1D-wave -Function CalculateLCMOfWave(wv) - WAVE wv +Function CalculateLCMOfWave(WAVE wv) variable i, result variable numRows = DimSize(wv, ROWS) @@ -153,9 +149,7 @@ threadsafe Function/WAVE GetUniqueEntries(WAVE wv, [variable caseSensitive, vari End /// @brief Convenience wrapper around GetUniqueTextEntries() for string lists -threadsafe Function/S GetUniqueTextEntriesFromList(list, [sep, caseSensitive]) - string list, sep - variable caseSensitive +threadsafe Function/S GetUniqueTextEntriesFromList(string list, [string sep, variable caseSensitive]) if(ParamIsDefault(sep)) sep = ";" @@ -212,22 +206,20 @@ threadsafe static Function/WAVE GetUniqueTextEntries(WAVE/T wv, [variable caseSe End /// @brief Function prototype for use with #CallFunctionForEachListItem -Function CALL_FUNCTION_LIST_PROTOTYPE(str) - string str +Function CALL_FUNCTION_LIST_PROTOTYPE(string str) + End /// @brief Function prototype for use with #CallFunctionForEachListItem -threadsafe Function CALL_FUNCTION_LIST_PROTOTYPE_TS(str) - string str +threadsafe Function CALL_FUNCTION_LIST_PROTOTYPE_TS(string str) + End /// @brief Convenience function to call the function f with each list item /// /// The function's type must be #CALL_FUNCTION_LIST_PROTOTYPE where the return /// type is ignored. -Function CallFunctionForEachListItem(f, list, [sep]) - FUNCREF CALL_FUNCTION_LIST_PROTOTYPE f - string list, sep +Function CallFunctionForEachListItem(FUNCREF CALL_FUNCTION_LIST_PROTOTYPE f, string list, [string sep]) variable i, numEntries string entry @@ -247,9 +239,7 @@ End /// Compatibility wrapper for threadsafe functions `f` /// /// @see CallFunctionForEachListItem() -threadsafe Function CallFunctionForEachListItem_TS(f, list, [sep]) - FUNCREF CALL_FUNCTION_LIST_PROTOTYPE_TS f - string list, sep +threadsafe Function CallFunctionForEachListItem_TS(FUNCREF CALL_FUNCTION_LIST_PROTOTYPE_TS f, string list, [string sep]) variable i, numEntries string entry @@ -269,12 +259,7 @@ End /// @brief Return the row index of the given value, string converted to a variable, or wv /// /// Assumes wv being one dimensional and does not use any tolerance for numerical values. -threadsafe Function GetRowIndex(wv, [val, str, refWave, reverseSearch]) - WAVE wv - variable val - string str - WAVE/Z refWave - variable reverseSearch +threadsafe Function GetRowIndex(WAVE wv, [variable val, string str, WAVE/Z refWave, variable reverseSearch]) variable numEntries, i @@ -397,9 +382,7 @@ End /// /// @param inwave The wave that will have its rows shuffled. /// @param noiseGenMode [optional, defaults to #NOISE_GEN_XOSHIRO] type of RNG to use -Function InPlaceRandomShuffle(inwave, [noiseGenMode]) - WAVE inwave - variable noiseGenMode +Function InPlaceRandomShuffle(WAVE inwave, [variable noiseGenMode]) variable i, j, emax, temp variable N = DimSize(inwave, ROWS) @@ -435,9 +418,7 @@ End /// @returns 2-dim wave with the start, stop, step as columns and rows as /// number of elements. Returns -1 instead of `*` or `(empty)`. An invalid /// wave reference is returned on parsing errors. -Function/WAVE ExtractFromSubrange(listOfRanges, dim) - string listOfRanges - variable dim +Function/WAVE ExtractFromSubrange(string listOfRanges, variable dim) variable numElements, i, start, stop, step string str, rdSpec, stopStr @@ -487,7 +468,7 @@ Function/WAVE ExtractFromSubrange(listOfRanges, dim) ranges[i][2] = 1 endif elseif(V_Flag == 3) // case 6 - stop = str2num(stopStr) // case 5 + stop = str2num(stopStr) // case 5 ranges[i][0] = start ranges[i][1] = IsFinite(stop) ? stop : -1 ranges[i][2] = step @@ -505,6 +486,7 @@ End /// Given {1, 2, 10} and {2, 5, 11} this will return {1, 2, 5, 10, 11}. /// The order of the returned entries is not defined. threadsafe Function/WAVE GetSetUnion(WAVE wave1, WAVE wave2) + variable type, wave1Points, wave2Points, totalPoints ASSERT_TS((IsNumericWave(wave1) && IsNumericWave(wave2)) \ @@ -814,6 +796,7 @@ End /// In both cases the dimension label of the each column holds the number of found levels /// in each data colum. This will be always 1 for FINDLEVEL_MODE_SINGLE. threadsafe Function/WAVE FindLevelWrapper(WAVE data, variable level, variable edge, variable mode, [variable maxNumLevels]) + variable numCols, numColsFixed, numRows, numLayers, xDelta, maxLevels, numLevels variable first, last, i, xLevel, found, columnOffset @@ -972,8 +955,9 @@ End /// From https://www.wavemetrics.com/code-snippet/binary-search-pre-sorted-text-waves by Jamie Boyd /// Completely reworked, fixed and removed unused features threadsafe Function BinarySearchText(WAVE/T theWave, string theText, [variable caseSensitive, variable startPos, variable endPos]) - variable iPos // the point to be compared - variable theCmp // the result of the comparison + + variable iPos // the point to be compared + variable theCmp // the result of the comparison variable firstPt variable lastPt variable i @@ -1037,6 +1021,7 @@ End /// and write the result into output[][col]. The result is capped to the output rows. /// No window function is applied. threadsafe Function DoPowerSpectrum(WAVE input, WAVE output, variable col) + variable numRows = DimSize(input, ROWS) Duplicate/FREE/RMD=[*][col] input, slice diff --git a/Packages/MIES/MIES_Utilities_Checks.ipf b/Packages/MIES/MIES_Utilities_Checks.ipf index 71f139822b..a4512998b9 100644 --- a/Packages/MIES/MIES_Utilities_Checks.ipf +++ b/Packages/MIES/MIES_Utilities_Checks.ipf @@ -14,8 +14,7 @@ /// @hidecallgraph /// @hidecallergraph /// UTF_NOINSTRUMENTATION -threadsafe Function IsFinite(var) - variable var +threadsafe Function IsFinite(variable var) return numType(var) == 0 End @@ -25,8 +24,7 @@ End /// @hidecallgraph /// @hidecallergraph /// UTF_NOINSTRUMENTATION -threadsafe Function IsNaN(var) - variable var +threadsafe Function IsNaN(variable var) return numType(var) == 2 End @@ -47,8 +45,7 @@ End /// @hidecallgraph /// @hidecallergraph /// UTF_NOINSTRUMENTATION -threadsafe Function IsNull(str) - string &str +threadsafe Function IsNull(string &str) variable len = strlen(str) return numtype(len) == 2 @@ -70,8 +67,7 @@ End /// @hidecallgraph /// @hidecallergraph /// UTF_NOINSTRUMENTATION -Function WindowExists(win) - string win +Function WindowExists(string win) return WinType(win) != 0 End @@ -79,9 +75,7 @@ End /// @brief Check that the given value can be stored in the wave /// /// Does currently ignore floating point precision and ranges for integer waves -threadsafe Function ValueCanBeWritten(wv, value) - WAVE/Z wv - variable value +threadsafe Function ValueCanBeWritten(WAVE/Z wv, variable value) variable type @@ -105,8 +99,7 @@ End /// @brief Returns one if var is an integer and zero otherwise /// UTF_NOINSTRUMENTATION -threadsafe Function IsInteger(var) - variable var +threadsafe Function IsInteger(variable var) return IsFinite(var) && trunc(var) == var End @@ -132,8 +125,7 @@ End /// @return 1 if pointing to prototype function, 0 otherwise /// /// UTF_NOINSTRUMENTATION -threadsafe Function FuncRefIsAssigned(funcInfo) - string funcInfo +threadsafe Function FuncRefIsAssigned(string funcInfo) variable result @@ -158,8 +150,7 @@ End /// @param strong_or_weak [optional, defaults to strong] type of condition, can be zero for weak or 1 for strong /// /// UTF_NOINSTRUMENTATION -Function CheckIfClose(var1, var2, [tol, strong_or_weak]) - variable var1, var2, tol, strong_or_weak +Function CheckIfClose(variable var1, variable var2, [variable tol, variable strong_or_weak]) if(ParamIsDefault(tol)) tol = 1e-8 @@ -184,9 +175,7 @@ End /// /// @param var variable /// @param tol [optional, defaults to 1e-8] tolerance -Function CheckIfSmall(var, [tol]) - variable var - variable tol +Function CheckIfSmall(variable var, [variable tol]) if(ParamIsDefault(tol)) tol = 1e-8 @@ -197,32 +186,28 @@ End /// @brief Return 1 if the wave is a text wave, zero otherwise /// UTF_NOINSTRUMENTATION -threadsafe Function IsTextWave(wv) - WAVE wv +threadsafe Function IsTextWave(WAVE wv) return WaveType(wv, 1) == 2 End /// @brief Return 1 if the wave is a numeric wave, zero otherwise /// UTF_NOINSTRUMENTATION -threadsafe Function IsNumericWave(wv) - WAVE wv +threadsafe Function IsNumericWave(WAVE wv) return WaveType(wv, 1) == 1 End /// @brief Return 1 if the wave is a wave reference wave, zero otherwise /// UTF_NOINSTRUMENTATION -threadsafe Function IsWaveRefWave(wv) - WAVE wv +threadsafe Function IsWaveRefWave(WAVE wv) return WaveType(wv, 1) == IGOR_TYPE_WAVEREF_WAVE End /// @brief Return 1 if the wave is a floating point wave /// UTF_NOINSTRUMENTATION -threadsafe Function IsFloatingPointWave(wv) - WAVE wv +threadsafe Function IsFloatingPointWave(WAVE wv) variable type = WaveType(wv) @@ -232,8 +217,7 @@ End /// @brief Return 1 if the wave is a double (64bit) precision floating point wave /// /// UTF_NOINSTRUMENTATION -threadsafe Function IsDoubleFloatingPointWave(wv) - WAVE wv +threadsafe Function IsDoubleFloatingPointWave(WAVE wv) return WaveType(wv) & IGOR_TYPE_64BIT_FLOAT End @@ -241,22 +225,19 @@ End /// @brief Return 1 if the wave is a single (32bit) precision floating point wave /// /// UTF_NOINSTRUMENTATION -threadsafe Function IsSingleFloatingPointWave(wv) - WAVE wv +threadsafe Function IsSingleFloatingPointWave(WAVE wv) return WaveType(wv) & IGOR_TYPE_32BIT_FLOAT End /// @brief Return 1 if the wave is a global wave (not a null wave and not a free wave) -threadsafe Function IsGlobalWave(wv) - WAVE wv +threadsafe Function IsGlobalWave(WAVE wv) return WaveType(wv, 2) == 1 End /// @brief Return 1 if the wave is a complex wave -threadsafe Function IsComplexWave(wv) - WAVE wv +threadsafe Function IsComplexWave(WAVE wv) return WaveType(wv) & IGOR_TYPE_COMPLEX End @@ -264,8 +245,7 @@ End /// @brief Return true if wv is a free wave, false otherwise /// /// UTF_NOINSTRUMENTATION -threadsafe Function IsFreeWave(wv) - WAVE wv +threadsafe Function IsFreeWave(WAVE wv) return WaveType(wv, 2) == 2 End @@ -331,8 +311,7 @@ End /// @param[in] str string to check for suffix /// @param[in] suffix to check for /// @returns 1 if str ends with suffix, 0 otherwise. If str and/or suffix are empty or null 0 is returned. -Function StringEndsWith(str, suffix) - string str, suffix +Function StringEndsWith(string str, string suffix) variable pos @@ -406,6 +385,7 @@ End /// @brief Return true if the passed regular expression is well-formed threadsafe Function IsValidRegexp(string regexp) + variable err, result // GrepString and friends treat an empty regular expression as *valid* @@ -498,8 +478,7 @@ End /// @brief Check if all elements of the string list are the same /// /// Returns true for lists with less than one element -Function ListHasOnlyOneUniqueEntry(list, [sep]) - string list, sep +Function ListHasOnlyOneUniqueEntry(string list, [string sep]) variable numElements, i string element, refElement diff --git a/Packages/MIES/MIES_Utilities_Conversions.ipf b/Packages/MIES/MIES_Utilities_Conversions.ipf index 4f92e167ef..aedae7b30d 100644 --- a/Packages/MIES/MIES_Utilities_Conversions.ipf +++ b/Packages/MIES/MIES_Utilities_Conversions.ipf @@ -10,22 +10,19 @@ /// @brief Utility functions for conversions /// @brief Convert Bytes to MiBs, a mebibyte being 2^20. -Function ConvertFromBytesToMiB(var) - variable var +Function ConvertFromBytesToMiB(variable var) return var / 1024 / 1024 End /// @brief Convert the sampling interval in microseconds (1e-6s) to the rate in kHz -threadsafe Function ConvertSamplingIntervalToRate(val) - variable val +threadsafe Function ConvertSamplingIntervalToRate(variable val) return 1 / (val * MICRO_TO_ONE) * ONE_TO_KILO End /// @brief Convert the rate in kHz to the sampling interval in microseconds (1e-6s) -threadsafe Function ConvertRateToSamplingInterval(val) - variable val +threadsafe Function ConvertRateToSamplingInterval(variable val) return 1 / (val * KILO_TO_ONE) * ONE_TO_MICRO End @@ -45,7 +42,8 @@ End /// /// Counterpart @see ConvertListToTextWave /// @see NumericWaveToList -threadsafe Function/S TextWaveToList(WAVE/T/Z txtWave, string rowSep, [string colSep, string layerSep, string chunkSep, variable stopOnEmpty, variable maxElements, variable trailSep]) +threadsafe Function/S TextWaveToList(WAVE/Z/T txtWave, string rowSep, [string colSep, string layerSep, string chunkSep, variable stopOnEmpty, variable maxElements, variable trailSep]) + string entry, seps string list = "" variable i, j, k, l, lasti, lastj, lastk, lastl, numRows, numCols, numLayers, numChunks, count, done @@ -209,10 +207,7 @@ End /// '_free_'[0][0][1][1]= {"","","",""} /// '_free_'[0][0][0][2]= {"6","","",""} /// '_free_'[0][0][1][2]= {"","","",""} -threadsafe Function/WAVE ListToTextWaveMD(list, dims, [rowSep, colSep, laySep, chuSep]) - string list - variable dims - string rowSep, colSep, laySep, chuSep +threadsafe Function/WAVE ListToTextWaveMD(string list, variable dims, [string rowSep, string colSep, string laySep, string chuSep]) variable colSize, laySize, chuSize variable rowMaxSize, colMaxSize, layMaxSize, chuMaxSize @@ -410,8 +405,7 @@ End /// /// This allows to specify the minimum number of significant digits. /// The normal printf/sprintf specifier only allows the maximum number of significant digits for `%g`. -Function/S FloatWithMinSigDigits(var, [numMinSignDigits]) - variable var, numMinSignDigits +Function/S FloatWithMinSigDigits(variable var, [variable numMinSignDigits]) variable numMag @@ -430,22 +424,19 @@ Function/S FloatWithMinSigDigits(var, [numMinSignDigits]) End // @brief Convert a number to the strings `Passed` (!= 0) or `Failed` (0). -Function/S ToPassFail(passedOrFailed) - variable passedOrFailed +Function/S ToPassFail(variable passedOrFailed) return SelectString(passedOrFailed, "failed", "passed") End // @brief Convert a number to the strings `True` (!= 0) or `False` (0). -Function/S ToTrueFalse(var) - variable var +Function/S ToTrueFalse(variable var) return SelectString(var, "False", "True") End // @brief Convert a number to the strings `On` (!= 0) or `Off` (0). -Function/S ToOnOff(var) - variable var +Function/S ToOnOff(variable var) return SelectString(var, "Off", "On") End @@ -453,8 +444,7 @@ End /// @brief Convert the DAQ run mode to a string /// /// @param runMode One of @ref DAQRunModes -threadsafe Function/S DAQRunModeToString(runMode) - variable runMode +threadsafe Function/S DAQRunModeToString(variable runMode) switch(runMode) case DAQ_NOT_RUNNING: @@ -478,8 +468,7 @@ End /// @brief Convert the Testpulse run mode to a string /// /// @param runMode One of @ref TestPulseRunModes -threadsafe Function/S TestPulseRunModeToString(runMode) - variable runMode +threadsafe Function/S TestPulseRunModeToString(variable runMode) runMode = ClearBit(runMode, TEST_PULSE_DURING_RA_MOD) @@ -515,6 +504,7 @@ End /// /// @return string with textual number representation threadsafe Function/S num2strHighPrec(variable val, [variable precision, variable shorten]) + string str precision = ParamIsDefault(precision) ? 5 : precision @@ -542,9 +532,7 @@ End /// numer of points in the wave. /// /// @returns an existing index in @p wv between 0 and `DimSize(wv, dim) - 1` -Function ScaleToIndexWrapper(wv, scale, dim) - WAVE wv - variable scale, dim +Function ScaleToIndexWrapper(WAVE wv, variable scale, variable dim) variable index @@ -567,8 +555,7 @@ End /// @brief Convert a hexadecimal character into a number /// /// UTF_NOINSTRUMENTATION -threadsafe Function HexToNumber(ch) - string ch +threadsafe Function HexToNumber(string ch) variable var @@ -583,8 +570,7 @@ End /// @brief Convert a number into hexadecimal /// /// UTF_NOINSTRUMENTATION -threadsafe Function/S NumberToHex(var) - variable var +threadsafe Function/S NumberToHex(variable var) string str @@ -600,8 +586,7 @@ End /// This function works on a byte level so it does not care about endianess. /// /// UTF_NOINSTRUMENTATION -threadsafe Function/WAVE HexToBinary(str) - string str +threadsafe Function/WAVE HexToBinary(string str) variable length @@ -788,16 +773,16 @@ Function/WAVE JSONToWave(string str, [string path]) ASSERT(0, "Type is not supported: " + type) endswitch - WAVE/D/Z dimSizes = JSON_GetWave(jsonID, path + "/dimension/size", waveMode = 1, ignoreErr = 1) + WAVE/Z/D dimSizes = JSON_GetWave(jsonID, path + "/dimension/size", waveMode = 1, ignoreErr = 1) ASSERT(WaveExists(dimSizes), "dimension sizes are missing") Make/D/FREE/N=(MAX_DIMENSION_COUNT) newSizes = -1 newSizes[0, DimSize(dimSizes, ROWS) - 1] = dimSizes[p] Redimension/N=(newSizes[0], newSizes[1], newSizes[2], newSizes[3]) data - WAVE/D/Z dimDeltas = JSON_GetWave(jsonID, path + "/dimension/delta", waveMode = 1, ignoreErr = 1) - WAVE/D/Z dimOffsets = JSON_GetWave(jsonID, path + "/dimension/offset", waveMode = 1, ignoreErr = 1) - WAVE/T/Z dimUnits = JSON_GetTextWave(jsonID, path + "/dimension/unit", ignoreErr = 1) + WAVE/Z/D dimDeltas = JSON_GetWave(jsonID, path + "/dimension/delta", waveMode = 1, ignoreErr = 1) + WAVE/Z/D dimOffsets = JSON_GetWave(jsonID, path + "/dimension/offset", waveMode = 1, ignoreErr = 1) + WAVE/Z/T dimUnits = JSON_GetTextWave(jsonID, path + "/dimension/unit", ignoreErr = 1) if(WaveExists(dimDeltas) || WaveExists(dimOffsets) || WaveExists(dimUnits)) @@ -843,7 +828,7 @@ Function/WAVE JSONToWave(string str, [string path]) endfor endif - WAVE/T/Z dimLabelsFull = JSON_GetTextWave(jsonID, path + "/dimension/label/full", ignoreErr = 1) + WAVE/Z/T dimLabelsFull = JSON_GetTextWave(jsonID, path + "/dimension/label/full", ignoreErr = 1) if(WaveExists(dimLabelsFull)) for(lbl : dimLabelsFull) @@ -852,7 +837,7 @@ Function/WAVE JSONToWave(string str, [string path]) endfor endif - WAVE/T/Z dimLabelsEach = JSON_GetTextWave(jsonID, path + "/dimension/label/each", ignoreErr = 1) + WAVE/Z/T dimLabelsEach = JSON_GetTextWave(jsonID, path + "/dimension/label/each", ignoreErr = 1) if(WaveExists(dimLabelsEach)) ASSERT(DimSize(dimLabelsEach, ROWS) == Sum(dimSizes), "Mismatched dimension label each wave") @@ -866,7 +851,7 @@ Function/WAVE JSONToWave(string str, [string path]) // no way to restore the modification date - WAVE/D/Z dataFullScale = JSON_GetWave(jsonID, path + "/data/fullScale", waveMode = 1, ignoreErr = 1) + WAVE/Z/D dataFullScale = JSON_GetWave(jsonID, path + "/data/fullScale", waveMode = 1, ignoreErr = 1) if(!WaveExists(dataFullScale)) Make/FREE/D dataFullScale = {0, 0} diff --git a/Packages/MIES/MIES_Utilities_DataFolder.ipf b/Packages/MIES/MIES_Utilities_DataFolder.ipf index 55e55939b7..eebbf80150 100644 --- a/Packages/MIES/MIES_Utilities_DataFolder.ipf +++ b/Packages/MIES/MIES_Utilities_DataFolder.ipf @@ -21,10 +21,7 @@ /// @param exprType [optional, defaults: MATCH_REGEXP] convention used for matchExpr, one of @ref MatchExpressions /// /// @returns list of object names matching matchExpr -threadsafe Function/S GetListOfObjects(dfr, matchExpr, [typeFlag, fullPath, recursive, exprType]) - DFREF dfr - string matchExpr - variable fullPath, recursive, typeFlag, exprType +threadsafe Function/S GetListOfObjects(DFREF dfr, string matchExpr, [variable typeFlag, variable fullPath, variable recursive, variable exprType]) variable i, numFolders string name, folders, basePath, subList, freeDFName @@ -142,8 +139,7 @@ End /// Includes fast handling of the common case that the datafolder exists. /// @returns reference to the datafolder /// UTF_NOINSTRUMENTATION -threadsafe Function/DF createDFWithAllParents(dataFolder) - string dataFolder +threadsafe Function/DF createDFWithAllParents(string dataFolder) variable i, numItems string partialPath, component @@ -174,8 +170,7 @@ End /// /// @param dfr data folder reference to kill /// @returns 1 in case the folder was removed and 0 in all other cases -Function RemoveEmptyDataFolder(dfr) - DFREF dfr +Function RemoveEmptyDataFolder(DFREF dfr) if(!DataFolderExistsDFR(dfr)) return 0 @@ -202,8 +197,7 @@ Function IsDataFolderEmpty(DFREF dfr) End /// @brief Remove all empty datafolders in the passed datafolder reference recursively including sourceDFR -Function RemoveAllEmptyDataFolders(sourceDFR) - DFREF sourceDFR +Function RemoveAllEmptyDataFolders(DFREF sourceDFR) variable numFolder, i string folder @@ -228,9 +222,7 @@ End /// /// @param dfr datafolder reference where the new datafolder should be created /// @param baseName first part of the datafolder, might be shortend due to Igor Pro limitations -threadsafe Function/DF UniqueDataFolder(dfr, baseName) - DFREF dfr - string baseName +threadsafe Function/DF UniqueDataFolder(DFREF dfr, string baseName) string path @@ -298,5 +290,6 @@ End /// @brief Clear the given datafolder reference threadsafe Function DFREFClear(DFREF &dfr) + DFREF dfr = $"" End diff --git a/Packages/MIES/MIES_Utilities_Debugger.ipf b/Packages/MIES/MIES_Utilities_Debugger.ipf index 36673763c6..52549e78b8 100644 --- a/Packages/MIES/MIES_Utilities_Debugger.ipf +++ b/Packages/MIES/MIES_Utilities_Debugger.ipf @@ -43,8 +43,7 @@ End /// ResetDebuggerState(debuggerState) /// // now the debugger is in the same state as before /// \endrst -Function ResetDebuggerState(debuggerState) - variable debuggerState +Function ResetDebuggerState(variable debuggerState) variable debugOnError, nvarChecking @@ -72,8 +71,7 @@ End /// @brief Reset Debug on Error state /// /// @param debugOnError state before, usually the same value as DisableDebugOnError() returned -Function ResetDebugOnError(debugOnError) - variable debugOnError +Function ResetDebugOnError(variable debugOnError) if(!debugOnError) return NaN diff --git a/Packages/MIES/MIES_Utilities_File.ipf b/Packages/MIES/MIES_Utilities_File.ipf index 0b7e4d6df0..c62a3431f6 100644 --- a/Packages/MIES/MIES_Utilities_File.ipf +++ b/Packages/MIES/MIES_Utilities_File.ipf @@ -17,8 +17,7 @@ /// @param symbPath symbolic path /// @param baseName base name of the file, must not be empty /// @param suffix file/folder suffix -Function/S UniqueFileOrFolder(symbPath, baseName, [suffix]) - string symbPath, baseName, suffix +Function/S UniqueFileOrFolder(string symbPath, string baseName, [string suffix]) string file variable i = 1 @@ -49,8 +48,7 @@ Function/S UniqueFileOrFolder(symbPath, baseName, [suffix]) End /// @brief Return true if the given absolute path refers to an existing drive letter -Function IsDriveValid(absPath) - string absPath +Function IsDriveValid(string absPath) string drive @@ -72,8 +70,7 @@ End /// @brief Create a folder recursively on disk given an absolute path /// /// If you pass windows style paths using backslashes remember to always *double* them. -Function CreateFolderOnDisk(absPath) - string absPath +Function CreateFolderOnDisk(string absPath) string path, partialPath, tempPath variable numParts, i @@ -106,8 +103,7 @@ End /// @param filePathWithSuffix full path /// @param sep [optional, defaults to ":"] character /// separating the path components -threadsafe Function/S GetBaseName(filePathWithSuffix, [sep]) - string filePathWithSuffix, sep +threadsafe Function/S GetBaseName(string filePathWithSuffix, [string sep]) if(ParamIsDefault(sep)) sep = ":" @@ -123,8 +119,7 @@ End /// @param filePathWithSuffix full path /// @param sep [optional, defaults to ":"] character /// separating the path components -threadsafe Function/S GetFileSuffix(filePathWithSuffix, [sep]) - string filePathWithSuffix, sep +threadsafe Function/S GetFileSuffix(string filePathWithSuffix, [string sep]) if(ParamIsDefault(sep)) sep = ":" @@ -141,8 +136,7 @@ End /// @param filePathWithSuffix full path /// @param sep [optional, defaults to ":"] character /// separating the path components -threadsafe Function/S GetFolder(filePathWithSuffix, [sep]) - string filePathWithSuffix, sep +threadsafe Function/S GetFolder(string filePathWithSuffix, [string sep]) if(ParamIsDefault(sep)) sep = ":" @@ -158,8 +152,7 @@ End /// @param filePathWithSuffix full path /// @param sep [optional, defaults to ":"] character /// separating the path components -threadsafe Function/S GetFile(filePathWithSuffix, [sep]) - string filePathWithSuffix, sep +threadsafe Function/S GetFile(string filePathWithSuffix, [string sep]) if(ParamIsDefault(sep)) sep = ":" @@ -169,8 +162,7 @@ threadsafe Function/S GetFile(filePathWithSuffix, [sep]) End /// @brief Return the path converted to a windows style path -threadsafe Function/S GetWindowsPath(path) - string path +threadsafe Function/S GetWindowsPath(string path) return ParseFilepath(5, path, "\\", 0, 0) End @@ -191,8 +183,7 @@ End /// /// @return full path or an empty string if the file does not exist or the /// shortcut points to a non existing file/folder -Function/S ResolveAlias(path, [pathName]) - string pathName, path +Function/S ResolveAlias(string path, [string pathName]) if(ParamIsDefault(pathName)) GetFileFolderInfo/Q/Z path @@ -223,8 +214,7 @@ End /// string symbPath = GetUniqueSymbolicPath() /// NewPath/Q/O $symbPath, "C:" /// \endrst -Function/S GetUniqueSymbolicPath([prefix]) - string prefix +Function/S GetUniqueSymbolicPath([string prefix]) if(ParamIsDefault(prefix)) prefix = "temp_" @@ -245,8 +235,7 @@ End /// /// @param pathName igor symbolic path to search recursively /// @param extension [optional, defaults to all files] file suffixes to search for -Function/S GetAllFilesRecursivelyFromPath(pathName, [extension]) - string pathName, extension +Function/S GetAllFilesRecursivelyFromPath(string pathName, [string extension]) string fileOrPath, folders, subFolderPathName, fileName string files, allFilesList @@ -286,7 +275,7 @@ Function/S GetAllFilesRecursivelyFromPath(pathName, [extension]) endfor AssertOnAndClearRTError() - folders = IndexedDir($pathName, -1, 1, FILE_LIST_SEP); err = GetRTError(1) + folders = IndexedDir($pathName, -1, 1, FILE_LIST_SEP); err = GetRTError(1) folders = folders + foldersFromAlias WAVE/T wFolders = ListToTextWave(folders, FILE_LIST_SEP) for(folder : wFolders) @@ -336,9 +325,7 @@ End /// /// @param diskPath path on disk to check /// @param requiredFreeSpace required free space in GB -Function HasEnoughDiskspaceFree(diskPath, requiredFreeSpace) - string diskPath - variable requiredFreeSpace +Function HasEnoughDiskspaceFree(string diskPath, variable requiredFreeSpace) variable leftOverBytes @@ -352,6 +339,7 @@ End /// @brief Return a `/Z` flag value for the `Open` operation which works with /// automated testing Function GetOpenZFlag() + #ifdef AUTOMATED_TESTING return 1 // no dialog if the file does not exist #else @@ -368,9 +356,7 @@ End /// @param[out] savedFileName [optional, default = ""] file name of the saved file /// @param[in] showDialogOnOverwrite [optional, default = 0] opens save file dialog, if the current fileName would cause an overwrite, to allow user to change fileName /// @returns NaN if file open dialog was aborted or an error was encountered, 0 otherwise -Function SaveTextFile(data, fileName, [fileFilter, message, savedFileName, showDialogOnOverwrite]) - string data, fileName, fileFilter, message, &savedFileName - variable showDialogOnOverwrite +Function SaveTextFile(string data, string fileName, [string fileFilter, string message, string &savedFileName, variable showDialogOnOverwrite]) variable fNum, dialogCode @@ -481,8 +467,7 @@ End /// @brief Check wether the given path points to an existing file /// /// Resolves shortcuts and symlinks recursively. -Function FileExists(filepath) - string filepath +Function FileExists(string filepath) filepath = ResolveAlias(filepath) AssertOnAndClearRTError() @@ -496,8 +481,7 @@ Function FileExists(filepath) End /// @brief Check wether the given path points to an existing folder -Function FolderExists(folderpath) - string folderpath +Function FolderExists(string folderpath) folderpath = ResolveAlias(folderpath) AssertOnAndClearRTError() @@ -511,8 +495,7 @@ Function FolderExists(folderpath) End /// @brief Return the file version -Function/S GetFileVersion(filepath) - string filepath +Function/S GetFileVersion(string filepath) filepath = ResolveAlias(filepath) AssertOnAndClearRTError() @@ -552,11 +535,13 @@ End /// /// The path *must* exist. Function/S HFSPathToPosix(string path) + return ParseFilePath(9, path, "*", 0, 0) End /// @brief Convert a HFS path (`:`) to a Windows path (`\\`) Function/S HFSPathToWindows(string path) + return ParseFilePath(5, path, "\\", 0, 0) End @@ -628,6 +613,7 @@ End /// @brief Load the wave `$name.itx` from the folder of this procedure file and store /// it in the static data folder. Function/WAVE LoadWaveFromDisk(string name) + string path path = GetFolder(FunctionPath("")) + name + ".itx" @@ -650,6 +636,7 @@ End /// @brief Store the given wave as `$name.itx` in the same folder as this /// procedure file on disk. Function StoreWaveOnDisk(WAVE wv, string name) + string path ASSERT(IsValidObjectName(name), "Name is not a valid igor object name") @@ -676,14 +663,14 @@ End #ifdef MACINTOSH threadsafe Function MU_GetFreeDiskSpace(string path) + ASSERT_TS(0, "Not implemented") End #endif /// @brief Cleanup the experiment name -Function/S CleanupExperimentName(expName) - string expName +Function/S CleanupExperimentName(string expName) // Remove the following suffixes: // - sibling @@ -701,9 +688,7 @@ End /// @param path absolute path to a file /// @param method [optional, defaults to #HASH_SHA2_256] /// Type of cryptographic hash function, one of @ref HASH_SHA2_256 -Function/S CalcHashForFile(path, [method]) - string path - variable method +Function/S CalcHashForFile(string path, [variable method]) string contents, loadedFilePath @@ -720,8 +705,7 @@ End /// @brief Check if the file paths referenced in `list` are pointing /// to identical files -Function CheckIfPathsRefIdenticalFiles(list) - string list +Function CheckIfPathsRefIdenticalFiles(string list) variable i, numEntries string path, refHash, newHash diff --git a/Packages/MIES/MIES_Utilities_GUI.ipf b/Packages/MIES/MIES_Utilities_GUI.ipf index 24e937fc63..aa6e272310 100644 --- a/Packages/MIES/MIES_Utilities_GUI.ipf +++ b/Packages/MIES/MIES_Utilities_GUI.ipf @@ -16,10 +16,7 @@ End /// @brief Check if a given wave, or at least one wave from the dfr, is displayed on a graph /// /// @return one if one is displayed, zero otherwise -Function IsWaveDisplayedOnGraph(win, [wv, dfr]) - string win - WAVE/Z wv - DFREF dfr +Function IsWaveDisplayedOnGraph(string win, [WAVE/Z wv, DFREF dfr]) string traceList, trace, list variable numWaves, numTraces, i @@ -59,8 +56,7 @@ End /// /// @param graphs semicolon separated list of graph names /// @param cursorName name of cursor as string -Function KillCursorInGraphs(graphs, cursorName) - string graphs, cursorName +Function KillCursorInGraphs(string graphs, string cursorName) string graph variable i, numGraphs @@ -84,8 +80,7 @@ End /// @param cursorName name of cursor as string /// /// @return graph where cursor was found -Function/S FindCursorInGraphs(graphs, cursorName) - string graphs, cursorName +Function/S FindCursorInGraphs(string graphs, string cursorName) string graph, csr variable i, numGraphs @@ -114,9 +109,7 @@ End /// @param[in] graph where the cursor are /// @param[out] csrAx Position of cursor A /// @param[out] csrBx Position of cursor B -Function GetCursorXPositionAB(graph, csrAx, csrBx) - string graph - variable &csrAx, &csrBx +Function GetCursorXPositionAB(string graph, variable &csrAx, variable &csrBx) string csrA, csrB @@ -135,8 +128,7 @@ Function GetCursorXPositionAB(graph, csrAx, csrBx) End ///@brief Removes all annotations from the graph -Function RemoveAnnotationsFromGraph(graph) - string graph +Function RemoveAnnotationsFromGraph(string graph) DeleteAnnotations/W=$graph/A End @@ -149,8 +141,7 @@ End /// /// @param graph existing graph /// @param baseName base name of the trace, must not be empty -Function/S UniqueTraceName(graph, baseName) - string graph, baseName +Function/S UniqueTraceName(string graph, string baseName) variable i = 1 variable numTrials @@ -181,8 +172,7 @@ End /// /// @param numPoints number of points shown /// @param numMarkers desired number of markers -Function GetMarkerSkip(numPoints, numMarkers) - variable numPoints, numMarkers +Function GetMarkerSkip(variable numPoints, variable numMarkers) if(!IsFinite(numPoints) || !IsFinite(numMarkers)) return 1 @@ -194,8 +184,7 @@ End /// @brief Kill all passed windows /// /// Silently ignore errors. -Function KillWindows(list) - string list +Function KillWindows(string list) variable numEntries, i @@ -209,9 +198,7 @@ End /// /// @param graph graph /// @param axisOrientation One of @ref AxisOrientationConstants -Function/S GetAllAxesWithOrientation(graph, axisOrientation) - string graph - variable axisOrientation +Function/S GetAllAxesWithOrientation(string graph, variable axisOrientation) string axList, axis string list = "" @@ -237,11 +224,7 @@ End /// @param key keyword /// @param listChar empty, `{` or `(` depending on keyword style /// @param item return the given element from the extracted list -Function GetNumFromModifyStr(info, key, listChar, item) - string info - string key - string listChar - variable item +Function GetNumFromModifyStr(string info, string key, string listChar, variable item) string list, escapedListChar, regexp @@ -267,8 +250,7 @@ End /// to lowest starting value of the `axisEnab` keyword. /// /// `list` must be from one orientation, usually something returned by GetAllAxesWithOrientation() -Function/S SortAxisList(graph, list) - string graph, list +Function/S SortAxisList(string graph, string list) variable numAxes, i string axis @@ -293,9 +275,7 @@ Function/S SortAxisList(graph, list) return TextWaveToList(axisListWave, ";") End -Function GetPlotArea(win, s) - string win - STRUCT RectD &s +Function GetPlotArea(string win, STRUCT RectD &s) InitRectD(s) @@ -467,9 +447,7 @@ End /// schemes to list of axes, see sortingOrder parameter of `SortList` /// @param listForBegin [optional, defaults to an empty list] list of axes to move to the front of the sorted axis list /// @param listForEnd [optional, defaults to an empty list] list of axes to move to the end of the sorted axis list -Function EquallySpaceAxis(graph, [axisRegExp, axisOffset, axisOrientation, sortOrder, listForBegin, listForEnd]) - string graph, axisRegExp, listForBegin, listForEnd - variable axisOffset, axisOrientation, sortOrder +Function EquallySpaceAxis(string graph, [string axisRegExp, variable axisOffset, variable axisOrientation, variable sortOrder, string listForBegin, string listForEnd]) variable numAxes, i string axes, axis, list @@ -580,8 +558,7 @@ Function EquallySpaceAxisPA(string graph, string allAxes, string distAxes, [vari End /// @brief Remove all free axis from the given graph -Function RemoveFreeAxisFromGraph(graph) - string graph +Function RemoveFreeAxisFromGraph(string graph) string list, name, info variable i, numEntries @@ -603,6 +580,7 @@ End /// @brief Remove all draw layers from the graph Function RemoveDrawLayers(string graph) + variable i, numLayers Make/FREE/T layers = {"ProgBack", "UserBack", "ProgAxes", "UserAxes", "ProgFront", "UserFront", "Overlay"} @@ -622,11 +600,7 @@ End /// @param dfr [optional, default: ignored] remove all traces which stem from one of the waves in dfr /// /// Only one of trace/wv/dfr may be supplied. -Function RemoveTracesFromGraph(graph, [trace, wv, dfr]) - string graph - string trace - WAVE/Z wv - DFREF dfr +Function RemoveTracesFromGraph(string graph, [string trace, WAVE/Z wv, DFREF dfr]) variable i, numEntries, numOptArgs, remove_all_traces, err string traceList, refTrace @@ -681,17 +655,13 @@ Function RemoveTracesFromGraph(graph, [trace, wv, dfr]) End /// @brief Add user data "panelVersion" to the panel -Function AddVersionToPanel(win, version) - string win - variable version +Function AddVersionToPanel(string win, variable version) SetWindow $win, userData(panelVersion)=num2str(version) End /// @brief Return 1 if the panel is up to date, zero otherwise -Function HasPanelLatestVersion(win, expectedVersion) - string win - variable expectedVersion +Function HasPanelLatestVersion(string win, variable expectedVersion) variable version @@ -709,8 +679,7 @@ End /// @param win panel window as string /// @returns numeric panel version greater 0 and -1 if no version is present /// or -2 if the windows does not exist -Function GetPanelVersion(win) - string win +Function GetPanelVersion(string win) variable version @@ -734,11 +703,7 @@ End /// @param checkBoxIn ctrl checkbox ex. cba.ctrlName /// @param checkBoxPartner checkbox that will be placed in opposite state /// @param checkBoxInState state of the ctrl checkbox -Function ToggleCheckBoxes(win, checkBoxIn, checkBoxPartner, checkBoxInState) - string win - string checkBoxIn - string checkBoxPartner - variable checkBoxInState +Function ToggleCheckBoxes(string win, string checkBoxIn, string checkBoxPartner, variable checkBoxInState) SetCheckBoxState(win, checkBoxIn, checkBoxInState) DAG_Update(win, checkBoxIn, val = checkBoxInState) @@ -752,11 +717,7 @@ End /// @param checkBoxIn ctrl checkbox ex. cba.ctrlName /// @param checkBoxPartner checkbox that will be placed in the same state /// @param checkBoxInState state of the ctrl checkbox -Function EqualizeCheckBoxes(win, checkBoxIn, checkBoxPartner, checkBoxInState) - string win - string checkBoxIn - string checkBoxPartner - variable checkBoxInState +Function EqualizeCheckBoxes(string win, string checkBoxIn, string checkBoxPartner, variable checkBoxInState) SetCheckBoxState(win, checkBoxIn, checkBoxInState) DAG_Update(win, checkBoxIn, val = checkBoxInState) diff --git a/Packages/MIES/MIES_Utilities_Generators.ipf b/Packages/MIES/MIES_Utilities_Generators.ipf index 4fa90a5672..8bca56fe8a 100644 --- a/Packages/MIES/MIES_Utilities_Generators.ipf +++ b/Packages/MIES/MIES_Utilities_Generators.ipf @@ -10,6 +10,7 @@ /// @brief utility functions that generate code Function GenerateMultiplierConstants() + variable numElements, i, j, maxLength string str diff --git a/Packages/MIES/MIES_Utilities_JSON.ipf b/Packages/MIES/MIES_Utilities_JSON.ipf index 912c8c3018..914fd86211 100644 --- a/Packages/MIES/MIES_Utilities_JSON.ipf +++ b/Packages/MIES/MIES_Utilities_JSON.ipf @@ -13,6 +13,7 @@ /// /// Fill `payload` array with content from files Function AddPayloadEntriesFromFiles(variable jsonID, WAVE/T paths, [variable isBinary]) + string data, fName, filepath, jsonpath variable numEntries, i, offset @@ -21,7 +22,7 @@ Function AddPayloadEntriesFromFiles(variable jsonID, WAVE/T paths, [variable isB for(i = 0; i < numEntries; i += 1) [data, fName] = LoadTextFile(paths[i]) - values[i] = data + values[i] = data keys[i] = GetFile(paths[i]) endfor @@ -33,6 +34,7 @@ End /// /// Fill `payload` array Function AddPayloadEntries(variable jsonID, WAVE/T keys, WAVE/T values, [variable isBinary]) + string jsonpath variable numEntries, i, offset diff --git a/Packages/MIES/MIES_Utilities_List.ipf b/Packages/MIES/MIES_Utilities_List.ipf index 1f80094051..165eaa817f 100644 --- a/Packages/MIES/MIES_Utilities_List.ipf +++ b/Packages/MIES/MIES_Utilities_List.ipf @@ -11,9 +11,7 @@ /// @brief Matches `list` against the expression `matchExpr` using the given /// convention in `exprType` -threadsafe Function/S ListMatchesExpr(list, matchExpr, exprType) - string list, matchExpr - variable exprType +threadsafe Function/S ListMatchesExpr(string list, string matchExpr, variable exprType) switch(exprType) case MATCH_REGEXP: @@ -33,9 +31,7 @@ End /// @param listSep [optional] list Separation character. default is ";" /// /// @return a list with elements ranging from itemBegin to itemEnd of the input list -Function/S ListFromList(list, itemBegin, itemEnd, [listSep]) - string list, listSep - variable itemBegin, itemEnd +Function/S ListFromList(string list, variable itemBegin, variable itemEnd, [string listSep]) variable i, numItems, start, stop @@ -75,9 +71,7 @@ End /// @param start first point of the range /// @param step step size for iterating over the range /// @param stop last point of the range -Function/S BuildList(format, start, step, stop) - string format - variable start, step, stop +Function/S BuildList(string format, variable start, variable step, variable stop) string str string list = "" @@ -100,9 +94,7 @@ End /// @param listOfWaves list of waves with full path /// @param[out] baseName Returns the common baseName if the list has one, /// otherwise this will be an empty string. -Function WaveListHasSameWaveNames(listOfWaves, baseName) - string listOfWaves - string &baseName +Function WaveListHasSameWaveNames(string listOfWaves, string &baseName) baseName = "" @@ -129,6 +121,7 @@ End /// @brief Add a string prefix to each list item and /// return the new list threadsafe Function/S AddPrefixToEachListItem(string prefix, string list, [string sep]) + string result = "" variable numEntries, i @@ -147,6 +140,7 @@ End /// @brief Add a string suffix to each list item and /// return the new list threadsafe Function/S AddSuffixToEachListItem(string suffix, string list, [string sep]) + string result = "" variable numEntries, i @@ -167,6 +161,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function/S RemovePrefixFromListItem(string prefix, string list, [string listSep, variable regExp]) + string result, entry variable numEntries, i diff --git a/Packages/MIES/MIES_Utilities_Numeric.ipf b/Packages/MIES/MIES_Utilities_Numeric.ipf index bc44b08102..ec1684fc71 100644 --- a/Packages/MIES/MIES_Utilities_Numeric.ipf +++ b/Packages/MIES/MIES_Utilities_Numeric.ipf @@ -34,6 +34,7 @@ End /// /// Return a reproducible random number depending on the RNG seed. threadsafe Function GetReproducibleRandom([variable noiseGenMode]) + variable randomSeed if(ParamIsDefault(noiseGenMode)) @@ -52,19 +53,18 @@ End /// The returned values can *not* be used for statistical purposes /// as the distribution is not uniform anymore. Function GetUniqueInteger() + return (GetReproducibleRandom() * 2^33) & 0xFFFFFFFF End /// @brief Set the given bit mask in var -threadsafe Function SetBit(var, bit) - variable var, bit +threadsafe Function SetBit(variable var, variable bit) return var | bit End /// @brief Clear the given bit mask in var -threadsafe Function ClearBit(var, bit) - variable var, bit +threadsafe Function ClearBit(variable var, variable bit) return var & ~bit End @@ -107,8 +107,7 @@ End /// /// @f$ x > a @f$ where @f$ x = c^p @f$ holds and @f$ x @f$ is /// the smallest possible value. -threadsafe Function FindNextPower(a, p) - variable a, p +threadsafe Function FindNextPower(variable a, variable p) ASSERT_TS(p > 1, "Invalid power") ASSERT_TS(a > 0, "Invalid value") @@ -122,8 +121,7 @@ End /// /// @f$ x < a @f$ where @f$ x = c^p @f$ holds and @f$ x @f$ is /// the largest possible value. -Function FindPreviousPower(a, p) - variable a, p +Function FindPreviousPower(variable a, variable p) ASSERT(p > 1, "Invalid power") ASSERT(a > 0, "Invalid value") @@ -133,8 +131,7 @@ Function FindPreviousPower(a, p) End /// @brief Return the alignment of the decimal number (usually a 32bit/64bit pointer) -Function GetAlignment(val) - variable val +Function GetAlignment(variable val) variable i @@ -146,8 +143,7 @@ Function GetAlignment(val) End /// @brief Compute the least common multiplier of two variables -Function CalculateLCM(a, b) - variable a, b +Function CalculateLCM(variable a, variable b) return (a * b) / gcd(a, b) End @@ -293,6 +289,7 @@ End /// @brief Acts like the `limit` builtin but replaces values outside the valid range instead of clipping them threadsafe Function LimitWithReplace(variable val, variable low, variable high, variable replacement) + return (val >= low && val <= high) ? val : replacement End diff --git a/Packages/MIES/MIES_Utilities_ProgramFlow.ipf b/Packages/MIES/MIES_Utilities_ProgramFlow.ipf index 845f11528d..02341a2c53 100644 --- a/Packages/MIES/MIES_Utilities_ProgramFlow.ipf +++ b/Packages/MIES/MIES_Utilities_ProgramFlow.ipf @@ -60,12 +60,12 @@ End /// @brief Return true if the calling function is called recursively, i.e. it /// is present multiple times in the call stack threadsafe Function IsFunctionCalledRecursively() + return ItemsInList(ListMatch(GetRTStackInfo(0), GetRTStackInfo(2))) > 1 End /// @brief Wrapper function for `Abort` which honours our interactive mode setting -Function DoAbortNow(msg) - string msg +Function DoAbortNow(string msg) DEBUGPRINTSTACKINFO() @@ -84,8 +84,7 @@ Function DoAbortNow(msg) End /// @brief Return a nicely formatted multiline stacktrace -threadsafe Function/S GetStackTrace([prefix]) - string prefix +threadsafe Function/S GetStackTrace([string prefix]) string stacktrace, entry, func, line, file, str string output @@ -141,6 +140,7 @@ End /// @hidecallergraph /// UTF_NOINSTRUMENTATION Function ASSERT(variable var, string errorMsg, [variable extendedOutput]) + string stracktrace, miesVersionStr, lockedDevicesStr, device string stacktrace = "" variable i, numLockedDevices, doCallDebugger @@ -278,6 +278,7 @@ End /// @hidecallergraph /// UTF_NOINSTRUMENTATION threadsafe Function ASSERT_TS(variable var, string errorMsg, [variable extendedOutput]) + string stacktrace try @@ -333,6 +334,7 @@ End #ifdef MACINTOSH threadsafe Function MU_RunningInMainThread() + TUFXOP_RunningInMainThread return V_value diff --git a/Packages/MIES/MIES_Utilities_SFHCheckers.ipf b/Packages/MIES/MIES_Utilities_SFHCheckers.ipf index 8abeb85096..7c9473fbf8 100644 --- a/Packages/MIES/MIES_Utilities_SFHCheckers.ipf +++ b/Packages/MIES/MIES_Utilities_SFHCheckers.ipf @@ -15,6 +15,7 @@ /// /// UTF_NOINSTRUMENTATION threadsafe Function IsValidObjectName(string name) + return NameChecker(name, 0) End @@ -24,6 +25,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function IsValidLiberalObjectName(string name) + return NameChecker(name, 1) End @@ -48,6 +50,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function BetweenZeroAndOneExc(variable val) + return val > 0.0 && val < 1.0 End @@ -55,6 +58,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function BetweenZeroAndOne(variable val) + return val >= 0.0 && val <= 1.0 End @@ -62,6 +66,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function BetweenZeroAndOneHoundredExc(variable val) + return val > 0.0 && val < 100.0 End @@ -69,5 +74,6 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function BetweenZeroAndOneHoundred(variable val) + return val >= 0.0 && val <= 100.0 End diff --git a/Packages/MIES/MIES_Utilities_Strings.ipf b/Packages/MIES/MIES_Utilities_Strings.ipf index 38b1e46fe6..38a77bae58 100644 --- a/Packages/MIES/MIES_Utilities_Strings.ipf +++ b/Packages/MIES/MIES_Utilities_Strings.ipf @@ -13,6 +13,7 @@ /// /// @sa GetStringFromWaveNote() threadsafe Function/S ExtractStringFromPair(string str, string key, [string keySep, string listSep]) + if(ParamIsDefault(keySep)) keySep = DEFAULT_KEY_SEP endif @@ -31,6 +32,7 @@ End /// @brief Remove the surrounding quotes from the string if they are present Function/S PossiblyUnquoteName(string name, string quote) + variable len if(isEmpty(name)) @@ -68,9 +70,7 @@ End /// @param str string to break into lines /// @param minimumWidth [optional, defaults to zero] Each line, except the last one, /// will have at least this length -Function/S LineBreakingIntoPar(str, [minimumWidth]) - string str - variable minimumWidth +Function/S LineBreakingIntoPar(string str, [variable minimumWidth]) variable len, i, width string output = "" @@ -114,6 +114,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function/S RemovePrefix(string str, [string start, variable regExp]) + variable length, pos, skipLength, err string regExpResult @@ -160,8 +161,7 @@ End /// In case the regular expression does not match, the string is returned unaltered. /// /// See also `DisplayHelpTopic "Regular Expressions"`. -threadsafe Function/S RemoveEndingRegExp(str, endingRegExp) - string str, endingRegExp +threadsafe Function/S RemoveEndingRegExp(string str, string endingRegExp) string endStr variable err @@ -239,8 +239,7 @@ End /// supports 6 subpatterns, specified by curly brackets in regex /// /// @returns text wave containing subpatterns of regex call -Function/WAVE SearchStringBase(str, regex) - string str, regex +Function/WAVE SearchStringBase(string str, string regex) string command variable i, numBrackets @@ -273,8 +272,7 @@ End /// @brief Search for the occurence of pattern in string /// /// @returns number of occurences -Function CountSubstrings(str, pattern) - string str, pattern +Function CountSubstrings(string str, string pattern) variable i = -1, position = -1 @@ -297,11 +295,7 @@ End /// see below or [1] chapter 3 for the full list /// @param[out] numPrefix numerical value of the decimal multiplier /// @param[out] unit unit -threadsafe Function ParseUnit(unitWithPrefix, prefix, numPrefix, unit) - string unitWithPrefix - string &prefix - variable &numPrefix - string &unit +threadsafe Function ParseUnit(string unitWithPrefix, string &prefix, variable &numPrefix, string &unit) string expr, unitInt, prefixInt @@ -325,8 +319,7 @@ End /// @brief Return the numerical value of a SI decimal multiplier /// /// @see ParseUnit -threadsafe Function GetDecimalMultiplierValue(prefix) - string prefix +threadsafe Function GetDecimalMultiplierValue(string prefix) if(isEmpty(prefix)) return 1 @@ -378,8 +371,7 @@ End /// or Unix EOLs (`\n`) /// /// UTF_NOINSTRUMENTATION -threadsafe Function/S NormalizeToEOL(str, eol) - string str, eol +threadsafe Function/S NormalizeToEOL(string str, string eol) str = ReplaceString("\r\n", str, eol) @@ -396,6 +388,7 @@ End /// @brief Elide the given string to the requested length Function/S ElideText(string str, variable returnLength) + variable length, totalLength, i, first, suffixLength string ch, suffix diff --git a/Packages/MIES/MIES_Utilities_System.ipf b/Packages/MIES/MIES_Utilities_System.ipf index 75ac52b884..a544000ff5 100644 --- a/Packages/MIES/MIES_Utilities_System.ipf +++ b/Packages/MIES/MIES_Utilities_System.ipf @@ -11,6 +11,7 @@ /// @brief Return the name of the experiment without the file suffix threadsafe Function/S GetExperimentName() + return IgorInfo(1) End @@ -26,6 +27,7 @@ End /// Due to memory fragmentation you can not assume that you can still create a wave /// occupying as much space as returned. threadsafe Function GetFreeMemory() + variable freeMem #if defined(IGOR64) @@ -44,8 +46,7 @@ End /// period to be reached are also running. /// /// @param task Named background task identifier, this is *not* the function set with `proc=` -Function IsBackgroundTaskRunning(task) - string task +Function IsBackgroundTaskRunning(string task) CtrlNamedBackground $task, status return NumberByKey("RUN", s_info) @@ -56,9 +57,7 @@ End /// @param name name of the keyword/setting /// @param globalSymbol [optional, defaults to false] `name` refers to a global /// symbol set via `poundDefine` -Function QuerySetIgorOption(name, [globalSymbol]) - string name - variable globalSymbol +Function QuerySetIgorOption(string name, [variable globalSymbol]) string cmd variable result @@ -98,6 +97,7 @@ End /// /// Uses the "Operation Queue". Function ForceRecompile() + Execute/P/Q "Silent 100" End @@ -115,6 +115,7 @@ End /// @brief Return an Igor-style path to the Igor Pro executable Function/S GetIgorExecutable() + string path = SpecialDirPath("Igor Executable", 0, 0, 0) #ifdef IGOR64 @@ -143,7 +144,7 @@ threadsafe Function/S GetIgorInfo(variable selector) string key key = CA_IgorInfoKey(selector) - WAVE/T/Z result = CA_TryFetchingEntryFromCache(key, options = CA_OPTS_NO_DUPLICATE) + WAVE/Z/T result = CA_TryFetchingEntryFromCache(key, options = CA_OPTS_NO_DUPLICATE) if(!WaveExists(result)) Make/FREE/T result = {IgorInfo(selector)} @@ -155,6 +156,7 @@ End /// @brief Return the Igor Pro version string threadsafe Function/S GetIgorProVersion() + return StringByKey("IGORFILEVERSION", GetIgorInfo(3)) End @@ -169,6 +171,7 @@ End /// This allows to distinguish different builds from the same major/minor /// version. threadsafe Function/S GetIgorProBuildVersion() + return StringByKey("BUILD", GetIgorInfo(0)) End @@ -189,14 +192,14 @@ End /// @brief Bring the control window (the window with the command line) to the /// front of the desktop Function ControlWindowToFront() + DoWindow/H End /// @brief Execute a list of functions via the Operation Queue /// /// Special purpose function. Not intended for normal use. -Function ExecuteListOfFunctions(funcList) - string funcList +Function ExecuteListOfFunctions(string funcList) variable i, numEntries string func @@ -216,8 +219,7 @@ End /// @brief High precision version of the builtin Sleep command /// /// @param var time in seconds to busy-sleep (current precision is around 0.1ms) -Function SleepHighPrecision(var) - variable var +Function SleepHighPrecision(variable var) ASSERT(var >= 0, "Invalid duration") @@ -232,8 +234,7 @@ End /// @brief Return the machine epsilon for the given wave type /// /// Experimentally determined with Igor Pro 7.08 -Function GetMachineEpsilon(type) - variable type +Function GetMachineEpsilon(variable type) type = ClearBit(type, IGOR_TYPE_UNSIGNED) ASSERT((type & IGOR_TYPE_COMPLEX) == 0, "Complex waves are not supported") @@ -257,6 +258,7 @@ End /// a readable copy of the history starting from the time of the /// notebook creation. Function CreateHistoryNotebook() + NewNotebook/K=2/V=0/F=0/N=HistoryCarbonCopy End @@ -303,6 +305,7 @@ End /// /// Requires administrative privileges via UAC. Only required once for ITC hardware. Function TurnOffASLR() + string cmd, path path = GetFolder(FunctionPath("")) + ":ITCXOP2:tools:Disable-ASLR-for-Igor64.ps1" @@ -316,6 +319,7 @@ End /// @brief Check if we are running on Windows 10/11 Function IsWindows10Or11() + string info, os info = IgorInfo(3) @@ -326,8 +330,7 @@ End /// @brief Upload the given JSON document /// /// See `tools/http-upload/upload-json-payload-v1.php` for the JSON format description. -Function UploadJSONPayload(jsonID) - variable jsonID +Function UploadJSONPayload(variable jsonID) URLrequest/DSTR=(JSON_Dump(jsonID)) url="https://ai.customers.byte-physics.de/upload-json-payload-v1.php", method=put ASSERT(!V_Flag, "URLrequest did not succeed due to: " + S_ServerResponse) @@ -337,6 +340,7 @@ End /// /// It allows to distinguish multiple Igor instances, but is not globally unique. threadsafe Function/S GetIgorInstanceID() + return Hash(IgorInfo(-102), 1) End @@ -351,6 +355,7 @@ End /// \endrst /// Function CleanupOperationQueueResult() + Execute/P/Q "KillVariables/Z V_flag" End @@ -358,6 +363,7 @@ End /// /// The result is constant and can therefore be compared with constants. threadsafe Function ConvertXOPErrorCode(variable err) + // error codes -1 to 9999 are Igor Pro error codes // for first loaded XOP -> xop error codes returned are in the range 10000+ up to max. 10999 // for second+ loaded XOP -> xop error codes returned are offsetted by n x 0x10000 per XOP instead of 10000 diff --git a/Packages/MIES/MIES_Utilities_Time.ipf b/Packages/MIES/MIES_Utilities_Time.ipf index aa9da87a9e..c177c73679 100644 --- a/Packages/MIES/MIES_Utilities_Time.ipf +++ b/Packages/MIES/MIES_Utilities_Time.ipf @@ -15,8 +15,7 @@ /// /// @param humanReadable [optional, default to false] Return a format viable for display in a GUI /// @param secondsSinceIgorEpoch [optional, defaults to number of seconds until now] Seconds since the Igor Pro epoch (1/1/1904) -Function/S GetTimeStamp([secondsSinceIgorEpoch, humanReadable]) - variable secondsSinceIgorEpoch, humanReadable +Function/S GetTimeStamp([variable secondsSinceIgorEpoch, variable humanReadable]) if(ParamIsDefault(secondsSinceIgorEpoch)) secondsSinceIgorEpoch = DateTime @@ -37,6 +36,7 @@ End /// @brief Return the seconds, including fractional part, since Igor Pro epoch (1/1/1904) in UTC time zone threadsafe Function DateTimeInUTC() + return DateTime - date2secs(-1, -1, -1) End @@ -45,8 +45,7 @@ End /// in UTC (or local time zone depending on `localTimeZone`) /// @param numFracSecondsDigits [optional, defaults to zero] Number of sub-second digits /// @param localTimeZone [optional, defaults to false] Use the local time zone instead of UTC -threadsafe Function/S GetISO8601TimeStamp([secondsSinceIgorEpoch, numFracSecondsDigits, localTimeZone]) - variable secondsSinceIgorEpoch, numFracSecondsDigits, localTimeZone +threadsafe Function/S GetISO8601TimeStamp([variable secondsSinceIgorEpoch, variable numFracSecondsDigits, variable localTimeZone]) string str variable timezone @@ -89,8 +88,7 @@ End /// - ` `/`T` between date and time /// - fractional seconds /// - `,`/`.` as decimal separator -threadsafe Function ParseISO8601TimeStamp(timestamp) - string timestamp +threadsafe Function ParseISO8601TimeStamp(string timestamp) string year, month, day, hour, minute, second, regexp, fracSeconds, tzOffsetSign, tzOffsetHour, tzOffsetMinute variable secondsSinceEpoch, timeOffset, err @@ -150,6 +148,7 @@ End /// @brief Stop all millisecond Igor Pro timers Function StopAllMSTimers() + variable i for(i = 0; i < MAX_NUM_MS_TIMERS; i += 1) @@ -160,6 +159,7 @@ End /// @brief Return a time in seconds with high precision, microsecond resolution, using an /// arbitrary zero point. Function RelativeNowHighPrec() + return stopmstimer(-2) * MICRO_TO_ONE End @@ -178,19 +178,18 @@ End /// StoreElapsedTime(referenceTime) /// \endrst Function GetReferenceTime() + return stopmstimer(-2) End /// @brief Get the elapsed time in seconds -Function GetElapsedTime(referenceTime) - variable referenceTime +Function GetElapsedTime(variable referenceTime) return (stopmstimer(-2) - referenceTime) * MICRO_TO_ONE End /// @brief Store the elapsed time in a wave -Function StoreElapsedTime(referenceTime) - variable referenceTime +Function StoreElapsedTime(variable referenceTime) variable count, elapsed diff --git a/Packages/MIES/MIES_Utilities_WaveHandling.ipf b/Packages/MIES/MIES_Utilities_WaveHandling.ipf index 9c355e4695..e4c826497c 100644 --- a/Packages/MIES/MIES_Utilities_WaveHandling.ipf +++ b/Packages/MIES/MIES_Utilities_WaveHandling.ipf @@ -107,9 +107,7 @@ End /// /// @param wv wave to redimension /// @param maximumSize maximum number of the rows, defaults to MAXIMUM_SIZE -Function EnsureSmallEnoughWave(wv, [maximumSize]) - WAVE wv - variable maximumSize +Function EnsureSmallEnoughWave(WAVE wv, [variable maximumSize]) if(ParamIsDefault(maximumSize)) maximumSize = MAXIMUM_WAVE_SIZE @@ -142,6 +140,7 @@ End /// /// Inspired by http://www.igorexchange.com/node/1845 threadsafe Function GetSizeOfType(WAVE wv) + variable type, size type = WaveType(wv) @@ -179,9 +178,7 @@ threadsafe Function GetSizeOfType(WAVE wv) End /// @brief Returns the size of the wave in bytes. -threadsafe Function GetWaveSize(wv, [recursive]) - WAVE/Z wv - variable recursive +threadsafe Function GetWaveSize(WAVE/Z wv, [variable recursive]) if(ParamIsDefault(recursive)) recursive = 0 @@ -217,9 +214,7 @@ End /// /// The expected wave note format is: `key1:val1;key2:val2;` /// UTF_NOINSTRUMENTATION -threadsafe Function GetNumberFromWaveNote(wv, key) - WAVE wv - string key +threadsafe Function GetNumberFromWaveNote(WAVE wv, string key) ASSERT_TS(WaveExists(wv), "Missing wave") ASSERT_TS(!IsEmpty(key), "Empty key") @@ -236,11 +231,7 @@ End /// the conversion to string for `val` /// /// The expected wave note format is: `key1:val1;key2:val2;` -threadsafe Function SetNumberInWaveNote(wv, key, val, [format]) - WAVE wv - string key - variable val - string format +threadsafe Function SetNumberInWaveNote(WAVE wv, string key, variable val, [string format]) string str @@ -268,6 +259,7 @@ End /// /// @returns the value on success. An empty string is returned if it could not be found threadsafe Function/S GetStringFromWaveNote(WAVE wv, string key, [string keySep, string listSep, variable recursive]) + variable numEntries = numpnts(wv) string result @@ -293,7 +285,7 @@ threadsafe Function/S GetStringFromWaveNote(WAVE wv, string key, [string keySep, Make/FREE/T/N=(numEntries) notes = ExtractStringFromPair(note(WaveRef(wv, row = p)), key, keySep = keySep, listSep = listSep) - WAVE/T/Z uniqueEntries = GetUniqueEntries(notes) + WAVE/Z/T uniqueEntries = GetUniqueEntries(notes) ASSERT_TS(WaveExists(uniqueEntries), "Missing unique entries") if(DimSize(uniqueEntries, ROWS) == 1 && !cmpstr(uniqueEntries[0], result)) @@ -351,13 +343,7 @@ End /// @param replaceEntry 0 (default) or 1, should existing keys named `key` be replaced (does only work reliable /// in wave note lists without carriage returns). /// @param format [optional, defaults to `%g`] format string used for converting `var` to `str` -Function AddEntryIntoWaveNoteAsList(wv, key, [var, str, appendCR, replaceEntry, format]) - WAVE wv - string key - variable var - string str - variable appendCR, replaceEntry - string format +Function AddEntryIntoWaveNoteAsList(WAVE wv, string key, [variable var, string str, variable appendCR, variable replaceEntry, string format]) string formattedString, formatString @@ -400,9 +386,7 @@ End /// Ignores spaces around the equal ("=") sign. /// /// @sa AddEntryIntoWaveNoteAsList() -Function HasEntryInWaveNoteList(wv, key, value) - WAVE wv - string key, value +Function HasEntryInWaveNoteList(WAVE wv, string key, string value) return GrepString(note(wv), "\\Q" + key + "\\E\\s*=\\s*\\Q" + value + "\\E\\s*;") End @@ -422,9 +406,7 @@ threadsafe Function/S UniqueWaveName(DFREF dfr, string baseName) End /// @brief Return a new wave from the subrange of the given 1D wave -Function/WAVE DuplicateSubRange(wv, first, last) - WAVE wv - variable first, last +Function/WAVE DuplicateSubRange(WAVE wv, variable first, variable last) ASSERT(DimSize(wv, COLS) == 0, "Requires 1D wave") @@ -434,9 +416,7 @@ Function/WAVE DuplicateSubRange(wv, first, last) End /// @brief Search the row in refWave which has the same contents as the given row in the sourceWave -Function GetRowWithSameContent(refWave, sourceWave, row) - WAVE/T refWave, sourceWave - variable row +Function GetRowWithSameContent(WAVE/T refWave, WAVE/T sourceWave, variable row) variable i, j, numRows, numCols numRows = DimSize(refWave, ROWS) @@ -462,9 +442,7 @@ Function GetRowWithSameContent(refWave, sourceWave, row) End /// @brief Returns the column from a multidimensional wave using the dimlabel -Function/WAVE GetColfromWavewithDimLabel(wv, dimLabel) - WAVE wv - string dimLabel +Function/WAVE GetColfromWavewithDimLabel(WAVE wv, string dimLabel) variable column = FindDimLabel(wv, COLS, dimLabel) ASSERT(column != -2, "dimLabel:" + dimLabel + "cannot be found") @@ -473,8 +451,7 @@ Function/WAVE GetColfromWavewithDimLabel(wv, dimLabel) End /// @brief Turn a persistent wave into a free wave -Function/WAVE MakeWaveFree(wv) - WAVE/Z wv +Function/WAVE MakeWaveFree(WAVE/Z wv) if(!WaveExists(wv)) return $"" @@ -512,11 +489,7 @@ End /// @param list List of dimension labels, semicolon separated. /// @param dim Wave dimension, see, @ref WaveDimensions /// @param startPos [optional, defaults to 0] First dimLabel index -threadsafe Function SetDimensionLabels(wv, list, dim, [startPos]) - WAVE wv - string list - variable dim - variable startPos +threadsafe Function SetDimensionLabels(WAVE wv, string list, variable dim, [variable startPos]) string labelName variable i @@ -641,8 +614,7 @@ End /// @brief Remove the dimlabels of all dimensions with data /// /// Due to no better solutions the dim labels are actually overwritten with an empty string -Function RemoveAllDimLabels(wv) - WAVE/Z wv +Function RemoveAllDimLabels(WAVE/Z wv) variable dims, i, j, numEntries @@ -677,8 +649,7 @@ End /// @brief Merge two floating point waves labnotebook waves /// /// The result will hold the finite row entry of either `wv1` or `wv2`. -Function/WAVE MergeTwoWaves(wv1, wv2) - WAVE wv1, wv2 +Function/WAVE MergeTwoWaves(WAVE wv1, WAVE wv2) variable numEntries, i, validEntryOne, validEntryTwo @@ -710,9 +681,7 @@ Function/WAVE MergeTwoWaves(wv1, wv2) End /// @brief Adapt the wave lock status on the wave and its contained waves -threadsafe Function ChangeWaveLock(wv, val) - WAVE/WAVE wv - variable val +threadsafe Function ChangeWaveLock(WAVE/WAVE wv, variable val) variable numEntries, i @@ -800,6 +769,7 @@ End /// /// @return 0 if at least one entry was found, 1 otherwise threadsafe Function RemoveTextWaveEntry1D(WAVE/T w, string entry, [variable options, variable all]) + ASSERT_TS(IsTextWave(w), "Input wave must be a text wave") variable start, foundOnce @@ -960,6 +930,7 @@ End /// /// The order of arguments is modelled after SelectString/SelectNumber. threadsafe Function/WAVE SelectWave(variable condition, WAVE/Z waveIfFalse, WAVE/Z waveIfTrue) + if(!!condition != 0) return waveIfTrue else @@ -1265,8 +1236,7 @@ End /// @brief Detects duplicate values in a 1d wave. /// /// @return one if duplicates could be found, zero otherwise -Function SearchForDuplicates(wv) - WAVE wv +Function SearchForDuplicates(WAVE wv) ASSERT(WaveExists(wv), "Missing wave") @@ -1318,9 +1288,7 @@ End /// (wave reference waves only with matching sizes) /// /// @return new wave reference to dest wave -Function/WAVE MoveWaveWithOverwrite(dest, src, [recursive]) - WAVE dest, src - variable recursive +Function/WAVE MoveWaveWithOverwrite(WAVE dest, WAVE src, [variable recursive]) string path variable numEntries @@ -1359,8 +1327,7 @@ End /// 2D waves are zeroed along each row /// /// @return 0 if nothing was done, 1 if zeroed -threadsafe Function ZeroWave(wv) - WAVE wv +threadsafe Function ZeroWave(WAVE wv) if(GetNumberFromWaveNote(wv, NOTE_KEY_ZEROED) == 1) return 0 @@ -1397,8 +1364,7 @@ End /// @param numRows number of rows in the input wave /// @param decimationFactor decimation factor, must be an integer and larger than 1 /// @param method one of @ref DecimationMethods -Function GetDecimatedWaveSize(numRows, decimationFactor, method) - variable numRows, decimationFactor, method +Function GetDecimatedWaveSize(variable numRows, variable decimationFactor, variable method) variable decimatedSize @@ -1426,10 +1392,7 @@ End /// @param wv text wave to search in /// @param colLabel column label from wv /// @param endRow maximum row index to consider -Function/S GetLastNonEmptyEntry(wv, colLabel, endRow) - WAVE/T wv - string colLabel - variable endRow +Function/S GetLastNonEmptyEntry(WAVE/T wv, string colLabel, variable endRow) WAVE/Z indizes = FindIndizes(wv, colLabel = colLabel, prop = PROP_EMPTY | PROP_NOT, endRow = endRow) diff --git a/Packages/MIES/MIES_WaveBuilder.ipf b/Packages/MIES/MIES_WaveBuilder.ipf index f6437dbb95..4484586278 100644 --- a/Packages/MIES/MIES_WaveBuilder.ipf +++ b/Packages/MIES/MIES_WaveBuilder.ipf @@ -48,8 +48,7 @@ static Constant DELTA_OPERATION_EXPLICIT = 6 /// in the datafolder hierarchy /// /// @return stimset wave ref or an invalid wave ref -Function/WAVE WB_CreateAndGetStimSet(setName) - string setName +Function/WAVE WB_CreateAndGetStimSet(string setName) variable type, needToCreateStimSet @@ -90,9 +89,7 @@ End /// @param type indicate parameter wave (WP, WPT, or SegWvType), see @ref ParameterWaveTypes /// @param nwbFormat [optional, defaults to false] nwbFormat has type as suffix /// @return name as string -Function/S WB_GetParameterWaveName(stimset, type, [nwbFormat]) - string stimset - variable type, nwbFormat +Function/S WB_GetParameterWaveName(string stimset, variable type, [variable nwbFormat]) string shortname, fullname @@ -116,8 +113,7 @@ End /// @brief Return the wave `WP` for a stim set /// /// @return valid/invalid wave reference -Function/WAVE WB_GetWaveParamForSet(setName) - string setName +Function/WAVE WB_GetWaveParamForSet(string setName) variable type @@ -141,8 +137,7 @@ End /// @brief Return the wave `WPT` for a stim set /// /// @return valid/invalid wave reference -Function/WAVE WB_GetWaveTextParamForSet(setName) - string setName +Function/WAVE WB_GetWaveTextParamForSet(string setName) variable type @@ -166,8 +161,7 @@ End /// @brief Return the wave `SegmentWvType` for a stim set /// /// @return valid/invalid wave reference -Function/WAVE WB_GetSegWvTypeForSet(setName) - string setName +Function/WAVE WB_GetSegWvTypeForSet(string setName) variable type @@ -311,10 +305,7 @@ End /// @brief Return a checksum of the stimsets and its parameter waves. /// /// Uses the entry from the stimset wave note if available. -Function WB_GetStimsetChecksum(stimset, setName, dataAcqOrTP) - WAVE stimset - string setName - variable dataAcqOrTP +Function WB_GetStimsetChecksum(WAVE stimset, string setName, variable dataAcqOrTP) variable crc @@ -358,8 +349,8 @@ End /// /// @param setName string containing name of stimset /// @return date of last modification as double precision Igor date/time value -Function WB_GetLastModStimSet(setName) - string setname +Function WB_GetLastModStimSet(string setName) + variable channelType channelType = WB_GetStimSetType(setName) @@ -379,6 +370,7 @@ End /// @brief Return the current stimset wave for the wavebuilder Function/WAVE WB_GetStimSetForWaveBuilder() + return WB_GetStimSet() End @@ -424,7 +416,7 @@ static Function/WAVE WB_GetStimSet([setName]) setName = "" else WAVE/Z WP = WB_GetWaveParamForSet(setName) - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(setName) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(setName) WAVE/Z SegWvType = WB_GetSegWvTypeForSet(setName) channelType = WB_GetStimSetType(setName) @@ -551,10 +543,7 @@ End /// given the index into `WP` of the value itself. /// /// @return 0 on success, 1 otherwise -Function WB_GetDeltaDimLabel(wv, index, s) - WAVE wv - variable index - STRUCT DeltaControlNames &s +Function WB_GetDeltaDimLabel(WAVE wv, variable index, STRUCT DeltaControlNames &s) string name @@ -1094,9 +1083,7 @@ static Function WB_UpdateEpochID(epochIndex, epochDuration, accumulatedDuration) End /// @brief Query the stimset wave note for the sweep/set specific ITI -Function WB_GetITI(stimset, sweep) - WAVE stimset - variable sweep +Function WB_GetITI(WAVE stimset, variable sweep) variable ITI @@ -1124,9 +1111,7 @@ End /// @param wv WPT wave reference /// @param channelType AD/DA or TTL channel type /// @param i index of epoch containing custom wave -Function WB_UpgradeCustomWaveInWPT(wv, channelType, i) - WAVE/T wv - variable channelType, i +Function WB_UpgradeCustomWaveInWPT(WAVE/T wv, variable channelType, variable i) string customWaveName = wv[0][i][EPOCH_TYPE_CUSTOM] @@ -1236,8 +1221,7 @@ static Function WB_RampSegment(pa) End /// @brief Check if the given frequency is a valid setting for the noise epoch -Function WB_IsValidCutoffFrequency(freq) - variable freq +Function WB_IsValidCutoffFrequency(variable freq) return WB_IsValidScaledCutoffFrequency(freq / WAVEBUILDER_MIN_SAMPINT_HZ) End @@ -1245,8 +1229,7 @@ End /// @brief Check if the given frequency is a valid setting for the noise epoch /// /// Requires a scaled frequency as input, see `DisplayHelpTopic "FilterIIR"` -Function WB_IsValidScaledCutoffFrequency(freq) - variable freq +Function WB_IsValidScaledCutoffFrequency(variable freq) return freq > 0 && freq <= 0.5 End @@ -1535,8 +1518,7 @@ static Function WB_CreatePulse(wv, pulseType, amplitude, first, last) End /// @brief Convert the numeric epoch type to a stringified version -Function/S WB_ToEpochTypeString(epochType) - variable epochType +Function/S WB_ToEpochTypeString(variable epochType) switch(epochType) case EPOCH_TYPE_SQUARE_PULSE: @@ -1564,8 +1546,7 @@ Function/S WB_ToEpochTypeString(epochType) End /// @brief Convert the stringified epoch type to a numerical one -Function WB_ToEpochType(epochTypeStr) - string epochTypeStr +Function WB_ToEpochType(string epochTypeStr) strswitch(epochTypeStr) case "Square pulse": @@ -1648,11 +1629,7 @@ End /// @param key [optional] named entry to return, not required for #VERSION_ENTRY /// @param sweep [optional] number of the sweep /// @param epoch [optional] number of the epoch -Function/S WB_GetWaveNoteEntry(text, entryType, [key, sweep, epoch]) - string text - variable entryType - string key - variable sweep, epoch +Function/S WB_GetWaveNoteEntry(string text, variable entryType, [string key, variable sweep, variable epoch]) string match, re @@ -1698,11 +1675,7 @@ Function/S WB_GetWaveNoteEntry(text, entryType, [key, sweep, epoch]) End // @copydoc WB_GetWaveNoteEntry -Function WB_GetWaveNoteEntryAsNumber(text, entryType, [key, sweep, epoch]) - string text - variable entryType - string key - variable sweep, epoch +Function WB_GetWaveNoteEntryAsNumber(string text, variable entryType, [string key, variable sweep, variable epoch]) string str @@ -1781,7 +1754,7 @@ static Function [WAVE/D pulseStartTimes, WAVE/D pulseStartIndices, WAVE/D pulseE pulseToPulseLength = 0 for(;;) - pulseStartTime += -ln(abs(enoise(1, pa.noiseGenMode))) / pa.frequency * ONE_TO_MILLI + pulseStartTime += -ln(abs(enoise(1, pa.noiseGenMode))) / pa.frequency * ONE_TO_MILLI [startIndex, endIndex, startOffset, durationError] = WB_GetIndicesForSignalDuration(pulseStartTime, pa.pulseDuration, WAVEBUILDER_MIN_SAMPINT) if(endIndex >= numRows || endIndex < 0) break @@ -1966,6 +1939,7 @@ End /// The rows are sorted by creationDate of the WP/stimset wave to try to keep /// the shorthands constants even when new stimsets are added. Function WB_UpdateEpochCombineList(WAVE/T epochCombineList, variable channelType) + string list, setPath, setParamPath, entry variable numEntries, i @@ -1985,7 +1959,7 @@ Function WB_UpdateEpochCombineList(WAVE/T epochCombineList, variable channelType for(i = 0; i < numEntries; i += 1) entry = StringFromList(i, list) - WAVE/SDFR=dfr/Z stimset = $entry + WAVE/Z/SDFR=dfr stimset = $entry WAVE/Z WP = WB_GetWaveParamForSet(entry) if(WaveExists(WP)) @@ -2091,6 +2065,7 @@ End /// @brief Replace shorthands with the real stimset names suffixed with `?` Function WB_FormulaSwitchToStimset(variable channelType, string formula, STRUCT FormulaProperties &fp) + string stimset, shorthand, stimsetSpec, prefix, suffix variable numSets, i, stimsetFound @@ -2309,7 +2284,7 @@ static Function/S WB_StimsetChildren([stimset]) formula = WPT[6][i][EPOCH_TYPE_COMBINE] numStimsets = CountSubstrings(formula, "?") for(j = 0; j < numStimsets; j += 1) - WAVE/T/Z wv = SearchStringBase(formula, "(.*)\\b(\\w+)\\b\\?(.*)") + WAVE/Z/T wv = SearchStringBase(formula, "(.*)\\b(\\w+)\\b\\?(.*)") ASSERT(WaveExists(wv), "Error in formula: could not properly resolve formula to stimset") formula = wv[0] + wv[2] stimsets = AddListItem(wv[1], stimsets) @@ -2326,8 +2301,7 @@ End /// @param[out] knownNames unique list of stimsets /// /// @return number of parents stimsets that were moved to child stimsets -Function WB_StimsetFamilyNames(knownNames, [parent]) - string parent, &knownNames +Function WB_StimsetFamilyNames(string &knownNames, [string parent]) string children, familynames variable numChildren, i, numMoved @@ -2354,8 +2328,7 @@ End /// You can not recurse into a stimset that depends on itself. /// /// @return list of stimsets that derive from the input stimset -Function/S WB_StimsetRecursion([parent, knownStimsets]) - string parent, knownStimsets +Function/S WB_StimsetRecursion([string parent, string knownStimsets]) string stimset, stimsetQueue variable numStimsets, i, numBefore, numAfter, numMoved @@ -2395,8 +2368,7 @@ End /// @param stimsetQueue can be a list of stimsets (separated by ;) or a simple string /// /// @return list of stimsets that derive from the input stimsets -Function/S WB_StimsetRecursionForList(stimsetQueue) - string stimsetQueue +Function/S WB_StimsetRecursionForList(string stimsetQueue) variable i, numStimsets string stimset, stimsetList @@ -2417,8 +2389,7 @@ End /// @brief check if parameter waves exist /// /// @return 1 if parameter waves exist, 0 otherwise -Function WB_ParameterWavesExist(stimset) - string stimset +Function WB_ParameterWavesExist(string stimset) WAVE/Z WP = WB_GetWaveParamForSet(stimset) WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimset) @@ -2434,8 +2405,8 @@ End /// @brief check if (custom) stimset exists /// /// @return 1 if stimset wave was found, 0 otherwise -Function WB_StimsetExists(stimset) - string stimset +Function WB_StimsetExists(string stimset) + variable channelType channelType = WB_GetStimSetType(stimset) @@ -2455,8 +2426,7 @@ Function WB_StimsetExists(stimset) End /// @brief Kill Parameter waves for stimset -Function WB_KillParameterWaves(stimset) - string stimset +Function WB_KillParameterWaves(string stimset) WAVE/Z WP = WB_GetWaveParamForSet(stimset) WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimset) @@ -2474,8 +2444,7 @@ Function WB_KillParameterWaves(stimset) End /// @brief Kill (custom) stimset -Function WB_KillStimset(stimset) - string stimset +Function WB_KillStimset(string stimset) variable channelType @@ -2502,8 +2471,7 @@ End /// Third party stimsets don't have all parameter waves /// /// @return true if from third party, false otherwise -Function WB_StimsetIsFromThirdParty(stimset) - string stimset +Function WB_StimsetIsFromThirdParty(string stimset) ASSERT(!IsEmpty(stimset), "Stimset name can not be empty") @@ -2515,12 +2483,7 @@ Function WB_StimsetIsFromThirdParty(stimset) End /// @brief Internal use only -Function WB_AddAnalysisParameterIntoWPT(WPT, name, [var, str, wv]) - WAVE/T WPT - string name - variable var - string str - WAVE wv +Function WB_AddAnalysisParameterIntoWPT(WAVE/T WPT, string name, [variable var, string str, WAVE wv]) string params @@ -2541,6 +2504,7 @@ End /// @brief Internal use only Function WB_SetAnalysisFunctionGeneric(variable stimulusType, string analysisFunction, WAVE/T WPT) + if(stimulusType != CHANNEL_TYPE_DAC) // only store analysis functions for DAC return 1 @@ -2573,6 +2537,7 @@ static Function WB_SaveStimSetParameterWaves(string setName, WAVE SegWvType, WAV End Function/S WB_SaveStimSet(string baseName, variable stimulusType, WAVE SegWvType, WAVE WP, WAVE/T WPT, variable setNumber, variable saveAsBuiltin) + string setName, genericFunc, params, errorMessage, childStimsets string tempName variable i @@ -2734,6 +2699,7 @@ End /// /// Counterpart to WB_AssembleSetName() Function WB_SplitStimsetName(string setName, string &setPrefix, variable &stimulusType, variable &setNumber) + string stimulusTypeString, setNumberString, setPrefixString setNumber = NaN @@ -2806,9 +2772,9 @@ static Function [variable startIndex, variable endIndex, variable startOffset, v ASSERT(startTime >= 0 && duration > 0 && sampleInterval > 0, "invalid argument values") [startIndex, startOffset] = RoundAndDelta(startTime / sampleInterval) - actualStartTime = startIndex * sampleInterval - [endIndex, ceilDelta] = CeilAndDelta((actualStartTime + duration) / sampleInterval) - actualDuration = (endIndex - startIndex) * sampleInterval + actualStartTime = startIndex * sampleInterval + [endIndex, ceilDelta] = CeilAndDelta((actualStartTime + duration) / sampleInterval) + actualDuration = (endIndex - startIndex) * sampleInterval return [startIndex, endIndex, startOffset, actualDuration - duration] End @@ -2828,9 +2794,7 @@ End /// @brief Extract the analysis function name from the wave note of the stim set /// @return Analysis function for the given event type, empty string if none is set -Function/S WB_ExtractAnalysisFuncFromStimSet(stimSet, eventType) - WAVE stimSet - variable eventType +Function/S WB_ExtractAnalysisFuncFromStimSet(WAVE stimSet, variable eventType) string eventName @@ -2843,8 +2807,7 @@ End /// @brief Return the analysis function parameters as comma (`,`) separated list /// /// @sa GetWaveBuilderWaveTextParam() for the exact format. -Function/S WB_ExtractAnalysisFunctionParams(stimSet) - WAVE stimSet +Function/S WB_ExtractAnalysisFunctionParams(WAVE stimSet) return WB_GetWaveNoteEntry(note(stimset), STIMSET_ENTRY, key = ANALYSIS_FUNCTION_PARAMS_STIMSET) End diff --git a/Packages/MIES/MIES_WaveBuilderPanel.ipf b/Packages/MIES/MIES_WaveBuilderPanel.ipf index 664f59de8c..3c2ab3ae2d 100644 --- a/Packages/MIES/MIES_WaveBuilderPanel.ipf +++ b/Packages/MIES/MIES_WaveBuilderPanel.ipf @@ -57,7 +57,7 @@ Function WB_OpenStimulusSetInWaveBuilder() headstage = str2num(TUD_GetUserData(graph, trace, "headstage")) WAVE/T textualValues = $TUD_GetUserData(graph, trace, "textualValues") - WAVE/T/Z stimsetLBN = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T stimsetLBN = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) if(!WaveExists(stimsetLBN) || IsNaN(headstage)) printf "Context menu option \"%s\" could not find the stimulus set of the trace %s.\r", S_Value, trace @@ -499,8 +499,7 @@ static Function WBP_SetControl(win, control, [value, str]) endif End -Function WBP_ButtonProc_DeleteSet(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_DeleteSet(STRUCT WMButtonAction &ba) : ButtonControl string setWaveToDelete @@ -525,8 +524,7 @@ Function WBP_ButtonProc_DeleteSet(ba) : ButtonControl return 0 End -Function WBP_CheckProc(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function WBP_CheckProc(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -541,8 +539,7 @@ Function WBP_CheckProc(cba) : CheckBoxControl End /// @brief Additional `initialhook` called in `ACL_DisplayTab` -Function WBP_InitialTabHook(tca) - STRUCT WMTabControlAction &tca +Function WBP_InitialTabHook(STRUCT WMTabControlAction &tca) string type variable tabnum, idx @@ -568,8 +565,7 @@ Function WBP_InitialTabHook(tca) End /// @brief Additional `finalhook` called in `ACL_DisplayTab` -Function WBP_FinalTabHook(tca) - STRUCT WMTabControlAction &tca +Function WBP_FinalTabHook(STRUCT WMTabControlAction &tca) if(tca.tab != EPOCH_TYPE_PULSE_TRAIN) EnableControl(panel, "SetVar_WaveBuilder_P0") @@ -593,8 +589,7 @@ Function WBP_FinalTabHook(tca) return 0 End -Function WBP_ButtonProc_SaveSet(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_SaveSet(STRUCT WMButtonAction &ba) : ButtonControl string basename, setName variable stimulusType, setNumber, saveAsBuiltin, ret @@ -678,10 +673,7 @@ static Function WBP_ExtractRowNumberFromControl(control) End /// @brief Update the named control and pass its new value into the parameter wave -Function WBP_UpdateControlAndWave(control, [var, str]) - string control - variable var - string str +Function WBP_UpdateControlAndWave(string control, [variable var, string str]) variable stimulusType, epoch, paramRow @@ -720,8 +712,7 @@ Function WBP_UpdateControlAndWave(control, [var, str]) endswitch End -Function WBP_SetVarProc_UpdateParam(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function WBP_SetVarProc_UpdateParam(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -840,11 +831,11 @@ static Function WBP_ChangeWaveType() End Function WBP_GetStimulusType() + return ParseChannelTypeFromString(GetPopupMenuString(panel, "popup_wavebuilder_outputtype")) End -Function WBP_PopMenuProc_WaveType(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopMenuProc_WaveType(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: @@ -874,8 +865,7 @@ Function/S WBP_GetListOfWaves() return listOfWaves End -Function WBP_SetVarProc_SetSearchString(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function WBP_SetVarProc_SetSearchString(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -887,8 +877,7 @@ Function WBP_SetVarProc_SetSearchString(sva) : SetVariableControl return 0 End -Function WBP_PopMenuProc_WaveToLoad(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopMenuProc_WaveToLoad(STRUCT WMPopupAction &pa) : PopupMenuControl variable SegmentNo string win @@ -931,8 +920,7 @@ Function/S WBP_ReturnListSavedSets() End /// @brief Return true if the given stimset is a builtin, false otherwise -Function WBP_IsBuiltinStimset(setName) - string setName +Function WBP_IsBuiltinStimset(string setName) return GrepString(setName, "^MIES_.*") || !CmpStr(setName, STIMSET_TP_WHILE_DAQ) End @@ -1048,8 +1036,7 @@ static Function WBP_UpdateEpochControls() endif End -Function WBP_SetVarProc_EpochToEdit(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function WBP_SetVarProc_EpochToEdit(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -1061,8 +1048,7 @@ Function WBP_SetVarProc_EpochToEdit(sva) : SetVariableControl endswitch End -Function WBP_PopupMenu_LoadSet(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopupMenu_LoadSet(STRUCT WMPopupAction &pa) : PopupMenuControl string setName @@ -1123,8 +1109,7 @@ Function/S WBP_ReturnFoldersList() return NONE + ";root:;..;" + GetListOfObjects(dfr, ".*", typeFlag = COUNTOBJECTS_DATAFOLDER) End -Function WBP_PopMenuProc_FolderSelect(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopMenuProc_FolderSelect(STRUCT WMPopupAction &pa) : PopupMenuControl string popStr, path @@ -1161,8 +1146,7 @@ Function WBP_PopMenuProc_FolderSelect(pa) : PopupMenuControl return 0 End -Function WBP_CheckProc_PreventUpdate(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function WBP_CheckProc_PreventUpdate(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -1171,8 +1155,7 @@ Function WBP_CheckProc_PreventUpdate(cba) : CheckBoxControl endswitch End -Function WBP_PopupMenu(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopupMenu(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: @@ -1300,8 +1283,7 @@ static Function WBP_AdjustDeltaControls(control) endswitch End -Function WBP_ButtonProc_NewSeed(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_NewSeed(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -1315,8 +1297,7 @@ Function WBP_ButtonProc_NewSeed(ba) : ButtonControl return 0 End -Function WBP_PopupMenu_AnalysisFunctions(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function WBP_PopupMenu_AnalysisFunctions(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -1356,6 +1337,7 @@ End /// This avoids having to hardcode the parameter values. ///@{ Function/S WBP_GetAnalysisFunctions_V3() + return WBP_GetAnalysisFunctions(ANALYSIS_FUNCTION_VERSION_V3) End ///@} @@ -1363,24 +1345,24 @@ End /// @brief Return a list of analysis functions including NONE, usable for popup menues /// /// @sa AFM_GetAnalysisFunctions -Function/S WBP_GetAnalysisFunctions(versionBitMask) - variable versionBitMask +Function/S WBP_GetAnalysisFunctions(variable versionBitMask) return AddListItem(NONE, AFH_GetAnalysisFunctions(versionBitMask)) End /// @brief Return a list of noise types, usable for popup menues Function/S WBP_GetNoiseTypes() + return NOISE_TYPES_STRINGS End /// @brief Return a list of build resolutions , usable for popup menues Function/S WBP_GetNoiseBuildResolution() + return "1;5;10;20;40;60;80;100" End -Function WBP_ButtonProc_OpenAnaFuncs(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_OpenAnaFuncs(STRUCT WMButtonAction &ba) : ButtonControl string userFile, baseName, fileName, func variable refNum @@ -1424,8 +1406,7 @@ Function WBP_ButtonProc_OpenAnaFuncs(ba) : ButtonControl return 0 End -Function WBP_SetVarCombineEpochFormula(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function WBP_SetVarCombineEpochFormula(STRUCT WMSetVariableAction &sva) : SetVariableControl STRUCT FormulaProperties fp string win, formula @@ -1496,8 +1477,7 @@ End /// /// The epoch selection is done on the mouseup event if there exists no marquee. /// This allows to still use the zooming capability. -Function WBP_MainWindowHook(s) - STRUCT WMWinHookStruct &s +Function WBP_MainWindowHook(STRUCT WMWinHookStruct &s) string win variable numEntries, i, loc @@ -1601,12 +1581,11 @@ Function WBP_MainWindowHook(s) End Function/S WBP_GetFFTSpectrumPanel() + return panel + "#fftSpectrum" End -Function WBP_ShowFFTSpectrumIfReq(segmentWave, sweep) - WAVE segmentWave - variable sweep +Function WBP_ShowFFTSpectrumIfReq(WAVE segmentWave, variable sweep) DEBUGPRINT("sweep=", var = sweep) @@ -1671,8 +1650,8 @@ Function WBP_ShowFFTSpectrumIfReq(segmentWave, sweep) WAVE axesPropsMag = GetAxesProperties(graphMag) WAVE axesPropsPhase = GetAxesProperties(graphPhase) - WAVE/T/Z cursorInfosMag = GetCursorInfos(graphMag) - WAVE/T/Z cursorInfosPhase = GetCursorInfos(graphPhase) + WAVE/Z/T cursorInfosMag = GetCursorInfos(graphMag) + WAVE/Z/T cursorInfosPhase = GetCursorInfos(graphPhase) if(sweep == 0) RemoveTracesFromGraph(graphMag) @@ -1891,8 +1870,7 @@ static Function WBP_ToggleAnalysisParamGUI() return 0 End -Function WBP_ButtonProc_DeleteParam(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_DeleteParam(STRUCT WMButtonAction &ba) : ButtonControl variable numEntries, i @@ -1922,8 +1900,7 @@ Function WBP_ButtonProc_DeleteParam(ba) : ButtonControl return 0 End -Function WBP_ButtonProc_AddParam(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_AddParam(STRUCT WMButtonAction &ba) : ButtonControl string win, name, type string value @@ -1975,8 +1952,7 @@ Function WBP_ButtonProc_AddParam(ba) : ButtonControl return 0 End -Function WBP_ButtonProc_OpenAnaParamGUI(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_OpenAnaParamGUI(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -1991,8 +1967,7 @@ Function WBP_ButtonProc_OpenAnaParamGUI(ba) : ButtonControl return 0 End -Function WBP_ListBoxProc_AnalysisParams(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function WBP_ListBoxProc_AnalysisParams(STRUCT WMListboxAction &lba) : ListBoxControl variable numericValue string stimset, win, name, value, params @@ -2008,7 +1983,7 @@ Function WBP_ListBoxProc_AnalysisParams(lba) : ListBoxControl win = lba.win row = lba.row col = lba.col - WAVE/T/Z listWave = lba.listWave + WAVE/Z/T listWave = lba.listWave WAVE/Z selWave = lba.selWave if(row < 0 || row >= DimSize(listWave, ROWS)) @@ -2033,8 +2008,7 @@ Function WBP_ListBoxProc_AnalysisParams(lba) : ListBoxControl return 0 End -Function WBP_ButtonProc_LoadSet(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function WBP_ButtonProc_LoadSet(STRUCT WMButtonAction &ba) : ButtonControl string setName @@ -2050,6 +2024,7 @@ End /// @brief Function to regenerate code for GetEpochParameterNames() Function/S WBP_RegenerateEpochParameterNamesCode() + variable i, numEntries string list, msg string code = "" diff --git a/Packages/MIES/MIES_WaveDataFolderGetters.ipf b/Packages/MIES/MIES_WaveDataFolderGetters.ipf index 60cb103bed..105a1b9f26 100644 --- a/Packages/MIES/MIES_WaveDataFolderGetters.ipf +++ b/Packages/MIES/MIES_WaveDataFolderGetters.ipf @@ -86,13 +86,12 @@ End /// Columns: /// - Head stage number /// -Function/WAVE GetChanAmpAssign(device) - string device +Function/WAVE GetChanAmpAssign(string device) DFREF dfr = GetDevicePath(device) variable versionOfNewWave = 3 - WAVE/D/Z/SDFR=dfr wv = ChanAmpAssign + WAVE/Z/D/SDFR=dfr wv = ChanAmpAssign if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -148,13 +147,12 @@ End /// Columns: /// - Head stage number /// -Function/WAVE GetChanAmpAssignUnit(device) - string device +Function/WAVE GetChanAmpAssignUnit(string device) DFREF dfr = GetDevicePath(device) variable versionOfNewWave = 1 - WAVE/T/Z/SDFR=dfr wv = ChanAmpAssignUnit + WAVE/Z/T/SDFR=dfr wv = ChanAmpAssignUnit if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -287,8 +285,7 @@ End /// @brief return the Version of the Wave, returns NaN if no version was set /// UTF_NOINSTRUMENTATION -threadsafe Function GetWaveVersion(wv) - WAVE/Z wv +threadsafe Function GetWaveVersion(WAVE/Z wv) return GetNumberFromWaveNote(wv, WAVE_NOTE_LAYOUT_KEY) End @@ -333,8 +330,7 @@ End /// \endrst /// /// @return DFREF to the `newFolder` with the contents of `oldFolder` -threadsafe Function/DF UpgradeDataFolderLocation(oldFolder, newFolder) - string oldFolder, newFolder +threadsafe Function/DF UpgradeDataFolderLocation(string oldFolder, string newFolder) string oldName, newName, from, to, msg, tempFolder @@ -436,8 +432,7 @@ End /// /// @returns wave reference to the wave in the new location, an invalid one if the wave does /// not exist at the specified former location -Function/WAVE UpgradeWaveLocationAndGetIt(p) - STRUCT WaveLocationMod &p +Function/WAVE UpgradeWaveLocationAndGetIt(STRUCT WaveLocationMod &p) ASSERT(strlen(p.name) > 0, "Invalid name") @@ -450,10 +445,10 @@ Function/WAVE UpgradeWaveLocationAndGetIt(p) p.newName = p.name endif - WAVE/SDFR=p.newDFR/Z dest = $p.newName + WAVE/Z/SDFR=p.newDFR dest = $p.newName if(DataFolderExistsDFR(p.dfr)) - WAVE/SDFR=p.dfr/Z src = $p.name + WAVE/Z/SDFR=p.dfr src = $p.name endif if(WaveExists(dest)) @@ -507,14 +502,13 @@ End /// /// Layers: /// - NUM_HEADSTAGES positions with value entries at hsIndex -Function/WAVE GetTPResultAsyncBuffer(device) - string device +Function/WAVE GetTPResultAsyncBuffer(string device) variable versionOfNewWave = 1 DFREF dfr = GetDeviceTestPulse(device) - WAVE/Z/SDFR=dfr/D wv = TPResultAsyncBuffer + WAVE/Z/D/SDFR=dfr wv = TPResultAsyncBuffer if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -558,8 +552,7 @@ End /// Layers: /// - 0: Clamp Mode /// - 1: Headstage -Function/WAVE GetChannelClampMode(device) - string device +Function/WAVE GetChannelClampMode(string device) DFREF dfr = GetDevicePath(device) variable versionOfNewWave = 1 @@ -593,8 +586,7 @@ End /// @brief Return properties for the headstages *during* TP/DAQ /// /// @sa DC_UpdateHSProperties() -Function/WAVE GetHSProperties(device) - string device +Function/WAVE GetHSProperties(string device) DFREF dfr = GetDevicePath(device) variable versionOfNewWave = 1 @@ -660,16 +652,15 @@ Function/S GetActiveDAQDevicesFolderAS() End /// @brief Return a datafolder reference to the device type folder -Function/DF GetDeviceTypePath(deviceType) - string deviceType +Function/DF GetDeviceTypePath(string deviceType) + return createDFWithAllParents(GetDeviceTypePathAsString(deviceType)) End /// @brief Return the path to the device type folder, e.g. root:mies:HardwareDevices:ITC1600 /// /// UTF_NOINSTRUMENTATION -threadsafe Function/S GetDeviceTypePathAsString(deviceType) - string deviceType +threadsafe Function/S GetDeviceTypePathAsString(string deviceType) return GetDAQDevicesFolderAsString() + ":" + deviceType End @@ -677,8 +668,8 @@ End /// @brief Return a datafolder reference to the device folder /// /// UTF_NOINSTRUMENTATION -threadsafe Function/DF GetDevicePath(device) - string device +threadsafe Function/DF GetDevicePath(string device) + return createDFWithAllParents(GetDevicePathAsString(device)) End @@ -699,8 +690,7 @@ End /// @brief Return the path to the device folder, e.g. root:mies:HardwareDevices:ITC1600:Device0 /// /// UTF_NOINSTRUMENTATION -threadsafe Function/S GetDevicePathAsString(device) - string device +threadsafe Function/S GetDevicePathAsString(string device) string deviceType, deviceNumber ASSERT_TS(ParseDeviceString(device, deviceType, deviceNumber), "Invalid/Non-locked device") @@ -721,16 +711,16 @@ threadsafe Function/S GetDevicePathAsString(device) End /// @brief Return a datafolder reference to the device data folder -Function/DF GetDeviceDataPath(device) - string device +Function/DF GetDeviceDataPath(string device) + return createDFWithAllParents(GetDeviceDataPathAsString(device)) End /// @brief Return the path to the device folder, e.g. root:mies:HardwareDevices:ITC1600:Device0:Data /// /// UTF_NOINSTRUMENTATION -Function/S GetDeviceDataPathAsString(device) - string device +Function/S GetDeviceDataPathAsString(string device) + return GetDevicePathAsString(device) + ":Data" End @@ -738,17 +728,20 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function/DF GetMiesPath() + return createDFWithAllParents(GetMiesPathAsString()) End /// @brief Returns the base folder for all MIES functionality, e.g. root:MIES /// UTF_NOINSTRUMENTATION threadsafe Function/S GetMiesPathAsString() + return "root:" + DF_NAME_MIES End /// @brief Returns a data folder reference to the sweep formula folder threadsafe Function/DF GetSweepFormulaPath() + return createDFWithAllParents(GetSweepFormulaPathAsString()) End @@ -756,6 +749,7 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function/S GetSweepFormulaPathAsString() + return GetMiesPathAsString() + ":SweepFormula" End @@ -770,6 +764,7 @@ End /// @brief Returns a data folder reference to the call once folder threadsafe Function/DF GetCalledOncePath() + return createDFWithAllParents(GetCalledOncePathAsString()) End @@ -777,23 +772,20 @@ End /// /// UTF_NOINSTRUMENTATION threadsafe Function/S GetCalledOncePathAsString() + return GetMiesPathAsString() + ":CalledOnce" End /// @brief Return a datafolder reference to a subfolder below `dfr` for splitted sweep specific data, e.g. dfr:X_5 /// /// UTF_NOINSTRUMENTATION -Function/DF GetSingleSweepFolder(dfr, sweepNo) - DFREF dfr - variable sweepNo +Function/DF GetSingleSweepFolder(DFREF dfr, variable sweepNo) return createDFWithAllParents(GetSingleSweepFolderAsString(dfr, sweepNo)) End /// @brief Return the path to a subfolder below `dfr` for splitted sweep specific data -Function/S GetSingleSweepFolderAsString(dfr, sweepNo) - DFREF dfr - variable sweepNo +Function/S GetSingleSweepFolderAsString(DFREF dfr, variable sweepNo) ASSERT(DataFolderExistsDFR(dfr), "dfr must exist") ASSERT(IsValidSweepNumber(sweepNo), "Invalid sweepNo") @@ -841,7 +833,7 @@ Function/WAVE GetDAQDataWave(string device, variable mode) ASSERT(0, "Invalid dataAcqOrTP") endswitch - WAVE/W/Z/SDFR=dfr wv = $name + WAVE/Z/W/SDFR=dfr wv = $name if(WaveExists(wv)) return wv @@ -869,7 +861,7 @@ Function/WAVE GetSUCompositeTTLWave(string device) DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(WaveExists(wv)) return wv @@ -1020,7 +1012,7 @@ Function/WAVE GetEpochsWave(string device) string name = "EpochsWave" DFREF dfr = GetDevicePath(device) - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, EPOCHS_WAVE_VERSION)) return wv @@ -1064,6 +1056,7 @@ static Function SetEpochsDimensionLabelAndVersion(WAVE wv) End threadsafe Function SetEpochsDimensionLabelsSingleChannel(WAVE wv) + SetDimLabel COLS, EPOCH_COL_STARTTIME, StartTime, wv SetDimLabel COLS, EPOCH_COL_ENDTIME, EndTime, wv SetDimLabel COLS, EPOCH_COL_TAGS, Tags, wv @@ -1118,12 +1111,11 @@ End /// - Change wave to double precision /// - Headstage column added /// - ClampMode column added -Function/WAVE GetDAQConfigWave(device) - string device +Function/WAVE GetDAQConfigWave(string device) DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = DAQConfigWave + WAVE/Z/D/SDFR=dfr wv = DAQConfigWave // On version upgrade also adapt function IsValidConfigWave if(ExistsWithCorrectLayoutVersion(wv, DAQ_CONFIG_WAVE_VERSION)) @@ -1221,15 +1213,14 @@ Function/WAVE GetDQMActiveDeviceList() End /// @brief Return the intermediate storage wave for the TTL data -Function/WAVE GetTTLWave(device) - string device +Function/WAVE GetTTLWave(string device) DFREF dfr = GetDevicePath(device) variable hardwareType = GetHardwareType(device) switch(hardwareType) case HARDWARE_ITC_DAC: - WAVE/W/Z/SDFR=dfr wv = TTLWave + WAVE/Z/W/SDFR=dfr wv = TTLWave if(WaveExists(wv)) return wv @@ -1242,7 +1233,7 @@ Function/WAVE GetTTLWave(device) break case HARDWARE_NI_DAC: // intended drop through case HARDWARE_SUTTER_DAC: - WAVE/WAVE/Z/SDFR=dfr wv_ni = TTLWave + WAVE/Z/WAVE/SDFR=dfr wv_ni = TTLWave if(WaveExists(wv_ni)) return wv_ni @@ -1268,12 +1259,11 @@ End /// Columns: /// - 0: Stimset fingerprint of the previous sweep /// - 1: Current stimset acquisition cycle ID -Function/WAVE GetStimsetAcqIDHelperWave(device) - string device +Function/WAVE GetStimsetAcqIDHelperWave(string device) DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = stimsetAcqIDHelper + WAVE/Z/D/SDFR=dfr wv = stimsetAcqIDHelper if(WaveExists(wv)) return wv @@ -1305,8 +1295,7 @@ Function/S GetLabNotebookFolderAsString() End /// @brief Return the data folder reference to the device specific lab notebook -Function/DF GetDevSpecLabNBFolder(device) - string device +Function/DF GetDevSpecLabNBFolder(string device) return createDFWithAllParents(GetDevSpecLabNBFolderAsString(device)) End @@ -1314,8 +1303,7 @@ End /// @brief Return the full path to the device specific lab notebook, e.g. root:MIES:LabNoteBook:ITC18USB:Device0 /// /// UTF_NOINSTRUMENTATION -Function/S GetDevSpecLabNBFolderAsString(device) - string device +Function/S GetDevSpecLabNBFolderAsString(string device) string deviceType, deviceNumber @@ -1350,8 +1338,7 @@ End /// Layers: /// - 0-7: data for a particular headstage using the layer index /// - 8: headstage independent data -Function/WAVE GetLBTextualValues(device) - string device +Function/WAVE GetLBTextualValues(string device) string newName = LBN_TEXTUAL_VALUES_NAME DFREF newDFR = GetDevSpecLabNBFolder(device) @@ -1362,7 +1349,7 @@ Function/WAVE GetLBTextualValues(device) p.name = "txtDocWave" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(WaveExists(wv)) return wv @@ -1717,8 +1704,7 @@ End /// - 3: Source entry type, one of @ref DataAcqModes /// - 4: Acquisition state, one of @ref AcquisitionStates /// - other columns are filled at runtime -Function/WAVE GetLBTextualKeys(device) - string device +Function/WAVE GetLBTextualKeys(string device) variable versionOfNewWave = LABNOTEBOOK_VERSION string newName = LBN_TEXTUAL_KEYS_NAME @@ -1730,7 +1716,7 @@ Function/WAVE GetLBTextualKeys(device) p.name = "txtDocKeyWave" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -1771,8 +1757,7 @@ End /// - 3: Source entry type, one of @ref DataAcqModes /// - 4: Acquisition state, one of @ref AcquisitionStates /// - other columns are filled at runtime -Function/WAVE GetLBNumericalKeys(device) - string device +Function/WAVE GetLBNumericalKeys(string device) variable versionOfNewWave = LABNOTEBOOK_VERSION /// @todo move the renaming stuff into one function for all four labnotebook waves @@ -1785,7 +1770,7 @@ Function/WAVE GetLBNumericalKeys(device) p.name = "keyWave" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -1856,7 +1841,7 @@ static Function/WAVE GetLBDescription_Impl(string name, variable forceReload) variable versionOfNewWave = LABNOTEBOOK_VERSION DFREF dfr = GetStaticDataFolder() - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave) && !forceReload) return wv @@ -1864,7 +1849,7 @@ static Function/WAVE GetLBDescription_Impl(string name, variable forceReload) KillOrMoveToTrash(wv = wv) - WAVE/T/Z wv = LoadWaveFromDisk(name) + WAVE/Z/T wv = LoadWaveFromDisk(name) ASSERT(WaveExists(wv), "Missing wave") ASSERT(!IsFreeWave(wv), "Not a permanent wave") @@ -1886,19 +1871,21 @@ End static Constant LBN_NUMERICAL_DESCRIPTION_VERSION = 2 Function SaveLBNumericalDescription() + SaveLBDescription_Impl("labnotebook_numerical_description", LBN_NUMERICAL_DESCRIPTION_VERSION) End static Constant LBN_TEXTUAL_DESCRIPTION_VERSION = 1 Function SaveLBTextualDescription() + SaveLBDescription_Impl("labnotebook_textual_description", LBN_TEXTUAL_DESCRIPTION_VERSION) End static Function SaveLBDescription_Impl(string name, variable version) DFREF dfr = GetStaticDataFolder() - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name ASSERT(WaveExists(wv), "Missing wave") RemoveAllDimLabels(wv) @@ -1981,8 +1968,7 @@ End /// Layers: /// - 0-7: data for a particular headstage using the layer index /// - 8: headstage independent data -Function/WAVE GetLBNumericalValues(device) - string device +Function/WAVE GetLBNumericalValues(string device) string newName = LBN_NUMERICAL_VALUES_NAME DFREF newDFR = GetDevSpecLabNBFolder(device) @@ -1993,7 +1979,7 @@ Function/WAVE GetLBNumericalValues(device) p.name = "settingsHistory" p.newName = newName - WAVE/D/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/D wv = UpgradeWaveLocationAndGetIt(p) if(!WaveExists(wv)) Make/D/N=(MINIMUM_WAVE_SIZE, INITIAL_KEY_WAVE_COL_COUNT, LABNOTEBOOK_LAYER_COUNT) newDFR:$newName/WAVE=wv = NaN @@ -2026,7 +2012,7 @@ Function/WAVE GetNumericalResultsKeys() string name = LBN_NUMERICALRESULT_KEYS_NAME DFREF dfr = GetResultsFolder() - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name versionOfNewWave = RESULTS_VERSION if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) @@ -2070,7 +2056,7 @@ Function/WAVE GetNumericalResultsValues() string name = LBN_NUMERICALRESULT_VALUES_NAME DFREF dfr = GetResultsFolder() - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(WaveExists(wv)) // upgrade will be handled in GetNumericalResultsKeys() @@ -2121,7 +2107,7 @@ Function/WAVE GetTextualResultsKeys() string name = LBN_TEXTUALRESULT_KEYS_NAME DFREF dfr = GetResultsFolder() - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name versionOfNewWave = RESULTS_VERSION if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) @@ -2165,7 +2151,7 @@ Function/WAVE GetTextualResultsValues() string name = LBN_TEXTUALRESULT_VALUES_NAME DFREF dfr = GetResultsFolder() - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(WaveExists(wv)) // upgrade will be handled in GetTextualResultsKeys() @@ -2198,8 +2184,7 @@ End /// /// Layers: /// - One for each entrySourceType, mapped via EntrySourceTypeMapper() -threadsafe Function/WAVE GetLBRowCache(values) - WAVE values +threadsafe Function/WAVE GetLBRowCache(WAVE values) variable actual, sweepNo, first, last string key, name @@ -2277,8 +2262,7 @@ End /// Contents: /// - row index if the entry could be found, #LABNOTEBOOK_MISSING_VALUE if it /// could not be found, and #LABNOTEBOOK_UNCACHED_VALUE if the cache is empty. -threadsafe Function/WAVE GetLBIndexCache(values) - WAVE values +threadsafe Function/WAVE GetLBIndexCache(WAVE values) variable actual, sweepNo, first, last string key, name @@ -2347,8 +2331,7 @@ End /// - RAC (repeated acquisition cycle IDs) sweeps /// - SCI (simset cycle IDs) sweeps /// -threadsafe Function/WAVE GetLBNidCache(numericalValues) - WAVE numericalValues +threadsafe Function/WAVE GetLBNidCache(WAVE numericalValues) variable actual string key, name @@ -2427,8 +2410,7 @@ End /// Layers: /// - 0-7: data for a particular headstage using the layer index /// - 8: headstage independent data -Function/WAVE GetSweepSettingsWave(device) - string device +Function/WAVE GetSweepSettingsWave(string device) variable numCols @@ -2442,7 +2424,7 @@ Function/WAVE GetSweepSettingsWave(device) p.name = "sweepSettingsWave" p.newName = newName - WAVE/D/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/D wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, SWEEP_SETTINGS_WAVE_VERSION)) return wv @@ -2540,8 +2522,7 @@ End /// - 59: Save amplifier settings /// - 60: Require amplifier /// - 61: Skip Ahead -Function/WAVE GetSweepSettingsKeyWave(device) - string device +Function/WAVE GetSweepSettingsKeyWave(string device) variable versionOfNewWave = SWEEP_SETTINGS_WAVE_VERSION string newName = "sweepSettingsNumericKeys" @@ -2553,7 +2534,7 @@ Function/WAVE GetSweepSettingsKeyWave(device) p.name = "sweepSettingsKeyWave" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -2678,7 +2659,7 @@ Function/WAVE GetSweepSettingsKeyWave(device) wv[%Tolerance][26] = "0.1" wv[%Parameter][27] = "Stim set length" - wv[%Units][27] = "" // points not time + wv[%Units][27] = "" // points not time wv[%Tolerance][27] = "0.1" wv[%Parameter][28] = "oodDAQ Pre Feature" @@ -2836,8 +2817,7 @@ End /// Layers: /// - 0-7: data for a particular headstage using the layer index /// - 8: headstage independent data -Function/WAVE GetSweepSettingsTextWave(device) - string device +Function/WAVE GetSweepSettingsTextWave(string device) variable numCols @@ -2851,7 +2831,7 @@ Function/WAVE GetSweepSettingsTextWave(device) p.name = "SweepSettingsTxtData" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -2927,8 +2907,7 @@ End /// - 39: TTL rack one set cycle counts (ITC hardware) /// - 40: TTL set cycle counts (NI hardware), string list in `INDEP_HEADSTAGE` layer with empty entries indexed by [0, NUM_DA_TTL_CHANNELS[ /// - 41: Device (aka DAEphys panel name) -Function/WAVE GetSweepSettingsTextKeyWave(device) - string device +Function/WAVE GetSweepSettingsTextKeyWave(string device) variable versionOfNewWave = SWEEP_SETTINGS_WAVE_VERSION string newName = "sweepSettingsTextKeys" @@ -2940,7 +2919,7 @@ Function/WAVE GetSweepSettingsTextKeyWave(device) p.name = "SweepSettingsKeyTxtData" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -3059,13 +3038,12 @@ End /// state is switched (aka on->off or off->on) /// - 29: Auto TP Baseline Fit result: One of @ref TPBaselineFitResults /// - 30: Auto TP Delta V [mV] -Function/WAVE GetTPStorage(device) - string device +Function/WAVE GetTPStorage(string device) DFREF dfr = GetDeviceTestPulse(device) variable versionOfNewWave = 15 - WAVE/Z/SDFR=dfr/D wv = TPStorage + WAVE/Z/D/SDFR=dfr wv = TPStorage if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -3159,16 +3137,16 @@ End /// @brief Return a datafolder reference to the test pulse folder /// /// UTF_NOINSTRUMENTATION -Function/DF GetDeviceTestPulse(device) - string device +Function/DF GetDeviceTestPulse(string device) + return createDFWithAllParents(GetDeviceTestPulseAsString(device)) End /// @brief Return the path to the test pulse folder, e.g. root:mies:HardwareDevices:ITC1600:Device0:TestPulse /// /// UTF_NOINSTRUMENTATION -Function/S GetDeviceTestPulseAsString(device) - string device +Function/S GetDeviceTestPulseAsString(string device) + return GetDevicePathAsString(device) + ":TestPulse" End @@ -3227,8 +3205,7 @@ End /// @brief Return a wave for displaying scaled data in the oscilloscope window /// /// Contents can be decimated for faster display. -Function/WAVE GetOscilloscopeWave(device) - string device +Function/WAVE GetOscilloscopeWave(string device) DFREF dfr = GetDevicePath(device) WAVE/Z/SDFR=dfr wv = OscilloscopeData @@ -3267,8 +3244,7 @@ End /// /// Columns: /// - DA/AD/TTLs data, same order as GetDAQDataWave() -Function/WAVE GetTPOscilloscopeWave(device) - string device +Function/WAVE GetTPOscilloscopeWave(string device) DFREF dfr = GetDevicePath(device) WAVE/Z/SDFR=dfr wv = TPOscilloscopeData @@ -3283,11 +3259,10 @@ Function/WAVE GetTPOscilloscopeWave(device) End /// @brief Return a wave reference wave for storing the *full* test pulses -Function/WAVE GetStoredTestPulseWave(device) - string device +Function/WAVE GetStoredTestPulseWave(string device) DFREF dfr = GetDeviceTestPulse(device) - WAVE/WAVE/Z/SDFR=dfr wv = StoredTestPulses + WAVE/Z/WAVE/SDFR=dfr wv = StoredTestPulses if(WaveExists(wv)) return wv @@ -3317,10 +3292,11 @@ End /// Columns: /// - NUM_HEADSTAGES Function/WAVE GetTPResults(string device) + variable version = 3 DFREF dfr = GetDeviceTestPulse(device) - WAVE/D/Z/SDFR=dfr wv = results + WAVE/Z/D/SDFR=dfr wv = results if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -3332,7 +3308,7 @@ Function/WAVE GetTPResults(string device) wv = NaN // initialize with the old 1D waves - WAVE/D/Z/SDFR=dfr InstResistance, BaselineSSAvg, SSResistance + WAVE/Z/D/SDFR=dfr InstResistance, BaselineSSAvg, SSResistance wv[0][] = WaveExists(InstResistance) ? InstResistance[q] : NaN wv[1][] = WaveExists(BaselineSSAvg) ? BaselineSSAvg[q] : NaN @@ -3354,13 +3330,12 @@ End /// @brief Return the testpulse results buffer wave /// /// Same layout as GetTPResults() but as many layers as the buffer size. -Function/WAVE GetTPResultsBuffer(device) - string device +Function/WAVE GetTPResultsBuffer(string device) variable version = 2 DFREF dfr = GetDeviceTestPulse(device) - WAVE/D/Z/SDFR=dfr wv = resultsBuffer + WAVE/Z/D/SDFR=dfr wv = resultsBuffer if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -3390,6 +3365,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetAmplifierFolder() + return createDFWithAllParents(GetAmplifierFolderAsString()) End @@ -3397,6 +3373,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetAmplifierFolderAsString() + return GetMiesPathAsString() + ":Amplifiers" End @@ -3413,8 +3390,7 @@ End /// /// Contents: /// - numerical amplifier settings -Function/WAVE GetAmplifierParamStorageWave(device) - string device +Function/WAVE GetAmplifierParamStorageWave(string device) variable versionOfNewWave = 4 STRUCT WaveLocationMod p @@ -3773,7 +3749,7 @@ Function/WAVE GetAmplifierTelegraphServers() DFREF dfr = GetAmplifierFolder() - WAVE/I/Z/SDFR=dfr wv = W_TelegraphServers + WAVE/Z/I/SDFR=dfr wv = W_TelegraphServers if(WaveExists(wv)) return wv @@ -3792,7 +3768,7 @@ Function/WAVE GetAmplifierMultiClamps() DFREF dfr = GetAmplifierFolder() - WAVE/I/Z/SDFR=dfr wv = W_MultiClamps + WAVE/Z/I/SDFR=dfr wv = W_MultiClamps if(WaveExists(wv)) return wv @@ -3811,6 +3787,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWaveBuilderPath() + return createDFWithAllParents(GetWaveBuilderPathAsString()) End @@ -3818,6 +3795,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWaveBuilderPathAsString() + return GetMiesPathAsString() + ":WaveBuilder" End @@ -3825,6 +3803,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWaveBuilderDataPath() + return createDFWithAllParents(GetWaveBuilderDataPathAsString()) End @@ -3832,6 +3811,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWaveBuilderDataPathAsString() + return GetWaveBuilderPathAsString() + ":Data" End @@ -3839,6 +3819,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWaveBuilderDataDAPath() + return createDFWithAllParents(GetWaveBuilderDataDAPathAsString()) End @@ -3846,6 +3827,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWaveBuilderDataDAPathAsString() + return GetWaveBuilderDataPathAsString() + ":DA" End @@ -3853,6 +3835,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWaveBuilderDataTTLPath() + return createDFWithAllParents(GetWaveBuilderDataTTLPathAsString()) End @@ -3860,6 +3843,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWaveBuilderDataTTLPathAsString() + return GetWaveBuilderDataPathAsString() + ":TTL" End @@ -3867,6 +3851,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetParamPath() + return createDFWithAllParents(GetWBSvdStimSetParamPathAS()) End @@ -3874,6 +3859,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetParamPathAS() + return GetWaveBuilderPathAsString() + ":SavedStimulusSetParameters" End @@ -3881,6 +3867,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetPath() + return createDFWithAllParents(GetWBSvdStimSetPathAsString()) End @@ -3888,6 +3875,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetPathAsString() + return GetWaveBuilderPathAsString() + ":SavedStimulusSets" End @@ -3895,6 +3883,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetParamDAPath() + return createDFWithAllParents(GetWBSvdStimSetParamDAPathAS()) End @@ -3902,6 +3891,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetParamDAPathAS() + return GetWBSvdStimSetParamPathAS() + ":DA" End @@ -3909,6 +3899,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetParamTTLPath() + return createDFWithAllParents(GetWBSvdStimSetParamTTLAsString()) End @@ -3916,6 +3907,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetParamTTLAsString() + return GetWBSvdStimSetParamPathAS() + ":TTL" End @@ -3923,6 +3915,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetDAPath() + return createDFWithAllParents(GetWBSvdStimSetDAPathAsString()) End @@ -3930,6 +3923,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetDAPathAsString() + return GetWBSvdStimSetPathAsString() + ":DA" End @@ -3937,6 +3931,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetWBSvdStimSetTTLPath() + return createDFWithAllParents(GetWBSvdStimSetTTLPathAsString()) End @@ -3944,6 +3939,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetWBSvdStimSetTTLPathAsString() + return GetWBSvdStimSetPathAsString() + ":TTL" End @@ -3984,8 +3980,7 @@ End /// @brief Upgrade the wave layout of `WP` to the most recent one /// as defined in `WP_WAVE_LAYOUT_VERSION` -Function UpgradeWaveParam(wv) - WAVE wv +Function UpgradeWaveParam(WAVE wv) if(ExistsWithCorrectLayoutVersion(wv, WP_WAVE_LAYOUT_VERSION)) return NaN @@ -4222,8 +4217,7 @@ End /// @brief Upgrade the wave layout of `WPT` to the most recent one /// as defined in `WPT_WAVE_LAYOUT_VERSION` -Function UpgradeWaveTextParam(wv) - WAVE/T wv +Function UpgradeWaveTextParam(WAVE/T wv) string params, names, name, type variable numEntries, i @@ -4404,7 +4398,7 @@ End Function/WAVE GetWaveBuilderWaveTextParam() DFREF dfr = GetWaveBuilderDataPath() - WAVE/T/Z/SDFR=dfr wv = WPT + WAVE/Z/T/SDFR=dfr wv = WPT if(WaveExists(wv)) UpgradeWaveTextParam(wv) @@ -4420,6 +4414,7 @@ End /// /// @sa GetWaveBuilderWaveTextParam() Function/WAVE GetWaveBuilderWaveTextParamAsFree() + Make/FREE/N=(51, 100, EPOCH_TYPES_TOTAL_NUMBER)/T wv AddDimLabelsToWPT(wv) SetWaveVersion(wv, WPT_WAVE_LAYOUT_VERSION) @@ -4437,8 +4432,7 @@ End /// @brief Upgrade the wave layout of `SegWvType` to the most recent one /// as defined in `SEGWVTYPE_WAVE_LAYOUT_VERSION` -Function UpgradeSegWvType(wv) - WAVE wv +Function UpgradeSegWvType(WAVE wv) if(ExistsWithCorrectLayoutVersion(wv, SEGWVTYPE_WAVE_LAYOUT_VERSION)) return NaN @@ -4556,7 +4550,7 @@ Function/WAVE GetWBEpochCombineList(variable channelType) // remove the existing wave which is not channel type aware DFREF dfr = GetWaveBuilderDataPath() - WAVE/T/Z/SDFR=dfr wv = epochCombineList + WAVE/Z/T/SDFR=dfr wv = epochCombineList KillOrMoveToTrash(wv = wv) switch(channelType) @@ -4570,7 +4564,7 @@ Function/WAVE GetWBEpochCombineList(variable channelType) ASSERT(0, "Unknown channel type") endswitch - WAVE/T/Z/SDFR=dfr wv = epochCombineList + WAVE/Z/T/SDFR=dfr wv = epochCombineList if(WaveExists(wv)) return wv @@ -4619,7 +4613,7 @@ End Function/WAVE GetEpochParameterNames() DFREF dfr = GetWaveBuilderDataPath() - WAVE/T/Z/SDFR=dfr wv = epochParameterNames + WAVE/Z/T/SDFR=dfr wv = epochParameterNames if(WaveExists(wv)) return wv @@ -4716,6 +4710,7 @@ End /// - 4: Async Alarm $Channel Max /// - 5: Async AD $Channel [$Title] Function/WAVE GetAsyncSettingsKeyWave(WAVE settingsWave, variable channel, string title, string unit) + string prefix sprintf prefix, "Async %d", channel @@ -4758,7 +4753,7 @@ Function/WAVE GetAsyncSettingsKeyWave(WAVE settingsWave, variable channel, strin wv[%Parameter][5] = prefix wv[%Units][5] = unit - wv[%Tolerance][5] = "" // tolerance is calculated in ED_createAsyncWaveNoteTags() + wv[%Tolerance][5] = "" // tolerance is calculated in ED_createAsyncWaveNoteTags() sprintf prefix, "Async Alarm %d", channel @@ -4804,6 +4799,7 @@ End /// - 0: Async $Channel Title /// - 1: Async $Channel Unit Function/WAVE GetAsyncSettingsTextKeyWave(WAVE/T settingsWave, variable channel) + string prefix Make/T/N=(1, 2)/FREE wv @@ -4825,8 +4821,7 @@ End ///@{ /// @brief Returns device specific pressure folder as string -Function/S P_GetDevicePressureFolderAS(device) - string device +Function/S P_GetDevicePressureFolderAS(string device) string DeviceNumber string DeviceType @@ -4839,24 +4834,24 @@ End /// @brief Creates device specific pressure folder - used to store data for pressure regulators /// /// UTF_NOINSTRUMENTATION -Function/DF P_DeviceSpecificPressureDFRef(device) - string device +Function/DF P_DeviceSpecificPressureDFRef(string device) + return CreateDFWithAllParents(P_GetDevicePressureFolderAS(device)) End /// @brief Returns pressure folder as string /// /// UTF_NOINSTRUMENTATION -Function/S P_GetPressureFolderAS(device) - string device +Function/S P_GetPressureFolderAS(string device) + return GetMiesPathAsString() + ":Pressure" End /// @brief Returns the data folder reference for the main pressure folder "root:MIES:Pressure" /// /// UTF_NOINSTRUMENTATION -Function/DF P_PressureFolderReference(device) - string device +Function/DF P_PressureFolderReference(string device) + return CreateDFWithAllParents(P_GetPressureFolderAS(device)) End @@ -4870,8 +4865,7 @@ End /// - 1: AD data /// - 2: TTL data rack 0 /// - 3: TTL data rack 1 (available if supported by the device) -Function/WAVE P_GetITCData(device) - string device +Function/WAVE P_GetITCData(string device) DFREF dfr = P_DeviceSpecificPressureDFRef(device) @@ -4905,8 +4899,7 @@ End /// - 1: Channel number /// - 2: Sampling interval /// - 3: Decimation -Function/WAVE P_GetITCChanConfig(device) - string device +Function/WAVE P_GetITCChanConfig(string device) DFREF dfr = P_DeviceSpecificPressureDFRef(device) @@ -5068,12 +5061,11 @@ End /// - 45: User pressure deviceID /// - 46: User pressure device hardware type /// - 47: User pressure ADC -Function/WAVE P_GetPressureDataWaveRef(device) - string device +Function/WAVE P_GetPressureDataWaveRef(string device) variable versionOfNewWave = 8 DFREF dfr = P_DeviceSpecificPressureDFRef(device) - WAVE/D/Z/SDFR=dfr wv = PressureData + WAVE/Z/D/SDFR=dfr wv = PressureData if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -5133,8 +5125,7 @@ End /// - 0: Digitial to analog converter device type string. /// - 1: DA unit. /// - 2: AD unit. -Function/WAVE P_PressureDataTxtWaveRef(device) - string device +Function/WAVE P_PressureDataTxtWaveRef(string device) variable versionOfNewWave = 1 DFREF dfr = P_DeviceSpecificPressureDFRef(device) @@ -5175,8 +5166,7 @@ End /// @brief Return the data folder reference to the device specific lab notebook folder for temporary waves /// /// UTF_NOINSTRUMENTATION -Function/DF GetDevSpecLabNBTempFolder(device) - string device +Function/DF GetDevSpecLabNBTempFolder(string device) return createDFWithAllParents(GetDevSpecLabNBTempFolderAS(device)) End @@ -5184,8 +5174,7 @@ End /// @brief Return the full path to the device specific lab notebook temp folder, e.g. root:MIES:LabNoteBook:ITC18USB:Device0:Temp /// /// UTF_NOINSTRUMENTATION -Function/S GetDevSpecLabNBTempFolderAS(device) - string device +Function/S GetDevSpecLabNBTempFolderAS(string device) return GetDevSpecLabNBFolderAsString(device) + ":" + LOGBOOK_WAVE_TEMP_FOLDER End @@ -5213,6 +5202,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetAnalysisFolder() + return createDFWithAllParents(GetAnalysisFolderAS()) End @@ -5220,54 +5210,54 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetAnalysisFolderAS() + return GetMiesPathAsString() + ":Analysis" End /// @brief Return the datafolder reference to the per experiment folder /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisExpFolder(expFolder) - string expFolder +Function/DF GetAnalysisExpFolder(string expFolder) + return createDFWithAllParents(GetAnalysisExpFolderAS(expFolder)) End /// @brief Return the full path to the per experiment folder, e.g. root:MIES:Analysis:my_experiment /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisExpFolderAS(expFolder) - string expFolder +Function/S GetAnalysisExpFolderAS(string expFolder) + return GetAnalysisFolderAS() + ":" + expFolder End /// @brief Return the datafolder reference to the per device folder of an experiment /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisDeviceFolder(expFolder, device) - string expFolder, device +Function/DF GetAnalysisDeviceFolder(string expFolder, string device) + return createDFWithAllParents(GetAnalysisDeviceFolderAS(expFolder, device)) End /// @brief Return the full path to the per device folder of an experiment, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0 /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisDeviceFolderAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisDeviceFolderAS(string expFolder, string device) + return GetAnalysisExpFolderAS(expFolder) + ":" + device End /// @brief Return the datafolder reference to the sweep to channel relation of a device and experiment pair /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisDevChannelFolder(expFolder, device) - string expFolder, device +Function/DF GetAnalysisDevChannelFolder(string expFolder, string device) + return createDFWithAllParents(GetAnalysisDevChannelFolderAS(expFolder, device)) End /// @brief Return the full path to the sweep to channel relation folder of a device and experiment pair, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:channel /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisDevChannelFolderAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisDevChannelFolderAS(string expFolder, string device) return GetAnalysisDeviceFolderAS(expFolder, device) + ":channel" End @@ -5275,16 +5265,15 @@ End /// @brief Return the datafolder reference to the sweep config folder of a device and experiment pair /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisDeviceConfigFolder(expFolder, device) - string expFolder, device +Function/DF GetAnalysisDeviceConfigFolder(string expFolder, string device) + return createDFWithAllParents(GetAnalysisDeviceConfigFolderAS(expFolder, device)) End /// @brief Return the full path to the sweep config folder of a device and experiment pair, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:config /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisDeviceConfigFolderAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisDeviceConfigFolderAS(string expFolder, string device) return GetAnalysisDeviceFolderAS(expFolder, device) + ":config" End @@ -5292,40 +5281,39 @@ End /// @brief Return the datafolder reference to the testpulse folder of a device and experiment pair /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisDeviceTestpulse(expFolder, device) - string expFolder, device +Function/DF GetAnalysisDeviceTestpulse(string expFolder, string device) + return createDFWithAllParents(GetAnalysisDeviceTestpulseAS(expFolder, device)) End /// @brief Return the full path to the testpulse folder of a device and experiment pair, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:testpulse /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisDeviceTestpulseAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisDeviceTestpulseAS(string expFolder, string device) + return GetAnalysisDeviceFolderAS(expFolder, device) + ":testpulse" End /// @brief Return the datafolder reference to the labnotebook folder of a device and experiment pair /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisLabNBFolder(expFolder, device) - string expFolder, device +Function/DF GetAnalysisLabNBFolder(string expFolder, string device) + return createDFWithAllParents(GetAnalysisLabNBFolderAS(expFolder, device)) End /// @brief Return the full path to the labnotebook folder of a device and experiment pair, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:labnotebook /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisLabNBFolderAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisLabNBFolderAS(string expFolder, string device) + return GetAnalysisDeviceFolderAS(expFolder, device) + ":labnotebook" End /// @brief Return the datafolder reference to the sweep folder of a device and experiment pair /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisSweepPath(expFolder, device) - string expFolder, device +Function/DF GetAnalysisSweepPath(string expFolder, string device) return createDFWithAllParents(GetAnalysisSweepPathAsString(expFolder, device)) End @@ -5333,8 +5321,7 @@ End /// @brief Return the full path to the sweep folder of a device and experiment pair, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:sweep /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisSweepPathAsString(expFolder, device) - string expFolder, device +Function/S GetAnalysisSweepPathAsString(string expFolder, string device) return GetAnalysisDeviceFolderAS(expFolder, device) + ":sweep" End @@ -5342,9 +5329,7 @@ End /// @brief Return the datafolder reference to the per sweep folder /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisSweepDataPath(expFolder, device, sweep) - string expFolder, device - variable sweep +Function/DF GetAnalysisSweepDataPath(string expFolder, string device, variable sweep) return createDFWithAllParents(GetAnalysisSweepDataPathAS(expFolder, device, sweep)) End @@ -5352,9 +5337,7 @@ End /// @brief Return the full path to the the per sweep folder, e.g. root:MIES:Analysis:my_experiment:ITC18USB_Dev_0:sweep:X_$sweep /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisSweepDataPathAS(expFolder, device, sweep) - string expFolder, device - variable sweep +Function/S GetAnalysisSweepDataPathAS(string expFolder, string device, variable sweep) ASSERT(IsValidSweepNumber(sweep), "Expected finite sweep number") return GetSingleSweepFolderAsString(GetAnalysisSweepPath(expFolder, device), sweep) @@ -5363,8 +5346,7 @@ End /// @brief Return the datafolder reference to the stim set folder /// /// UTF_NOINSTRUMENTATION -Function/DF GetAnalysisStimSetPath(expFolder, device) - string expFolder, device +Function/DF GetAnalysisStimSetPath(string expFolder, string device) return createDFWithAllParents(GetAnalysisStimSetPathAS(expFolder, device)) End @@ -5372,8 +5354,7 @@ End /// @brief Return the full path to the stim set folder, e.g. root:MIES:Analysis:my_experiment::stimset /// /// UTF_NOINSTRUMENTATION -Function/S GetAnalysisStimSetPathAS(expFolder, device) - string expFolder, device +Function/S GetAnalysisStimSetPathAS(string expFolder, string device) return GetAnalysisDeviceFolderAS(expFolder, device) + ":stimset" End @@ -5382,6 +5363,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetAnalysisResultsFolder(string expFolder) + return createDFWithAllParents(GetAnalysisResultsFolderAsString(expFolder)) End @@ -5398,6 +5380,7 @@ End /// @param expFolder experiment datafolder name /// @param type One of @ref LabnotebookWaveTypes Function/WAVE GetAnalysisResultsWave(string expFolder, variable type) + string name DFREF ref = GetAnalysisResultsFolder(expFolder) @@ -5425,12 +5408,12 @@ Function/WAVE GetAnalysisResultsWave(string expFolder, variable type) End /// wave is used to relate it's index to sweepWave and deviceWave. -Function/WAVE GetAnalysisChannelStorage(dataFolder, device) - string dataFolder, device +Function/WAVE GetAnalysisChannelStorage(string dataFolder, string device) + variable versionOfWave = 2 DFREF dfr = GetAnalysisDevChannelFolder(dataFolder, device) - WAVE/Z/SDFR=dfr/WAVE wv = channelStorage + WAVE/Z/WAVE/SDFR=dfr wv = channelStorage if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -5450,12 +5433,11 @@ End /// @brief Return a wave containing all stimulus channels in the NWB file as a ";"-separated List /// wave is used to relate it's index to sweepWave and deviceWave. -Function/WAVE GetAnalysisChannelStimWave(dataFolder, device) - string dataFolder, device +Function/WAVE GetAnalysisChannelStimWave(string dataFolder, string device) DFREF dfr = GetAnalysisDevChannelFolder(dataFolder, device) - WAVE/Z/SDFR=dfr/T wv = stimulus + WAVE/Z/T/SDFR=dfr wv = stimulus if(WaveExists(wv)) return wv @@ -5469,12 +5451,11 @@ End /// @brief Return a wave containing all acquisition channels in the NWB file as a ";"-separated List /// wave is used to relate it's index to sweepWave and deviceWave. -Function/WAVE GetAnalysisChannelAcqWave(dataFolder, device) - string dataFolder, device +Function/WAVE GetAnalysisChannelAcqWave(string dataFolder, string device) DFREF dfr = GetAnalysisDevChannelFolder(dataFolder, device) - WAVE/Z/SDFR=dfr/T wv = acquisition + WAVE/Z/T/SDFR=dfr wv = acquisition if(WaveExists(wv)) return wv @@ -5488,12 +5469,11 @@ End /// @brief Return a wave containing all sweeps in a unique fashion. /// wave is used to relate it's index to channelWave and deviceWave -Function/WAVE GetAnalysisChannelSweepWave(dataFolder, device) - string dataFolder, device +Function/WAVE GetAnalysisChannelSweepWave(string dataFolder, string device) DFREF dfr = GetAnalysisDevChannelFolder(dataFolder, device) - WAVE/Z/SDFR=dfr/I wv = sweeps + WAVE/Z/I/SDFR=dfr wv = sweeps if(WaveExists(wv)) return wv @@ -5507,12 +5487,11 @@ End /// @brief Return a wave containing all devices /// wave is used to relate it's index to sweepWave and channelWave. -Function/WAVE GetAnalysisDeviceWave(dataFolder) - string dataFolder +Function/WAVE GetAnalysisDeviceWave(string dataFolder) DFREF dfr = GetAnalysisExpFolder(dataFolder) - WAVE/Z/SDFR=dfr/T wv = devices + WAVE/Z/T/SDFR=dfr wv = devices if(WaveExists(wv)) return wv @@ -5529,7 +5508,7 @@ Function/WAVE GetAnalysisStoredTestPulses(string dataFolder, string device) DFREF dfr = GetAnalysisDeviceTestpulse(dataFolder, device) - WAVE/Z/SDFR=dfr/WAVE wv = StoredTestPulses + WAVE/Z/WAVE/SDFR=dfr wv = StoredTestPulses if(WaveExists(wv)) return wv @@ -5551,6 +5530,7 @@ End /// - 2: %DataFolder Data folder inside current Igor experiment /// - 3: %FileType File Type identifier for routing to loader functions, one of @ref AnalysisBrowserFileTypes Function/WAVE GetAnalysisBrowserMap() + DFREF dfr = GetAnalysisFolder() variable versionOfWave = 3 @@ -5594,7 +5574,7 @@ Function/WAVE GetAnalysisBrowserGUIFolderList() DFREF dfr = GetAnalysisFolder() variable versionOfWave = ANALYSIS_BROWSER_FOLDER_LISTBOX_WAVE_VERSION - WAVE/Z/SDFR=dfr/T wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -5640,7 +5620,7 @@ Function/WAVE GetAnalysisBrowserGUIFolderColors() DFREF dfr = GetAnalysisFolder() variable versionOfWave = ANALYSIS_BROWSER_FOLDERCOL_LISTBOX_WAVE_VERSION - WAVE/Z/SDFR=dfr/W/U wv = $name + WAVE/Z/U/W/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -5678,7 +5658,7 @@ Function/WAVE GetExperimentBrowserGUIList() DFREF dfr = GetAnalysisFolder() variable versionOfWave = ANALYSIS_BROWSER_LISTBOX_WAVE_VERSION - WAVE/Z/SDFR=dfr/T wv = expBrowserList + WAVE/Z/T/SDFR=dfr wv = expBrowserList if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -5732,14 +5712,12 @@ Function/WAVE GetExperimentBrowserGUISel() End /// @brief Return the configSweep wave of a given sweep from the analysis subfolder -Function/WAVE GetAnalysisConfigWave(dataFolder, device, sweep) - string dataFolder, device - variable sweep +Function/WAVE GetAnalysisConfigWave(string dataFolder, string device, variable sweep) DFREF dfr = GetAnalysisDeviceConfigFolder(dataFolder, device) string configSweep = GetConfigWaveName(sweep) - WAVE/I/Z/SDFR=dfr wv = $configSweep + WAVE/Z/I/SDFR=dfr wv = $configSweep if(WaveExists(wv)) // do nothing @@ -5756,12 +5734,12 @@ End /// UTF_NOINSTRUMENTATION Function/WAVE ANALYSIS_LBN_GETTER_PROTO(string expFolder, string device) + ASSERT(0, "Can not call prototype function") End /// @brief Return the numerical labnotebook values in the analysis browser of a device and experiment pair -Function/WAVE GetAnalysLBNumericalValues(expFolder, device) - string expFolder, device +Function/WAVE GetAnalysLBNumericalValues(string expFolder, string device) STRUCT WaveLocationMod p p.dfr = GetAnalysisLabNBFolder(expFolder, device) @@ -5772,8 +5750,7 @@ Function/WAVE GetAnalysLBNumericalValues(expFolder, device) End /// @brief Return the textual labnotebook keys in the analysis browser of a device and experiment pair -Function/WAVE GetAnalysLBTextualValues(expFolder, device) - string expFolder, device +Function/WAVE GetAnalysLBTextualValues(string expFolder, string device) STRUCT WaveLocationMod p p.dfr = GetAnalysisLabNBFolder(expFolder, device) @@ -5784,8 +5761,7 @@ Function/WAVE GetAnalysLBTextualValues(expFolder, device) End /// @brief Return the numerical labnotebook keys in the analysis browser of a device and experiment pair -Function/WAVE GetAnalysLBNumericalKeys(expFolder, device) - string expFolder, device +Function/WAVE GetAnalysLBNumericalKeys(string expFolder, string device) STRUCT WaveLocationMod p p.dfr = GetAnalysisLabNBFolder(expFolder, device) @@ -5796,8 +5772,7 @@ Function/WAVE GetAnalysLBNumericalKeys(expFolder, device) End /// @brief Return the textual labnotebook keys in the analysis browser of a device and experiment pair -Function/WAVE GetAnalysLBTextualKeys(expFolder, device) - string expFolder, device +Function/WAVE GetAnalysLBTextualKeys(string expFolder, string device) STRUCT WaveLocationMod p p.dfr = GetAnalysisLabNBFolder(expFolder, device) @@ -5823,8 +5798,7 @@ End /// /// Layers: /// - Channels -Function/WAVE GetIndexingStorageWave(device) - string device +Function/WAVE GetIndexingStorageWave(string device) DFREF dfr = GetDevicePath(device) variable versionOfNewWave = 1 @@ -5874,6 +5848,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetStaticDataFolder() + return createDFWithAllParents(GetStaticDataFolderAS()) End @@ -5890,6 +5865,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetActDAQDevicesTestPulseFolder() + return createDFWithAllParents(GetActiveDAQDevicesTestPulseFolderAsString()) End @@ -5897,6 +5873,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetActiveDAQDevicesTestPulseFolderAsString() + return GetDAQDevicesFolderAsString() + ":ActiveDAQDevices:TestPulse" End @@ -5970,8 +5947,7 @@ End /// - 17+: Unique controls /// /// UTF_NOINSTRUMENTATION -Function/WAVE GetDA_EphysGuiStateNum(device) - string device +Function/WAVE GetDA_EphysGuiStateNum(string device) variable uniqueCtrlCount string uniqueCtrlList @@ -6040,8 +6016,7 @@ End /// - 10+: Unique controls (SetVariable and PopupMenu only) /// /// UTF_NOINSTRUMENTATION -Function/WAVE GetDA_EphysGuiStateTxT(device) - string device +Function/WAVE GetDA_EphysGuiStateTxT(string device) DFREF dfr = GetDevicePath(device) WAVE/Z/T/SDFR=dfr wv = DA_EphysGuiStateTxT @@ -6087,6 +6062,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetNWBFolder() + return createDFWithAllParents(GetNWBFolderAS()) End @@ -6094,6 +6070,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetNWBFolderAS() + return GetMiesPathAsString() + ":NWB" End @@ -6149,12 +6126,14 @@ End /// @brief Return the datafolder reference to the wave cache /// UTF_NOINSTRUMENTATION threadsafe Function/DF GetCacheFolder() + return createDFWithAllParents(GetCacheFolderAS()) End /// @brief Return the full path to the wave cache datafolder, e.g. root:MIES:Cache /// UTF_NOINSTRUMENTATION threadsafe Function/S GetCacheFolderAS() + return GetMiesPathAsString() + ":Cache" End @@ -6166,7 +6145,7 @@ threadsafe Function/WAVE GetCacheValueWave() DFREF dfr = GetCacheFolder() - WAVE/WAVE/Z/SDFR=dfr wv = values + WAVE/Z/WAVE/SDFR=dfr wv = values if(WaveExists(wv)) return wv @@ -6187,7 +6166,7 @@ threadsafe Function/WAVE GetCacheKeyWave() DFREF dfr = GetCacheFolder() - WAVE/T/Z/SDFR=dfr wv = keys + WAVE/Z/T/SDFR=dfr wv = keys if(WaveExists(wv)) return wv @@ -6219,7 +6198,7 @@ threadsafe Function/WAVE GetCacheStatsWave() variable numRows, index, oldNumRows DFREF dfr = GetCacheFolder() - WAVE/D/Z/SDFR=dfr wv = stats + WAVE/Z/D/SDFR=dfr wv = stats if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6273,8 +6252,7 @@ End /// the headstage refers to the logical entity inside MIES. /// /// Will be written into the labnotebook and used for the NWB export. -Function/WAVE GetCellElectrodeNames(device) - string device +Function/WAVE GetCellElectrodeNames(string device) variable versionOfNewWave = 1 DFREF dfr = GetDevicePath(device) @@ -6301,8 +6279,7 @@ End /// - One row for each headstage /// /// @sa P_UpdatePressureType -Function/WAVE GetPressureTypeWv(device) - string device +Function/WAVE GetPressureTypeWv(string device) DFREF dfr = P_DeviceSpecificPressureDFRef(device) @@ -6320,8 +6297,7 @@ End /// @brief Return the pulse averaging folder /// /// UTF_NOINSTRUMENTATION -Function/DF GetDevicePulseAverageFolder(dfr) - DFREF dfr +Function/DF GetDevicePulseAverageFolder(DFREF dfr) return createDFWithAllParents(GetDevicePulseAverageFolderAS(dfr)) End @@ -6329,8 +6305,7 @@ End /// @brief Return the full path to the pulse averaging folder, e.g. dfr:PulseAveraging /// /// UTF_NOINSTRUMENTATION -Function/S GetDevicePulseAverageFolderAS(dfr) - DFREF dfr +Function/S GetDevicePulseAverageFolderAS(DFREF dfr) return GetDataFolder(1, dfr) + "PulseAveraging" End @@ -6340,8 +6315,7 @@ End /// This holds various helper waves for the graph generation. /// /// UTF_NOINSTRUMENTATION -Function/DF GetDevicePulseAverageHelperFolder(dfr) - DFREF dfr +Function/DF GetDevicePulseAverageHelperFolder(DFREF dfr) return createDFWithAllParents(GetDevicePulseAverageHelperFolderAS(dfr)) End @@ -6349,8 +6323,7 @@ End /// @brief Return the full path to the pulse averaging helper folder, e.g. dfr:Helper /// /// UTF_NOINSTRUMENTATION -Function/S GetDevicePulseAverageHelperFolderAS(dfr) - DFREF dfr +Function/S GetDevicePulseAverageHelperFolderAS(DFREF dfr) return GetDevicePulseAverageFolderAS(dfr) + ":Helper" End @@ -6363,9 +6336,7 @@ End /// @param channelNumber channel number /// @param region region index (a region is the range with data in a dDAQ/oodDAQ measurement) /// @param pulseIndex pulse number, 0-based -Function/WAVE GetPulseAverageWave(dfr, length, channelType, channelNumber, region, pulseIndex) - DFREF dfr - variable length, channelType, pulseIndex, channelNumber, region +Function/WAVE GetPulseAverageWave(DFREF dfr, variable length, variable channelType, variable channelNumber, variable region, variable pulseIndex) variable versionOfNewWave = PULSE_WAVE_VERSION string wvName @@ -6373,7 +6344,7 @@ Function/WAVE GetPulseAverageWave(dfr, length, channelType, channelNumber, regio ASSERT(DataFolderExistsDFR(dfr), "Missing dfr") wvName = PA_GeneratePulseWaveName(channelType, channelNumber, region, pulseIndex) - WAVE/SDFR=dfr/Z wv = $wvName + WAVE/Z/SDFR=dfr wv = $wvName if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv elseif(WaveExists(wv)) @@ -6396,9 +6367,7 @@ End /// @param channelNumber channel number /// @param region region index (a region is the range with data in a dDAQ/oodDAQ measurement) /// @param pulseIndex pulse number, 0-based -Function/WAVE GetPulseAverageWaveNoteWave(dfr, length, channelType, channelNumber, region, pulseIndex) - DFREF dfr - variable length, channelType, pulseIndex, channelNumber, region +Function/WAVE GetPulseAverageWaveNoteWave(DFREF dfr, variable length, variable channelType, variable channelNumber, variable region, variable pulseIndex) variable versionOfNewWave = PULSE_WAVE_VERSION string wvName @@ -6406,7 +6375,7 @@ Function/WAVE GetPulseAverageWaveNoteWave(dfr, length, channelType, channelNumbe ASSERT(DataFolderExistsDFR(dfr), "Missing dfr") wvName = PA_GeneratePulseWaveName(channelType, channelNumber, region, pulseIndex) + PULSEWAVE_NOTE_SUFFIX - WAVE/SDFR=dfr/Z wv = $wvName + WAVE/Z/SDFR=dfr wv = $wvName if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv elseif(WaveExists(wv)) @@ -6525,10 +6494,11 @@ End /// Belongs to GetPulseAverageProperties() and also has the same /// `NOTE_INDEX` count stored there. Function/WAVE GetPulseAveragePropertiesWaves(DFREF dfr) + variable versionOfNewWave = 2 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/WAVE/Z/SDFR=dfr wv = propertiesWaves + WAVE/Z/WAVE/SDFR=dfr wv = propertiesWaves if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6550,10 +6520,11 @@ End /// Belongs to GetPulseAverageProperties() and also has the same /// `NOTE_INDEX` count stored there. Function/WAVE GetPulseAverageDisplayMapping(DFREF dfr) + variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/D/Z/SDFR=dfr wv = displayMapping + WAVE/Z/D/SDFR=dfr wv = displayMapping if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6572,13 +6543,12 @@ End /// @brief Return the artefact removal listbox wave for the /// databrowser or the sweepbrowser -Function/WAVE GetArtefactRemovalListWave(dfr) - DFREF dfr +Function/WAVE GetArtefactRemovalListWave(DFREF dfr) variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/T/Z/SDFR=dfr wv = artefactRemovalListBoxWave + WAVE/Z/T/SDFR=dfr wv = artefactRemovalListBoxWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6597,13 +6567,12 @@ End /// @brief Return the artefact removal wave /// databrowser or the sweepbrowser -Function/WAVE GetArtefactRemovalDataWave(dfr) - DFREF dfr +Function/WAVE GetArtefactRemovalDataWave(DFREF dfr) variable versionOfNewWave = 2 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/D/Z/SDFR=dfr wv = artefactRemovalDataWave + WAVE/Z/D/SDFR=dfr wv = artefactRemovalDataWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6624,13 +6593,12 @@ End /// @brief Return the overlay sweeps listbox wave for the /// databrowser or the sweepbrowser -Function/WAVE GetOverlaySweepsListWave(dfr) - DFREF dfr +Function/WAVE GetOverlaySweepsListWave(DFREF dfr) variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/T/Z/SDFR=dfr wv = overlaySweepsListBoxWave + WAVE/Z/T/SDFR=dfr wv = overlaySweepsListBoxWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6649,13 +6617,12 @@ End /// @brief Return the overlay sweeps listbox selection wave /// for the databrowser or the sweepbrowser -Function/WAVE GetOverlaySweepsListSelWave(dfr) - DFREF dfr +Function/WAVE GetOverlaySweepsListSelWave(DFREF dfr) variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/B/Z/SDFR=dfr wv = overlaySweepsListBoxSelWave + WAVE/Z/B/SDFR=dfr wv = overlaySweepsListBoxSelWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6681,6 +6648,7 @@ End /// Columns: /// - #NUM_HEADSTAGES, 1 if active and 0 if removed Function/WAVE GetOverlaySweepHeadstageRemoval(DFREF dfr) + variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") @@ -6702,10 +6670,7 @@ End /// @brief Return the overlay sweeps wave with all sweep selection choices /// for the databrowser or the sweepbrowser -Function/WAVE GetOverlaySweepSelectionChoices(win, dfr, [skipUpdate]) - string win - DFREF dfr - variable skipUpdate +Function/WAVE GetOverlaySweepSelectionChoices(string win, DFREF dfr, [variable skipUpdate]) variable versionOfNewWave = 4 @@ -6723,7 +6688,7 @@ Function/WAVE GetOverlaySweepSelectionChoices(win, dfr, [skipUpdate]) p.name = "overlaySweepsStimSetListWave" p.newName = newName - WAVE/T/Z wv = UpgradeWaveLocationAndGetIt(p) + WAVE/Z/T wv = UpgradeWaveLocationAndGetIt(p) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) if(!skipUpdate) @@ -6749,8 +6714,7 @@ Function/WAVE GetOverlaySweepSelectionChoices(win, dfr, [skipUpdate]) End /// @brief Return the channel selection wave for the databrowser or sweep browser -Function/WAVE GetChannelSelectionWave(dfr) - DFREF dfr +Function/WAVE GetChannelSelectionWave(DFREF dfr) variable versionOfNewWave = 1 @@ -6790,14 +6754,13 @@ Function/WAVE GetAxisLabelCacheWave() End /// @brief Return the sweepBrowser map wave from the given DFR -Function/WAVE GetSweepBrowserMap(dfr) - DFREF dfr +Function/WAVE GetSweepBrowserMap(DFREF dfr) variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Missing SweepBrowser DFR") - WAVE/T/Z/SDFR=dfr wv = map + WAVE/Z/T/SDFR=dfr wv = map if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv else @@ -6821,6 +6784,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetDebugPanelFolder() + return createDFWithAllParents(GetDebugPanelFolderAS()) End @@ -6828,6 +6792,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetDebugPanelFolderAS() + return GetMiesPathAsString() + ":Debug" End @@ -6836,7 +6801,7 @@ Function/WAVE GetDebugPanelListWave() variable versionOfNewWave = 1 DFREF dfr = GetDebugPanelFolder() - WAVE/T/Z/SDFR=dfr wv = fileSelectionListWave + WAVE/Z/T/SDFR=dfr wv = fileSelectionListWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6854,7 +6819,7 @@ Function/WAVE GetDebugPanelListSelWave() variable versionOfNewWave = 1 DFREF dfr = GetDebugPanelFolder() - WAVE/B/Z/SDFR=dfr wv = fileSelectionListSelWave + WAVE/Z/B/SDFR=dfr wv = fileSelectionListSelWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6874,12 +6839,11 @@ End /// @brief Return a wave reference which holds an headstage-dependent index /// /// Can be used by analysis function to count the number of invocations. -Function/WAVE GetAnalysisFuncIndexingHelper(device) - string device +Function/WAVE GetAnalysisFuncIndexingHelper(string device) variable versionOfNewWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = analysisFuncIndexing + WAVE/Z/D/SDFR=dfr wv = analysisFuncIndexing if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6902,12 +6866,11 @@ End /// /// Columns: /// - Headstages -Function/WAVE GetAnalysisFuncDAScaleDeltaV(device) - string device +Function/WAVE GetAnalysisFuncDAScaleDeltaV(string device) variable versionOfNewWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = analysisFuncDAScaleDeltaV + WAVE/Z/D/SDFR=dfr wv = analysisFuncDAScaleDeltaV if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6936,12 +6899,11 @@ End /// /// Columns: /// - Headstages -Function/WAVE GetAnalysisFuncDAScaleDeltaI(device) - string device +Function/WAVE GetAnalysisFuncDAScaleDeltaI(string device) variable versionOfNewWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = analysisFuncDAScaleDeltaI + WAVE/Z/D/SDFR=dfr wv = analysisFuncDAScaleDeltaI if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6968,12 +6930,11 @@ End /// Columns: /// - Value /// - Error (standard deviation) -Function/WAVE GetAnalysisFuncDAScaleRes(device) - string device +Function/WAVE GetAnalysisFuncDAScaleRes(string device) variable versionOfNewWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = analysisFuncDAScaleRes + WAVE/Z/D/SDFR=dfr wv = analysisFuncDAScaleRes if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -6995,9 +6956,7 @@ End /// @brief Return a wave reference to the fitted resistance wave created by `CurveFit` /// /// Used by PSQ_AdjustDAScale(). -Function/WAVE GetAnalysisFuncDAScaleResFit(device, headstage) - string device - variable headstage +Function/WAVE GetAnalysisFuncDAScaleResFit(string device, variable headstage) variable versionOfNewWave = 1 string name @@ -7005,7 +6964,7 @@ Function/WAVE GetAnalysisFuncDAScaleResFit(device, headstage) DFREF dfr = GetDevicePath(device) name = "analysisFuncDAScaleResFit" + "_" + num2str(headstage) - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7025,9 +6984,7 @@ End /// @brief Return a wave reference to the spikes frequency wave /// /// Used by PSQ_AdjustDAScale(). -Function/WAVE GetAnalysisFuncDAScaleSpikeFreq(device, headstage) - string device - variable headstage +Function/WAVE GetAnalysisFuncDAScaleSpikeFreq(string device, variable headstage) variable versionOfNewWave = 1 string name @@ -7035,7 +6992,7 @@ Function/WAVE GetAnalysisFuncDAScaleSpikeFreq(device, headstage) DFREF dfr = GetDevicePath(device) name = "analysisFuncDAScaleSpikeFreq" + "_" + num2str(headstage) - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7054,9 +7011,7 @@ End /// @brief Return a wave reference to the spikes frequency wave /// /// Used by PSQ_AdjustDAScale(). -Function/WAVE GetAnalysisFuncDAScaleFreqFit(device, headstage) - string device - variable headstage +Function/WAVE GetAnalysisFuncDAScaleFreqFit(string device, variable headstage) variable versionOfNewWave = 1 string name @@ -7064,7 +7019,7 @@ Function/WAVE GetAnalysisFuncDAScaleFreqFit(device, headstage) DFREF dfr = GetDevicePath(device) name = "analysisFuncDAScaleFreqFit" + "_" + num2str(headstage) - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7083,9 +7038,7 @@ End /// @brief Return a wave reference to the DAScale wave /// /// Used by PSQ_AdjustDAScale(). -Function/WAVE GetAnalysisFuncDAScales(device, headstage) - string device - variable headstage +Function/WAVE GetAnalysisFuncDAScales(string device, variable headstage) variable versionOfNewWave = 1 string name @@ -7093,7 +7046,7 @@ Function/WAVE GetAnalysisFuncDAScales(device, headstage) DFREF dfr = GetDevicePath(device) name = "analysisFuncDAScales" + "_" + num2str(headstage) - WAVE/D/Z/SDFR=dfr wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7123,12 +7076,11 @@ End /// Columns: /// - 0-#TOTAL_NUM_EVENTS - 1: Analysis functions /// - #ANALYSIS_FUNCTION_PARAMS: Analysis function params (only for V3 generic functions) -Function/WAVE GetAnalysisFunctionStorage(device) - string device +Function/WAVE GetAnalysisFunctionStorage(string device) variable versionOfWave = 4 DFREF dfr = GetDevicePath(device) - WAVE/T/Z/SDFR=dfr wv = analysisFunctions + WAVE/Z/T/SDFR=dfr wv = analysisFunctions if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7153,12 +7105,11 @@ End /// Columns: /// - PRE_SET_EVENT /// - POST_SET_EVENT -Function/WAVE GetSetEventFlag(device) - string device +Function/WAVE GetSetEventFlag(string device) variable versionOfWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = setEventFlag + WAVE/Z/D/SDFR=dfr wv = setEventFlag if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7178,12 +7129,11 @@ End /// @brief Return the wave for storing timestamps for perf testing repeated /// acquisition -Function/WAVE GetRAPerfWave(device) - string device +Function/WAVE GetRAPerfWave(string device) variable versionOfWave = 1 DFREF dfr = GetDevicePath(device) - WAVE/D/Z/SDFR=dfr wv = perfingRA + WAVE/Z/D/SDFR=dfr wv = perfingRA if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7207,7 +7157,7 @@ Function/WAVE WBP_GetAnalysisParamGUIListWave() variable versionOfWave = 3 DFREF dfr = GetWaveBuilderDataPath() - WAVE/T/Z/SDFR=dfr wv = analysisGUIListWave + WAVE/Z/T/SDFR=dfr wv = analysisGUIListWave if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7233,7 +7183,7 @@ Function/WAVE WBP_GetAnalysisParamGUISelWave() variable versionOfWave = 1 DFREF dfr = GetWaveBuilderDataPath() - WAVE/B/Z/SDFR=dfr wv = analysisGUISelWave + WAVE/Z/B/SDFR=dfr wv = analysisGUISelWave if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7251,7 +7201,7 @@ Function/WAVE WBP_GetAnalysisParamGUIHelpWave() variable versionOfWave = 1 DFREF dfr = GetWaveBuilderDataPath() - WAVE/T/Z/SDFR=dfr wv = analysisGUIHelpWave + WAVE/Z/T/SDFR=dfr wv = analysisGUIHelpWave if(ExistsWithCorrectLayoutVersion(wv, versionOfWave)) return wv @@ -7272,13 +7222,12 @@ End /// @brief Return the analysis function dashboard listbox wave for the /// databrowser or the sweepbrowser -Function/WAVE GetAnaFuncDashboardListWave(dfr) - DFREF dfr +Function/WAVE GetAnaFuncDashboardListWave(DFREF dfr) variable versionOfNewWave = 2 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/T/Z/SDFR=dfr wv = dashboardListWave + WAVE/Z/T/SDFR=dfr wv = dashboardListWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7301,13 +7250,12 @@ End /// @brief Return the analysis function dashboard info wave for the /// databrowser or the sweepbrowser -Function/WAVE GetAnaFuncDashboardInfoWave(dfr) - DFREF dfr +Function/WAVE GetAnaFuncDashboardInfoWave(DFREF dfr) variable versionOfNewWave = 3 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/T/Z/SDFR=dfr wv = dashboardInfoWave + WAVE/Z/T/SDFR=dfr wv = dashboardInfoWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7330,13 +7278,12 @@ End /// @brief Return the analysis function dashboard listbox selection wave for the /// databrowser or the sweepbrowser -Function/WAVE GetAnaFuncDashboardSelWave(dfr) - DFREF dfr +Function/WAVE GetAnaFuncDashboardSelWave(DFREF dfr) variable versionOfNewWave = 2 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/B/Z/SDFR=dfr wv = dashboardSelWave + WAVE/Z/B/SDFR=dfr wv = dashboardSelWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7354,13 +7301,12 @@ End /// @brief Return the analysis function dashboard listbox color wave for the /// databrowser or the sweepbrowser -Function/WAVE GetAnaFuncDashboardColorWave(dfr) - DFREF dfr +Function/WAVE GetAnaFuncDashboardColorWave(DFREF dfr) variable versionOfNewWave = 2 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/W/U/Z/SDFR=dfr wv = dashboardColorWave + WAVE/Z/U/W/SDFR=dfr wv = dashboardColorWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7381,13 +7327,12 @@ End /// @brief Return the analysis function dashboard help wave for the /// databrowser or the sweepbrowser -Function/WAVE GetAnaFuncDashboardHelpWave(dfr) - DFREF dfr +Function/WAVE GetAnaFuncDashboardHelpWave(DFREF dfr) variable versionOfNewWave = 1 ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/T/Z/SDFR=dfr wv = dashboardHelpWave + WAVE/Z/T/SDFR=dfr wv = dashboardHelpWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7420,7 +7365,7 @@ Function/WAVE GetDeviceInfoWave(string device) variable hardwareType DFREF dfr = GetDeviceInfoPath() - WAVE/D/Z/SDFR=dfr wv = $device + WAVE/Z/D/SDFR=dfr wv = $device if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7460,7 +7405,7 @@ Function/WAVE GetElapsedTimeWave() variable versionOfNewWave = 1 DFREF dfr = GetTempPath() - WAVE/D/Z/SDFR=dfr wv = elapsedTime + WAVE/Z/D/SDFR=dfr wv = elapsedTime if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7517,7 +7462,7 @@ Function/WAVE GetPopupExtMenuWave() variable versionOfNewWave = 1 DFREF dfr = GetMiesPath() - WAVE/T/Z/SDFR=dfr wv = popupExtMenuInfo + WAVE/Z/T/SDFR=dfr wv = popupExtMenuInfo if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7570,7 +7515,7 @@ Function/WAVE GetGraphUserData(string graph) variable versionOfNewWave = 1 DFREF dfr = GetGraphUserDataFolderDFR() string name = BuildGraphName(graph) - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7600,7 +7545,7 @@ Function/WAVE GetPAGraphData() variable versionOfNewWave = 1 DFREF dfr = GetGraphUserDataFolderDFR() string name = "PAGraphData" - WAVE/T/Z/SDFR=dfr wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7754,6 +7699,7 @@ End /// UTF_NOINSTRUMENTATION Function/S GetDANDIFolderAsString() + return "root:MIES:DANDI" End @@ -7846,6 +7792,7 @@ End /// @brief Free wave version of GetTPSettingsFree() Function/WAVE GetTPSettingsFree() + Make/N=(14, LABNOTEBOOK_LAYER_COUNT)/D/FREE wv wv = NaN @@ -7891,7 +7838,7 @@ Function/WAVE GetTPSettings(string device) DFREF dfr = GetDeviceTestPulse(device) - WAVE/Z/SDFR=dfr/D wv = settings + WAVE/Z/D/SDFR=dfr wv = settings if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -7919,7 +7866,7 @@ Function/WAVE GetTPSettingsCalculated(string device) DFREF dfr = GetDeviceTestPulse(device) - WAVE/Z/SDFR=dfr/D wv = settingsCalculated + WAVE/Z/D/SDFR=dfr wv = settingsCalculated if(ExistsWithCorrectLayoutVersion(wv, TP_SETTINGSCALCULATED_WAVE_VERSION)) return wv @@ -8002,7 +7949,7 @@ Function/WAVE GetTPSettingsLabnotebookKeyWave(string device) variable versionOfNewWave = TP_SETTINGS_WAVE_VERSION DFREF dfr = GetDevSpecLabNBTempFolder(device) - WAVE/Z/SDFR=dfr/T wv = TPSettingsKeyWave + WAVE/Z/T/SDFR=dfr wv = TPSettingsKeyWave if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -8090,7 +8037,7 @@ Function/WAVE GetTPSettingsLabnotebook(string device) variable versionOfNewWave = TP_SETTINGS_WAVE_VERSION DFREF dfr = GetDevSpecLabNBTempFolder(device) - WAVE/Z/SDFR=dfr/D wv = TPSettings + WAVE/Z/D/SDFR=dfr wv = TPSettings if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv @@ -8121,8 +8068,7 @@ End /// when jobs should be read out in order, the waiting data folders are buffered in this wave /// e.g. if the next read out would be job 2, but a data folder from job 3 is returned /// the data folder is buffered until the one from job 2 appears from the output queue -Function/WAVE GetDFREFbuffer(dfr) - DFREF dfr +Function/WAVE GetDFREFbuffer(DFREF dfr) ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") WAVE/Z/DF/SDFR=dfr wv = DFREFbuffer @@ -8140,11 +8086,10 @@ End /// row stores work load classes named through dimension label /// column 0 stores how many work loads were pushed to Async /// column 1 stores how many work loads were read out from Async -Function/WAVE GetWorkloadTracking(dfr) - DFREF dfr +Function/WAVE GetWorkloadTracking(DFREF dfr) ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/Z/SDFR=dfr/L/U wv = WorkloadTracking + WAVE/Z/U/L/SDFR=dfr wv = WorkloadTracking if(WaveExists(wv)) return wv @@ -8159,11 +8104,10 @@ End /// @brief Returns wave ref for buffering results when THREADING_DISABLED is defined /// 1D wave using NOTE_INDEX logic -Function/WAVE GetSerialExecutionBuffer(dfr) - DFREF dfr +Function/WAVE GetSerialExecutionBuffer(DFREF dfr) ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/Z/SDFR=dfr/DF wv = SerialExecutionBuffer + WAVE/Z/DF/SDFR=dfr wv = SerialExecutionBuffer if(WaveExists(wv)) return wv @@ -8179,6 +8123,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/S GetAsyncHomeStr() + return "root:Packages:Async" End @@ -8186,6 +8131,7 @@ End /// /// UTF_NOINSTRUMENTATION Function/DF GetAsyncHomeDF() + return createDFWithAllParents(getAsyncHomeStr()) End @@ -8327,7 +8273,7 @@ End Function/WAVE GetPSXSingleEventFitWaveFromDFR(DFREF dfr) - WAVE/D/SDFR=dfr/Z wv = singleEventFit + WAVE/Z/D/SDFR=dfr wv = singleEventFit if(WaveExists(wv)) return wv @@ -8368,7 +8314,7 @@ static Function/WAVE GetWaveFromFolder(DFREF dfr, string name) ASSERT(DataFolderExistsDFR(dfr), "Invalid dfr") - WAVE/SDFR=dfr/Z wv = $name + WAVE/Z/SDFR=dfr wv = $name ASSERT(WaveExists(wv), "Missing wave:" + name) return wv @@ -8479,7 +8425,7 @@ Function/WAVE GetPSXAverageWave(DFREF dfr, variable state) string name = "average" + PSX_StateToString(state) - WAVE/D/SDFR=dfr/Z wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(WaveExists(wv)) return wv @@ -8492,7 +8438,7 @@ End Function/WAVE GetPSXAcceptedAverageFitWaveFromDFR(DFREF dfr) - WAVE/D/SDFR=dfr/Z wv = acceptedAverageFit + WAVE/Z/D/SDFR=dfr wv = acceptedAverageFit if(WaveExists(wv)) return wv @@ -8547,7 +8493,7 @@ Function/WAVE GetSUDeviceInfo() DFREF dfr = GetDeviceInfoPath() - WAVE/Z/SDFR=dfr/T wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -8579,7 +8525,7 @@ Function/WAVE GetSUDeviceInput(string device) DFREF dfr = GetDevicePath(device) - WAVE/Z/SDFR=dfr/T wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -8610,7 +8556,7 @@ Function/WAVE GetSUDeviceOutput(string device) DFREF dfr = GetDevicePath(device) - WAVE/Z/SDFR=dfr/T wv = $name + WAVE/Z/T/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -8640,7 +8586,7 @@ Function/WAVE GetSUDeviceInputGains(string device) DFREF dfr = GetDevicePath(device) - WAVE/Z/SDFR=dfr/D wv = $name + WAVE/Z/D/SDFR=dfr wv = $name if(ExistsWithCorrectLayoutVersion(wv, version)) return wv @@ -8709,8 +8655,7 @@ End /// @brief Return the stimset folder from the numeric channelType, #CHANNEL_TYPE_DAC or #CHANNEL_TYPE_TTL /// /// @returns Data Folder reference to Stimset dataFolder -Function/DF GetSetFolder(channelType) - variable channelType +Function/DF GetSetFolder(variable channelType) if(channelType == CHANNEL_TYPE_DAC) return GetWBSvdStimSetDAPath() @@ -8724,8 +8669,7 @@ End /// @brief Return the stimset folder from the numeric channelType, #CHANNEL_TYPE_DAC or #CHANNEL_TYPE_TTL /// /// @returns String with full path to Stimset dataFolder -Function/S GetSetFolderAsString(channelType) - variable channelType +Function/S GetSetFolderAsString(variable channelType) if(channelType == CHANNEL_TYPE_DAC) return GetWBSvdStimSetDAPathAsString() @@ -8741,8 +8685,7 @@ End /// @param channelType #CHANNEL_TYPE_DAC or #CHANNEL_TYPE_TTL /// /// @returns dataFolder as DFREF -Function/DF GetSetParamFolder(channelType) - variable channelType +Function/DF GetSetParamFolder(variable channelType) if(channelType == CHANNEL_TYPE_DAC) return GetWBSvdStimSetParamDAPath() @@ -8758,8 +8701,7 @@ End /// @param channelType #CHANNEL_TYPE_DAC or #CHANNEL_TYPE_TTL /// /// @returns dataFolder as String -Function/S GetSetParamFolderAsString(channelType) - variable channelType +Function/S GetSetParamFolderAsString(variable channelType) if(channelType == CHANNEL_TYPE_DAC) return GetWBSvdStimSetParamPathAS() + ":DA" diff --git a/Packages/MIES_Include.ipf b/Packages/MIES_Include.ipf index 2ed934674b..8b69e8f5b1 100644 --- a/Packages/MIES_Include.ipf +++ b/Packages/MIES_Include.ipf @@ -42,8 +42,7 @@ Window OpenPanelWithDocumentationLink() : Panel Button button1, pos={51.00, 133.00}, size={195.00, 29.00}, proc=ButtonProc_DownloadNightly, title="Download Igor Pro nightly build" EndMacro -Function ButtonProc_OpenMiesDocuUpdateNightly(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_OpenMiesDocuUpdateNightly(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -96,8 +95,7 @@ static Function/S GetDestinationIgorPath() return path End -Function ButtonProc_DownloadNightly(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function ButtonProc_DownloadNightly(STRUCT WMButtonAction &ba) : ButtonControl string url, filename, path diff --git a/Packages/doc/ipf/example-stimulus-set-api.ipf b/Packages/doc/ipf/example-stimulus-set-api.ipf index 2d8324297c..bd3c7f544a 100644 --- a/Packages/doc/ipf/example-stimulus-set-api.ipf +++ b/Packages/doc/ipf/example-stimulus-set-api.ipf @@ -1,5 +1,6 @@ Function StimsetAPIExample() + string setName, stimsets variable numEpochs diff --git a/Packages/tests/Basic/UTF_AnalysisFunctionHelpers.ipf b/Packages/tests/Basic/UTF_AnalysisFunctionHelpers.ipf index 1037589ccb..f3418895b9 100644 --- a/Packages/tests/Basic/UTF_AnalysisFunctionHelpers.ipf +++ b/Packages/tests/Basic/UTF_AnalysisFunctionHelpers.ipf @@ -588,6 +588,7 @@ Function AE_TextWorksIndepHeadstage() End Function AE_TextHasCorrectTimeStamps() + variable row, col, ts, i string key = "someKey" @@ -689,18 +690,22 @@ End /// @{ Function/S AnaFunc_WrongSep_GetParams() + return "param1;param2" End Function/S AnaFunc_1_GetParams() + return "param1" End Function/S AnaFunc_WithType_GetParams() + return "param1:variable" End Function/S AnaFunc_WithOptionals_GetParams() + return "param1,[optParam1],param2,[optParam2]" End diff --git a/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf b/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf index 544eabd5a6..f78a8d63f3 100644 --- a/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf +++ b/Packages/tests/Basic/UTF_AnalysisFunctionParameters.ipf @@ -22,7 +22,7 @@ static Function UpgradeToEncodedAnalysisParamsWorks() string params, actual, expected string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) // force a wave upgrade @@ -33,7 +33,7 @@ static Function UpgradeToEncodedAnalysisParamsWorks() WPT[10][%Set][INDEP_EPOCH_TYPE] = "a:variable=1.234,b:string=hi there,c:textwave= |zz|,d:wave=1|2|3|," // force wave upgrade - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) CHECK_GE_VAR(GetWaveVersion(WPT), 10) @@ -52,7 +52,7 @@ static Function AbortsWithEmptyName() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -74,7 +74,7 @@ static Function AbortsWithInvalidName1() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -96,7 +96,7 @@ static Function AbortsWithInvalidName2() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -118,7 +118,7 @@ static Function AbortsWithNoData() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -140,7 +140,7 @@ static Function AbortsWithInvalidDataComb1() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -162,7 +162,7 @@ static Function AbortsWithInvalidDataComb2() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -184,7 +184,7 @@ static Function AbortsWithInvalidDataComb3() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -206,7 +206,7 @@ static Function AbortsWithInvalidDataComb4() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -228,7 +228,7 @@ static Function WorksWithPreviouslyInvalidContents() string params, input, reference, expected string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -248,7 +248,7 @@ static Function AbortsWithInvalidWaveType() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -271,7 +271,7 @@ static Function AbortsWithEmptyWave() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -296,7 +296,7 @@ static Function AcceptsAllTextWaveContents() string refString, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -315,7 +315,7 @@ static Function WorksWithVariable() variable refValue, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -346,7 +346,7 @@ static Function WorksWithString() string refString, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -377,7 +377,7 @@ static Function WorksWithNumericWave() string refString, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -409,7 +409,7 @@ static Function WorksWithTextWave() string refString, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -441,7 +441,7 @@ static Function ReplacesDuplicateEntries() string refString, val string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -471,7 +471,7 @@ static Function ReturnsInvalidWaveRef() string params string stimSet = "AnaFuncParams1_DA_0" - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(stimSet) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(stimSet) CHECK_WAVE(WPT, TEXT_WAVE) params = WPT[29][%Set][INDEP_EPOCH_TYPE] @@ -770,6 +770,7 @@ static Function/WAVE GetAnalysisFunctions() End Function CheckHelpStringsOfAllAnalysisFunctions() + string genericFunc, params, names, name, help variable j, numParams @@ -816,10 +817,10 @@ static Function [WAVE/T required, WAVE/T optional, WAVE/T mixed] GetAllAnalysisP WAVE/Z mixedRequiredAndOptional = GetSetIntersection(allRequiredParamsUnique, allOptParamsUnique) CHECK_WAVE(mixedRequiredAndOptional, TEXT_WAVE) - WAVE/T/Z allRequiredParamsUniqueNoMixed = GetSetDifference(allRequiredParamsUnique, mixedRequiredAndOptional) + WAVE/Z/T allRequiredParamsUniqueNoMixed = GetSetDifference(allRequiredParamsUnique, mixedRequiredAndOptional) CHECK_WAVE(allRequiredParamsUniqueNoMixed, TEXT_WAVE) - WAVE/T/Z allOptParamsUniqueNoMixed = GetSetDifference(allOptParamsUnique, mixedRequiredAndOptional) + WAVE/Z/T allOptParamsUniqueNoMixed = GetSetDifference(allOptParamsUnique, mixedRequiredAndOptional) CHECK_WAVE(allOptParamsUniqueNoMixed, TEXT_WAVE) ChangeFreeWaveName(allRequiredParamsUniqueNoMixed, "required") diff --git a/Packages/tests/Basic/UTF_AsynFrameworkTest.ipf b/Packages/tests/Basic/UTF_AsynFrameworkTest.ipf index 085ea9b4e7..077b2994d8 100644 --- a/Packages/tests/Basic/UTF_AsynFrameworkTest.ipf +++ b/Packages/tests/Basic/UTF_AsynFrameworkTest.ipf @@ -1264,8 +1264,7 @@ End /// Worker/Readout functions follow /// @brief Generic worker with a variable runtime, the function transfers required data to the output folder -threadsafe Function/DF RunGenericWorker(dfr) - DFREF dfr +threadsafe Function/DF RunGenericWorker(DFREF dfr) DFREF dfrOut = NewFreeDataFolder() @@ -1293,16 +1292,14 @@ threadsafe Function/DF RunGenericWorker(dfr) End /// @brief A second generic worker, with a different name, which is identical to the first -threadsafe Function/DF RunGenericWorker2(dfr) - DFREF dfr +threadsafe Function/DF RunGenericWorker2(DFREF dfr) return RunGenericWorker(dfr) End /// @brief Generic worker with a variable runtime, the function transfers required data to the output folder /// this worker uses a real data folder instead of an empty one -threadsafe Function/DF RunGenericWorker3(dfr) - DFREF dfr +threadsafe Function/DF RunGenericWorker3(DFREF dfr) NewDataFolder freeroot DFREF dfrOut = :freeroot @@ -1331,14 +1328,13 @@ threadsafe Function/DF RunGenericWorker3(dfr) End /// @brief A worker, that return no data folder -threadsafe Function/DF RunGenericWorker4(dfr) - DFREF dfr +threadsafe Function/DF RunGenericWorker4(DFREF dfr) + End /// @brief Generic worker with a fixed runtime, the function transfers required data to the output folder /// The fixed runtime should be > granularity of datetime -threadsafe Function/DF RunGenericWorker5(dfr) - DFREF dfr +threadsafe Function/DF RunGenericWorker5(DFREF dfr) DFREF dfrOut = NewFreeDataFolder() @@ -1455,8 +1451,7 @@ Function RunGenericReadOutAbort(STRUCT ASYNC_ReadOutStruct &ar) End /// @brief Worker that generates a runtime error 330 -threadsafe Function/DF RunWorkerOfDOOM(dfr) - DFREF dfr +threadsafe Function/DF RunWorkerOfDOOM(DFREF dfr) DFREF dfrOut = NewFreeDataFolder() @@ -1487,8 +1482,7 @@ Function RunReadOutOfDOOM(STRUCT ASYNC_ReadOutStruct &ar) End /// @brief Worker that sleeps infinitely, thus blocking the thread -threadsafe Function/DF InfiniteWorker(dfr) - DFREF dfr +threadsafe Function/DF InfiniteWorker(DFREF dfr) // some processing that has a infinite runtime // We want to catch the thread abort RT on IP7 @@ -1501,6 +1495,7 @@ threadsafe Function/DF InfiniteWorker(dfr) End threadsafe Function InfiniteWorkerHelper_IGNORE() + Sleep/S 1 End diff --git a/Packages/tests/Basic/UTF_Basic.ipf b/Packages/tests/Basic/UTF_Basic.ipf index 085b4e4d08..8b80640cd9 100644 --- a/Packages/tests/Basic/UTF_Basic.ipf +++ b/Packages/tests/Basic/UTF_Basic.ipf @@ -63,6 +63,7 @@ // Entry point for UTF Function run() + return RunWithOpts(instru = DoInstrumentation()) End @@ -185,19 +186,21 @@ Function RunWithOpts([string testcase, string testsuite, variable allowdebug, va End Function TEST_BEGIN_OVERRIDE(string name) + TestBeginCommon() End Function TEST_END_OVERRIDE(string name) + TestEndCommon() End -Function TEST_CASE_BEGIN_OVERRIDE(name) - string name +Function TEST_CASE_BEGIN_OVERRIDE(string name) TestCaseBeginCommon(name) End Function TEST_CASE_END_OVERRIDE(string testcase) + TestCaseEndCommon(testcase) End diff --git a/Packages/tests/Basic/UTF_Configuration.ipf b/Packages/tests/Basic/UTF_Configuration.ipf index d77e168d76..b4686c35ab 100644 --- a/Packages/tests/Basic/UTF_Configuration.ipf +++ b/Packages/tests/Basic/UTF_Configuration.ipf @@ -115,8 +115,7 @@ Function/WAVE TCONF_RadioCoupling() End /// @brief CheckBox proc helper to check Config_RestorePriority -Function TCONF_CheckProc(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function TCONF_CheckProc(STRUCT WMCheckboxAction &cba) : CheckBoxControl string ctrlName diff --git a/Packages/tests/Basic/UTF_DAEphyswoHardware.ipf b/Packages/tests/Basic/UTF_DAEphyswoHardware.ipf index a9b94ce4be..45f38ec8f2 100644 --- a/Packages/tests/Basic/UTF_DAEphyswoHardware.ipf +++ b/Packages/tests/Basic/UTF_DAEphyswoHardware.ipf @@ -212,6 +212,7 @@ End static StrConstant device = "ITC18USB_DEV_0" Function AssertOnInvalidSeed() + NVAR rngSeed = $GetRNGSeed(device) rngSeed = NaN @@ -224,6 +225,7 @@ Function AssertOnInvalidSeed() End Function CreatesReproducibleResults() + NVAR rngSeed = $GetRNGSeed(device) // Use GetNextRandomNumberForDevice directly diff --git a/Packages/tests/Basic/UTF_Debugging.ipf b/Packages/tests/Basic/UTF_Debugging.ipf index eca9aa350f..315c18b702 100644 --- a/Packages/tests/Basic/UTF_Debugging.ipf +++ b/Packages/tests/Basic/UTF_Debugging.ipf @@ -8,6 +8,7 @@ /// @{ Function BUGWorks() + variable bugCount bugCount = ROVar(GetBugCount()) @@ -22,6 +23,7 @@ Function BUGWorks() End Function BUG_TSWorks1() + variable bugCount TUFXOP_Clear/N=(TSDS_BUGCOUNT)/Q/Z @@ -42,6 +44,7 @@ threadsafe static Function BugHelper(variable idx) End Function BUG_TSWorks2() + variable bugCount, numThreads TUFXOP_Clear/N=(TSDS_BUGCOUNT)/Q/Z diff --git a/Packages/tests/Basic/UTF_EpochswoHardware.ipf b/Packages/tests/Basic/UTF_EpochswoHardware.ipf index 1904ffa2ba..18b91d3af4 100644 --- a/Packages/tests/Basic/UTF_EpochswoHardware.ipf +++ b/Packages/tests/Basic/UTF_EpochswoHardware.ipf @@ -11,7 +11,7 @@ static Function [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] string key, keyText string device = EP_DUMMY_DEVICE - WAVE/T/Z epochsWave = GetEpochsWave(device) + WAVE/Z/T epochsWave = GetEpochsWave(device) CHECK_WAVE(epochsWave, TEXT_WAVE) DAC = 2 // HS 0 @@ -94,7 +94,7 @@ static Function EP_GetEpochsHasMatch() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() - WAVE/T/Z result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") + WAVE/Z/T result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) @@ -112,10 +112,10 @@ static Function EP_GetEpochsIgnoresCase() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() // same as in EP_GetEpochsHasMatch - WAVE/T/Z resultUpper = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") + WAVE/Z/T resultUpper = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") CHECK_WAVE(resultUpper, TEXT_WAVE) - WAVE/T/Z resultLower = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "ep1") + WAVE/Z/T resultLower = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "ep1") CHECK_WAVE(resultLower, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(resultUpper, resultLower) @@ -127,36 +127,36 @@ static Function EP_GetEpochsWorks() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() // same as in EP_GetEpochsHasMatch - WAVE/T/Z result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") + WAVE/Z/T result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1") CHECK_WAVE(result, TEXT_WAVE) - WAVE/T/Z resultWithLevel = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 1) + WAVE/Z/T resultWithLevel = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 1) CHECK_WAVE(resultWithLevel, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(result, resultWithLevel) // treeLevel NaN means all treelevels - WAVE/T/Z resultNaNTreeLevel = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = NaN) + WAVE/Z/T resultNaNTreeLevel = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = NaN) CHECK_WAVE(resultNaNTreeLevel, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(result, resultNaNTreeLevel) // unknown treelevel - WAVE/T/Z resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 4711) + WAVE/Z/T resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 4711) CHECK_WAVE(resultEmpty, NULL_WAVE) // no epoch with that treelevel - WAVE/T/Z resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 2) + WAVE/Z/T resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", treeLevel = 2) CHECK_WAVE(resultEmpty, NULL_WAVE) // can read epoch info from epochsWave - WAVE/T/Z resultFromWave = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", epochsWave = epochsWave) + WAVE/Z/T resultFromWave = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "EP1", epochsWave = epochsWave) CHECK_WAVE(resultFromWave, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(result, resultFromWave) // all epochs with treeLevel 1 - WAVE/T/Z resultAllEpochs = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, ".*", treeLevel = 1) + WAVE/Z/T resultAllEpochs = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, ".*", treeLevel = 1) CHECK_WAVE(resultAllEpochs, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(resultAllEpochs, ROWS), 3) @@ -176,10 +176,10 @@ static Function EP_GetEpochsDoesNotFallbackWithShortNames() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() - WAVE/T/Z resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "someDesc") + WAVE/Z/T resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "someDesc") CHECK_WAVE(resultEmpty, NULL_WAVE) - WAVE/T/Z resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "otherDesc") + WAVE/Z/T resultEmpty = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_DAC, 2, "otherDesc") CHECK_WAVE(resultEmpty, NULL_WAVE) End @@ -195,19 +195,19 @@ End // UTF_TD_GENERATOR OldEpochsFormats static Function EP_GetEpochsWorksWithoutShortNames([WAVE wv]) - WAVE/T/Z result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Inserted TP", epochsWave = wv) + WAVE/Z/T result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Inserted TP", epochsWave = wv) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 2) - WAVE/T/Z result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Test Pulse", epochsWave = wv) + WAVE/Z/T result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Test Pulse", epochsWave = wv) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 2) - WAVE/T/Z result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Inserted TP;Test Pulse", epochsWave = wv) + WAVE/Z/T result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "Inserted TP;Test Pulse", epochsWave = wv) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 2) - WAVE/T/Z result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "STIM.*", epochsWave = wv) + WAVE/Z/T result = EP_GetEpochs($"", $"", NaN, XOP_CHANNEL_TYPE_DAC, 0, "STIM.*", epochsWave = wv) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) End @@ -217,7 +217,7 @@ static Function EP_GetNextEpochsHasMatch() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() - WAVE/T/Z result = EP_GetNextEpoch(numericalValues, textualValues, 0, $"", XOP_CHANNEL_TYPE_DAC, 2, "EP1", 1) + WAVE/Z/T result = EP_GetNextEpoch(numericalValues, textualValues, 0, $"", XOP_CHANNEL_TYPE_DAC, 2, "EP1", 1) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) CHECK_EQUAL_VAR(str2num(result[0][%StartTime]), 2 * MICRO_TO_ONE) @@ -233,7 +233,7 @@ static Function EP_GetNextEpochsWithGapHasMatch() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() - WAVE/T/Z result = EP_GetNextEpoch(numericalValues, textualValues, 0, $"", XOP_CHANNEL_TYPE_DAC, 2, "EP_1a", 1, ignoreGaps = 1) + WAVE/Z/T result = EP_GetNextEpoch(numericalValues, textualValues, 0, $"", XOP_CHANNEL_TYPE_DAC, 2, "EP_1a", 1, ignoreGaps = 1) CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) CHECK_EQUAL_VAR(str2num(result[0][%StartTime]), 4e-6) @@ -250,7 +250,7 @@ static Function EP_CheckADCToDACMApping() [WAVE numericalValues, WAVE/T textualValues, WAVE/T epochsWave] = PrepareEpochsTable_IGNORE() // HS0 ADC6 -> DAC2 - WAVE/T/Z result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_ADC, 6, "EP_1a") + WAVE/Z/T result = EP_GetEpochs(numericalValues, textualValues, 0, XOP_CHANNEL_TYPE_ADC, 6, "EP_1a") CHECK_WAVE(result, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) CHECK_EQUAL_VAR(str2num(result[0][%StartTime]), 2e-6) @@ -292,6 +292,7 @@ static Function EP_TestSortEpochs() End Function RPI_WorksWithOldData() + string epochInfo // 4e534e29 (Pulse Averaging: Pulse starting times are now read from the lab notebook, 2020-10-07) diff --git a/Packages/tests/Basic/UTF_ForeignFunctionInterface.ipf b/Packages/tests/Basic/UTF_ForeignFunctionInterface.ipf index 932a8679bf..49fb8f0056 100644 --- a/Packages/tests/Basic/UTF_ForeignFunctionInterface.ipf +++ b/Packages/tests/Basic/UTF_ForeignFunctionInterface.ipf @@ -7,7 +7,7 @@ static Function TestMessageFilters() string wvNote - WAVE/T/Z filters = FFI_GetAvailableMessageFilters() + WAVE/Z/T filters = FFI_GetAvailableMessageFilters() CHECK_WAVE(filters, FREE_WAVE | TEXT_WAVE) CHECK_GT_VAR(DimSize(filters, ROWS), 0) @@ -19,7 +19,7 @@ End static Function TestLogbookQuery() string key, keyTxT, device - device = "ITC16USB_0_DEV" + device = "ITC16USB_0_DEV" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE/Z settings = FFI_QueryLogbook(device, LBT_LABNOTEBOOK, 0, key, DATA_ACQUISITION_MODE) @@ -32,7 +32,7 @@ End static Function TestLogbookQueryUnique() string key, keyTxT, device - device = "ITC16USB_0_DEV" + device = "ITC16USB_0_DEV" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE/Z settings = FFI_QueryLogbookUniqueSetting(device, LBT_LABNOTEBOOK, key) diff --git a/Packages/tests/Basic/UTF_GuiUtilities.ipf b/Packages/tests/Basic/UTF_GuiUtilities.ipf index 48deb8a480..f9ad315b15 100644 --- a/Packages/tests/Basic/UTF_GuiUtilities.ipf +++ b/Packages/tests/Basic/UTF_GuiUtilities.ipf @@ -61,18 +61,20 @@ End /// @{ Function GUD_ReturnsNullWaveIfNothingFound() + string recMacro, win Display win = s_name recMacro = WinRecreation(win, 0) - WAVE/T/Z userDataKeys = GetUserdataKeys(recMacro) + WAVE/Z/T userDataKeys = GetUserdataKeys(recMacro) CHECK_WAVE(userDataKeys, NULL_WAVE) End Function GUD_ReturnsFoundEntries() + string recMacro, win Display @@ -87,6 +89,7 @@ Function GUD_ReturnsFoundEntries() End Function GUD_ReturnsFoundEntriesWithoutDuplicates() + string recMacro, win Display @@ -151,6 +154,7 @@ End /// @{ Function/S CreateTestPanel_IGNORE() + string win NewPanel/K=1 @@ -162,10 +166,11 @@ Function/S CreateTestPanel_IGNORE() End Function GCP_Var_Works() + string win, recMacro variable var, controlType - win = CreateTestPanel_IGNORE() + win = CreateTestPanel_IGNORE() [recMacro, controlType] = GetRecreationMacroAndType(win, "setVar0") CHECK_EQUAL_VAR(controlType, CONTROL_TYPE_SETVARIABLE) @@ -183,10 +188,11 @@ Function GCP_Var_Works() End Function GCP_Str_Works() + string win, ref, str, recMacro variable controlType - win = CreateTestPanel_IGNORE() + win = CreateTestPanel_IGNORE() [recMacro, controlType] = GetRecreationMacroAndType(win, "setVar0") CHECK_EQUAL_VAR(controlType, CONTROL_TYPE_SETVARIABLE) @@ -211,6 +217,7 @@ End /// @{ Function GetMarqueeHelperWorks() + string win, refWin variable first, last @@ -323,7 +330,7 @@ Function StoreRestoreAxisProps([string str]) WAVE props = GetAxesProperties(win) RemoveTracesFromGraph(win) - WAVE/SDFR=root/Z data + WAVE/Z/SDFR=root data CHECK_WAVE(data, NORMAL_WAVE) AppendToGraph/W=$win data diff --git a/Packages/tests/Basic/UTF_JSONWaveNotes.ipf b/Packages/tests/Basic/UTF_JSONWaveNotes.ipf index 751e8a8268..66f472ebdd 100644 --- a/Packages/tests/Basic/UTF_JSONWaveNotes.ipf +++ b/Packages/tests/Basic/UTF_JSONWaveNotes.ipf @@ -203,7 +203,7 @@ static Function Test_WaveRefNumeric() WAVE/Z data = JWN_GetNumericWaveFromWaveNote(wv, "refWave/3") CHECK_EQUAL_WAVES(data, wvData3, mode = WAVE_DATA | DIMENSION_SIZES) - WAVE/WAVE/Z container = JWN_GetWaveRefNumericFromWaveNote(wv, "refWave") + WAVE/Z/WAVE container = JWN_GetWaveRefNumericFromWaveNote(wv, "refWave") CHECK_EQUAL_VAR(DimSize(container, ROWS), 4) CHECK_EQUAL_VAR(DimSize(container, COLS), 0) @@ -289,7 +289,7 @@ static Function Test_WaveRefText() WAVE/Z data = JWN_GetTextWaveFromWaveNote(wv, "refWave/3") CHECK_EQUAL_WAVES(data, wvData3, mode = WAVE_DATA) - WAVE/WAVE/Z container = JWN_GetWaveRefTextFromWaveNote(wv, "refWave") + WAVE/Z/WAVE container = JWN_GetWaveRefTextFromWaveNote(wv, "refWave") CHECK_EQUAL_VAR(DimSize(container, ROWS), 4) CHECK_EQUAL_VAR(DimSize(container, COLS), 0) diff --git a/Packages/tests/Basic/UTF_Labnotebook.ipf b/Packages/tests/Basic/UTF_Labnotebook.ipf index 4818e909cf..01a5178ba0 100644 --- a/Packages/tests/Basic/UTF_Labnotebook.ipf +++ b/Packages/tests/Basic/UTF_Labnotebook.ipf @@ -687,6 +687,7 @@ Function SCid_InvalidWaveRef() End Function/WAVE LBNInvalidValidPairs() + Make/WAVE/N=5/FREE waves Make/T/FREE wv0 = {"a:b", "a [b]"} @@ -709,13 +710,14 @@ End // UTF_TD_GENERATOR LBNInvalidValidPairs Function LabnotebookUpgradeForValidDimensionLabelsNum([WAVE/T wv]) + string device, txtSetting, refSetting, invalidName, newName variable numSetting device = "ABCD" WAVE/Z numericalValues = GetLBNumericalValues(device) - WAVE/T/Z numericalKeys = GetLBNumericalKeys(device) + WAVE/Z/T numericalKeys = GetLBNumericalKeys(device) // add entry (numerical) Make/D/FREE/N=(LABNOTEBOOK_LAYER_COUNT) values = NaN @@ -750,12 +752,13 @@ End // UTF_TD_GENERATOR LBNInvalidValidPairs Function LabnotebookUpgradeForValidDimensionLabelsText([WAVE/T wv]) + string device, refSetting, invalidName, newName, setting device = "ABCD" WAVE/Z textualValues = GetLBTextualValues(device) - WAVE/T/Z textualKeys = GetLBTextualKeys(device) + WAVE/Z/T textualKeys = GetLBTextualKeys(device) // add entry (textual) Make/T/FREE/N=(LABNOTEBOOK_LAYER_COUNT) valuesTxt @@ -792,7 +795,7 @@ static Function Test_GetHeadstageForChannel() string device, key, keyTxt variable index, sweepNo, channelCnt, channel, hs, i - device = "ABCD" + device = "ABCD" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE numericalValues = GetLBNumericalValues(device) @@ -827,10 +830,11 @@ static Function Test_GetHeadstageForChannel() End Function Test_GetLastSettingChannel() + string device, key, keyTxt variable index, sweepNo, channelNumber - device = "ABCD" + device = "ABCD" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE numericalValues = GetLBNumericalValues(device) @@ -842,22 +846,22 @@ Function Test_GetLastSettingChannel() CHECK_EQUAL_VAR(index, NaN) // or sweepNo - sweepNo = 10 - channelNumber = 2 + sweepNo = 10 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NULL_WAVE) CHECK_EQUAL_VAR(index, NaN) // or channelNumber - sweepNo = 0 - channelNumber = 7 + sweepNo = 0 + channelNumber = 7 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NULL_WAVE) CHECK_EQUAL_VAR(index, NaN) // or wrong channel type - sweepNo = 0 - channelNumber = 2 + sweepNo = 0 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NULL_WAVE) CHECK_EQUAL_VAR(index, NaN) @@ -866,48 +870,48 @@ Function Test_GetLastSettingChannel() // works with associated entry // HS0: DA - sweepNo = 0 - channelNumber = 2 + sweepNo = 0 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_WAVES(settings, {131415, 161718, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS0: AD - sweepNo = 0 - channelNumber = 6 + sweepNo = 0 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_WAVES(settings, {131415, 161718, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS1: DA - sweepNo = 0 - channelNumber = 3 + sweepNo = 0 + channelNumber = 3 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_WAVES(settings, {131415, 161718, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS1: AD - sweepNo = 0 - channelNumber = 7 + sweepNo = 0 + channelNumber = 7 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_WAVES(settings, {131415, 161718, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // works with unassociated DA entry (old) - sweepNo = 0 - channelNumber = 4 + sweepNo = 0 + channelNumber = 4 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) CHECK_EQUAL_WAVES(settings, {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 123}, mode = WAVE_DATA) // works with unassociated AD entry (old) - sweepNo = 0 - channelNumber = 8 + sweepNo = 0 + channelNumber = 8 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) @@ -917,48 +921,48 @@ Function Test_GetLastSettingChannel() // works with associated entry // HS0: DA - sweepNo = 0 - channelNumber = 2 + sweepNo = 0 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_TEXTWAVES(settings, {"131415", "161718", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS0: AD - sweepNo = 0 - channelNumber = 6 + sweepNo = 0 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_TEXTWAVES(settings, {"131415", "161718", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS1: DA - sweepNo = 0 - channelNumber = 3 + sweepNo = 0 + channelNumber = 3 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_TEXTWAVES(settings, {"131415", "161718", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS1: AD - sweepNo = 0 - channelNumber = 7 + sweepNo = 0 + channelNumber = 7 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_TEXTWAVES(settings, {"131415", "161718", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // works with unassociated DA entry (old) - sweepNo = 0 - channelNumber = 4 + sweepNo = 0 + channelNumber = 4 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) CHECK_EQUAL_TEXTWAVES(settings, {"", "", "", "", "", "", "", "", "123"}, mode = WAVE_DATA) // works with unassociated AD entry (old) - sweepNo = 0 - channelNumber = 8 + sweepNo = 0 + channelNumber = 8 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) @@ -968,48 +972,48 @@ Function Test_GetLastSettingChannel() // works with associated entry // HS0: DA - sweepNo = 1 - channelNumber = 2 + sweepNo = 1 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_WAVES(settings, {192021, 222324, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS0: AD - sweepNo = 1 - channelNumber = 6 + sweepNo = 1 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_WAVES(settings, {192021, 222324, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS1: DA - sweepNo = 1 - channelNumber = 3 + sweepNo = 1 + channelNumber = 3 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_WAVES(settings, {192021, 222324, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // HS1: AD - sweepNo = 1 - channelNumber = 7 + sweepNo = 1 + channelNumber = 7 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_WAVES(settings, {192021, 222324, NaN, NaN, NaN, NaN, NaN, NaN, NaN}, mode = WAVE_DATA) // works with unassociated DA entry (new) - sweepNo = 1 - channelNumber = 5 + sweepNo = 1 + channelNumber = 5 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) CHECK_EQUAL_WAVES(settings, {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 456}, mode = WAVE_DATA) // works with unassociated AD entry (new) - sweepNo = 1 - channelNumber = 9 + sweepNo = 1 + channelNumber = 9 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) @@ -1019,48 +1023,48 @@ Function Test_GetLastSettingChannel() // works with associated entry // HS0: DA - sweepNo = 1 - channelNumber = 2 + sweepNo = 1 + channelNumber = 2 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_TEXTWAVES(settings, {"192021", "222324", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS0: AD - sweepNo = 1 - channelNumber = 6 + sweepNo = 1 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 0) CHECK_EQUAL_TEXTWAVES(settings, {"192021", "222324", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS1: DA - sweepNo = 1 - channelNumber = 3 + sweepNo = 1 + channelNumber = 3 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_TEXTWAVES(settings, {"192021", "222324", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // HS1: AD - sweepNo = 1 - channelNumber = 7 + sweepNo = 1 + channelNumber = 7 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, 1) CHECK_EQUAL_TEXTWAVES(settings, {"192021", "222324", "", "", "", "", "", "", ""}, mode = WAVE_DATA) // works with unassociated DA entry (new) - sweepNo = 1 - channelNumber = 5 + sweepNo = 1 + channelNumber = 5 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_DAC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) CHECK_EQUAL_TEXTWAVES(settings, {"", "", "", "", "", "", "", "", "456"}, mode = WAVE_DATA) // works with unassociated AD entry (new) - sweepNo = 1 - channelNumber = 9 + sweepNo = 1 + channelNumber = 9 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) @@ -1071,29 +1075,29 @@ Function Test_GetLastSettingChannel() // numerical // returns nothing as the channel was not active - sweepNo = 2 - channelNumber = 0 + sweepNo = 2 + channelNumber = 0 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NULL_WAVE) CHECK_EQUAL_VAR(index, NaN) // works - sweepNo = 2 - channelNumber = 6 + sweepNo = 2 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweepNo, key, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) CHECK_EQUAL_WAVES(settings, {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 252627}, mode = WAVE_DATA) // textual - sweepNo = 2 - channelNumber = 0 + sweepNo = 2 + channelNumber = 0 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, NULL_WAVE) CHECK_EQUAL_VAR(index, NaN) - sweepNo = 2 - channelNumber = 6 + sweepNo = 2 + channelNumber = 6 [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, keyTxt, channelNumber, XOP_CHANNEL_TYPE_ADC, UNKNOWN_MODE) CHECK_WAVE(settings, TEXT_WAVE) CHECK_EQUAL_VAR(index, INDEP_HEADSTAGE) @@ -1101,6 +1105,7 @@ Function Test_GetLastSettingChannel() End Function/WAVE AllDescriptionWaves() + Make/FREE/WAVE/N=1 wvs // GetLBNumericalDescription creates a wave within the MIES datafolder, but that is killed at Test Begin @@ -1113,6 +1118,7 @@ Function/WAVE AllDescriptionWaves() End Function IsValidUnit(string unitWithPrefix) + string prefix, unit variable numPrefix @@ -1123,6 +1129,7 @@ End // UTF_TD_GENERATOR AllDescriptionWaves Function CheckLBNDescriptions([WAVE/T wv]) + variable i, numEntries, num string entry @@ -1182,10 +1189,11 @@ Function CheckLBNDescriptions([WAVE/T wv]) End Function Test_GetEntryProperties() + string key, keyTxT, unit, device, ref variable col, result - device = "ABCD" + device = "ABCD" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE keys = GetLBNumericalKeys(device) @@ -1259,7 +1267,7 @@ Function GTW_WorksWithCustomDefault() WAVE/T values = LBN_GetTextWave(defValue = "abcd") - WAVE/T/Z result = GetUniqueEntries(values) + WAVE/Z/T result = GetUniqueEntries(values) CHECK_EQUAL_TEXTWAVES(result, {"abcd"}) End @@ -1326,9 +1334,10 @@ Function MultipleSameEDAdds() End Function GetUniqueSettingsWorks() + string key, keyTxT, device - device = "ITC16USB_0_DEV" + device = "ITC16USB_0_DEV" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE/T numericalValues = GetLogbookWaves(LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, device = device) @@ -1357,11 +1366,11 @@ Function LabnotebookUpgradeMissingNoteIndexNumerical() variable idx, idxRedone string device, key, keyTxt - device = "ITC16USB_0_DEV" + device = "ITC16USB_0_DEV" [key, keyTxt] = PrepareLBN_IGNORE(device) WAVE/Z numericalValues = GetLBNumericalValues(device) - WAVE/T/Z numericalKeys = GetLBNumericalKeys(device) + WAVE/Z/T numericalKeys = GetLBNumericalKeys(device) idx = GetNumberFromWaveNote(numericalValues, NOTE_INDEX) CHECK_GT_VAR(idx, 0) @@ -1390,11 +1399,11 @@ Function LabnotebookUpgradeMissingNoteIndexTextual() variable idx, idxRedone string device, key, keyTxt - device = "ITC16USB_0_DEV" + device = "ITC16USB_0_DEV" [key, keyTxt] = PrepareLBN_IGNORE(device) - WAVE/T/Z textualValues = GetLBTextualValues(device) - WAVE/T/Z textualKeys = GetLBTextualKeys(device) + WAVE/Z/T textualValues = GetLBTextualValues(device) + WAVE/Z/T textualKeys = GetLBTextualKeys(device) idx = GetNumberFromWaveNote(textualValues, NOTE_INDEX) CHECK_GT_VAR(idx, 0) diff --git a/Packages/tests/Basic/UTF_PGCSetAndActivateControl.ipf b/Packages/tests/Basic/UTF_PGCSetAndActivateControl.ipf index cbe9da014a..7edd568b72 100644 --- a/Packages/tests/Basic/UTF_PGCSetAndActivateControl.ipf +++ b/Packages/tests/Basic/UTF_PGCSetAndActivateControl.ipf @@ -66,8 +66,7 @@ Function CreatePGCTestPanel_IGNORE() ListBox listbox_ctrl, selWave=selWave, titleWave=titleWave, mode=1, proc=PGCT_ListBoxProc End -Function PGCT_PopMenuProc(pa) : PopupMenuControl - STRUCT WMPopupAction &pa +Function PGCT_PopMenuProc(STRUCT WMPopupAction &pa) : PopupMenuControl switch(pa.eventCode) case 2: // mouse up @@ -80,8 +79,7 @@ Function PGCT_PopMenuProc(pa) : PopupMenuControl return 0 End -Function PGCT_CheckProc(cba) : CheckBoxControl - STRUCT WMCheckboxAction &cba +Function PGCT_CheckProc(STRUCT WMCheckboxAction &cba) : CheckBoxControl switch(cba.eventCode) case 2: // mouse up @@ -93,8 +91,7 @@ Function PGCT_CheckProc(cba) : CheckBoxControl return 0 End -Function PGCT_SliderProc(sa) : SliderControl - STRUCT WMSliderAction &sa +Function PGCT_SliderProc(STRUCT WMSliderAction &sa) : SliderControl switch(sa.eventCode) default: @@ -108,8 +105,7 @@ Function PGCT_SliderProc(sa) : SliderControl return 0 End -Function PGCT_SetVarProc(sva) : SetVariableControl - STRUCT WMSetVariableAction &sva +Function PGCT_SetVarProc(STRUCT WMSetVariableAction &sva) : SetVariableControl switch(sva.eventCode) case 1: // mouse up @@ -124,8 +120,7 @@ Function PGCT_SetVarProc(sva) : SetVariableControl return 0 End -Function PGCT_ButtonProc(ba) : ButtonControl - STRUCT WMButtonAction &ba +Function PGCT_ButtonProc(STRUCT WMButtonAction &ba) : ButtonControl switch(ba.eventCode) case 2: // mouse up @@ -136,8 +131,7 @@ Function PGCT_ButtonProc(ba) : ButtonControl return 0 End -Function PGCT_TabProc(tca) : TabControl - STRUCT WMTabControlAction &tca +Function PGCT_TabProc(STRUCT WMTabControlAction &tca) : TabControl switch(tca.eventCode) case 2: // mouse up @@ -149,8 +143,7 @@ Function PGCT_TabProc(tca) : TabControl return 0 End -Function PGCT_ListBoxProc(lba) : ListBoxControl - STRUCT WMListboxAction &lba +Function PGCT_ListBoxProc(STRUCT WMListboxAction &lba) : ListBoxControl switch(lba.eventCode) case 3: // double click diff --git a/Packages/tests/Basic/UTF_SweepFormula.ipf b/Packages/tests/Basic/UTF_SweepFormula.ipf index fcabfd193f..eaae29a3e5 100644 --- a/Packages/tests/Basic/UTF_SweepFormula.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula.ipf @@ -1283,8 +1283,8 @@ static Function TestVariables1([WAVE wv]) WAVE/WAVE wRef = wv [win, device] = CreateEmptyUnlockedDataBrowserWindow() - win = CreateFakeSweepData(win, device, sweepNo = 0) - win = CreateFakeSweepData(win, device, sweepNo = 1) + win = CreateFakeSweepData(win, device, sweepNo = 0) + win = CreateFakeSweepData(win, device, sweepNo = 1) WAVE/T formulaAndRest = wRef[0] diff --git a/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf b/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf index b6e91f85b6..4e8cd8b8f5 100644 --- a/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula_Operations.ipf @@ -207,7 +207,7 @@ static Function StoreWorks([WAVE wv]) results = GetLastSettingTextIndep(textualResultsValues, NaN, "Sweep Formula store [ABCD]", SWEEP_FORMULA_RESULT) CHECK_PROPER_STR(results) - WAVE/WAVE/Z container = JSONToWave(results) + WAVE/Z/WAVE container = JSONToWave(results) CHECK_WAVE(container, WAVE_WAVE) WAVE/Z resultsWave = container[0] CHECK_EQUAL_TEXTWAVES(wv, resultsWave, mode = WAVE_DATA) @@ -720,7 +720,7 @@ static Function TestOperationDifferentiateIntegrate() str = "derivative([0,1,4,9,16,25,36,49,64,81])" WAVE output = SF_ExecuteFormula(str, win, singleResult = 1, useVariables = 0) Make/N=10/U/I/FREE sourcewave = p^2 - Differentiate/EP=0 sourcewave / D=testwave + Differentiate/EP=0 sourcewave/D=testwave MakeWaveFree(testwave) REQUIRE_EQUAL_WAVES(output, testwave, mode = WAVE_DATA) WAVE/WAVE dataRef = SF_ExecuteFormula(str, win, useVariables = 0) @@ -2089,7 +2089,7 @@ static Function TestOperationLabNotebook() [win, device] = CreateEmptyUnlockedDataBrowserWindow() [numSweeps, numChannels, WAVE/U/I channels] = FillFakeDatabrowserWindow(win, device, XOP_CHANNEL_TYPE_ADC, textKey, textValue) - win = GetCurrentWindow() + win = GetCurrentWindow() Make/FREE/N=(numSweeps * numChannels) channelsRef channelsRef[] = channels[trunc(p / numChannels)][mod(p, numChannels)] @@ -2210,7 +2210,7 @@ static Function TestOperationEpochs() textValue += "0.5100000,0.5200000," + epoch2 + ",2," [numSweeps, numChannels, WAVE/U/I channels] = FillFakeDatabrowserWindow(win, device, XOP_CHANNEL_TYPE_DAC, textKey, textValue) - win = GetCurrentWindow() + win = GetCurrentWindow() str = "epochs(\"E0_PT_P48\")" WAVE/WAVE dataWref = SF_ExecuteFormula(str, win, useVariables = 0) @@ -2484,7 +2484,7 @@ static Function TestOperationSelectFails([string str]) string win, device [win, device] = CreateEmptyUnlockedDataBrowserWindow() - win = CreateFakeSweepData(win, device, sweepNo = 0) + win = CreateFakeSweepData(win, device, sweepNo = 0) try WAVE/WAVE comp = SF_ExecuteFormula(str, win, useVariables = 0) @@ -2523,7 +2523,7 @@ static Function TestOperationSelect() dataRef[][0] = sweepNo dataRef[0, 1][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) dataRef[2, 3][1] = WhichListItem("DA", XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 7, 2, 3} // AD6, AD7, DA2, DA3 + dataRef[][2] = {6, 7, 2, 3} // AD6, AD7, DA2, DA3 dataRef[][3] = NaN str = "select(selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2536,7 +2536,7 @@ static Function TestOperationSelect() dataRef[][0] = sweepNo dataRef[0][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) dataRef[1][1] = WhichListItem("DA", XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 2} // AD6, DA2 + dataRef[][2] = {6, 2} // AD6, DA2 dataRef[][3] = NaN str = "select(selchannels(2, 6),selsweeps(" + num2istr(sweepNo) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2544,7 +2544,7 @@ static Function TestOperationSelect() Make/FREE/N=(2, 4) dataRef dataRef[][0] = sweepNo dataRef[][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 7} // AD6, AD7 + dataRef[][2] = {6, 7} // AD6, AD7 dataRef[][3] = NaN str = "select(selchannels(AD),selsweeps(" + num2istr(sweepNo) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2556,7 +2556,7 @@ static Function TestOperationSelect() Make/FREE/N=(1, 4) dataRef dataRef[][0] = 3 dataRef[][1] = WhichListItem("DA", XOP_CHANNEL_NAMES) - dataRef[][2] = {0} // DA0 (unassoc) + dataRef[][2] = {0} // DA0 (unassoc) dataRef[][3] = NaN str = "select(selchannels(DA0),selsweeps(" + num2istr(3) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2564,7 +2564,7 @@ static Function TestOperationSelect() Make/FREE/N=(1, 4) dataRef dataRef[][0] = 3 dataRef[][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) - dataRef[][2] = {1} // AD1 (unassoc) + dataRef[][2] = {1} // AD1 (unassoc) dataRef[][3] = NaN str = "select(selchannels(AD1),selsweeps(" + num2istr(3) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2572,7 +2572,7 @@ static Function TestOperationSelect() Make/FREE/N=(1, 4) dataRef dataRef[][0] = 3 dataRef[][1] = WhichListItem("TTL", XOP_CHANNEL_NAMES) - dataRef[][2] = {2} // TTL2 + dataRef[][2] = {2} // TTL2 dataRef[][3] = NaN str = "select(selchannels(TTL2),selsweeps(" + num2istr(3) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2592,9 +2592,9 @@ static Function TestOperationSelect() CHECK_WAVE(dataSel, NULL_WAVE) Make/FREE/N=(4, 4) dataRef - dataRef[][0] = {sweepNo, sweepNo, sweepNo + 1, sweepNo + 1} // sweep 0, 1 with 2 AD channels each + dataRef[][0] = {sweepNo, sweepNo, sweepNo + 1, sweepNo + 1} // sweep 0, 1 with 2 AD channels each dataRef[][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 7, 6, 7} // AD6, AD7, AD6, AD7 + dataRef[][2] = {6, 7, 6, 7} // AD6, AD7, AD6, AD7 dataRef[][3] = NaN str = "select(selchannels(AD),selsweeps(" + num2istr(sweepNo) + "," + num2istr(sweepNo + 1) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2602,7 +2602,7 @@ static Function TestOperationSelect() Make/FREE/N=(2, 4) dataRef dataRef[][0] = {sweepNo, sweepNo + 1} dataRef[][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 6} // AD6, AD6 + dataRef[][2] = {6, 6} // AD6, AD6 dataRef[][3] = NaN str = "select(selchannels(AD6),selsweeps(" + num2istr(sweepNo) + "," + num2istr(sweepNo + 1) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2611,7 +2611,7 @@ static Function TestOperationSelect() dataRef[][0] = {sweepNo, sweepNo, sweepNo, sweepNo + 1, sweepNo + 1, sweepNo + 1} chanList = "AD;DA;DA;AD;DA;DA;" dataRef[][1] = WhichListItem(StringFromList(p, chanList), XOP_CHANNEL_NAMES) - dataRef[][2] = {6, 2, 3, 6, 2, 3} // AD6, DA2, DA3, AD6, DA2, DA3 + dataRef[][2] = {6, 2, 3, 6, 2, 3} // AD6, DA2, DA3, AD6, DA2, DA3 dataRef[][3] = NaN str = "select(selchannels(AD6, DA),selsweeps(" + num2istr(sweepNo) + "," + num2istr(sweepNo + 1) + "),selvis(all))" TestOperationSelectCompareWithFullRange(win, str, dataRef) @@ -2736,7 +2736,7 @@ static Function TestOperationSelect() CHECK_WAVE(dataSel, NULL_WAVE) Make/FREE/N=(2, 4) dataRef - dataRef[][0] = {sweepNo, sweepNo + 1} // both sweeps have the same SCI + dataRef[][0] = {sweepNo, sweepNo + 1} // both sweeps have the same SCI dataRef[][1] = WhichListItem("AD", XOP_CHANNEL_NAMES) dataRef[][2] = {6, 6} dataRef[][3] = NaN @@ -2900,7 +2900,7 @@ static Function TestOperationSelect() dataRef[][1] = WhichListItem(StringFromList(p, chanList), XOP_CHANNEL_NAMES) dataRef[][2] = {6, 7, 2, 6, 7, 2} dataRef[][3] = NaN - str = "select(selchannels(DA2, AD),selsweeps())" // note: channels are sorted AD, DA... + str = "select(selchannels(DA2, AD),selsweeps())" // note: channels are sorted AD, DA... TestOperationSelectCompareWithFullRange(win, str, dataRef) // No existing sweeps @@ -3032,12 +3032,12 @@ static Function TestOperationMerge() CHECK_EQUAL_WAVES(wv, refWvTxt) code = "merge(dataset())" - WAVE/WAVE/Z output = SF_ExecuteFormula(code, win, useVariables = 0) + WAVE/Z/WAVE output = SF_ExecuteFormula(code, win, useVariables = 0) CHECK_WAVE(output, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(output, ROWS), 0) code = "merge(dataset(wave(I_DONT_EXIST)))" - WAVE/WAVE/Z output = SF_ExecuteFormula(code, win, useVariables = 0) + WAVE/Z/WAVE output = SF_ExecuteFormula(code, win, useVariables = 0) CHECK_WAVE(output, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(output, ROWS), 0) End @@ -3116,7 +3116,7 @@ static Function TPWithModelCell() WAVE textualResultsValues = GetLogbookWaves(LBT_RESULTS, LBN_TEXTUAL_VALUES) str = GetLastSettingTextIndep(textualResultsValues, NaN, "Sweep Formula store [ss]", SWEEP_FORMULA_RESULT) - WAVE/WAVE/Z container = JSONToWave(str) + WAVE/Z/WAVE container = JSONToWave(str) CHECK_WAVE(container, WAVE_WAVE) WAVE/Z results = container[0] CHECK_WAVE(results, NUMERIC_WAVE) @@ -3124,7 +3124,7 @@ static Function TPWithModelCell() CHECK_EQUAL_WAVES(ref, results, mode = WAVE_DATA) str = GetLastSettingTextIndep(textualResultsValues, NaN, "Sweep Formula store [inst]", SWEEP_FORMULA_RESULT) - WAVE/WAVE/Z container = JSONToWave(str) + WAVE/Z/WAVE container = JSONToWave(str) CHECK_WAVE(container, WAVE_WAVE) WAVE/Z results = container[0] CHECK_WAVE(results, NUMERIC_WAVE) @@ -3208,7 +3208,7 @@ static Function TestOperationAnaFuncParam() [win, device] = CreateEmptyUnlockedDataBrowserWindow() [numSweeps, numChannels, WAVE/U/I channels] = FillFakeDatabrowserWindow(win, device, XOP_CHANNEL_TYPE_ADC, textKey, textValue) - win = GetCurrentWindow() + win = GetCurrentWindow() Make/FREE/T/N=(1, 1) funcParamsKey funcParamsKey[0][0] = ANALYSIS_FUNCTION_PARAMS_LBN diff --git a/Packages/tests/Basic/UTF_SweepFormula_PSX.ipf b/Packages/tests/Basic/UTF_SweepFormula_PSX.ipf index b4e0c4e58d..4d217b5186 100644 --- a/Packages/tests/Basic/UTF_SweepFormula_PSX.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula_PSX.ipf @@ -1255,14 +1255,14 @@ static Function TestOperationPSXTooLargeDecayTau() CHECK_EQUAL_WAVES(fitResult, {PSX_DECAY_FIT_ERROR, PSX_DECAY_FIT_ERROR}, mode = WAVE_DATA) End -static Function CheckEventDataHelper(WAVE/WAVE/Z dataWref, variable index) +static Function CheckEventDataHelper(WAVE/Z/WAVE dataWref, variable index) variable numEvents WAVE/Z psxEvent = dataWref[%$"psxEvent_" + num2str(index)] CHECK_WAVE(psxEvent, NUMERIC_WAVE, minorType = DOUBLE_WAVE) - WAVE/WAVE/Z eventFit = dataWref[%$"eventFit_" + num2str(index)] + WAVE/Z/WAVE eventFit = dataWref[%$"eventFit_" + num2str(index)] CHECK_WAVE(eventFit, WAVE_WAVE) numEvents = DimSize(psxEvent, ROWS) @@ -1323,7 +1323,7 @@ static Function [WAVE psxEvent_0, WAVE psxEvent_1] GetPSXEventWavesHelper(string DFREF workDFR = MIES_PSX#PSX_GetWorkingFolder(win) CHECK(DataFolderExistsDFR(workDFR)) - WAVE/DF/Z comboFolders = MIES_PSX#PSX_GetAllCombinationFolders(workDFR) + WAVE/Z/DF comboFolders = MIES_PSX#PSX_GetAllCombinationFolders(workDFR) CHECK_WAVE(comboFolders, DATAFOLDER_WAVE) CHECK_EQUAL_VAR(DimSize(comboFolders, ROWS), 2) @@ -1889,7 +1889,7 @@ static Function AllEventGraph([STRUCT IUTF_mData &m]) WAVE/WAVE singleEventWaves = ListToWaveRefWave(GetListOfObjects(singleEventDFR, ".*", fullPath = 1)) CHECK_EQUAL_VAR(DimSize(singleEventWaves, ROWS), 2) - WAVE/WAVE/Z calcAvgPack = MIES_fWaveAverage(singleEventWaves, 1, IGOR_TYPE_64BIT_FLOAT) + WAVE/Z/WAVE calcAvgPack = MIES_fWaveAverage(singleEventWaves, 1, IGOR_TYPE_64BIT_FLOAT) CHECK_WAVE(calcAvgPack, WAVE_WAVE) WAVE/Z calcAvg = calcAvgPack[0] CHECK_WAVE(calcAvg, NUMERIC_WAVE, minorType = DOUBLE_WAVE) diff --git a/Packages/tests/Basic/UTF_Testpulse.ipf b/Packages/tests/Basic/UTF_Testpulse.ipf index 9f920a7ec4..b209834ef5 100644 --- a/Packages/tests/Basic/UTF_Testpulse.ipf +++ b/Packages/tests/Basic/UTF_Testpulse.ipf @@ -55,13 +55,13 @@ static Function FetchingTestpulsesWorks() TP_StoreTP(device, {2}, 0xB, "I_DONT_CARE") // works with fetching one TP - WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xA, 1) + WAVE/Z/WAVE result = TP_GetStoredTPs(device, 0xA, 1) CHECK_WAVE(result, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{1}}, mode = WAVE_DATA) // works with fetching two TPs - WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xB, 2) + WAVE/Z/WAVE result = TP_GetStoredTPs(device, 0xB, 2) CHECK_WAVE(result, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 2) CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{1}}, mode = WAVE_DATA) @@ -74,12 +74,12 @@ static Function FetchingTestpulsesWorks() SetNumberInWaveNote(storedTPs[2], "TPCycleID", 4711) // fetching one works - WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xC, 1) + WAVE/Z/WAVE result = TP_GetStoredTPs(device, 0xC, 1) CHECK_WAVE(result, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 1) CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{3}}, mode = WAVE_DATA) // but two not because 0xB has a different cycle id - WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xC, 2) + WAVE/Z/WAVE result = TP_GetStoredTPs(device, 0xC, 2) CHECK_WAVE(result, NULL_WAVE) End diff --git a/Packages/tests/Basic/UTF_TraceUserData.ipf b/Packages/tests/Basic/UTF_TraceUserData.ipf index 3b60239fd6..9241f9ae69 100644 --- a/Packages/tests/Basic/UTF_TraceUserData.ipf +++ b/Packages/tests/Basic/UTF_TraceUserData.ipf @@ -19,7 +19,7 @@ Function CreatesWave() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) CHECK_WAVE(graphUserData, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(graphUserData, COLS), 0) @@ -29,6 +29,7 @@ Function CreatesWave() End Function KillGraphAndCheckEmptyUserData_IGNORE(string graph, WAVE/T graphUserData, [variable clearInstead]) + variable modCount if(ParamIsDefault(clearInstead)) @@ -62,7 +63,7 @@ Function ClearsWaveOnKillWindow() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "efgh", "ijkl") @@ -90,7 +91,7 @@ Function ClearsWaveOnKillWindowRecursively() Display/HOST=$panel subGraph = panel + "#" + S_name - WAVE/T/Z graphUserData = GetGraphUserData(subGraph) + WAVE/Z/T graphUserData = GetGraphUserData(subGraph) TUD_Init(subGraph) TUD_SetUserData(subGraph, "trace1", "efgh", "ijkl") @@ -100,6 +101,7 @@ End // Test: TUD_Clear Function ClearDoesHonourRecursiveFlag() + string graph, subGraph, subPanel variable modCount @@ -117,8 +119,8 @@ Function ClearDoesHonourRecursiveFlag() TUD_Init(subGraph) TUD_SetUserData(subGraph, "trace1", "efgh", "ijkl") - WAVE/T/Z graphUserData = GetGraphUserData(graph) - WAVE/T/Z subGraphUserData = GetGraphUserData(subGraph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) + WAVE/Z/T subGraphUserData = GetGraphUserData(subGraph) modCount = WaveModCount(subGraphUserData) @@ -141,7 +143,7 @@ Function SetUserDataWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key", "value") @@ -149,7 +151,7 @@ Function SetUserDataWorks() // check indexing json jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) // check wave contents @@ -173,7 +175,7 @@ Function SetUserDataFromWaveWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserDataFromWaves(graph, "trace1", {"key1", "key2"}, {"value1", "value2"}) @@ -181,7 +183,7 @@ Function SetUserDataFromWaveWorks() // check indexing json jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) // check wave contents @@ -211,7 +213,7 @@ Function SetUserDataBothTogether() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") TUD_SetUserDataFromWaves(graph, "trace1", {"key2", "key3"}, {"value2", "value3"}) @@ -220,7 +222,7 @@ Function SetUserDataBothTogether() // check indexing json jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) // check wave contents @@ -255,7 +257,7 @@ Function SetUserDataBothTogetherInvertedOrder() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserDataFromWaves(graph, "trace1", {"key1", "key2"}, {"value1", "value2"}) TUD_SetUserData(graph, "trace1", "key3", "value3") @@ -264,7 +266,7 @@ Function SetUserDataBothTogetherInvertedOrder() // check indexing json jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) // check wave contents @@ -296,7 +298,7 @@ Function GetTraceCountWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) CHECK_EQUAL_VAR(TUD_GetTraceCount(graph), 0) @@ -321,20 +323,20 @@ Function RegeneratesJSON() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key", "value") // check indexing json jsonIDOld = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonIDOld, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonIDOld, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) JSON_Release(jsonIDOld) // fetch Index JSON to trigger regeneration jsonIDNew = MIES_TUD#TUD_GetIndexJSON(graphUserData) - WAVE/T/Z traces = JSON_GetKeys(jsonIDNew, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonIDNew, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1"}) CHECK(jsonIDOld != jsonIDNew) @@ -347,7 +349,7 @@ Function GetUserDataExpectsExistingTraceAndKey() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key", "value") @@ -376,7 +378,7 @@ Function GetUserDataWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserDataFromWaves(graph, "trace1", {"key1", "key2"}, {"value1", "value2"}) TUD_SetUserData(graph, "trace1", "key3", "value3") @@ -403,7 +405,7 @@ Function GetAllUserDataExpectsExistingTrace() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key", "value") @@ -427,7 +429,7 @@ Function GetAllUserDataWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserDataFromWaves(graph, "trace1", {"key1", "key2"}, {"value1", "value2"}) TUD_SetUserData(graph, "trace1", "key3", "value3") @@ -447,7 +449,7 @@ Function GetUserDataAsWaveChecksInput() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) WAVE/Z result = TUD_GetUserDataAsWave(graph, "I DONT EXIST") // no traces exist @@ -514,7 +516,7 @@ Function GetUserDataAsWaveWorksBasic() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) WAVE/Z result = TUD_GetUserDataAsWave(graph, "traceName") CHECK_WAVE(result, NULL_WAVE) @@ -540,7 +542,7 @@ Function GetUserDataAsWaveWorksBasicIndizes() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") TUD_SetUserData(graph, "trace2", "key2", "value2") @@ -564,7 +566,7 @@ Function GetUserDataAsWaveWorksComplex() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") TUD_SetUserData(graph, "trace2", "key2", "value2") @@ -595,7 +597,7 @@ Function GetUserDataAsWaveWorksComplexIndizes() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") TUD_SetUserData(graph, "trace2", "key2", "value2") @@ -646,10 +648,10 @@ static Function PrepareUserDataWaveForRemoval_IGNORE() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) KillWaves/Z graphUserData - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") TUD_SetUserData(graph, "trace2", "key2", "value2") @@ -660,7 +662,7 @@ static Function PrepareUserDataWaveForRemoval_IGNORE() CHECK_EQUAL_TEXTWAVES(TUD_GetUserDataAsWave(graph, "traceName"), {"trace1", "trace2", "trace3"}) jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1", "trace2", "trace3"}) End @@ -673,7 +675,7 @@ Function RemoveUserDataWorks() PrepareUserDataWaveForRemoval_IGNORE() - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) // remove the first entry TUD_RemoveUserData(graph, "trace1") @@ -682,14 +684,14 @@ Function RemoveUserDataWorks() CHECK_EQUAL_TEXTWAVES(TUD_GetUserDataAsWave(graph, "traceName"), {"trace2", "trace3"}) jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace2", "trace3"}) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace2"), 0) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace3"), 1) PrepareUserDataWaveForRemoval_IGNORE() - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) // remove the second entry TUD_RemoveUserData(graph, "trace2") @@ -698,14 +700,14 @@ Function RemoveUserDataWorks() CHECK_EQUAL_TEXTWAVES(TUD_GetUserDataAsWave(graph, "traceName"), {"trace1", "trace3"}) jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1", "trace3"}) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace1"), 0) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace3"), 1) PrepareUserDataWaveForRemoval_IGNORE() - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) // remove last entry TUD_RemoveUserData(graph, "trace3") @@ -714,7 +716,7 @@ Function RemoveUserDataWorks() CHECK_EQUAL_TEXTWAVES(TUD_GetUserDataAsWave(graph, "traceName"), {"trace1", "trace2"}) jsonID = GetNumberFromWaveNote(graphUserData, TUD_INDEX_JSON) - WAVE/T/Z traces = JSON_GetKeys(jsonID, "", esc = 0) + WAVE/Z/T traces = JSON_GetKeys(jsonID, "", esc = 0) CHECK_EQUAL_TEXTWAVES(traces, {"trace1", "trace2"}) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace1"), 0) CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/trace2"), 1) @@ -725,7 +727,7 @@ Function TraceIsOnGraphWorks() SVAR graph = root:graph - WAVE/T/Z graphUserData = GetGraphUserData(graph) + WAVE/Z/T graphUserData = GetGraphUserData(graph) TUD_SetUserData(graph, "trace1", "key1", "value1") diff --git a/Packages/tests/Basic/UTF_UpgradeWaveLocationAndGetIt.ipf b/Packages/tests/Basic/UTF_UpgradeWaveLocationAndGetIt.ipf index 99d6466249..32580098bd 100644 --- a/Packages/tests/Basic/UTF_UpgradeWaveLocationAndGetIt.ipf +++ b/Packages/tests/Basic/UTF_UpgradeWaveLocationAndGetIt.ipf @@ -26,6 +26,7 @@ static Function TEST_CASE_END_OVERRIDE(name) End Function asserts_on_invalid_1() + STRUCT WaveLocationMod p try @@ -37,6 +38,7 @@ Function asserts_on_invalid_1() End Function asserts_on_invalid_2() + STRUCT WaveLocationMod p p.dfr = root: @@ -50,6 +52,7 @@ Function asserts_on_invalid_2() End Function asserts_on_invalid_3() + STRUCT WaveLocationMod p p.name = "w" @@ -63,6 +66,7 @@ Function asserts_on_invalid_3() End Function empty_wave_ref() + STRUCT WaveLocationMod p p.name = "w" @@ -73,6 +77,7 @@ Function empty_wave_ref() End Function no_trafo() + STRUCT WaveLocationMod p p.name = "srcw" @@ -84,6 +89,7 @@ Function no_trafo() End Function rename_wave_only() + STRUCT WaveLocationMod p string newName, name @@ -104,6 +110,7 @@ Function rename_wave_only() End Function rename_handles_equal_names() + STRUCT WaveLocationMod p string newName, name @@ -124,6 +131,7 @@ Function rename_handles_equal_names() End Function move_wave_only() + STRUCT WaveLocationMod p string folder, newFolder @@ -144,6 +152,7 @@ Function move_wave_only() End Function move_fails_on_non_exist_ret_src() + STRUCT WaveLocationMod p string newFolder @@ -168,6 +177,7 @@ Function move_fails_on_non_exist_ret_src() End Function move_handles_equal_folders() + STRUCT WaveLocationMod p string folder, newFolder @@ -188,6 +198,7 @@ Function move_handles_equal_folders() End Function move_rename_both_equal() + STRUCT WaveLocationMod p string folder, newFolder @@ -211,6 +222,7 @@ Function move_rename_both_equal() End Function move_rename() + STRUCT WaveLocationMod p string folder, newFolder @@ -240,6 +252,7 @@ Function move_rename() End Function move_rename_keeps_dfr() + STRUCT WaveLocationMod p string folder, newFolder @@ -270,11 +283,12 @@ Function move_rename_keeps_dfr() CHECK(DataFolderExistsDFR(p.dfr)) - WAVE/SDFR=tmpDFR/Z src = $name + WAVE/Z/SDFR=tmpDFR src = $name CHECK_WAVE(src, NULL_WAVE) End Function return_dest_if_both_keep_src() + STRUCT WaveLocationMod p string folder, newFolder @@ -314,6 +328,7 @@ Function return_dest_if_both_keep_src() End Function fails_on_liberal_wavename() + STRUCT WaveLocationMod p p.dfr = srcf @@ -329,6 +344,7 @@ Function fails_on_liberal_wavename() End Function fails_on_invalid_wavename() + STRUCT WaveLocationMod p p.dfr = srcf diff --git a/Packages/tests/Basic/UTF_Utils_Algorithm.ipf b/Packages/tests/Basic/UTF_Utils_Algorithm.ipf index a35226309d..95381a902b 100644 --- a/Packages/tests/Basic/UTF_Utils_Algorithm.ipf +++ b/Packages/tests/Basic/UTF_Utils_Algorithm.ipf @@ -688,7 +688,7 @@ Function GSI_WorksText() Make/FREE/T data1 = {"a", "b", "c", "D"} Make/FREE/T data2 = {"c", "d", "e"} - WAVE/T/Z matches = GetSetIntersection(data1, data2) + WAVE/Z/T matches = GetSetIntersection(data1, data2) CHECK_EQUAL_TEXTWAVES(matches, {"c"}) End @@ -822,8 +822,7 @@ Function FLW_RequiresNumericWave() End // UTF_TD_GENERATOR InfiniteValues -Function FLW_RequiresFiniteLevel([var]) - variable var +Function FLW_RequiresFiniteLevel([variable var]) try Make/FREE data @@ -867,8 +866,7 @@ Function FLW_RequiresBigEnoughWave() End // UTF_TD_GENERATOR DataGenerators#FLW_SampleData -Function FLW_SameResultsAsFindLevelSingle([wv]) - WAVE wv +Function FLW_SameResultsAsFindLevelSingle([WAVE wv]) variable i, edge, level, numCols @@ -892,8 +890,7 @@ Function FLW_SameResultsAsFindLevelSingle([wv]) End // UTF_TD_GENERATOR DataGenerators#FLW_SampleDataMulti -Function FLW_MultiWorks([wv]) - WAVE wv +Function FLW_MultiWorks([WAVE wv]) variable i, edge, level diff --git a/Packages/tests/Basic/UTF_Utils_Checks.ipf b/Packages/tests/Basic/UTF_Utils_Checks.ipf index a4dc0d3148..c0b0710020 100644 --- a/Packages/tests/Basic/UTF_Utils_Checks.ipf +++ b/Packages/tests/Basic/UTF_Utils_Checks.ipf @@ -31,6 +31,7 @@ /// @{ Function IE_Works() + CHECK(IsEven(0)) CHECK(!IsEven(-1)) CHECK(IsEven(-2)) @@ -40,6 +41,7 @@ End // UTF_TD_GENERATOR DataGenerators#NonFiniteValues Function IE_FalseWithNonFiniteValues([variable var]) + CHECK(!IsEven(var)) End @@ -49,6 +51,7 @@ End /// @{ Function IO_Works() + CHECK(!IsOdd(0)) CHECK(!IsOdd(-2)) CHECK(IsOdd(-1)) @@ -58,6 +61,7 @@ End // UTF_TD_GENERATOR DataGenerators#NonFiniteValues Function IO_FalseWithNonFiniteValues([variable var]) + CHECK(!IsOdd(var)) End @@ -222,6 +226,7 @@ End /// @{ Function EVOB_Works() + CHECK(!EqualValuesOrBothNaN(0, 1)) CHECK(EqualValuesOrBothNaN(0, 0)) CHECK(!EqualValuesOrBothNaN(0, NaN)) @@ -243,8 +248,7 @@ Function IC_Works() End // UTF_TD_GENERATOR InfiniteValues -Function IC_WorksSpecialValues([val]) - variable val +Function IC_WorksSpecialValues([variable val]) Make/FREE/N=0 empty CHECK_EQUAL_VAR(IsConstant(empty, val, ignoreNaN = 0), NaN) @@ -257,6 +261,7 @@ Function IC_WorksSpecialValues([val]) End Function IC_CheckNaNInInputWave() + // default is to ignore NaNs CHECK_EQUAL_VAR(IsConstant({NaN, 0}, 0), 1) CHECK_EQUAL_VAR(IsConstant({NaN, 0}, 0, ignoreNaN = 1), 1) @@ -278,6 +283,7 @@ End /// @{ Function IVR_Works() + string null CHECK(IsValidRegexp(".*")) diff --git a/Packages/tests/Basic/UTF_Utils_Conversions.ipf b/Packages/tests/Basic/UTF_Utils_Conversions.ipf index 73bb837f72..461182b90a 100644 --- a/Packages/tests/Basic/UTF_Utils_Conversions.ipf +++ b/Packages/tests/Basic/UTF_Utils_Conversions.ipf @@ -296,6 +296,7 @@ static Function TWTLSingleElementNDSeparators([variable var]) End Function/WAVE SomeTextWaves() + Make/WAVE/FREE/N=5 all Make/FREE/T/N=0 wv1 @@ -319,6 +320,7 @@ End // UTF_TD_GENERATOR w0:SomeTextWaves // UTF_TD_GENERATOR v0:TrailSepOptions Function TWTLRoundTrips([STRUCT IUTF_MDATA &md]) + string list variable dims, trailSep @@ -343,6 +345,7 @@ End /// @brief Fail due to null string Function ListToTextWaveMDFail0() + string uninitialized variable err @@ -357,6 +360,7 @@ End /// @brief Fail due to wrong dims Function ListToTextWaveMDFail1() + try WAVE/T t = ListToTextWaveMD("", 0) FAIL() @@ -535,6 +539,7 @@ End /// @{ Function LTNWWorks() + WAVE wv = ListToNumericWave("1;1e6;-inf;1.5;NaN;", ";") CHECK_WAVE(wv, NUMERIC_WAVE, minorType = DOUBLE_WAVE) @@ -542,6 +547,7 @@ Function LTNWWorks() End Function LTNWWorksWithCustomSepAndFloatType() + WAVE wv = ListToNumericWave("1|1e6|-inf|1.5|NaN|", "|", type = IGOR_TYPE_32BIT_FLOAT) CHECK_WAVE(wv, NUMERIC_WAVE, minorType = FLOAT_WAVE) @@ -549,6 +555,7 @@ Function LTNWWorksWithCustomSepAndFloatType() End Function LTNWWorksWithIntegerType() + WAVE wv = ListToNumericWave("1;-1;", ";", type = IGOR_TYPE_32BIT_INT) CHECK_WAVE(wv, NUMERIC_WAVE, minorType = INT32_WAVE) @@ -556,6 +563,7 @@ Function LTNWWorksWithIntegerType() End Function LTNWWorksWithOnlySeps() + WAVE wv = ListToNumericWave(";;;", ";") CHECK_WAVE(wv, NUMERIC_WAVE, minorType = DOUBLE_WAVE) @@ -563,6 +571,7 @@ Function LTNWWorksWithOnlySeps() End Function LTNWRoundtripsWithNumericWaveToList() + string list Make/FREE expected = {1, 1e6, -Inf, 1.5, NaN} @@ -747,18 +756,21 @@ Function num2strHighPrecWorks5() End Function num2strHighPrecShortenWorks1() + string sref = "1.234" string s = num2strHighPrec(1.2340, precision = MAX_DOUBLE_PRECISION, shorten = 1) CHECK_EQUAL_STR(s, sref) End Function num2strHighPrecShortenWorks2() + string sref = "1" string s = num2strHighPrec(1.0, precision = MAX_DOUBLE_PRECISION, shorten = 1) CHECK_EQUAL_STR(s, sref) End Function num2strHighPrecShortenDoesNotEatAllZeroes() + string sref = "10" string s = num2strHighPrec(10.00, precision = MAX_DOUBLE_PRECISION, shorten = 1) CHECK_EQUAL_STR(s, sref) @@ -770,6 +782,7 @@ End /// @{ Function STIW_TestDimensions() + Make/FREE testwave SetScale/P x, 0, 0.1, testwave @@ -796,13 +809,13 @@ Function STIW_TestDimensions() End Function/WAVE STIW_TestAbortGetter() + Make/D/FREE data = {4, -1, 0.1, NaN, Inf, -Inf} return data End // UTF_TD_GENERATOR STIW_TestAbortGetter -Function STIW_TestAbort([var]) - variable var +Function STIW_TestAbort([variable var]) variable err @@ -824,6 +837,7 @@ End /// @{ Function HexAndNumbersWorks() + string str, expected CHECK_EQUAL_VAR(HexToNumber("0a"), 10) @@ -1013,6 +1027,7 @@ End /// UTF_TD_GENERATOR s0:DataGenerators#GetSupportedWaveTypes Function JSONWaveCreatesCorrectWaveTypes([STRUCT IUTF_mData &m]) + string str, typeStr variable type @@ -1044,8 +1059,8 @@ End /// @{ // UTF_TD_GENERATOR DataGenerators#InvalidSignDigits -Function FloatWithMinSigDigitsAborts([var]) - variable var +Function FloatWithMinSigDigitsAborts([variable var]) + try FloatWithMinSigDigits(1.234, numMinSignDigits = var) FAIL() diff --git a/Packages/tests/Basic/UTF_Utils_DataFolder.ipf b/Packages/tests/Basic/UTF_Utils_DataFolder.ipf index efbe5a2c7e..158e2c0f7b 100644 --- a/Packages/tests/Basic/UTF_Utils_DataFolder.ipf +++ b/Packages/tests/Basic/UTF_Utils_DataFolder.ipf @@ -16,8 +16,7 @@ /// @{ // This cuts away the temporary folder in which the tests runs -Function/S TrimVolatileFolderName_IGNORE(list) - string list +Function/S TrimVolatileFolderName_IGNORE(string list) variable pos, i, numEntries string str @@ -176,7 +175,7 @@ Function GetListOfObjectsWorksTypeFlag([STRUCT IUTF_mData &md]) Make dfr:wv1 Make dfr:wv2 variable/G dfr:var1 - variable/G/C dfr:var2 + variable/C/G dfr:var2 string/G dfr:str1 DFREF dfrDeep = $":test:test2" @@ -185,7 +184,7 @@ Function GetListOfObjectsWorksTypeFlag([STRUCT IUTF_mData &md]) Make dfrDeep:wv3 Make dfrDeep:wv4 variable/G dfrDeep:var3 - variable/G/C dfrDeep:var4 + variable/C/G dfrDeep:var4 string/G dfrDeep:str2 result = GetListOfObjects(dfr, ".*", recursive = 0, typeFlag = type) @@ -496,6 +495,7 @@ End /// @{ Function RDFU_Works() + string name, suffix, path name = "I_DONT_EXIST" @@ -524,6 +524,7 @@ End /// @{ Function DC_DFREFClear_Perm_Works() + NewDataFolder/O test DFREF dfr = :test CHECK(DataFolderExistsDFR(dfr)) @@ -534,6 +535,7 @@ Function DC_DFREFClear_Perm_Works() End Function DC_DFREFClear_Free_Works() + DFREF dfr = NewFreeDataFolder() CHECK(DataFolderExistsDFR(dfr)) DFREFClear(dfr) diff --git a/Packages/tests/Basic/UTF_Utils_Mies_Algorithm.ipf b/Packages/tests/Basic/UTF_Utils_Mies_Algorithm.ipf index 11cb45a30a..aef26e8d0e 100644 --- a/Packages/tests/Basic/UTF_Utils_Mies_Algorithm.ipf +++ b/Packages/tests/Basic/UTF_Utils_Mies_Algorithm.ipf @@ -346,6 +346,7 @@ End /// @{ Function FI_NumSearchWithCol1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -362,6 +363,7 @@ static Function FI_NumSearchWithCol1Inverted() End Function FI_NumSearchWithColAndLayer1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -370,6 +372,7 @@ Function FI_NumSearchWithColAndLayer1() End Function FI_NumSearchWithColAndLayer2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -378,6 +381,7 @@ Function FI_NumSearchWithColAndLayer2() End Function FI_NumSearchWithCol2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -386,6 +390,7 @@ Function FI_NumSearchWithCol2() End Function FI_NumSearchWithCol3() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -394,6 +399,7 @@ Function FI_NumSearchWithCol3() End Function FI_NumSearchWithColLabel() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -402,6 +408,7 @@ Function FI_NumSearchWithColLabel() End Function FI_NumSearchWithColAndStr() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -410,6 +417,7 @@ Function FI_NumSearchWithColAndStr() End Function FI_NumSearchWithColAndProp1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -418,6 +426,7 @@ Function FI_NumSearchWithColAndProp1() End Function FI_NumSearchWithColAndProp2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -426,6 +435,7 @@ Function FI_NumSearchWithColAndProp2() End Function FI_NumSearchWithColAndProp3() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -434,6 +444,7 @@ Function FI_NumSearchWithColAndProp3() End Function FI_NumSearchWithColAndProp4() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -442,6 +453,7 @@ Function FI_NumSearchWithColAndProp4() End Function FI_NumSearchWithColAndProp5() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -458,6 +470,7 @@ static Function FI_NumSearchWithColAndProp5Inverted() End Function FI_NumSearchWithColAndProp6() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -474,6 +487,7 @@ static Function FI_NumSearchWithColAndProp6Inverted() End Function FI_NumSearchWithColAndProp6a() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -482,6 +496,7 @@ Function FI_NumSearchWithColAndProp6a() End Function FI_NumSearchWithRestRows() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -490,6 +505,7 @@ Function FI_NumSearchWithRestRows() End Function FI_TextSearchWithCol1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -498,6 +514,7 @@ Function FI_TextSearchWithCol1() End Function FI_TextSearchWithColAndLayer1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -506,6 +523,7 @@ Function FI_TextSearchWithColAndLayer1() End Function FI_TextSearchWithColAndLayer2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -514,6 +532,7 @@ Function FI_TextSearchWithColAndLayer2() End Function FI_TextSearchWithCol2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -522,6 +541,7 @@ Function FI_TextSearchWithCol2() End Function FI_TextSearchWithCol3() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -530,6 +550,7 @@ Function FI_TextSearchWithCol3() End Function FI_TextSearchWithColLabel() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -538,6 +559,7 @@ Function FI_TextSearchWithColLabel() End Function FI_TextSearchWithColAndVar() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -546,6 +568,7 @@ Function FI_TextSearchWithColAndVar() End Function FI_TextSearchIgnoresCase() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -554,6 +577,7 @@ Function FI_TextSearchIgnoresCase() End Function FI_TextSearchWithColAndProp1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -562,6 +586,7 @@ Function FI_TextSearchWithColAndProp1() End Function FI_TextSearchWithColAndProp2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -570,6 +595,7 @@ Function FI_TextSearchWithColAndProp2() End Function FI_TextSearchWithColAndProp3() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -578,6 +604,7 @@ Function FI_TextSearchWithColAndProp3() End Function FI_TextSearchWithColAndProp4() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -586,6 +613,7 @@ Function FI_TextSearchWithColAndProp4() End Function FI_TextSearchWithColAndProp5() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -594,6 +622,7 @@ Function FI_TextSearchWithColAndProp5() End Function FI_TextSearchWithColAndProp6() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -602,6 +631,7 @@ Function FI_TextSearchWithColAndProp6() End Function FI_TextSearchWithRestRows() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr text @@ -610,12 +640,14 @@ Function FI_TextSearchWithRestRows() End Function FI_EmptyWave() + Make/FREE/N=0 emptyWave WAVE/Z indizes = FindIndizes(emptyWave, var = NaN) CHECK_WAVE(indizes, NULL_WAVE) End Function FI_AbortsWithInvalidParams1() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -628,6 +660,7 @@ Function FI_AbortsWithInvalidParams1() End Function FI_AbortsWithInvalidParams2() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -640,6 +673,7 @@ Function FI_AbortsWithInvalidParams2() End Function FI_AbortsWithInvalidParams3() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -652,6 +686,7 @@ Function FI_AbortsWithInvalidParams3() End Function FI_AbortsWithInvalidParams4() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -664,6 +699,7 @@ Function FI_AbortsWithInvalidParams4() End Function FI_AbortsWithInvalidParams5() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -676,6 +712,7 @@ Function FI_AbortsWithInvalidParams5() End Function FI_AbortsWithInvalidParams6() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -688,6 +725,7 @@ Function FI_AbortsWithInvalidParams6() End Function FI_AbortsWithInvalidParams7() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -700,6 +738,7 @@ Function FI_AbortsWithInvalidParams7() End Function FI_AbortsWithInvalidParams8() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -712,6 +751,7 @@ Function FI_AbortsWithInvalidParams8() End Function FI_AbortsWithInvalidParams9() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -724,6 +764,7 @@ Function FI_AbortsWithInvalidParams9() End Function FI_AbortsWithInvalidParams10() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -736,6 +777,7 @@ Function FI_AbortsWithInvalidParams10() End Function FI_AbortsWithInvalidParams11() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric @@ -769,6 +811,7 @@ Function FI_AbortsWithInvalidWave() End Function FI_AbortsWithInvalidRegExp() + DFREF dfr = root:FindIndizes WAVE/SDFR=dfr numeric diff --git a/Packages/tests/Basic/UTF_Utils_Mies_BackupWaves.ipf b/Packages/tests/Basic/UTF_Utils_Mies_BackupWaves.ipf index 0016d226b6..51e6e1fbaf 100644 --- a/Packages/tests/Basic/UTF_Utils_Mies_BackupWaves.ipf +++ b/Packages/tests/Basic/UTF_Utils_Mies_BackupWaves.ipf @@ -27,6 +27,7 @@ Function CreateBackupWaveChecksArgs() End Function CreateBackupWaveBasics() + Make data WAVE/Z bak = CreateBackupWave(data) CHECK_WAVE(bak, NORMAL_WAVE) @@ -99,6 +100,7 @@ Function/DF PrepareFolderForBackup_IGNORE() End Function CountElementsInFolder_IGNORE(DFREF dfr) + return CountObjectsDFR(dfr, COUNTOBJECTS_WAVES) + CountObjectsDFR(dfr, COUNTOBJECTS_VAR) \ + CountObjectsDFR(dfr, COUNTOBJECTS_STR) + CountObjectsDFR(dfr, COUNTOBJECTS_DATAFOLDER) End diff --git a/Packages/tests/Basic/UTF_Utils_Mies_Config.ipf b/Packages/tests/Basic/UTF_Utils_Mies_Config.ipf index 0c4dcc4117..4140eef37c 100644 --- a/Packages/tests/Basic/UTF_Utils_Mies_Config.ipf +++ b/Packages/tests/Basic/UTF_Utils_Mies_Config.ipf @@ -22,7 +22,7 @@ Function ITCC_WorksLegacy() WAVE/SDFR=root:ITCWaves config = ITCChanConfigWave_legacy CHECK(IsValidConfigWave(config, version = 0)) - WAVE/T/Z units = AFH_GetChannelUnits(config) + WAVE/Z/T units = AFH_GetChannelUnits(config) CHECK_WAVE(units, TEXT_WAVE) // we have one TTL channel which does not have a unit CHECK_EQUAL_VAR(DimSize(units, ROWS) + 1, DimSize(config, ROWS)) @@ -61,7 +61,7 @@ Function ITCC_WorksVersion1() WAVE/SDFR=root:ITCWaves config = ITCChanConfigWave_Version1 CHECK(IsValidConfigWave(config, version = 1)) - WAVE/T/Z units = AFH_GetChannelUnits(config) + WAVE/Z/T units = AFH_GetChannelUnits(config) CHECK_WAVE(units, TEXT_WAVE) // we have one TTL channel which does not have a unit CHECK_EQUAL_VAR(DimSize(units, ROWS) + 1, DimSize(config, ROWS)) @@ -100,7 +100,7 @@ Function ITCC_WorksVersion2() WAVE/SDFR=root:ITCWaves config = ITCChanConfigWave_Version2 CHECK(IsValidConfigWave(config, version = 2)) - WAVE/T/Z units = AFH_GetChannelUnits(config) + WAVE/Z/T units = AFH_GetChannelUnits(config) CHECK(WaveExists(units)) // we have one TTL channel which does not have a unit CHECK_EQUAL_VAR(DimSize(units, ROWS) + 1, DimSize(config, ROWS)) diff --git a/Packages/tests/Basic/UTF_Utils_Mies_Logging.ipf b/Packages/tests/Basic/UTF_Utils_Mies_Logging.ipf index b5c0aafe36..d7716fda22 100644 --- a/Packages/tests/Basic/UTF_Utils_Mies_Logging.ipf +++ b/Packages/tests/Basic/UTF_Utils_Mies_Logging.ipf @@ -75,8 +75,8 @@ static Function FBD_Works() Make/FREE/T ref = {"{\"ts\" : \"2021-12-24T00:00:00Z\", \"stuff\" : \"abcd\"}", \ "{\"ts\" : \"2022-01-20T00:00:00Z\", \"stuff\" : \"efgh\"}"} - first = 0 - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") + first = 0 + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") [result, lastIndex] = FilterByDate(input, first, last) CHECK_EQUAL_TEXTWAVES(result, ref) CHECK_EQUAL_VAR(lastIndex, 1) @@ -85,21 +85,21 @@ static Function FBD_Works() Make/FREE/T ref = {"{\"ts\" : \"2021-12-24T00:00:00Z\", \"stuff\" : \"abcd\"}", \ "{\"ts\" : \"2022-01-20T00:00:00Z\", \"stuff\" : \"efgh\"}"} - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") [result, lastIndex] = FilterByDate(input, first, last) CHECK_EQUAL_TEXTWAVES(result, ref) CHECK_EQUAL_VAR(lastIndex, 1) // will result null if nothing is in range (1) - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + 1 - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") - 1 + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + 1 + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") - 1 [result, lastIndex] = FilterByDate(input, first, last) CHECK_WAVE(result, NULL_WAVE) // will result null if nothing is in range (2) - first = ParseIsO8601TimeStamp("2020-01-01T00:00:00Z") - last = ParseIsO8601TimeStamp("2020-12-31T00:00:00Z") + first = ParseIsO8601TimeStamp("2020-01-01T00:00:00Z") + last = ParseIsO8601TimeStamp("2020-12-31T00:00:00Z") [result, lastIndex] = FilterByDate(input, first, last) CHECK_WAVE(result, NULL_WAVE) End @@ -123,15 +123,15 @@ static Function FBD_WorksWithInvalidTimeStamp() "{}", "{}", "{\"ts\" : \"2022-01-20T00:00:00Z\"}", \ "{}", "{}"} - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") [result, lastIndex] = FilterByDate(input2, first, last) CHECK_EQUAL_TEXTWAVES(result, ref) CHECK_EQUAL_VAR(lastIndex, 7) // left boundary - first = 0 - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") + first = 0 + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") [result, lastIndex] = FilterByDate(input2, first, last) CHECK_EQUAL_TEXTWAVES(result, ref) CHECK_EQUAL_VAR(lastIndex, 7) @@ -142,27 +142,27 @@ static Function FBD_WorksWithInvalidTimeStamp() "{}", "{}", "{\"ts\" : \"2022-01-25T00:00:00Z\"}", \ "{}", "{}"} - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") - last = Inf + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + last = Inf [result, lastIndex] = FilterByDate(input2, first, last) CHECK_EQUAL_TEXTWAVES(result, ref) CHECK_EQUAL_VAR(lastIndex, DimSize(input2, ROWS) - 1) // all invalid ts - first = 0 - last = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + first = 0 + last = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") [result, lastIndex] = FilterByDate(input3, first, last) CHECK_EQUAL_TEXTWAVES(result, input3) CHECK_EQUAL_VAR(lastIndex, DimSize(input3, ROWS) - 1) - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") - last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + last = ParseIsO8601TimeStamp("2022-01-20T00:00:00Z") [result, lastIndex] = FilterByDate(input3, first, last) CHECK_EQUAL_TEXTWAVES(result, input3) CHECK_EQUAL_VAR(lastIndex, DimSize(input3, ROWS) - 1) - first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") - last = Inf + first = ParseIsO8601TimeStamp("2021-12-24T00:00:00Z") + last = Inf [result, lastIndex] = FilterByDate(input3, first, last) CHECK_EQUAL_TEXTWAVES(result, input3) CHECK_EQUAL_VAR(lastIndex, DimSize(input3, ROWS) - 1) @@ -173,8 +173,8 @@ static Function FBD_WorksWithInvalidTimeStamp() "{}", "{\"ts\" : \"2022-01-25T00:00:00Z\"}", \ "{}"} - first = 0 - last = ParseIsO8601TimeStamp("2022-01-25T00:00:00Z") + first = 0 + last = ParseIsO8601TimeStamp("2022-01-25T00:00:00Z") [result, lastIndex] = FilterByDate(input4, first, last) CHECK_EQUAL_TEXTWAVES(result, input4) CHECK_EQUAL_VAR(lastIndex, DimSize(input4, ROWS) - 1) diff --git a/Packages/tests/Basic/UTF_Utils_Strings.ipf b/Packages/tests/Basic/UTF_Utils_Strings.ipf index 3412675d39..d7fdeb8f2d 100644 --- a/Packages/tests/Basic/UTF_Utils_Strings.ipf +++ b/Packages/tests/Basic/UTF_Utils_Strings.ipf @@ -27,6 +27,7 @@ End // These tests also cover GetStringFromWaveNote() Function ESFP_Works() + string ref, str ref = "123" @@ -63,6 +64,7 @@ End /// @{ Function PUN_Works() + string str, ref str = PossiblyUnquoteName("", "'") @@ -78,6 +80,7 @@ Function PUN_Works() End Function PUN_ChecksParams() + try PossiblyUnquoteName("abcd", "") FAIL() @@ -106,8 +109,7 @@ End /// @{ // UTF_TD_GENERATOR DataGenerators#NonFiniteValues -Function LBP_Aborts([var]) - variable var +Function LBP_Aborts([variable var]) try LineBreakingIntoPar("", minimumWidth = var); AbortOnRTE @@ -118,6 +120,7 @@ Function LBP_Aborts([var]) End Function LBP_Works() + string str, expected str = LineBreakingIntoPar("abcd efgh 123 one two\tfour") @@ -252,6 +255,7 @@ End // UTF_TD_GENERATOR DataGenerators#InvalidUnits Function PU_Fails([string str]) + string unit, prefix variable numPrefix = NaN @@ -269,6 +273,7 @@ End // UTF_TD_GENERATOR DataGenerators#ValidUnits Function PU_Works([WAVE/T wv]) + string unit, prefix, unitWithPrefix string refUnit, refPrefix variable numPrefix, refNumPrefix @@ -410,6 +415,7 @@ End // UTF_TD_GENERATOR DataGenerators#ETValidInput Function ET_Works([WAVE/T wv]) + string ref, str, result variable length @@ -424,6 +430,7 @@ End // UTF_TD_GENERATOR DataGenerators#ETInvalidInput Function ET_Fails([WAVE/T wv]) + string str variable length diff --git a/Packages/tests/Basic/UTF_Utils_Time.ipf b/Packages/tests/Basic/UTF_Utils_Time.ipf index bec0325dbd..df3e6225a2 100644 --- a/Packages/tests/Basic/UTF_Utils_Time.ipf +++ b/Packages/tests/Basic/UTF_Utils_Time.ipf @@ -19,8 +19,7 @@ /// @{ // UTF_TD_GENERATOR DataGenerators#ISO8601_timestamps -Function ISO8601_teststamps([str]) - string str +Function ISO8601_teststamps([string str]) variable secondsSinceIgorEpoch diff --git a/Packages/tests/Basic/UTF_Utils_WaveHandling.ipf b/Packages/tests/Basic/UTF_Utils_WaveHandling.ipf index 6550744118..e8fe0d9b74 100644 --- a/Packages/tests/Basic/UTF_Utils_WaveHandling.ipf +++ b/Packages/tests/Basic/UTF_Utils_WaveHandling.ipf @@ -131,6 +131,7 @@ Function ELE_KeepsMinimumWaveSize2() End Function ELE_KeepsMinimumWaveSize3() + // need to check that the index MINIMUM_WAVE_SIZE is now accessible Make/FREE/N=(MINIMUM_WAVE_SIZE) wv EnsureLargeEnoughWave(wv, indexShouldExist = MINIMUM_WAVE_SIZE) @@ -138,12 +139,14 @@ Function ELE_KeepsMinimumWaveSize3() End Function ELE_Returns1WithCheckMem() + Make/FREE/N=(MINIMUM_WAVE_SIZE) wv CHECK_EQUAL_VAR(EnsureLargeEnoughWave(wv, indexShouldExist = 2^50, checkFreeMemory = 1), 1) CHECK_EQUAL_VAR(DimSize(wv, ROWS), MINIMUM_WAVE_SIZE) End Function ELE_AbortsWithTooLargeValue() + Make/FREE/N=(MINIMUM_WAVE_SIZE) wv variable err @@ -179,6 +182,7 @@ End /// @{ Function GLS_Works() + Make/FREE data CHECK_EQUAL_VAR(GetLockState(data), 0) @@ -316,6 +320,7 @@ End /// @{ Function GSFWNR_Works() + string ref, str // non-wave ref @@ -385,6 +390,7 @@ End /// @{ Function SeSt_CheckParams() + try SetStringInWaveNote($"", "abcd", "123") FAIL() @@ -429,6 +435,7 @@ static Function SeSt_CheckParams2() End Function SeSt_Works() + string str, ref // adds entry @@ -786,6 +793,7 @@ End /// @{ Function WMCW_ChecksMainThread() + variable val Make/FREE data @@ -825,6 +833,7 @@ Function WMCW_ChecksPreemptiveThread() End Function WMCW_Works1() + variable val Make/O data @@ -836,6 +845,7 @@ Function WMCW_Works1() End Function WMCW_Works2() + variable val Make/FREE data @@ -1151,8 +1161,7 @@ End /// @{ // UTF_TD_GENERATOR DataGenerators#SW_TrueValues -Function SW_WorksWithTrue([var]) - variable var +Function SW_WorksWithTrue([variable var]) Make/FREE a, b WAVE/Z trueWave = SelectWave(var, a, b) @@ -1161,8 +1170,7 @@ Function SW_WorksWithTrue([var]) End // UTF_TD_GENERATOR DataGenerators#SW_FalseValues -Function SW_WorksWithFalse([var]) - variable var +Function SW_WorksWithFalse([variable var]) Make/FREE a, b WAVE/Z falseWave = SelectWave(var, a, b) @@ -1423,7 +1431,7 @@ static Function TestSplitWavesToDimension() Make/FREE wvData2 = {5, 6} Make/FREE/WAVE wvRef = {wvData1, wvData2} - WAVE/WAVE/Z result = SplitWavesToDimension(wvRef) + WAVE/Z/WAVE result = SplitWavesToDimension(wvRef) CHECK_WAVE(result, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 3) CHECK_EQUAL_VAR(DimSize(result, COLS), 0) @@ -1435,7 +1443,7 @@ static Function TestSplitWavesToDimension() Make/FREE/T wvDataTxt1 = {{"a", "b"}, {"c", "d"}} Make/FREE/WAVE wvRef = {wvData1, wvDataTxt1} - WAVE/WAVE/Z result = SplitWavesToDimension(wvRef) + WAVE/Z/WAVE result = SplitWavesToDimension(wvRef) CHECK_WAVE(result, WAVE_WAVE) CHECK_EQUAL_VAR(DimSize(result, ROWS), 4) CHECK_EQUAL_VAR(DimSize(result, COLS), 0) @@ -1872,6 +1880,7 @@ Function MWWO_ReturnsNewRef() End Function MWWO_RecursiveWorks() + variable err Make/WAVE/N=2 dest diff --git a/Packages/tests/Basic/UTF_WaveAveraging.ipf b/Packages/tests/Basic/UTF_WaveAveraging.ipf index 635cad5bce..30cb993666 100644 --- a/Packages/tests/Basic/UTF_WaveAveraging.ipf +++ b/Packages/tests/Basic/UTF_WaveAveraging.ipf @@ -57,8 +57,7 @@ Function DoesNothingWithInvalidWave() End /// UTF_TD_GENERATOR SupportedTypeGetter -Function ReturnsCorrectResultWithOneWave([var]) - variable var +Function ReturnsCorrectResultWithOneWave([variable var]) Make/D/FREE data = {1, 2, 3, 4} SetScale/P x, 0, 1, "m", data @@ -76,8 +75,7 @@ Function ReturnsCorrectResultWithOneWave([var]) End /// UTF_TD_GENERATOR SupportedTypeGetter -Function PointForPointNoNans([var]) - variable var +Function PointForPointNoNans([variable var]) Make/D/FREE data1 = {1, 2, 3, 4} Make/D/FREE data2 = {3, 4, 5, 6} @@ -97,8 +95,7 @@ Function PointForPointNoNans([var]) End /// UTF_TD_GENERATOR SupportedTypeGetter -Function PointForPointWithNaNs([var]) - variable var +Function PointForPointWithNaNs([variable var]) Make/D/FREE data1 = {1, 2, NaN, 4} Make/D/FREE data2 = {3, 4, 5, 6} @@ -118,8 +115,7 @@ Function PointForPointWithNaNs([var]) End /// UTF_TD_GENERATOR SupportedTypeGetter -Function NonPointForPointNoNans([var]) - variable var +Function NonPointForPointNoNans([variable var]) Make/D/FREE data1 = {1, 2, 3, 4} Make/D/FREE data2 = {3, 4, 5, 6, 7} @@ -139,8 +135,7 @@ Function NonPointForPointNoNans([var]) End /// UTF_TD_GENERATOR SupportedTypeGetter -Function NonPointForPointWithNans([var]) - variable var +Function NonPointForPointWithNans([variable var]) Make/D/FREE data1 = {1, 2, NaN, 4} Make/D/FREE data2 = {3, 4, 5, 6, NaN} diff --git a/Packages/tests/Basic/UTF_WaveBuilder.ipf b/Packages/tests/Basic/UTF_WaveBuilder.ipf index cda498081c..6e86f9fc5c 100644 --- a/Packages/tests/Basic/UTF_WaveBuilder.ipf +++ b/Packages/tests/Basic/UTF_WaveBuilder.ipf @@ -78,6 +78,7 @@ Function WB_StimsetEntryParsing() End Function WB_StimsetRecreation1() + string setName = "Ref0_DA_0" // stimset does not yet exist @@ -89,7 +90,7 @@ Function WB_StimsetRecreation1() WAVE/Z WP = WB_GetWaveParamForSet(setName) CHECK_WAVE(WP, NORMAL_WAVE) - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(setName) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(setName) CHECK_WAVE(WPT, NORMAL_WAVE) WAVE/Z SegWvType = WB_GetSegWvTypeForSet(setName) @@ -100,6 +101,7 @@ Function WB_StimsetRecreation1() End Function WB_StimsetRecreation2() + string setName = "Ref0_DA_0" WAVE/Z stimset = WB_CreateAndGetStimSet(setName) @@ -108,7 +110,7 @@ Function WB_StimsetRecreation2() WAVE/Z WP = WB_GetWaveParamForSet(setName) CHECK_WAVE(WP, NORMAL_WAVE) - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(setName) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(setName) CHECK_WAVE(WPT, NORMAL_WAVE) WAVE/Z SegWvType = WB_GetSegWvTypeForSet(setName) @@ -123,6 +125,7 @@ Function WB_StimsetRecreation2() End Function WB_StimsetRecreation3() + string setName = "Ref0_DA_0" WAVE/Z stimset = WB_CreateAndGetStimSet(setName) @@ -131,7 +134,7 @@ Function WB_StimsetRecreation3() WAVE/Z WP = WB_GetWaveParamForSet(setName) CHECK_WAVE(WP, NORMAL_WAVE) - WAVE/T/Z WPT = WB_GetWaveTextParamForSet(setName) + WAVE/Z/T WPT = WB_GetWaveTextParamForSet(setName) CHECK_WAVE(WPT, NORMAL_WAVE) WAVE/Z SegWvType = WB_GetSegWvTypeForSet(setName) @@ -154,6 +157,7 @@ Function WB_StimsetRecreation3() End Function WB_EditingExistingKeepsPrecision() + string panel = "WaveBuilder" string setName = "Ref6_b_DA_0" @@ -198,6 +202,7 @@ Function WB_EditingExistingKeepsPrecision() End Function WB_CheckEpochParameters() + string newCode, existingCode newCode = WBP_RegenerateEpochParameterNamesCode() @@ -213,6 +218,7 @@ Function WB_CheckEpochParameters() End Function WB_SaveErrorsDontDeleteExistingStimSets() + string win, setName, history variable refNum, modCount diff --git a/Packages/tests/Basic/UTF_WaveBuilderRegression.ipf b/Packages/tests/Basic/UTF_WaveBuilderRegression.ipf index b07d1c39c9..005afba6b3 100644 --- a/Packages/tests/Basic/UTF_WaveBuilderRegression.ipf +++ b/Packages/tests/Basic/UTF_WaveBuilderRegression.ipf @@ -53,12 +53,12 @@ Function/WAVE WB_FetchRefWave_IGNORE(string name) string majorVersion = num2istr(IgorVersion()) DFREF dfr = root:wavebuilder_misc:DAWaves - WAVE/SDFR=dfr/Z overrideWave = $(name + "_IP" + majorVersion) + WAVE/Z/SDFR=dfr overrideWave = $(name + "_IP" + majorVersion) if(WaveExists(overrideWave)) return overrideWave endif - WAVE/SDFR=dfr/Z wv = $name + WAVE/Z/SDFR=dfr wv = $name CHECK_WAVE(wv, NORMAL_WAVE) return wv diff --git a/Packages/tests/Basic/UTF_WaveVersioning.ipf b/Packages/tests/Basic/UTF_WaveVersioning.ipf index 6779e505a1..29f78693e4 100644 --- a/Packages/tests/Basic/UTF_WaveVersioning.ipf +++ b/Packages/tests/Basic/UTF_WaveVersioning.ipf @@ -5,16 +5,19 @@ /// @{ ExistsWithCorrectLayoutVersion Function EWCL_InvalidWaveRefHasNoVersion() + WAVE/Z wv = $"" CHECK(!MIES_WAVEGETTERS#ExistsWithCorrectLayoutVersion(wv, 1)) End Function EWCL_NoWaveVersionIsFalse() + Make/FREE wv CHECK(!MIES_WAVEGETTERS#ExistsWithCorrectLayoutVersion(wv, 1)) End Function EWCL_Works() + Make/FREE wv MIES_WAVEGETTERS#SetWaveVersion(wv, 1) CHECK(MIES_WAVEGETTERS#ExistsWithCorrectLayoutVersion(wv, 1)) @@ -111,6 +114,7 @@ Function WV_IsAtLeastNull() End Function WV_IsAtLeastOne() + Make/FREE wv try @@ -122,6 +126,7 @@ Function WV_IsAtLeastOne() End Function WV_IsAtLeastInteger() + Make/FREE wv try @@ -133,6 +138,7 @@ Function WV_IsAtLeastInteger() End Function WV_IsAtLeast() + Make/FREE wv CHECK(!MIES_WAVEGETTERS#WaveVersionIsAtLeast(wv, 1)) @@ -154,6 +160,7 @@ Function WV_IsSmallerNull() End Function WV_IsSmallerOne() + Make/FREE wv try @@ -165,6 +172,7 @@ Function WV_IsSmallerOne() End Function WV_IsSmallerInteger() + Make/FREE wv try @@ -176,6 +184,7 @@ Function WV_IsSmallerInteger() End Function WV_IsSmaller() + Make/FREE wv CHECK(MIES_WAVEGETTERS#WaveVersionIsSmaller(wv, 1)) @@ -188,6 +197,7 @@ End /// @{ ClearWaveNoteExceptWaveVersion Function CWNE_ClearsNoteWithoutVersion() + string str Make/FREE wv @@ -200,6 +210,7 @@ Function CWNE_ClearsNoteWithoutVersion() End Function CWNE_ClearsNoteAndDropsInvalidVersion() + string str Make/FREE wv @@ -218,6 +229,7 @@ Function CWNE_ClearsNoteAndDropsInvalidVersion() End Function CWNE_ClearsNoteAndKeepsValidWaveVersion() + string str, ref Make/FREE wv diff --git a/Packages/tests/Compilation/CompilationTester.ipf b/Packages/tests/Compilation/CompilationTester.ipf index 7a1597a7b1..44c6f5d22e 100644 --- a/Packages/tests/Compilation/CompilationTester.ipf +++ b/Packages/tests/Compilation/CompilationTester.ipf @@ -7,6 +7,7 @@ /// IUTF_SKIP Function run() + MIES_CompilationTester#runTest("CompilationTester.ipf", name = "Compilation tests", testCase = "TestCompilation", enableJU = 1) End @@ -36,6 +37,7 @@ static Function GetEnvironmentVariableAsBoolean(string key) End Function/WAVE GetIncludes() + // keep sorted Make/FREE/T includes = {"MIES_Include", \ "UTF_Basic", \ diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_HardwareAnalysisFunctions.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_HardwareAnalysisFunctions.ipf index 04be773ff8..ace2477183 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_HardwareAnalysisFunctions.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_HardwareAnalysisFunctions.ipf @@ -25,6 +25,7 @@ // Entry point for UTF Function run() + return RunWithOpts(instru = DoInstrumentation()) End diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_MultiPatchSeqSpikeControl.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_MultiPatchSeqSpikeControl.ipf index fe66f5d9bf..8e772fe415 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_MultiPatchSeqSpikeControl.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_MultiPatchSeqSpikeControl.ipf @@ -853,7 +853,7 @@ static Function SC_Test8([str]) // sweep 0, HS0: Too few (SPF) // sweep 0, HS1: Good (SPF) - wv[0][0][][0, 1] = "" // no spike + wv[0][0][][0, 1] = "" // no spike wv[0][1][][0, 1] = "SpikePosition_ms:4" // sweep 1, HS0: Good (SPF) @@ -872,7 +872,7 @@ static Function SC_Test8([str]) // sweep 3, HS1: Too Few (SPF) wv[3][0][][0, 1] = "SpikePosition_ms:6.5" - wv[3][1][][0, 1] = "" // no spike + wv[3][1][][0, 1] = "" // no spike wv[][][][] += ";SpontaneousSpikeMax:0.5" End diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf index ead6ed2e99..1a28bc75eb 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Sub.ipf @@ -218,7 +218,7 @@ static Function PS_DS_Sub1_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -429,7 +429,7 @@ static Function PS_DS_Sub2_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -592,7 +592,7 @@ static Function PS_DS_Sub3_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -812,7 +812,7 @@ static Function PS_DS_Sub4_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -965,7 +965,7 @@ static Function PS_DS_Sub5_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -1118,7 +1118,7 @@ static Function PS_DS_Sub5a_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -1339,7 +1339,7 @@ static Function PS_DS_Sub6_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -1516,7 +1516,7 @@ static Function PS_DS_Sub7_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -1706,7 +1706,7 @@ static Function PS_DS_Sub8_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -1870,7 +1870,7 @@ static Function PS_DS_Sub9_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB, PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) @@ -2049,7 +2049,7 @@ static Function PS_DS_Sub10_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUB}, mode = WAVE_DATA) WAVE/Z deltaI = GetLBNEntries_IGNORE(str, sweepNo, LBN_DELTA_I) diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf index 84c72101a9..8eacd4a21a 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqDAScale_Supra.ipf @@ -165,7 +165,7 @@ static Function PS_DS_Supra1_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -257,7 +257,7 @@ static Function PS_DS_Supra2_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -352,7 +352,7 @@ static Function PS_DS_Supra3_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -447,7 +447,7 @@ static Function PS_DS_Supra4_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 1}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -546,7 +546,7 @@ static Function PS_DS_Supra5_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) @@ -655,7 +655,7 @@ static Function PS_DS_Supra6_REENTRY([str]) WAVE/Z fISlopeReached = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_fI_SLOPE_REACHED_PASS) CHECK_EQUAL_WAVES(fISlopeReached, {0, 0, 0, 0, 0}, mode = WAVE_DATA) - WAVE/T/Z opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) + WAVE/Z/T opMode = GetLBNEntries_IGNORE(str, sweepNo, PSQ_FMT_LBN_DA_OPMODE) CHECK_EQUAL_TEXTWAVES(opMode, {PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA, PSQ_DS_SUPRA}, mode = WAVE_DATA) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNo) diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf index e7599ba707..f92b268dde 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRamp.ipf @@ -129,13 +129,13 @@ static Function/WAVE GetUserEpochs_IGNORE(sweepNo, device) WAVE textualValues = GetLBTextualValues(device) WAVE numericalValues = GetLBNumericalValues(device) - WAVE/T/Z results = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, EPOCHS_ENTRY_KEY, PSQ_TEST_HEADSTAGE, UNKNOWN_MODE) + WAVE/Z/T results = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, EPOCHS_ENTRY_KEY, PSQ_TEST_HEADSTAGE, UNKNOWN_MODE) CHECK_WAVE(results, TEXT_WAVE) // now filter out the user epochs numEntries = DimSize(results, ROWS) for(i = 0; i < numEntries; i += 1) - WAVE/T/Z epochWave = EP_EpochStrToWave(results[i]) + WAVE/Z/T epochWave = EP_EpochStrToWave(results[i]) CHECK_WAVE(epochWave, TEXT_WAVE) numEpochs = DimSize(epochWave, ROWS) @@ -252,7 +252,7 @@ static Function PS_RA1_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_WAVE(spikePositionWave, NULL_WAVE) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -339,7 +339,7 @@ static Function PS_RA2_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_WAVE(spikePositionWave, NULL_WAVE) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -416,7 +416,7 @@ static Function PS_RA2a_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_EQUAL_TEXTWAVES(spikePositionWave, {"10000;", "10000;"}, mode = WAVE_DATA) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -508,7 +508,7 @@ static Function PS_RA3_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_EQUAL_TEXTWAVES(spikePositionWave, {"10000;", "10000;", "10000;"}, mode = WAVE_DATA) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -595,7 +595,7 @@ static Function PS_RA4_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_EQUAL_TEXTWAVES(spikePositionWave, {"10000;", "", ""}, mode = WAVE_DATA) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -678,7 +678,7 @@ static Function PS_RA5_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_EQUAL_TEXTWAVES(spikePositionWave, {"", "10000;", "10000;"}, mode = WAVE_DATA) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -775,7 +775,7 @@ static Function PS_RA6_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_EQUAL_TEXTWAVES(spikePositionWave, {"10000;", "", "10000;", "10000;"}, mode = WAVE_DATA) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) @@ -864,7 +864,7 @@ static Function PS_RA7_REENTRY([str]) WAVE/Z spikePositionWave = GetSpikePosition_IGNORE(sweepNo, str) CHECK_WAVE(spikePositionWave, NULL_WAVE) - WAVE/T/Z userEpochs = GetUserEpochs_IGNORE(sweepNo, str) + WAVE/Z/T userEpochs = GetUserEpochs_IGNORE(sweepNo, str) CHECK_WAVE(userEpochs, TEXT_WAVE) WAVE/Z foundUserEpochs = FindUserEpochs(userEpochs) diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_SetControls.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_SetControls.ipf index be8d0a9fde..578a25b8f8 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_SetControls.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_SetControls.ipf @@ -493,7 +493,7 @@ static Function SC_SetControls8_REENTRY([str]) actual = GetNotebookText(str + "#UserComments#NB") CHECK_EQUAL_STR(expected, actual) - WAVE/T/Z allDBs = DB_FindAllDataBrowser(str) + WAVE/Z/T allDBs = DB_FindAllDataBrowser(str) CHECK_WAVE(allDBs, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(allDbs, ROWS), 2) diff --git a/Packages/tests/HardwareBasic/UTF_AnalysisFunctionManagement.ipf b/Packages/tests/HardwareBasic/UTF_AnalysisFunctionManagement.ipf index 3703e92ff9..49ba7b1bd8 100644 --- a/Packages/tests/HardwareBasic/UTF_AnalysisFunctionManagement.ipf +++ b/Packages/tests/HardwareBasic/UTF_AnalysisFunctionManagement.ipf @@ -117,6 +117,7 @@ static Function ChangeAnalysisFunctions_IGNORE() End Function RewriteAnalysisFunctions_IGNORE() + LoadStimsets() ChangeAnalysisFunctions_IGNORE() SaveStimsets() @@ -152,35 +153,35 @@ static Function AFT1_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -216,35 +217,35 @@ static Function AFT2_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -282,42 +283,42 @@ static Function AFT3_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -355,42 +356,42 @@ static Function AFT4_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -428,32 +429,32 @@ static Function AFT5_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) End @@ -492,42 +493,42 @@ static Function AFT6_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V2", "", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -565,35 +566,35 @@ static Function AFT6a_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V3", "", "", "", "", "", "", "", ""}) End @@ -634,42 +635,42 @@ static Function AFT6b_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"NotCalled_V1", "", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V3", "", "", "", "", "", "", "", ""}) End @@ -719,42 +720,42 @@ static Function AFT7_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidMultHS_V1", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -783,35 +784,35 @@ static Function AFT8_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -851,7 +852,7 @@ static Function AFT9_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"ValidFunc_V3", "", "", "", "", "", "", "", ""}) End @@ -880,35 +881,35 @@ static Function AFT10_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -947,42 +948,42 @@ static Function AFT11_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"preDAQ", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"preSet", "", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"preSweepConfig", "", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"midSweep", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"postSweep", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"postSet", "", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"postDAQ", "", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -1030,35 +1031,35 @@ static Function AFT12_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -1100,36 +1101,36 @@ static Function AFT13_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"StopMidSweep", "StopMidSweep", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End @@ -1183,40 +1184,40 @@ static Function AFT14_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"Params1_V3", "", "", "", "", "", "", "", ""}) key = ANALYSIS_FUNCTION_PARAMS_LBN - WAVE/T/Z anaFuncParams = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncParams = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncParams, TEXT_WAVE) End @@ -1927,7 +1928,7 @@ static Function AFT21_REENTRY([str]) CHECK_EQUAL_VAR(sweepNo, 0) WAVE/T textualValues = GetLBTextualValues(str) - WAVE/T/Z foundStimSets = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"AnaFuncPostDAQ_DA_0", "", "", "", "", "", "", "", ""}) @@ -1973,42 +1974,42 @@ static Function AFT22_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) key = StringFromList(PRE_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(PRE_SWEEP_CONFIG_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(MID_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_SWEEP_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_SET_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(POST_DAQ_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(anaFuncs, {"", "ValidMultHS_V1", "", "", "", "", "", "", ""}) key = StringFromList(GENERIC_EVENT, EVENT_NAME_LIST_LBN) - WAVE/T/Z anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) + WAVE/Z/T anaFuncs = GetLastSetting(textualValues, sweepNo, key, DATA_ACQUISITION_MODE) CHECK_WAVE(anaFuncs, NULL_WAVE) End diff --git a/Packages/tests/HardwareBasic/UTF_AutoTestpulse.ipf b/Packages/tests/HardwareBasic/UTF_AutoTestpulse.ipf index 960721cb1d..4b0ca67831 100644 --- a/Packages/tests/HardwareBasic/UTF_AutoTestpulse.ipf +++ b/Packages/tests/HardwareBasic/UTF_AutoTestpulse.ipf @@ -71,7 +71,7 @@ static Function AutoTP_OptimumValues_preAcq(string device) // 2 HS in IC mode // both have the ideal values overrideResults[][0, 1][%Factor] = TP_BASELINE_RATIO_OPT - overrideResults[][0, 1][%Voltage] = 0.015 // V + overrideResults[][0, 1][%Voltage] = 0.015 // V overrideResults[][0, 1][%BaselineFitResult] = TP_BASELINE_FIT_RESULT_OK PGC_SetAndActivateControl(device, "check_DataAcq_AutoTP", val = 1) @@ -125,7 +125,7 @@ static Function AutoTP_BadValues_preAcq(string device) // 2 HS in IC mode // both have very bad values, the fit is good overrideResults[][0, 1][%Factor] = TP_BASELINE_RATIO_LOW / 4 - overrideResults[][0, 1][%Voltage] = 0.020 // V + overrideResults[][0, 1][%Voltage] = 0.020 // V overrideResults[][0, 1][%BaselineFitResult] = TP_BASELINE_FIT_RESULT_OK PGC_SetAndActivateControl(device, "check_DataAcq_AutoTP", val = 1) @@ -176,12 +176,12 @@ static Function AutoTP_MixedOptimumBadValues_preAcq(string device) // HS0: ideal values overrideResults[][0][%Factor] = TP_BASELINE_RATIO_OPT - overrideResults[][0][%Voltage] = 0.015 // V + overrideResults[][0][%Voltage] = 0.015 // V overrideResults[][0][%BaselineFitResult] = TP_BASELINE_FIT_RESULT_OK // HS1: bad values overrideResults[][1][%Factor] = TP_BASELINE_RATIO_LOW / 4 - overrideResults[][1][%Voltage] = 0.020 // V + overrideResults[][1][%Voltage] = 0.020 // V overrideResults[][1][%BaselineFitResult] = TP_BASELINE_FIT_RESULT_OK PGC_SetAndActivateControl(device, "check_DataAcq_AutoTP", val = 1) @@ -230,7 +230,7 @@ static Function AutoTP_SpecialCases_preAcq(string device) // 2 HS in IC mode overrideResults[][0, 1][%Factor] = TP_BASELINE_RATIO_OPT - overrideResults[][0, 1][%Voltage] = 0.050 // V + overrideResults[][0, 1][%Voltage] = 0.050 // V overrideResults[][0, 1][%BaselineFitResult] = TP_BASELINE_FIT_RESULT_OK diff --git a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf index 0734bb1985..b65ab7e04b 100644 --- a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf +++ b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf @@ -524,8 +524,8 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([str]) endif WAVE/Z ttlStimSets = GetTTLLabnotebookEntry(textualValues, LABNOTEBOOK_TTL_STIMSETS, j) - WAVE/T/Z foundIndexingEndStimSets = GetLastSetting(textualValues, j, "TTL Indexing End stimset", DATA_ACQUISITION_MODE) - WAVE/T/Z stimWaveChecksums = GetLastSetting(textualValues, j, "TTL Stim Wave Checksum", DATA_ACQUISITION_MODE) + WAVE/Z/T foundIndexingEndStimSets = GetLastSetting(textualValues, j, "TTL Indexing End stimset", DATA_ACQUISITION_MODE) + WAVE/Z/T stimWaveChecksums = GetLastSetting(textualValues, j, "TTL Stim Wave Checksum", DATA_ACQUISITION_MODE) WAVE/Z stimSetLengths = GetLastSetting(textualValues, j, "TTL Stim set length", DATA_ACQUISITION_MODE) [WAVE settings, index] = GetLastSettingChannel(numericalValues, textualValues, j, "TTL Stim set length", 1, XOP_CHANNEL_TYPE_TTL, DATA_ACQUISITION_MODE) @@ -552,9 +552,9 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([str]) CHECK_EQUAL_WAVES(TTLs, {HW_ITC_GetITCXOPChannelForRack(device, RACK_ZERO)}, mode = WAVE_DATA) endif - WAVE/T/Z foundStimSetsRackZero = GetLastSetting(textualValues, j, "TTL rack zero stim sets", DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSetsRackZero = GetLastSetting(textualValues, j, "TTL rack zero stim sets", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(foundStimSetsRackZero, {"", "", "", "", "", "", "", "", ";StimulusSetA_TTL_0;;StimulusSetB_TTL_0;"}) - WAVE/T/Z foundStimSetsRackOne = GetLastSetting(textualValues, j, "TTL rack one stim sets", DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSetsRackOne = GetLastSetting(textualValues, j, "TTL rack one stim sets", DATA_ACQUISITION_MODE) if(numRacks == 2) CHECK_EQUAL_TEXTWAVES(foundStimSetsRackOne, {"", "", "", "", "", "", "", "", ";StimulusSetC_TTL_0;StimulusSetD_TTL_0;;"}) @@ -593,9 +593,9 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([str]) endif // set sweep count - WAVE/T/Z sweepCounts = GetLastSetting(textualValues, j, "TTL rack zero set sweep counts", DATA_ACQUISITION_MODE) + WAVE/Z/T sweepCounts = GetLastSetting(textualValues, j, "TTL rack zero set sweep counts", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(sweepCounts, {"", "", "", "", "", "", "", "", ";0;;0;"}) - WAVE/T/Z sweepCounts = GetLastSetting(textualValues, j, "TTL rack one set sweep counts", DATA_ACQUISITION_MODE) + WAVE/Z/T sweepCounts = GetLastSetting(textualValues, j, "TTL rack one set sweep counts", DATA_ACQUISITION_MODE) if(numRacks == 2) CHECK_EQUAL_TEXTWAVES(sweepCounts, {"", "", "", "", "", "", "", "", ";0;0;;"}) else @@ -603,9 +603,9 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([str]) endif // set cycle count - WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL rack zero set cycle counts", DATA_ACQUISITION_MODE) + WAVE/Z/T cycleCounts = GetLastSetting(textualValues, j, "TTL rack zero set cycle counts", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;;0;"}) - WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL rack one set cycle counts", DATA_ACQUISITION_MODE) + WAVE/Z/T cycleCounts = GetLastSetting(textualValues, j, "TTL rack one set cycle counts", DATA_ACQUISITION_MODE) if(numRacks == 2) CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;0;;"}) else @@ -638,16 +638,16 @@ static Function UnassociatedChannelsAndTTLs_REENTRY([str]) CHECK_EQUAL_TEXTWAVES(ttlStimSets, {"", "StimulusSetA_TTL_0", "", "StimulusSetB_TTL_0", "", "StimulusSetC_TTL_0", "StimulusSetD_TTL_0", ""}) CHECK_EQUAL_WAVES(TTLs, {1, 3, 5, 6}, mode = WAVE_DATA) - WAVE/T/Z channelsTxT = GetLastSetting(textualValues, j, "TTL channels", DATA_ACQUISITION_MODE) + WAVE/Z/T channelsTxT = GetLastSetting(textualValues, j, "TTL channels", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(channelsTxT, {"", "", "", "", "", "", "", "", ";1;;3;;5;6;;"}, mode = WAVE_DATA) - WAVE/T/Z foundStimSets = GetLastSetting(textualValues, j, "TTL stim sets", DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSetting(textualValues, j, "TTL stim sets", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"", "", "", "", "", "", "", "", ";StimulusSetA_TTL_0;;StimulusSetB_TTL_0;;StimulusSetC_TTL_0;StimulusSetD_TTL_0;;"}) - WAVE/T/Z sweepCounts = GetLastSetting(textualValues, j, "TTL set sweep counts", DATA_ACQUISITION_MODE) + WAVE/Z/T sweepCounts = GetLastSetting(textualValues, j, "TTL set sweep counts", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(sweepCounts, {"", "", "", "", "", "", "", "", ";0;;0;;0;0;;"}) - WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL set cycle counts", DATA_ACQUISITION_MODE) + WAVE/Z/T cycleCounts = GetLastSetting(textualValues, j, "TTL set cycle counts", DATA_ACQUISITION_MODE) CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;;0;;0;0;;"}) CHECK_EQUAL_TEXTWAVES(foundIndexingEndStimSets, {"", "", "", "", "", "", "", "", ";- none -;;- none -;;- none -;- none -;;"}) @@ -1016,11 +1016,11 @@ static Function ChangeCMDuringSweepWMS_REENTRY([str]) WAVE numericalValues = GetLBNumericalValues(str) // the stimsets are not changed as this is delayed clamp mode change in action - WAVE/T/Z foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, 0, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, 0, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"StimulusSetA_DA_0", "StimulusSetA_DA_0", "StimulusSetA_DA_0"}) - WAVE/T/Z foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, 1, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, 1, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"StimulusSetC_DA_0", "StimulusSetC_DA_0", "StimulusSetC_DA_0"}) End @@ -1445,7 +1445,7 @@ static Function DataBrowserCreatesBackupsByDefault_REENTRY([str]) for(i = 0; i < numEntries; i += 1) name = StringFromList(i, list) - WAVE/SDFR=singleSweepFolder/Z wv = $name + WAVE/Z/SDFR=singleSweepFolder wv = $name CHECK_WAVE(wv, NORMAL_WAVE) WAVE/Z bak = GetBackupWave(wv) CHECK_WAVE(bak, NORMAL_WAVE) @@ -1874,7 +1874,7 @@ static Function ExportStimsetsAndRoundtripThem([variable var]) variable numEntries, i [baseFolder, nwbFile] = GetUniqueNWBFileForExport(var) - discLocation = baseFolder + nwbFile + discLocation = baseFolder + nwbFile MIES_NWB#NWB_ExportAllStimsets(var, discLocation) @@ -2010,7 +2010,7 @@ static Function CheckPulseInfoGathering_REENTRY([string str]) CHECK_EQUAL_VAR(sweepNo, 0) WAVE/T textualValues = GetLBTextualValues(str) - WAVE/T/Z epochs = GetLastSetting(textualValues, sweepNo, EPOCHS_ENTRY_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T epochs = GetLastSetting(textualValues, sweepNo, EPOCHS_ENTRY_KEY, DATA_ACQUISITION_MODE) WAVE/Z pulseInfos = MIES_PA#PA_RetrievePulseInfosFromEpochs(epochs[0]) CHECK_WAVE(pulseInfos, NUMERIC_WAVE) @@ -2171,8 +2171,7 @@ static Function AcquireWithoutAmplifier_REENTRY([string str]) End // UTF_TD_GENERATOR GetITCDevices -Function HandlesFIFOTimeoutProperly([str]) - string str +Function HandlesFIFOTimeoutProperly([string str]) STRUCT DAQSettings s InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_RES0" + \ @@ -2184,8 +2183,7 @@ Function HandlesFIFOTimeoutProperly([str]) CtrlNamedBackGround ExecuteDuringDAQ, start, period=30, proc=UseFakeFIFOThreadWithTimeout_IGNORE End -Function HandlesFIFOTimeoutProperly_REENTRY([str]) - string str +Function HandlesFIFOTimeoutProperly_REENTRY([string str]) variable stopReason @@ -2199,8 +2197,7 @@ Function HandlesFIFOTimeoutProperly_REENTRY([str]) End // UTF_TD_GENERATOR GetITCDevices -Function HandlesStuckFIFOProperly([str]) - string str +Function HandlesStuckFIFOProperly([string str]) STRUCT DAQSettings s InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_RES0" + \ @@ -2212,8 +2209,7 @@ Function HandlesStuckFIFOProperly([str]) CtrlNamedBackGround ExecuteDuringDAQ, start, period=30, proc=UseFakeFIFOThreadBeingStuck_IGNORE End -Function HandlesStuckFIFOProperly_REENTRY([str]) - string str +Function HandlesStuckFIFOProperly_REENTRY([string str]) variable stopReason diff --git a/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf b/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf index a6cf475a57..660a2aa12b 100644 --- a/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf +++ b/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf @@ -53,7 +53,7 @@ static Function RestoreAndSaveConfiguration([string str]) WAVE/T wFileList = ListToTextWave(fileList, "|") for(fileName : wFileList) [fContent, fName] = LoadTextFile(fileName) - jsonId = JSON_Parse(fContent) + jsonId = JSON_Parse(fContent) if(JSON_Exists(jsonId, stimsetJsonPath)) FixupJSONConfigImplMain(jsonId, str) @@ -75,7 +75,7 @@ static Function RestoreAndSaveConfiguration([string str]) CHECK(FileExists(workingFolder + newConfig)) CHECK(FileExists(workingFolder + newRigConfig)) - [fContent, fName] = LoadTextFile(workingFolder + defaultRigConfig) + [fContent, fName] = LoadTextFile(workingFolder + defaultRigConfig) [fContentRig, fName] = LoadTextFile(workingFolder + newRigConfig) CHECK_EQUAL_STR(fContent, fContentRig) diff --git a/Packages/tests/HardwareBasic/UTF_DAEphys.ipf b/Packages/tests/HardwareBasic/UTF_DAEphys.ipf index e673280844..47677e064f 100644 --- a/Packages/tests/HardwareBasic/UTF_DAEphys.ipf +++ b/Packages/tests/HardwareBasic/UTF_DAEphys.ipf @@ -12,8 +12,7 @@ static Function GlobalPreAcq(string device) End // UTF_TD_GENERATOR DeviceNameGeneratorMD1 -Function CheckIfAllControlsReferStateWv([str]) - string str +Function CheckIfAllControlsReferStateWv([string str]) string list, ctrl, stri, expected, lbl, uniqueControls variable i, numEntries, val, channelIndex, channelType, controlType, index, oldVal @@ -165,8 +164,7 @@ Function CheckIfAllControlsReferStateWv([str]) End // UTF_TD_GENERATOR DeviceNameGeneratorMD1 -Function CheckStartupSettings([str]) - string str +Function CheckStartupSettings([string str]) string unlockedDevice, list, ctrl, expected, lbl variable i, numEntries, val, channelIndex, channelType, controlType, index, oldVal @@ -238,8 +236,7 @@ Function CheckStartupSettings([str]) End // UTF_TD_GENERATOR DeviceNameGeneratorMD1 -Function CheckStimsetPopupMetadata([str]) - string str +Function CheckStimsetPopupMetadata([string str]) string controls, stimsetlist, ctrl, menuExp variable i, numControls, channelIndex, channelType, controlType @@ -288,8 +285,7 @@ Function AllChannelControlsWork([string str]) End // UTF_TD_GENERATOR DeviceNameGeneratorMD1 -Function CheckIfConfigurationRestoresMCCFilterGain([str]) - string str +Function CheckIfConfigurationRestoresMCCFilterGain([string str]) string rewrittenConfig, fName variable val, gain, filterFreq, headStage, jsonID @@ -390,10 +386,10 @@ static Function ComplainsAboutVanishingEpoch_REENTRY([STRUCT IUTF_MDATA &md]) CHECK_WAVE(textualValues, TEXT_WAVE) // check that we have info for the vanished epoch - WAVE/T/Z e0 = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, "E0") + WAVE/Z/T e0 = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, "E0") CHECK_WAVE(e0, FREE_WAVE | TEXT_WAVE) - WAVE/T/Z e1 = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, "E1") + WAVE/Z/T e1 = EP_GetEpochs(numericalValues, textualValues, sweepNo, XOP_CHANNEL_TYPE_DAC, DAC, "E1") CHECK_WAVE(e1, FREE_WAVE | TEXT_WAVE) // remove left over from ??? diff --git a/Packages/tests/HardwareBasic/UTF_Databrowser.ipf b/Packages/tests/HardwareBasic/UTF_Databrowser.ipf index 70ac80fe06..b54ef79c1a 100644 --- a/Packages/tests/HardwareBasic/UTF_Databrowser.ipf +++ b/Packages/tests/HardwareBasic/UTF_Databrowser.ipf @@ -17,23 +17,23 @@ Function CanFindAllDataBrowsers([string str]) // second db CreateLockedDatabrowser(str) - WAVE/T/Z matches = DB_FindAllDataBrowser(str) + WAVE/Z/T matches = DB_FindAllDataBrowser(str) CHECK_WAVE(matches, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(matches, ROWS), 2) - WAVE/T/Z matchesAll = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_ALL) + WAVE/Z/T matchesAll = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_ALL) CHECK_EQUAL_WAVES(matches, matchesAll) - WAVE/T/Z matchesUser = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_USER) + WAVE/Z/T matchesUser = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_USER) CHECK_EQUAL_WAVES(matches, matchesUser) - WAVE/T/Z matchesAuto = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_AUTOMATION) + WAVE/Z/T matchesAuto = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_AUTOMATION) CHECK_WAVE(matchesAuto, NULL_WAVE) DB_GetBoundDataBrowser(str, mode = BROWSER_MODE_AUTOMATION) - WAVE/T/Z matchesAuto = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_AUTOMATION) + WAVE/Z/T matchesAuto = DB_FindAllDataBrowser(str, mode = BROWSER_MODE_AUTOMATION) CHECK_WAVE(matchesAuto, TEXT_WAVE) CHECK_EQUAL_VAR(DimSize(matchesAuto, ROWS), 1) @@ -63,14 +63,14 @@ static Function/WAVE AllDatabrowserSubWindows() win = DB_OpenDatabrowser() - WAVE/T/Z allWindows = ListToTextWave(GetAllWindows(win), ";") + WAVE/Z/T allWindows = ListToTextWave(GetAllWindows(win), ";") CHECK_WAVE(allWindows, TEXT_WAVE) allWindows[] = StringFromList(1, allWindows[p], "#") RemoveTextWaveEntry1D(allWindows, "", all = 1) - WAVE/T/Z allWindowsUnique = GetUniqueEntries(allWindows) + WAVE/Z/T allWindowsUnique = GetUniqueEntries(allWindows) CHECK_WAVE(allWindowsUnique, TEXT_WAVE) SetDimensionLabels(allWindowsUnique, TextWaveToList(allWindowsUnique, ";"), ROWS) diff --git a/Packages/tests/HardwareBasic/UTF_Epochs.ipf b/Packages/tests/HardwareBasic/UTF_Epochs.ipf index 3fcb75924f..b667550f9a 100644 --- a/Packages/tests/HardwareBasic/UTF_Epochs.ipf +++ b/Packages/tests/HardwareBasic/UTF_Epochs.ipf @@ -6,7 +6,7 @@ // Check the root datafolder for waves which might be present and could help debugging static Constant OODDAQ_PRECISION = 0.001 -static Constant OTHER_EPOCHS_PRECISION = 0.050 // in ms +static Constant OTHER_EPOCHS_PRECISION = 0.050 // in ms static Constant MAX_ITERATIONS = 100000 static Function GlobalPreAcq(string device) @@ -124,7 +124,7 @@ static Function TestEpochOverlap(WAVE startT_all, WAVE endT_all, WAVE isOodDAQ_a variable i, level, epochCnt, ret, refStart, refEnd WAVE/Z startT, endT, levels - WAVE/T/Z description + WAVE/Z/T description [startT, endT, levels, description] = RemoveOodDAQEntries(startT_all, endT_all, isOodDAQ_all, levels_all, description_all) CHECK_EQUAL_WAVES(startT, endT, mode = DIMENSION_SIZES) @@ -863,11 +863,11 @@ static Function EP_TestUserEpochs_REENTRY([str]) nextSweep = GetSetVariable(str, "SetVar_Sweep") for(i = 0; i < nextSweep; i += 1) - WAVE/T/Z epochLBN = GetLastSetting(textualValues, i, EPOCHS_ENTRY_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T epochLBN = GetLastSetting(textualValues, i, EPOCHS_ENTRY_KEY, DATA_ACQUISITION_MODE) CHECK_WAVE(epochLBN, TEXT_WAVE) for(j = 0; j < 2; j += 1) - WAVE/T/Z epochWave = EP_EpochStrToWave(epochLBN[j]) + WAVE/Z/T epochWave = EP_EpochStrToWave(epochLBN[j]) CHECK_WAVE(epochWave, TEXT_WAVE) DAC = AFH_GetDACFromHeadstage(str, j) diff --git a/Packages/tests/HardwareBasic/UTF_HardwareBasic.ipf b/Packages/tests/HardwareBasic/UTF_HardwareBasic.ipf index 7cb4d596fc..2da40440cf 100644 --- a/Packages/tests/HardwareBasic/UTF_HardwareBasic.ipf +++ b/Packages/tests/HardwareBasic/UTF_HardwareBasic.ipf @@ -25,6 +25,7 @@ // Entry point for UTF Function run() + return RunWithOpts(instru = DoInstrumentation()) End diff --git a/Packages/tests/HardwareBasic/UTF_HardwareTestsWithBUG.ipf b/Packages/tests/HardwareBasic/UTF_HardwareTestsWithBUG.ipf index 20eff6a407..adae082b7d 100644 --- a/Packages/tests/HardwareBasic/UTF_HardwareTestsWithBUG.ipf +++ b/Packages/tests/HardwareBasic/UTF_HardwareTestsWithBUG.ipf @@ -28,6 +28,7 @@ Function CheckSweepSavingCompatible([string str]) End Function CheckSweepSavingCompatible_REENTRY([string str]) + variable sweepNo CHECK_EQUAL_VAR(GetSetVariable(str, "SetVar_Sweep"), 0) diff --git a/Packages/tests/HardwareBasic/UTF_SweepSkipping.ipf b/Packages/tests/HardwareBasic/UTF_SweepSkipping.ipf index 4370826069..98798a43c7 100644 --- a/Packages/tests/HardwareBasic/UTF_SweepSkipping.ipf +++ b/Packages/tests/HardwareBasic/UTF_SweepSkipping.ipf @@ -84,7 +84,7 @@ static Function SweepSkipping_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) WAVE numericalValues = GetLBNumericalValues(str) - WAVE/T/Z foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"StimulusSetA_DA_0", "StimulusSetB_DA_0", "StimulusSetC_DA_0", "StimulusSetD_DA_0"}) @@ -132,7 +132,7 @@ static Function SweepSkippingAdvanced_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) WAVE numericalValues = GetLBNumericalValues(str) - WAVE/T/Z foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"StimulusSetA_DA_0", "StimulusSetA_DA_0", "StimulusSetA_DA_0", "StimulusSetA_DA_0"}) @@ -219,7 +219,7 @@ static Function SkipSweepsBackDuringITI_REENTRY([str]) WAVE/T textualValues = GetLBTextualValues(str) WAVE numericalValues = GetLBNumericalValues(str) - WAVE/T/Z foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSettingTextEachRAC(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, headstage, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) CHECK_EQUAL_TEXTWAVES(foundStimSets, {"StimulusSetA_DA_0", "StimulusSetA_DA_0", "StimulusSetA_DA_0", "StimulusSetA_DA_0"}) diff --git a/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf b/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf index c050328907..f515437637 100644 --- a/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf +++ b/Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf @@ -206,7 +206,7 @@ End static Function CheckTPEntriesFromLBN_REENTRY([string str]) // sweep 0 - WAVE/WAVE/Z entries_S0_DAQ = GetTPLBNEntries_IGNORE(str, 0, DATA_ACQUISITION_MODE) + WAVE/Z/WAVE entries_S0_DAQ = GetTPLBNEntries_IGNORE(str, 0, DATA_ACQUISITION_MODE) CHECK_WAVE(entries_S0_DAQ, WAVE_WAVE) CHECK_EQUAL_WAVES(entries_S0_DAQ[%baselineFrac], {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0.30}, mode = WAVE_DATA, tol = 1e-8) @@ -227,7 +227,7 @@ static Function CheckTPEntriesFromLBN_REENTRY([string str]) CHECK_WAVE(entries_S0_DAQ[%autoTPQC], NULL_WAVE) - WAVE/WAVE/Z entries_S0_TP = GetTPLBNEntries_IGNORE(str, 0, TEST_PULSE_MODE) + WAVE/Z/WAVE entries_S0_TP = GetTPLBNEntries_IGNORE(str, 0, TEST_PULSE_MODE) CHECK_WAVE(entries_S0_TP, WAVE_WAVE) CHECK_EQUAL_WAVES(entries_S0_TP[%baselineFrac], {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0.30}, mode = WAVE_DATA, tol = 1e-8) @@ -249,7 +249,7 @@ static Function CheckTPEntriesFromLBN_REENTRY([string str]) CHECK_WAVE(entries_S0_TP[%autoTPQC], NULL_WAVE) // sweep 1 - WAVE/WAVE/Z entries_S1_DAQ = GetTPLBNEntries_IGNORE(str, 1, DATA_ACQUISITION_MODE) + WAVE/Z/WAVE entries_S1_DAQ = GetTPLBNEntries_IGNORE(str, 1, DATA_ACQUISITION_MODE) CHECK_WAVE(entries_S1_DAQ, WAVE_WAVE) CHECK_EQUAL_WAVES(entries_S1_DAQ[%baselineFrac], {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0.30}, mode = WAVE_DATA, tol = 1e-8) @@ -270,7 +270,7 @@ static Function CheckTPEntriesFromLBN_REENTRY([string str]) CHECK_WAVE(entries_S1_DAQ[%autoTPQC], NULL_WAVE) - WAVE/WAVE/Z entries_S1_TP = GetTPLBNEntries_IGNORE(str, 1, TEST_PULSE_MODE) + WAVE/Z/WAVE entries_S1_TP = GetTPLBNEntries_IGNORE(str, 1, TEST_PULSE_MODE) CHECK_WAVE(entries_S1_TP, WAVE_WAVE) CHECK_EQUAL_WAVES(entries_S1_TP[%baselineFrac], {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0.30}, mode = WAVE_DATA, tol = 1e-8) @@ -292,7 +292,7 @@ static Function CheckTPEntriesFromLBN_REENTRY([string str]) CHECK_WAVE(entries_S1_TP[%autoTPQC], NULL_WAVE) // sweep 2 - WAVE/WAVE/Z entries_S2_DAQ = GetTPLBNEntries_IGNORE(str, 2, DATA_ACQUISITION_MODE) + WAVE/Z/WAVE entries_S2_DAQ = GetTPLBNEntries_IGNORE(str, 2, DATA_ACQUISITION_MODE) CHECK_WAVE(entries_S2_DAQ, WAVE_WAVE) CHECK_EQUAL_WAVES(entries_S2_DAQ[%baselineFrac], {NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0.30}, mode = WAVE_DATA, tol = 1e-8) @@ -313,7 +313,7 @@ static Function CheckTPEntriesFromLBN_REENTRY([string str]) CHECK_WAVE(entries_S2_DAQ[%autoTPQC], NULL_WAVE) - WAVE/WAVE/Z entries_S2_TP = GetTPLBNEntries_IGNORE(str, 2, TEST_PULSE_MODE) + WAVE/Z/WAVE entries_S2_TP = GetTPLBNEntries_IGNORE(str, 2, TEST_PULSE_MODE) CHECK_WAVE(entries_S2_TP, WAVE_WAVE) Make/N=(DimSize(entries_S2_TP, ROWS))/FREE validWaves = WaveExists(entries_S2_TP[p]) diff --git a/Packages/tests/HardwareBasic/UTF_TrackSweepCounts.ipf b/Packages/tests/HardwareBasic/UTF_TrackSweepCounts.ipf index 33be2eeac7..5bf856ead1 100644 --- a/Packages/tests/HardwareBasic/UTF_TrackSweepCounts.ipf +++ b/Packages/tests/HardwareBasic/UTF_TrackSweepCounts.ipf @@ -128,7 +128,7 @@ static Function AllTests(t, devices) sweepNo = ExtractSweepNumber(NameOfWave(sweep)) CHECK_GE_VAR(sweepNo, 0) - WAVE/T/Z foundStimSets = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) REQUIRE_WAVE(foundStimSets, TEXT_WAVE) // HS 0 diff --git a/Packages/tests/HistoricData/UTF_AttemptNWB2ExportOnOldData.ipf b/Packages/tests/HistoricData/UTF_AttemptNWB2ExportOnOldData.ipf index 309a0470be..ac9f3d139a 100644 --- a/Packages/tests/HistoricData/UTF_AttemptNWB2ExportOnOldData.ipf +++ b/Packages/tests/HistoricData/UTF_AttemptNWB2ExportOnOldData.ipf @@ -30,9 +30,9 @@ static Function TestSweepBrowserExportToNWB([string str]) string file, win, abWin, sweepBrowsers, fileType, dataFolder, nwbFileName - file = "input:" + str + file = "input:" + str [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}) - win = StringFromList(0, sweepBrowsers) + win = StringFromList(0, sweepBrowsers) WAVE/T map = GetAnalysisBrowserMap() fileType = map[0][%FileType] diff --git a/Packages/tests/HistoricData/UTF_EpochRecreation.ipf b/Packages/tests/HistoricData/UTF_EpochRecreation.ipf index ef58de6776..c5a1f05360 100644 --- a/Packages/tests/HistoricData/UTF_EpochRecreation.ipf +++ b/Packages/tests/HistoricData/UTF_EpochRecreation.ipf @@ -19,7 +19,7 @@ Function ExportEpochsFromFileToDF(string dfNameTemp) file = S_fileName [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1, loadStimsets = 1, absolutePaths = 1) - win = StringFromList(0, sweepBrowsers) + win = StringFromList(0, sweepBrowsers) WAVE/T map = MIES_SB#SB_GetSweepBrowserMapFromGraph(win) if(!GetNumberFromWaveNote(map, NOTE_INDEX)) @@ -123,7 +123,7 @@ static Function TestEpochRecreationShortNames([string str]) file = "input:" + str [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1, loadStimsets = 1) - win = StringFromList(0, sweepBrowsers) + win = StringFromList(0, sweepBrowsers) WAVE/T map = MIES_SB#SB_GetSweepBrowserMapFromGraph(win) REQUIRE_GE_VAR(GetNumberFromWaveNote(map, NOTE_INDEX), 0) WAVE/Z/T devices = SB_GetDeviceList(win) diff --git a/Packages/tests/HistoricData/UTF_HistoricAnalysisBrowser.ipf b/Packages/tests/HistoricData/UTF_HistoricAnalysisBrowser.ipf index 1b08d76e40..b980656195 100644 --- a/Packages/tests/HistoricData/UTF_HistoricAnalysisBrowser.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricAnalysisBrowser.ipf @@ -116,7 +116,7 @@ static Function LoadDependentStimsetsFromPXP() DownloadFilesIfRequired(files) [abWin, sweepBrowsers] = OpenAnalysisBrowser(files, loadStimsets = 1) - formulaSet = MIES_WB#WB_StimsetChildren(stimset = "baseset_DA_0") + formulaSet = MIES_WB#WB_StimsetChildren(stimset = "baseset_DA_0") CHECK_EQUAL_STR(formulaSet, "formula_da_0;") KillWindow $abWin diff --git a/Packages/tests/HistoricData/UTF_HistoricDashboard.ipf b/Packages/tests/HistoricData/UTF_HistoricDashboard.ipf index b5ec1e2098..7cd8d52357 100644 --- a/Packages/tests/HistoricData/UTF_HistoricDashboard.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricDashboard.ipf @@ -54,7 +54,7 @@ Function TestDashboardWithHistoricData([string str]) file = "input:" + str [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) - sbWin = StringFromList(0, sweepBrowsers) + sbWin = StringFromList(0, sweepBrowsers) CHECK_PROPER_STR(sbWin) bsPanel = BSP_GetPanel(sbWin) PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_DS", val = 1) @@ -94,7 +94,7 @@ Function TestDashboardDependentControlHandling() file = "input:" + files[0] [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) - sweepBrowser = StringFromList(0, sweepBrowsers, ";") + sweepBrowser = StringFromList(0, sweepBrowsers, ";") bsPanel = BSP_GetPanel(sweepBrowser) CHECK(WindowExists(bsPanel)) @@ -149,7 +149,7 @@ Function TestDashboardSelections() file = "input:" + files[0] [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) - sweepBrowser = StringFromList(0, sweepBrowsers, ";") + sweepBrowser = StringFromList(0, sweepBrowsers, ";") bsPanel = BSP_GetPanel(sweepBrowser) CHECK(WindowExists(bsPanel)) diff --git a/Packages/tests/HistoricData/UTF_HistoricData.ipf b/Packages/tests/HistoricData/UTF_HistoricData.ipf index 3dec49f95c..0974b30bfa 100644 --- a/Packages/tests/HistoricData/UTF_HistoricData.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricData.ipf @@ -29,6 +29,7 @@ static StrConstant HTTP_FOLDER_URL = "https://www.byte-physics.de/Downloads/alle // Entry point for UTF Function run() + return RunWithOpts(instru = DoInstrumentation()) End @@ -108,15 +109,16 @@ Function RunWithOpts([string testcase, string testsuite, variable allowdebug, va End Function TEST_BEGIN_OVERRIDE(string name) + TestBeginCommon() End Function TEST_END_OVERRIDE(string name) + TestEndCommon() End -Function TEST_CASE_BEGIN_OVERRIDE(name) - string name +Function TEST_CASE_BEGIN_OVERRIDE(string name) TestCaseBeginCommon(name) End diff --git a/Packages/tests/HistoricData/UTF_HistoricEpochClipping.ipf b/Packages/tests/HistoricData/UTF_HistoricEpochClipping.ipf index fe83f7fe9b..9e064a7b91 100644 --- a/Packages/tests/HistoricData/UTF_HistoricEpochClipping.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricEpochClipping.ipf @@ -12,7 +12,7 @@ static Function TestEpochClipping([string str]) file = "input:" + str [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) - sbWin = StringFromList(0, sweepBrowsers) + sbWin = StringFromList(0, sweepBrowsers) CHECK_PROPER_STR(sbWin) bsPanel = BSP_GetPanel(sbWin) diff --git a/Packages/tests/HistoricData/UTF_HistoricSweepUpgrade.ipf b/Packages/tests/HistoricData/UTF_HistoricSweepUpgrade.ipf index 9c799115e9..3d871acfb9 100644 --- a/Packages/tests/HistoricData/UTF_HistoricSweepUpgrade.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricSweepUpgrade.ipf @@ -13,7 +13,7 @@ static Function TestSweepUpgrade([string str]) file = "input:" + str [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) - sbWin = StringFromList(0, sweepBrowsers) + sbWin = StringFromList(0, sweepBrowsers) CHECK_PROPER_STR(sbWin) bsPanel = BSP_GetPanel(sbWin) diff --git a/Packages/tests/PAPlot/UTF_PAPlot.ipf b/Packages/tests/PAPlot/UTF_PAPlot.ipf index a7fcf29f44..158ac7772f 100644 --- a/Packages/tests/PAPlot/UTF_PAPlot.ipf +++ b/Packages/tests/PAPlot/UTF_PAPlot.ipf @@ -9,6 +9,7 @@ // Entry point for UTF Function run() + return RunWithOpts(instru = DoInstrumentation()) End diff --git a/Packages/tests/PAPlot/UTF_PA_Tests.ipf b/Packages/tests/PAPlot/UTF_PA_Tests.ipf index 77d41fb8df..1cc9b1dfc9 100644 --- a/Packages/tests/PAPlot/UTF_PA_Tests.ipf +++ b/Packages/tests/PAPlot/UTF_PA_Tests.ipf @@ -606,14 +606,14 @@ static Function PAT_VerifyImageAxes(string graph, string traceName, variable ach xLayoutCoord = multiGraphMode ? 0 : aregion - 1 yLayoutCoord = multiGraphMode ? 0 : achan - 1 - ref_from = xLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) - ref_to = (xLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) + ref_from = xLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) + ref_to = (xLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) [from, to] = PAT_GetAxisLayout(graph, xaxis) CHECK_GE_VAR(from, ref_from) CHECK_LE_VAR(to, ref_to) - ref_to = 100 - yLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) - ref_from = 100 - (yLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) + ref_to = 100 - yLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) + ref_from = 100 - (yLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) [from, to] = PAT_GetAxisLayout(graph, yaxis) CHECK_GE_VAR(from, ref_from) CHECK_LE_VAR(to, ref_to) @@ -659,15 +659,15 @@ static Function PAT_VerifyTraceAxes(string graph, string traceName, variable ach xLayoutCoord = multiGraphMode ? 0 : aregion - 1 yLayoutCoord = multiGraphMode ? 0 : achan - 1 - ref_from = xLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) - ref_to = (xLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) + ref_from = xLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) + ref_to = (xLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) [from, to] = PAT_GetAxisLayout(graph, xaxis) // TOOD rewrite using PAT_CHECKSmallOrClose or CHECK_SMALL_VAR/CHECK_CLOSE_VAR CHECK_GE_VAR(from, ref_from) CHECK_LE_VAR(to, ref_to) - ref_to = 100 - yLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) - ref_from = 100 - (yLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) + ref_to = 100 - yLayoutCoord * ONE_TO_PERCENT / sqrt(layoutSize) + ref_from = 100 - (yLayoutCoord + 1) * ONE_TO_PERCENT / sqrt(layoutSize) [from, to] = PAT_GetAxisLayout(graph, yaxis) // TOOD rewrite using PAT_CHECKSmallOrClose or CHECK_SMALL_VAR/CHECK_CLOSE_VAR CHECK_GE_VAR(from, ref_from) @@ -1851,6 +1851,7 @@ static Function PAT_FailedPulseCheck1() End Function PAT_FailedPulseCheckVC() + string bspName, graph STRUCT PA_Test patest0 STRUCT PA_Test patest4 diff --git a/Packages/tests/UTF_BackgroundFunctions.ipf b/Packages/tests/UTF_BackgroundFunctions.ipf index 5aadffe5b4..d76174022c 100644 --- a/Packages/tests/UTF_BackgroundFunctions.ipf +++ b/Packages/tests/UTF_BackgroundFunctions.ipf @@ -4,8 +4,7 @@ #pragma ModuleName=BackgroundFunctions /// @brief Background function to wait until DAQ is finished. -Function WaitUntilDAQDone_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function WaitUntilDAQDone_IGNORE(STRUCT WMBackgroundStruct &s) string dev variable numEntries, i @@ -35,8 +34,7 @@ End /// /// If it is finished pushes the next two, one setup and the /// corresponding `Test`, testcases to the queue. -Function WaitUntilTPDone_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function WaitUntilTPDone_IGNORE(STRUCT WMBackgroundStruct &s) string device variable numEntries, i @@ -62,8 +60,7 @@ Function WaitUntilTPDone_IGNORE(s) return 1 End -Function StopAcqDuringITI_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopAcqDuringITI_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -78,8 +75,7 @@ Function StopAcqDuringITI_IGNORE(s) return 0 End -Function StopAcqByUnlocking_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopAcqByUnlocking_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -94,8 +90,7 @@ Function StopAcqByUnlocking_IGNORE(s) return 0 End -Function StopAcqByUncompiled_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopAcqByUncompiled_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -110,8 +105,7 @@ Function StopAcqByUncompiled_IGNORE(s) return 0 End -Function StartTPDuringITI_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StartTPDuringITI_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -126,8 +120,7 @@ Function StartTPDuringITI_IGNORE(s) return 0 End -Function SkipToEndDuringITI_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function SkipToEndDuringITI_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -142,8 +135,7 @@ Function SkipToEndDuringITI_IGNORE(s) return 0 End -Function SkipSweepBackDuringITI_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function SkipSweepBackDuringITI_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -159,8 +151,7 @@ Function SkipSweepBackDuringITI_IGNORE(s) return 0 End -Function StopAcq_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopAcq_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -175,14 +166,12 @@ Function StopAcq_IGNORE(s) return 1 End -Function JustDelay_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function JustDelay_IGNORE(STRUCT WMBackgroundStruct &s) return 1 End -Function AutoPipetteOffsetAndStopTP_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function AutoPipetteOffsetAndStopTP_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -193,8 +182,7 @@ Function AutoPipetteOffsetAndStopTP_IGNORE(s) return 1 End -Function StopTP_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopTP_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -203,8 +191,7 @@ Function StopTP_IGNORE(s) return 1 End -Function StartAcq_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StartAcq_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -214,8 +201,7 @@ Function StartAcq_IGNORE(s) return 1 End -Function ChangeStimSet_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function ChangeStimSet_IGNORE(STRUCT WMBackgroundStruct &s) string ctrl SVAR devices = $GetLockedDevices() @@ -235,8 +221,7 @@ Function ChangeStimSet_IGNORE(s) return 0 End -Function ClampModeDuringSweep_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function ClampModeDuringSweep_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -251,8 +236,7 @@ Function ClampModeDuringSweep_IGNORE(s) return 0 End -Function ClampModeDuringITI_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function ClampModeDuringITI_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -267,8 +251,7 @@ Function ClampModeDuringITI_IGNORE(s) return 0 End -Function StopTPAfterFiveSeconds_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function StopTPAfterFiveSeconds_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -278,8 +261,7 @@ Function StopTPAfterFiveSeconds_IGNORE(s) return 1 End -Function AddLabnotebookEntries_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function AddLabnotebookEntries_IGNORE(STRUCT WMBackgroundStruct &s) SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -301,6 +283,7 @@ Function AddLabnotebookEntries_IGNORE(s) End Function StopTPWhenWeHaveOne(STRUCT WMBackgroundStruct &s) + SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) @@ -313,6 +296,7 @@ Function StopTPWhenWeHaveOne(STRUCT WMBackgroundStruct &s) End Function StopTPWhenFinished(STRUCT WMBackgroundStruct &s) + SVAR devices = $GetLockedDevices() string device = StringFromList(0, devices) diff --git a/Packages/tests/UTF_DataGenerators.ipf b/Packages/tests/UTF_DataGenerators.ipf index 211f336ce8..481394df00 100644 --- a/Packages/tests/UTF_DataGenerators.ipf +++ b/Packages/tests/UTF_DataGenerators.ipf @@ -13,6 +13,7 @@ Function/WAVE MajorNWBVersions() End Function/WAVE IndexingPossibilities() + Make/FREE wv = {0, 1} SetDimensionLabels(wv, "UnlockedIndexing;LockedIndexing", ROWS) @@ -21,6 +22,7 @@ Function/WAVE IndexingPossibilities() End Function/WAVE InsertedTPPossibilities() + Make/FREE wv = {0, 1} SetDimensionLabels(wv, "NoInsertedTP;WithInsertedTP", ROWS) @@ -45,6 +47,7 @@ Function/WAVE SingleMultiDeviceDAQ() End Function/WAVE DeviceNameGenerator() + return DeviceNameGeneratorMD1() End @@ -107,6 +110,7 @@ Function/WAVE DeviceNameGeneratorMD0() End Function/WAVE NWBVersionStrings() + variable i, numEntries string name @@ -115,6 +119,7 @@ Function/WAVE NWBVersionStrings() End Function/WAVE NeuroDataRefTree() + variable i, numEntries string name @@ -126,6 +131,7 @@ Function/WAVE NeuroDataRefTree() End Function/WAVE SpikeCountsStateValues() + variable numEntries = 6 variable idx @@ -274,6 +280,7 @@ static Function/WAVE SF_TestVariablesGen() End Function/WAVE GetMiesMacrosWithPanelType() + WAVE/T allMiesMacros = GetMIESMacros() Make/FREE/T panelsWithoutType = {"IDM_Headstage_Panel", "IDM_Popup_Panel", "DebugPanel", "ExportSettingsPanel", "PSXPanel"} diff --git a/Packages/tests/UTF_HardwareHelperFunctions.ipf b/Packages/tests/UTF_HardwareHelperFunctions.ipf index fe40fbc167..dc9f89a1d3 100644 --- a/Packages/tests/UTF_HardwareHelperFunctions.ipf +++ b/Packages/tests/UTF_HardwareHelperFunctions.ipf @@ -11,8 +11,7 @@ /// @file UTF_HardwareHelperFunctions.ipf /// @brief This file holds helper functions for the hardware tests -Function TEST_BEGIN_OVERRIDE(name) - string name +Function TEST_BEGIN_OVERRIDE(string name) variable needsLoading string filepath @@ -46,11 +45,11 @@ Function TEST_BEGIN_OVERRIDE(name) End Function TEST_END_OVERRIDE(string name) + TestEndCommon() End -Function TEST_CASE_BEGIN_OVERRIDE(name) - string name +Function TEST_CASE_BEGIN_OVERRIDE(string name) variable numWindows, i string list, reentryFuncName, win, experimentName @@ -88,8 +87,7 @@ Function TEST_CASE_BEGIN_OVERRIDE(name) DeleteFile/Z GetExperimentNWBFileForExport() End -Function TEST_CASE_END_OVERRIDE(name) - string name +Function TEST_CASE_END_OVERRIDE(string name) string dev, experimentNWBFile, baseFolder, nwbFile, wlName variable numEntries, i, fileID, nwbVersion, expensiveChecks @@ -208,7 +206,7 @@ static Function CheckUserEpochsFromChunks(string dev) endif DAC = AFH_GetDACFromHeadstage(dev, j) - WAVE/T/Z userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, EPOCH_SHORTNAME_USER_PREFIX + PSQ_BASELINE_CHUNK_SHORT_NAME_PREFIX + "[0-9]+", treelevel = EPOCH_USER_LEVEL) + WAVE/Z/T userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, EPOCH_SHORTNAME_USER_PREFIX + PSQ_BASELINE_CHUNK_SHORT_NAME_PREFIX + "[0-9]+", treelevel = EPOCH_USER_LEVEL) if(!WaveExists(userChunkEpochs)) continue @@ -343,12 +341,13 @@ Function RegisterReentryFunction(string testcase) endif End -Function CALLABLE_PROTO(device) - string device +Function CALLABLE_PROTO(string device) + FAIL() End Function LoadStimsets() + string filename = GetTestStimsetFullFilePath() NWB_LoadAllStimsets(filename = filename, overwrite = 1) End @@ -511,7 +510,7 @@ static Function CheckDashboard(string device, WAVE headstageQC) databrowser = DB_FindDataBrowser(device) DFREF dfr = BSP_GetFolder(databrowser, MIES_BSP_PANEL_FOLDER) - WAVE/T/Z listWave = GetAnaFuncDashboardListWave(dfr) + WAVE/Z/T listWave = GetAnaFuncDashboardListWave(dfr) CHECK_WAVE(listWave, TEXT_WAVE) // Check that we have acquired some sweeps @@ -560,6 +559,7 @@ static Function CheckAnaFuncVersion(string device, variable type) End Function CommonAnalysisFunctionChecks(string device, variable sweepNo, WAVE headstageQC) + string key variable type, DAC, index @@ -626,7 +626,7 @@ static Function CheckDAStimulusSets(string device, variable sweepNo, variable ty setPassed = GetLastSettingIndepSCI(numericalValues, sweepNo, key, PSQ_TEST_HEADSTAGE, UNKNOWN_MODE) CHECK(IsFinite(setPassed)) - WAVE/T/Z results = GetLastSetting(textualValues, sweepNo, "Stim Wave Name", DATA_ACQUISITION_MODE) + WAVE/Z/T results = GetLastSetting(textualValues, sweepNo, "Stim Wave Name", DATA_ACQUISITION_MODE) CHECK_WAVE(results, TEXT_WAVE) previousStimset = results[PSQ_TEST_HEADSTAGE] CHECK_PROPER_STR(previousStimset) @@ -707,7 +707,7 @@ static Function CheckRangeOfUserLabnotebookKeys(string device, variable type, va WAVE/Z entries = MIES_LBV#LBV_GetAllLogbookParamNames(textualValues, numericalValues) CHECK_WAVE(entries, TEXT_WAVE) - WAVE/T/Z allUserEntries = GrepTextWave(entries, LABNOTEBOOK_USER_PREFIX + ".*") + WAVE/Z/T allUserEntries = GrepTextWave(entries, LABNOTEBOOK_USER_PREFIX + ".*") CHECK_WAVE(allUserEntries, TEXT_WAVE) WAVE/Z sweeps = AFH_GetSweepsFromSameRACycle(numericalValues, sweepNoRef) @@ -831,6 +831,7 @@ static Function CheckRangeOfUserLabnotebookKeys(string device, variable type, va End Function CheckPublishedMessage(string device, variable type) + string expectedFilter, msg variable jsonID @@ -951,6 +952,7 @@ static Function TestSweepReconstruction_IGNORE(string device) End Function [string baseFolder, string nwbFile] GetUniqueNWBFileForExport(variable nwbVersion) + string suffix ASSERT(EnsureValidNWBVersion(nwbVersion), "Invalid nwb version") @@ -980,6 +982,7 @@ Function/S GetExperimentNWBFileForExport() End Function CheckPSQChunkTimes(string dev, WAVE chunkTimes, [variable sweep]) + string shortNameFormat shortNameFormat = EPOCH_SHORTNAME_USER_PREFIX + PSQ_BASELINE_CHUNK_SHORT_NAME_PREFIX + "%d" @@ -1001,6 +1004,7 @@ End /// by default all sweeps in the stimset cycle are checked /// @param ignoreIncomplete [optional, defaults to false] ignore epochs from incomplete sweeps Function CheckUserEpochs(string dev, WAVE times, string shortNameFormat, [variable sweep, variable ignoreIncomplete]) + variable size, numChunks, index, expectedChunkCnt, sweepCnt, DAC variable i, j, k variable startTime, endTime, startRef, endRef @@ -1041,7 +1045,7 @@ Function CheckUserEpochs(string dev, WAVE times, string shortNameFormat, [variab DAC = AFH_GetDACFromHeadstage(dev, j) REQUIRE(IsFinite(DAC)) - WAVE/T/Z unacquiredEpoch = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, "UA") + WAVE/Z/T unacquiredEpoch = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, "UA") if(ignoreIncomplete) CHECK_WAVE(unacquiredEpoch, TEXT_WAVE) @@ -1050,7 +1054,7 @@ Function CheckUserEpochs(string dev, WAVE times, string shortNameFormat, [variab // also works with full names without %d being present regexp = "^" + ReplaceString("%d", shortNameFormat, "[0-9]+") + "$" - WAVE/T/Z userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, regexp, treelevel = EPOCH_USER_LEVEL) + WAVE/Z/T userChunkEpochs = EP_GetEpochs(numericalValues, textualValues, sweeps[i], XOP_CHANNEL_TYPE_DAC, DAC, regexp, treelevel = EPOCH_USER_LEVEL) if(!WaveExists(userChunkEpochs)) continue endif @@ -1099,6 +1103,7 @@ static Function OpenDatabrowser() End Function EnsureMCCIsOpen() + AI_FindConnectedAmps() WAVE ampMCC = GetAmplifierMultiClamps() @@ -1120,6 +1125,7 @@ Structure DAQSettings EndStructure Function AcquireDataDoNothing(string device) + PASS() End @@ -1202,9 +1208,7 @@ static Function/S ParseString(string str, string name, [string defValue]) End /// @brief Fill the #DAQSetttings structure from a specially crafted string -Function InitDAQSettingsFromString(s, str) - STRUCT DAQSettings &s - string str +Function InitDAQSettingsFromString(STRUCT DAQSettings &s, string str) variable md, ra, idx, lidx, bkg_daq, res, headstage, clampMode, ttl string elem, output @@ -1268,7 +1272,7 @@ Function InitDAQSettingsFromString(s, str) s.tpd = ParseNumber(str, "_TPD", defValue = NaN) - WAVE/T/Z hsConfig = ListToTextWave(str, "__") + WAVE/Z/T hsConfig = ListToTextWave(str, "__") if(WaveExists(hsConfig)) // Throw away first element as that is not a hsConfig element @@ -1416,6 +1420,7 @@ End /// must be called `GlobalPreAcq`/`GlobalPreInit` and the per test case ones /// `${testcase}_PreAcq`/`${testcase}_PreInit`. They must all be static. Function AcquireData_NG(STRUCT DAQSettings &s, string device) + string ctrl variable i, activeHS @@ -1629,6 +1634,7 @@ Function AcquireData_NG(STRUCT DAQSettings &s, string device) End Function CheckDAQStopReason(string device, variable stopReason, [variable sweepNo]) + string key key = "DAQ stop reason" @@ -1648,6 +1654,7 @@ Function CheckDAQStopReason(string device, variable stopReason, [variable sweepN End Function CheckStartStopMessages(string mode, string state) + string msg, actual, expected variable jsonID @@ -1660,8 +1667,7 @@ Function CheckStartStopMessages(string mode, string state) JSON_Release(jsonID) End -Function GetMinSamplingInterval([unit]) - string unit +Function GetMinSamplingInterval([string unit]) variable factor @@ -1699,6 +1705,7 @@ Function CreateLockedDAEphys(string device, [string unlockedDevice]) End Function CreateLockedDatabrowser(string device) + string win, bsPanel win = DB_OpenDatabrowser() @@ -1742,8 +1749,7 @@ threadsafe static Function FakeThreadMonitor_IGNORE(variable fixedFifoPos) while(1) End -Function UseFakeFIFOThreadWithTimeout_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function UseFakeFIFOThreadWithTimeout_IGNORE(STRUCT WMBackgroundStruct &s) variable fifoPos @@ -1763,8 +1769,7 @@ Function UseFakeFIFOThreadWithTimeout_IGNORE(s) return 0 End -Function UseFakeFIFOThreadBeingStuck_IGNORE(s) - STRUCT WMBackgroundStruct &s +Function UseFakeFIFOThreadBeingStuck_IGNORE(STRUCT WMBackgroundStruct &s) variable fifoPos diff --git a/Packages/tests/UTF_HelperFunctions.ipf b/Packages/tests/UTF_HelperFunctions.ipf index 05d1adc662..4ed5d1ec30 100644 --- a/Packages/tests/UTF_HelperFunctions.ipf +++ b/Packages/tests/UTF_HelperFunctions.ipf @@ -16,8 +16,7 @@ /// @file UTF_HelperFunctions.ipf /// @brief This file holds helper functions for the tests -Function/S PrependExperimentFolder_IGNORE(filename) - string filename +Function/S PrependExperimentFolder_IGNORE(string filename) PathInfo home CHECK(V_flag) @@ -205,7 +204,7 @@ Function PrepareForPublishTest() End static Function CheckMessageFilters_IGNORE(string filter) - WAVE/T/Z allFilters = FFI_GetAvailableMessageFilters() + WAVE/Z/T allFilters = FFI_GetAvailableMessageFilters() CHECK_WAVE(allFilters, TEXT_WAVE) FindValue/TXOP=4/TEXT=(filter) allFilters @@ -213,6 +212,7 @@ static Function CheckMessageFilters_IGNORE(string filter) End Function/S FetchPublishedMessage(string expectedFilter) + variable i string msg, filter @@ -250,6 +250,7 @@ End // all finite values not equal to 0 and 0 otherwise. Return `NaN` in all other // cases. Function GetEnvironmentVariableAsBoolean(string key) + variable value value = str2numSafe(GetEnvironmentVariable(key)) @@ -751,6 +752,7 @@ Function/S CreateFakeSweepData(string win, string device, [variable sweepNo, FUN End Function/S GetDataBrowserWithData() + string win, device, result device = HW_ITC_BuildDeviceString(StringFromList(0, DEVICE_TYPES_ITC), StringFromList(0, DEVICE_NUMBERS)) @@ -766,6 +768,7 @@ Function/S GetDataBrowserWithData() End Function/WAVE TrackAnalysisFunctionCalls() + variable i DFREF dfr = root: @@ -784,13 +787,12 @@ Function/WAVE TrackAnalysisFunctionCalls() return wv End -Function/WAVE TrackAnalysisFunctionOrder([numHeadstages]) - variable numHeadstages +Function/WAVE TrackAnalysisFunctionOrder([variable numHeadstages]) variable i DFREF dfr = root: - WAVE/D/Z/SDFR=dfr wv = anaFuncOrder + WAVE/Z/D/SDFR=dfr wv = anaFuncOrder if(WaveExists(wv)) return wv @@ -847,6 +849,7 @@ Function/WAVE GetTrackSweepCounts() End Function IsRunningInCI() + return !IsEmpty(GetEnvironmentVariable("CI")) End @@ -860,6 +863,7 @@ static Function RetrieveAllWindowsInCI() End Function TestBeginCommon() + RetrieveAllWindowsInCI() MEN_ClearPackageSettings() @@ -905,6 +909,7 @@ Function TestCaseEndCommon(string testcase, [variable restartAsyncFramework]) End Function SetAsyncChannelProperties(string device, WAVE asyncChannels, variable minValue, variable maxValue) + variable chan string ctrl, title, unit @@ -931,7 +936,8 @@ Function SetAsyncChannelProperties(string device, WAVE asyncChannels, variable m endfor End -Function/WAVE ExtractSweepsFromSFPairs(WAVE/T/Z wv) +Function/WAVE ExtractSweepsFromSFPairs(WAVE/Z/T wv) + variable numEntries, i if(!WaveExists(wv)) @@ -953,6 +959,7 @@ Function/WAVE ExtractSweepsFromSFPairs(WAVE/T/Z wv) End Function CheckForBugMessages() + variable bugCount_ts NVAR bugCount = $GetBugCount() @@ -984,8 +991,7 @@ End /// @brief Exhaust all memory so that only `amountOfFreeMemoryLeft` [GB] is left /// /// Unwise use of this function can break Igor! -Function ExhaustMemory(amountOfFreeMemoryLeft) - variable amountOfFreeMemoryLeft +Function ExhaustMemory(variable amountOfFreeMemoryLeft) variable i, expo = 10, err string str @@ -1008,6 +1014,7 @@ Function ExhaustMemory(amountOfFreeMemoryLeft) End Function LoadStimsetsIfRequired() + string filepath variable needsLoading @@ -1423,6 +1430,7 @@ static Function CompareEpochsHistoricChannel(WAVE/T epochChannelRef, WAVE/T epoc End Function ExecuteSweepFormulaInDB(string code, string win) + string sfFormula, bsPanel bsPanel = BSP_GetPanel(win) @@ -1437,8 +1445,7 @@ Function ExecuteSweepFormulaInDB(string code, string win) End /// @brief test two jsonIDs for equal content -Function CHECK_EQUAL_JSON(jsonID0, jsonID1) - variable jsonID0, jsonID1 +Function CHECK_EQUAL_JSON(variable jsonID0, variable jsonID1) string jsonDump0, jsonDump1 diff --git a/Packages/tests/UTF_TestNWBExportV1.ipf b/Packages/tests/UTF_TestNWBExportV1.ipf index 8007582747..f98768f9cd 100644 --- a/Packages/tests/UTF_TestNWBExportV1.ipf +++ b/Packages/tests/UTF_TestNWBExportV1.ipf @@ -128,7 +128,7 @@ static Function TestStimsetParamWaves(fileID, device, sweeps) break endif - WAVE/T/Z stimsets = GetLastSetting(textualValues, sweep, "Stim Wave Name", DATA_ACQUISITION_MODE) + WAVE/Z/T stimsets = GetLastSetting(textualValues, sweep, "Stim Wave Name", DATA_ACQUISITION_MODE) CHECK_WAVE(stimsets, TEXT_WAVE) for(j = 0; j < NUM_HEADSTAGES; j += 1) @@ -215,7 +215,7 @@ static Function/S GetChannelNameFromChannelType(groupID, device, channel, sweep, if(IsNaN(params.electrodeNumber)) [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweep, "DAC", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE) - entry = settings[index] + entry = settings[index] else WAVE/Z settings = GetLastSetting(numericalValues, sweep, "DAC", DATA_ACQUISITION_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) @@ -230,7 +230,7 @@ static Function/S GetChannelNameFromChannelType(groupID, device, channel, sweep, if(IsNaN(params.electrodeNumber)) [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweep, "ADC", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE) - entry = settings[index] + entry = settings[index] else WAVE/Z settings = GetLastSetting(numericalValues, sweep, "ADC", DATA_ACQUISITION_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) @@ -368,7 +368,7 @@ static Function TestTimeSeries(fileID, device, groupID, channel, sweep, pxpSweep elseif(params.channelType == XOP_CHANNEL_TYPE_ADC && IsNaN(params.electrodeNumber)) // unassoc AD stimulus_expected = "PLACEHOLDER" elseif(params.channelType == XOP_CHANNEL_TYPE_TTL) - WAVE/T/Z TTLStimsets = GetTTLLabnotebookEntry(textualValues, LABNOTEBOOK_TTL_STIMSETS, sweep) + WAVE/Z/T TTLStimsets = GetTTLLabnotebookEntry(textualValues, LABNOTEBOOK_TTL_STIMSETS, sweep) CHECK_WAVE(TTLStimsets, TEXT_WAVE) if(IsFinite(params.ttlBit)) @@ -616,16 +616,17 @@ static Function TestListOfGroups(groupList, wv) End Function TestNwbExportV1() + string discLocation, device, acquisition string channel variable fileID, numEntries, i, sweep, numGroups, j, groupID discLocation = TestFileExport() - WAVE/T/Z entry = AB_GetMap(discLocation) + WAVE/Z/T entry = AB_GetMap(discLocation) CHECK_WAVE(entry, FREE_WAVE) - WAVE/T/Z devices = GetAnalysisDeviceWave(entry[%DataFolder]) + WAVE/Z/T devices = GetAnalysisDeviceWave(entry[%DataFolder]) CHECK_WAVE(devices, NORMAL_WAVE) CHECK_EQUAL_VAR(GetNumberFromWaveNote(devices, NOTE_INDEX), 1) diff --git a/Packages/tests/UTF_TestNWBExportV2.ipf b/Packages/tests/UTF_TestNWBExportV2.ipf index c3b8a71b6c..e3e5063d3b 100644 --- a/Packages/tests/UTF_TestNWBExportV2.ipf +++ b/Packages/tests/UTF_TestNWBExportV2.ipf @@ -189,7 +189,7 @@ static Function TestStimsetParamWaves(fileID, device, sweeps) break endif - WAVE/T/Z stimsets = GetLastSetting(textualValues, sweep, "Stim Wave Name", DATA_ACQUISITION_MODE) + WAVE/Z/T stimsets = GetLastSetting(textualValues, sweep, "Stim Wave Name", DATA_ACQUISITION_MODE) CHECK_WAVE(stimsets, TEXT_WAVE) for(j = 0; j < NUM_HEADSTAGES; j += 1) @@ -266,7 +266,7 @@ static Function/S GetChannelNameFromChannelType(groupID, device, channel, sweep, if(IsNaN(params.electrodeNumber)) [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweep, "DAC", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE) - entry = settings[index] + entry = settings[index] else WAVE/Z settings = GetLastSetting(numericalValues, sweep, "DAC", DATA_ACQUISITION_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) @@ -281,7 +281,7 @@ static Function/S GetChannelNameFromChannelType(groupID, device, channel, sweep, if(IsNaN(params.electrodeNumber)) [WAVE settings, index] = GetLastSettingChannel(numericalValues, $"", sweep, "ADC", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE) - entry = settings[index] + entry = settings[index] else WAVE/Z settings = GetLastSetting(numericalValues, sweep, "ADC", DATA_ACQUISITION_MODE) CHECK_WAVE(settings, NUMERIC_WAVE) @@ -397,7 +397,7 @@ static Function TestTimeSeries(fileID, filepath, device, groupID, channel, sweep elseif(params.channelType == XOP_CHANNEL_TYPE_ADC && IsNaN(params.electrodeNumber)) // unassoc AD stimulus_expected = "PLACEHOLDER" elseif(params.channelType == XOP_CHANNEL_TYPE_TTL) - WAVE/T/Z TTLStimsets = GetTTLLabnotebookEntry(textualValues, LABNOTEBOOK_TTL_STIMSETS, sweep) + WAVE/Z/T TTLStimsets = GetTTLLabnotebookEntry(textualValues, LABNOTEBOOK_TTL_STIMSETS, sweep) CHECK_WAVE(TTLStimsets, TEXT_WAVE) if(IsFinite(params.ttlBit)) @@ -554,7 +554,7 @@ static Function TestTimeSeries(fileID, filepath, device, groupID, channel, sweep idx = FindDimlabel(epochs, ROWS, channel) CHECK_GE_VAR(idx, 0) - WAVE/T/Z epochsSingleChannel = WaveRef(epochs, row = idx) + WAVE/Z/T epochsSingleChannel = WaveRef(epochs, row = idx) CHECK_WAVE(epochsSingleChannel, TEXT_WAVE) WAVE/Z epochsLBN = EP_FetchEpochs_TS(numericalValues, textualValues, sweep, GUIchannelNumber, params.channelType) @@ -639,7 +639,7 @@ static Function/S TestFileExport() string baseFolder, nwbFile, discLocation, abWin, sweepBrowser [baseFolder, nwbFile] = GetUniqueNWBFileForExport(NWB_VERSION) - discLocation = baseFolder + nwbFile + discLocation = baseFolder + nwbFile KillWindow/Z $AB_GetPanelName() KillOrMoveToTrash(dfr = GetAnalysisFolder()) @@ -670,16 +670,17 @@ static Function TestListOfGroups(groupList, wv) End Function TestNwbExportV2() + string discLocation, device string channel variable fileID, numEntries, i, sweep, numGroups, j, groupID discLocation = TestFileExport() - WAVE/T/Z entry = AB_GetMap(discLocation) + WAVE/Z/T entry = AB_GetMap(discLocation) CHECK_WAVE(entry, FREE_WAVE) - WAVE/T/Z devices = GetAnalysisDeviceWave(entry[%DataFolder]) + WAVE/Z/T devices = GetAnalysisDeviceWave(entry[%DataFolder]) CHECK_WAVE(devices, NORMAL_WAVE) CHECK_EQUAL_VAR(GetNumberFromWaveNote(devices, NOTE_INDEX), ItemsInList(Getalldevices())) WARN_EQUAL_VAR(GetNumberFromWaveNote(devices, NOTE_INDEX), 1) @@ -696,7 +697,7 @@ Function TestNwbExportV2() WAVE/Z/T stimuluses = GetAnalysisChannelStimWave(entry[%DataFolder], device) CHECK_WAVE(stimuluses, TEXT_WAVE) - WAVE/WAVE/Z epochs = LoadEpochTable(discLocation) + WAVE/Z/WAVE epochs = LoadEpochTable(discLocation) REQUIRE(FileExists(discLocation)) fileID = H5_OpenFile(discLocation) @@ -772,8 +773,7 @@ Function TestNwbExportV2() End // UTF_TD_GENERATOR NWBVersionStrings -Function TestNWBVersionStrings([str]) - string str +Function TestNWBVersionStrings([string str]) variable version0, version1, version2 @@ -785,8 +785,7 @@ Function TestNWBVersionStrings([str]) End // UTF_TD_GENERATOR NeuroDataRefTree -Function TestNeuroDataRefTree([str]) - string str +Function TestNeuroDataRefTree([string str]) string neurodata_type, ancestry diff --git a/Packages/tests/UserAnalysisFunctions.ipf b/Packages/tests/UserAnalysisFunctions.ipf index 92aa7c4cf2..230d6574e1 100644 --- a/Packages/tests/UserAnalysisFunctions.ipf +++ b/Packages/tests/UserAnalysisFunctions.ipf @@ -22,29 +22,17 @@ Function/WAVE InvalidSignatureAndReturnType() FAIL() End -Function/WAVE InvalidReturnTypeAndValidSig_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function/WAVE InvalidReturnTypeAndValidSig_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) FAIL() End -Function/WAVE InvalidReturnTypeAndValidSig_V2(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function/WAVE InvalidReturnTypeAndValidSig_V2(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) FAIL() End -Function ValidFunc_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function ValidFunc_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) CHECK_NON_EMPTY_STR(device) CHECK_EQUAL_VAR(numType(eventType), 0) @@ -117,11 +105,7 @@ Function ValidFunc_V2(string device, variable eventType, WAVE DAQDataWave, varia anaFuncTracker[eventType] += 1 End -Function ValidMultHS_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function ValidMultHS_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) CHECK_NON_EMPTY_STR(device) CHECK_EQUAL_VAR(numType(eventType), 0) @@ -148,20 +132,12 @@ Function ValidMultHS_V1(device, eventType, DAQDataWave, headStage) anaFuncTracker[eventType][headstage] += 1 End -Function NotCalled_V1(device, eventType, DAQDataWave, headStage) - string device - variable eventType - WAVE DAQDataWave - variable headstage +Function NotCalled_V1(string device, variable eventType, WAVE DAQDataWave, variable headStage) FAIL() End -Function preDAQHardAbort(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preDAQHardAbort(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -174,11 +150,7 @@ Function preDAQHardAbort(device, eventType, DAQDataWave, headStage, realDataLeng endif End -Function preDAQ(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preDAQ(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -187,11 +159,7 @@ Function preDAQ(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function preSet(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preSet(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -200,11 +168,7 @@ Function preSet(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function preSweepConfig(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function preSweepConfig(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -213,11 +177,7 @@ Function preSweepConfig(device, eventType, DAQDataWave, headStage, realDataLengt anaFuncTracker[eventType][headstage] += 1 End -Function midSweep(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function midSweep(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -226,11 +186,7 @@ Function midSweep(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function postSweep(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function postSweep(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -239,11 +195,7 @@ Function postSweep(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function postSet(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function postSet(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -252,11 +204,7 @@ Function postSet(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function postDAQ(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function postDAQ(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -265,11 +213,7 @@ Function postDAQ(device, eventType, DAQDataWave, headStage, realDataLength) anaFuncTracker[eventType][headstage] += 1 End -Function AbortPreDAQ(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function AbortPreDAQ(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -281,9 +225,7 @@ Function AbortPreDAQ(device, eventType, DAQDataWave, headStage, realDataLength) return 1 End -Function StopPreSweepConfig_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function StopPreSweepConfig_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -298,11 +240,7 @@ Function StopPreSweepConfig_V3(device, s) return NaN End -Function StopMidSweep(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function StopMidSweep(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -313,9 +251,7 @@ Function StopMidSweep(device, eventType, DAQDataWave, headStage, realDataLength) return ANALYSIS_FUNC_RET_REPURP_TIME End -Function ValidFunc_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function ValidFunc_V3(string device, STRUCT AnalysisFunction_V3 &s) variable hardwareType, i @@ -477,12 +413,11 @@ Function ValidFunc_V3(device, s) End Function/S Params1_V3_GetParams() + return "MyStr,MyVar,MyWave,MyTextWave" End -Function Params1_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params1_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -495,12 +430,11 @@ Function Params1_V3(device, s) End Function/S Params2_V3_GetParams() + return "MyStr:string,MyVar,[OptionalParam]" End -Function Params2_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params2_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -513,12 +447,11 @@ Function Params2_V3(device, s) End Function/S Params3_V3_GetParams() + return "MyStr:invalidType" End -Function Params3_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params3_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -531,12 +464,11 @@ Function Params3_V3(device, s) End Function/S Params4_V3_GetParams() + return "MyStr:variable" // wrong type End -Function Params4_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params4_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -548,8 +480,7 @@ Function Params4_V3(device, s) anaFuncTracker[s.eventType] += 1 End -Function/S Params5_V3_CheckParam(name, params) - string name, params +Function/S Params5_V3_CheckParam(string name, string params) string str variable var @@ -576,6 +507,7 @@ Function/S Params5_V3_CheckParam(name, params) End Function/S Params5_V3_GetHelp(string name) + string str strswitch(name) @@ -590,12 +522,11 @@ Function/S Params5_V3_GetHelp(string name) End Function/S Params5_V3_GetParams() + return "MyStr:string,[MyNum:variable]" End -Function Params5_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params5_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -608,6 +539,7 @@ Function Params5_V3(device, s) End Function/S Params6_V3_CheckParam(string name, STRUCT CheckParametersStruct &s) + string expected, actual strswitch(name) @@ -627,12 +559,11 @@ Function/S Params6_V3_CheckParam(string name, STRUCT CheckParametersStruct &s) End Function/S Params6_V3_GetParams() + return "MyStr:string" End -Function Params6_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params6_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -660,26 +591,18 @@ End // Params7_V3_GetParams is not present -Function Params7_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Params7_V3(string device, STRUCT AnalysisFunction_V3 &s) return NaN End -Function ChangeToOtherDeviceDAQAF(device, eventType, DAQDataWave, headStage, realDataLength) - string device - variable eventType - WAVE DAQDataWave - variable headstage, realDataLength +Function ChangeToOtherDeviceDAQAF(string device, variable eventType, WAVE DAQDataWave, variable headStage, variable realDataLength) PGC_SetAndActivateControl(device, "check_Settings_MD", val = !GetCheckBoxState(device, "check_Settings_MD")) return 0 End -Function Indexing_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function Indexing_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -691,9 +614,7 @@ Function Indexing_V3(device, s) anaFuncTracker[s.eventType] += 1 End -Function TrackSweepCount_V3(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function TrackSweepCount_V3(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncSweepCounts = GetTrackSweepCounts() @@ -716,9 +637,7 @@ Function TrackSweepCount_V3(device, s) anaFuncSweepCounts[s.sweepNo][s.eventType][s.headstage] = count End -Function AbortPreSet(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function AbortPreSet(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -734,9 +653,7 @@ Function AbortPreSet(device, s) endif End -Function TotalOrdering(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function TotalOrdering(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncOrder = TrackAnalysisFunctionOrder() @@ -747,9 +664,7 @@ Function TotalOrdering(device, s) anaFuncOrder[s.eventType][s.headstage] = ticks End -Function TrackActiveSetCount(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function TrackActiveSetCount(string device, STRUCT AnalysisFunction_V3 &s) if(s.eventType != PRE_SWEEP_CONFIG_EVENT) return NaN @@ -761,9 +676,7 @@ Function TrackActiveSetCount(device, s) anaFuncActiveSetCount[s.sweepNo][s.headstage] = activeSetCount End -Function SkipSweeps(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function SkipSweeps(string device, STRUCT AnalysisFunction_V3 &s) variable skipCountExisting @@ -788,9 +701,7 @@ Function SkipSweeps(device, s) endif End -Function SkipSweepsAdvanced(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function SkipSweepsAdvanced(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -821,9 +732,7 @@ Function SkipSweepsAdvanced(device, s) endif End -Function TrackActiveSetCountsAndEvents(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function TrackActiveSetCountsAndEvents(string device, STRUCT AnalysisFunction_V3 &s) WAVE anaFuncTracker = TrackAnalysisFunctionCalls() @@ -837,9 +746,7 @@ Function TrackActiveSetCountsAndEvents(device, s) anaFuncActiveSetCount[s.sweepNo][s.headstage] = activeSetCount End -Function WriteIntoLBNOnPreDAQ(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function WriteIntoLBNOnPreDAQ(string device, STRUCT AnalysisFunction_V3 &s) if(s.eventType == PRE_DAQ_EVENT) Make/FREE/N=(LABNOTEBOOK_LAYER_COUNT) values = p @@ -850,9 +757,7 @@ Function WriteIntoLBNOnPreDAQ(device, s) return 0 End -Function ChangeStimSet(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function ChangeStimSet(string device, STRUCT AnalysisFunction_V3 &s) string ctrl @@ -864,9 +769,7 @@ Function ChangeStimSet(device, s) return 0 End -Function IncrementalLabnotebookUpdate(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function IncrementalLabnotebookUpdate(string device, STRUCT AnalysisFunction_V3 &s) if(s.eventType == POST_SWEEP_EVENT) #if exists("ILCUCheck_IGNORE") @@ -885,9 +788,7 @@ Function IncrementalLabnotebookUpdate(device, s) return 0 End -Function AcquisitionStateTrackingFunc(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function AcquisitionStateTrackingFunc(string device, STRUCT AnalysisFunction_V3 &s) variable acqState, expectedAcqState string name @@ -961,6 +862,7 @@ Function ModifyStimSet(string device, STRUCT AnalysisFunction_V3 &s) End Function StopMidSweep_V3(string device, STRUCT AnalysisFunction_V3 &s) + variable DAC switch(s.eventType) @@ -977,6 +879,7 @@ Function StopMidSweep_V3(string device, STRUCT AnalysisFunction_V3 &s) End Function AddTooLargeUserEpoch_V3(string device, STRUCT AnalysisFunction_V3 &s) + variable DAC switch(s.eventType) @@ -989,6 +892,7 @@ Function AddTooLargeUserEpoch_V3(string device, STRUCT AnalysisFunction_V3 &s) End Function AddUserEpoch_V3(string device, STRUCT AnalysisFunction_V3 &s) + variable DAC string tags @@ -999,9 +903,7 @@ Function AddUserEpoch_V3(string device, STRUCT AnalysisFunction_V3 &s) EP_AddUserEpoch(epochWave, XOP_CHANNEL_TYPE_DAC, DAC, 0.5, 0.6, tags) End -Function ChangeTPSettings(device, s) - string device - STRUCT AnalysisFunction_V3 &s +Function ChangeTPSettings(string device, STRUCT AnalysisFunction_V3 &s) switch(s.eventType) case POST_SWEEP_EVENT: @@ -1027,6 +929,7 @@ Function ChangeTPSettings(device, s) End Function SetSweepFormula(string device, STRUCT AnalysisFunction_V3 &s) + string win, bsPanel, sweepFormulaNB, code switch(s.eventType) @@ -1088,10 +991,12 @@ Function/S ComplainWithProperString_CheckParam(string name, string params) End Function/S ComplainWithProperString_GetParams() + return "param" End Function ComplainWithProperString(string device, STRUCT AnalysisFunction_V3 &s) + FAIL() End @@ -1107,6 +1012,7 @@ Function EnableIndexing(string device, STRUCT AnalysisFunction_V3 &s) End Function AddUserEpochsForTPLike(string device, STRUCT AnalysisFunction_V3 &s) + variable ret switch(s.eventType) @@ -1119,6 +1025,7 @@ Function AddUserEpochsForTPLike(string device, STRUCT AnalysisFunction_V3 &s) End Function DashboardAnaFunc(string device, STRUCT AnalysisFunction_V3 &s) + string win, key, ref, str variable index @@ -1150,6 +1057,7 @@ Function DashboardAnaFunc(string device, STRUCT AnalysisFunction_V3 &s) End Function JustFail(string device, STRUCT AnalysisFunction_V3 &s) + FAIL() End @@ -1164,7 +1072,7 @@ static Function ILCUCheck_IGNORE(string device, STRUCT AnalysisFunction_V3 &s) WAVE/Z sweepCounts = GetLastSetting(numericalValues, s.sweepNo, "Set Sweep Count", DATA_ACQUISITION_MODE) CHECK_WAVE(sweepCounts, NUMERIC_WAVE) - WAVE/T/Z foundStimSets = GetLastSetting(textualValues, s.sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSetting(textualValues, s.sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) CHECK_WAVE(foundStimSets, TEXT_WAVE) WAVE/Z sweeps = AFH_GetSweepsFromSameSCI(numericalValues, s.sweepNo, 0) @@ -1183,7 +1091,7 @@ static Function ILCUCheck_IGNORE(string device, STRUCT AnalysisFunction_V3 &s) WAVE/Z sweepCounts = GetLastSetting(numericalValues, nonExistingSweep, "Set Sweep Count", DATA_ACQUISITION_MODE) CHECK_WAVE(sweepCounts, NULL_WAVE) - WAVE/T/Z foundStimSets = GetLastSetting(textualValues, nonExistingSweep, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) + WAVE/Z/T foundStimSets = GetLastSetting(textualValues, nonExistingSweep, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) CHECK_WAVE(foundStimSets, NULL_WAVE) WAVE/Z sweeps = AFH_GetSweepsFromSameSCI(numericalValues, nonExistingSweep, 0)