diff --git a/Packages/Conversion/MIES_MassExperimentProcessing.ipf b/Packages/Conversion/MIES_MassExperimentProcessing.ipf index a85879ae05..0f55ebe4e1 100644 --- a/Packages/Conversion/MIES_MassExperimentProcessing.ipf +++ b/Packages/Conversion/MIES_MassExperimentProcessing.ipf @@ -58,8 +58,7 @@ EndStructure static Constant kPrefsVersionNumber = 102 // Loads preferences into our structure. -static Function LoadPackagePrefs(prefs) - STRUCT MultiExperimentProcessPrefs &prefs +static Function LoadPackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs) variable currentPrefsVersion = kPrefsVersionNumber @@ -79,14 +78,12 @@ static Function LoadPackagePrefs(prefs) End // Saves our structure to preferences. -static Function SavePackagePrefs(prefs) - STRUCT MultiExperimentProcessPrefs &prefs +static Function SavePackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs) SavePackagePreferences kPackageName, kPreferencesFileName, kPrefsRecordID, prefs End -static Function ProcessCurrentExperiment(prefs) - STRUCT MultiExperimentProcessPrefs &prefs +static Function ProcessCurrentExperiment(STRUCT MultiExperimentProcessPrefs &prefs) variable jsonID, index string outputFilePath, inputFile, outputFolder @@ -133,8 +130,7 @@ static Function ProcessCurrentExperiment(prefs) StoreJSON(prefs, jsonID) End -static Function PerformMiesTasks(outputFilePath) - string outputFilePath +static Function PerformMiesTasks(string outputFilePath) string folder, message variable nwbVersion, error @@ -164,8 +160,7 @@ static Function IsAppropriateExperiment() End // Returns full path to the next experiment file to be loaded or "" if we are finished. -static Function/S FindNextExperiment(prefs) - STRUCT MultiExperimentProcessPrefs &prefs +static Function/S FindNextExperiment(STRUCT MultiExperimentProcessPrefs &prefs) variable jsonID, index @@ -183,8 +178,7 @@ static Function/S FindNextExperiment(prefs) End // Caller needs to release json -static Function GetJSON(prefs) - STRUCT MultiExperimentProcessPrefs &prefs +static Function GetJSON(STRUCT MultiExperimentProcessPrefs &prefs) string data, fname @@ -194,9 +188,7 @@ static Function GetJSON(prefs) End // json will be released -static Function StoreJSON(prefs, jsonID) - STRUCT MultiExperimentProcessPrefs &prefs - variable jsonID +static Function StoreJSON(STRUCT MultiExperimentProcessPrefs &prefs, variable jsonID) string data = JSON_Dump(jsonID, indent = 2) @@ -208,8 +200,7 @@ End // Posts commands to Igor's operation queue to close the current experiment and open the next one. // Igor executes operation queue commands when it is idling - that is, when it is not running a // function or operation. -static Function PostLoadNextExperiment(nextExperimentFullPath) - string nextExperimentFullPath +static Function PostLoadNextExperiment(string nextExperimentFullPath) ASSERT(FileExists(nextExperimentFullPath), "Experiment must exist") @@ -225,9 +216,7 @@ End // This is the hook function that Igor calls whenever a file is opened. We use it to // detect the opening of an experiment and to call our ProcessCurrentExperiment function. -static Function AfterFileOpenHook(refNum, file, pathName, type, creator, kind) - variable refNum, kind - string file, pathName, type, creator +static Function AfterFileOpenHook(variable refNum, string file, string pathName, string type, string creator, variable kind) STRUCT MultiExperimentProcessPrefs prefs diff --git a/Packages/MIES/MIES_AmplifierInteraction.ipf b/Packages/MIES/MIES_AmplifierInteraction.ipf index 1d1ddd7343..9c5d078be5 100644 --- a/Packages/MIES/MIES_AmplifierInteraction.ipf +++ b/Packages/MIES/MIES_AmplifierInteraction.ipf @@ -22,8 +22,7 @@ static Constant NUM_TRIES_AXON_TELEGRAPH = 10 #define AMPLIFIER_XOPS_PRESENT #endif -static Function AI_InitAxonTelegraphStruct(tds) - STRUCT AxonTelegraph_DataStruct &tds +static Function AI_InitAxonTelegraphStruct(STRUCT AxonTelegraph_DataStruct &tds) tds.version = 13 End @@ -58,9 +57,7 @@ static Structure AxonTelegraph_DataStruct EndStructure /// @brief Returns the serial number of the headstage compatible with Axon* functions, @see GetChanAmpAssign -static Function AI_GetAmpAxonSerial(device, headStage) - string device - variable headStage +static Function AI_GetAmpAxonSerial(string device, variable headStage) WAVE ChanAmpAssign = GetChanAmpAssign(device) @@ -68,9 +65,7 @@ static Function AI_GetAmpAxonSerial(device, headStage) End /// @brief Returns the serial number of the headstage compatible with MCC* functions, @see GetChanAmpAssign -static Function/S AI_GetAmpMCCSerial(device, headStage) - string device - variable headStage +static Function/S AI_GetAmpMCCSerial(string device, variable headStage) variable axonSerial string mccSerial @@ -86,19 +81,14 @@ static Function/S AI_GetAmpMCCSerial(device, headStage) End ///@brief Return the channel of the currently selected head stage -static Function AI_GetAmpChannel(device, headStage) - string device - variable headStage +static Function AI_GetAmpChannel(string device, variable headStage) WAVE ChanAmpAssign = GetChanAmpAssign(device) return ChanAmpAssign[%AmpChannelID][headStage] End -static Function AI_IsValidSerialAndChannel([mccSerial, axonSerial, channel]) - string mccSerial - variable axonSerial - variable channel +static Function AI_IsValidSerialAndChannel([string mccSerial, variable axonSerial, variable channel]) if(!ParamIsDefault(mccSerial)) if(isEmpty(mccSerial)) @@ -520,10 +510,7 @@ End /// @param device device /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// @param ctrl [optional, defaults to all controls] name of the control being updated -static Function AI_UpdateAmpView(device, headStage, [ctrl]) - string device - variable headStage - string ctrl +static Function AI_UpdateAmpView(string device, variable headStage, [string ctrl]) string lbl, list variable i, numEntries, value @@ -567,8 +554,7 @@ static Function AI_UpdateAmpView(device, headStage, [ctrl]) End /// @brief Convert amplifier controls to row labels for `AmpStorageWave` -static Function/S AI_AmpStorageControlToRowLabel(ctrl) - string ctrl +static Function/S AI_AmpStorageControlToRowLabel(string ctrl) strswitch(ctrl) // V-Clamp controls @@ -693,9 +679,7 @@ End /// /// @param device device /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] -static Function AI_MIESAutoPipetteOffset(device, headStage) - string device - variable headStage +static Function AI_MIESAutoPipetteOffset(string device, variable headStage) variable clampMode, vDelta, offset, value @@ -860,6 +844,7 @@ End /// /// @return a 1D FREE wave containing amplifier serial numbers without leading zeroes static Function/WAVE AI_GetMCCSerialNumbers() + AI_FindConnectedAmps() WAVE W_TelegraphServers = GetAmplifierTelegraphServers() Duplicate/FREE/R=[][FindDimLabel(W_TelegraphServers, COLS, "SerialNum")] W_TelegraphServers, OpenMCCList @@ -944,10 +929,7 @@ End /// @param clampMode clamp mode /// @param[out] ADGain ADC gain /// @param[out] DAGain DAC gain -static Function AI_RetrieveGains(device, headstage, clampMode, ADGain, DAGain) - string device - variable headstage, clampMode - variable &ADGain, &DAGain +static Function AI_RetrieveGains(string device, variable headstage, variable clampMode, variable &ADGain, variable &DAGain) variable axonSerial = AI_GetAmpAxonSerial(device, headstage) variable channel = AI_GetAmpChannel(device, headStage) @@ -1689,10 +1671,7 @@ Function AI_GetMode(string device, variable headstage) DEBUGPRINT("Unimplemented") End -static Function AI_RetrieveGains(device, headstage, clampMode, ADGain, DAGain) - string device - variable headstage, clampMode - variable &ADGain, &DAGain +static Function AI_RetrieveGains(string device, variable headstage, variable clampMode, variable &ADGain, variable &DAGain) ADGain = NaN DAGain = NaN diff --git a/Packages/MIES/MIES_AnalysisBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser.ipf index d4f3f8adbc..d2310ce1e6 100644 --- a/Packages/MIES/MIES_AnalysisBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser.ipf @@ -85,8 +85,7 @@ End /// /// @return index into mapping wave of the newly added entry or -1 if the file /// is already in the map -static Function AB_AddMapEntry(baseFolder, discLocation) - string baseFolder, discLocation +static Function AB_AddMapEntry(string baseFolder, string discLocation) variable nextFreeIndex, fileID, nwbVersion, dim, writeIndex string dataFolder, fileType, relativePath, extension @@ -325,8 +324,7 @@ static Function AB_FileHasStimsets(WAVE/T map) End /// @brief function tries to load Data From discLocation. -static Function AB_LoadFile(discLocation) - string discLocation +static Function AB_LoadFile(string discLocation) string device, deviceList variable numDevices, i, highestSweepNumber @@ -386,8 +384,7 @@ End /// which this version of the analysis browser can handle. /// /// @param discLocation file to check, parameter to AB_GetMap() -static Function AB_HasCompatibleVersion(discLocation) - string discLocation +static Function AB_HasCompatibleVersion(string discLocation) string dataFolderPath variable numWavesLoaded @@ -428,10 +425,7 @@ static Function AB_HasCompatibleVersion(discLocation) endswitch End -static Function/S AB_GetSettingNumFiniteVals(wv, device, sweepNo, name) - WAVE wv - variable sweepNo - string name, device +static Function/S AB_GetSettingNumFiniteVals(WAVE wv, string device, variable sweepNo, string name) variable numRows @@ -647,9 +641,8 @@ End /// @param dataFolder DataFolder of HDF5 or Experiment File where LabNoteBook is saved /// @param device device for which to get sweeps. /// @param clean Variable indicating if ouput can contain duplicate values -static Function/WAVE AB_GetSweepsFromLabNotebook(dataFolder, device, [clean]) - string dataFolder, device - variable clean +static Function/WAVE AB_GetSweepsFromLabNotebook(string dataFolder, string device, [variable clean]) + if(ParamIsDefault(clean)) clean = 0 endif @@ -669,8 +662,7 @@ static Function/WAVE AB_GetSweepsFromLabNotebook(dataFolder, device, [clean]) End /// @brief Returns the highest referenced sweep number from the labnotebook -static Function AB_GetHighestPossibleSweepNum(dataFolder, device) - string dataFolder, device +static Function AB_GetHighestPossibleSweepNum(string dataFolder, string device) WAVE sweepNums = AB_GetSweepsFromLabNotebook(dataFolder, device, clean = 0) WaveStats/M=1/Q sweepNums @@ -685,8 +677,7 @@ End /// @param discLocation location of Experiment File on Disc. /// ID in AnalysisBrowserMap /// @param device device for which to get sweeps. -static Function AB_LoadSweepsFromExperiment(discLocation, device) - string discLocation, device +static Function AB_LoadSweepsFromExperiment(string discLocation, string device) variable highestSweepNumber, sweepNumber, numSweeps, i, numConfigWaves string listSweepConfig, sweepConfig @@ -724,8 +715,7 @@ End /// ID in AnalysisBrowserMap /// @param dataFolder datafolder of the project /// @param device device for which to get sweeps. -static Function AB_LoadSweepsFromNWB(discLocation, dataFolder, device) - string discLocation, dataFolder, device +static Function AB_LoadSweepsFromNWB(string discLocation, string dataFolder, string device) variable h5_fileID, nwbVersion string channelList @@ -753,11 +743,7 @@ End /// @brief Store channelList in storage wave according to index in sweeps wave /// /// @todo Update this function for the use with SweepTable -static Function AB_StoreChannelsBySweep(groupID, nwbVersion, channelList, sweeps, storage) - variable groupID, nwbVersion - string channelList - WAVE/I sweeps - WAVE/T storage +static Function AB_StoreChannelsBySweep(variable groupID, variable nwbVersion, string channelList, WAVE/I sweeps, WAVE/T storage) variable numChannels, numSweeps, i, sweepNo, sweep_table_id string channelString @@ -800,8 +786,7 @@ static Function AB_StoreChannelsBySweep(groupID, nwbVersion, channelList, sweeps SetNumberInWaveNote(storage, NOTE_INDEX, numSweeps) End -static Function AB_LoadTPStorageFromIgor(expFilePath, expFolder, device) - string expFilePath, expFolder, device +static Function AB_LoadTPStorageFromIgor(string expFilePath, string expFolder, string device) string dataFolderPath, wanted, unwanted, all variable numWavesLoaded @@ -851,8 +836,7 @@ Function AB_LoadTPStorageFromNWB(string nwbFilePath, string expFolder, string de H5_CloseFile(h5_fileID) End -static Function AB_LoadStoredTestpulsesFromNWB(nwbFilePath, expFolder, device) - string nwbFilePath, expFolder, device +static Function AB_LoadStoredTestpulsesFromNWB(string nwbFilePath, string expFolder, string device) variable h5_fileID, testpulseGroup, numEntries, i string dataFolderPath, list, name, groupName @@ -886,6 +870,7 @@ static Function AB_LoadStoredTestpulsesFromNWB(nwbFilePath, expFolder, device) End static Function AB_LoadResultsFromIgor(string expFilePath, string expFolder) + string dataFolderPath variable numWavesLoaded @@ -898,6 +883,7 @@ static Function AB_LoadResultsFromIgor(string expFilePath, string expFolder) End static Function AB_LoadResultsFromNWB(string nwbFilePath, string expFolder) + variable h5_fileID, resultsGroup, numEntries, i string list, name, groupName @@ -936,8 +922,7 @@ static Function AB_LoadResultsFromNWB(string nwbFilePath, string expFolder) H5_CloseFile(h5_fileID) End -static Function AB_LoadUserCommentFromFile(expFilePath, expFolder, device) - string expFilePath, expFolder, device +static Function AB_LoadUserCommentFromFile(string expFilePath, string expFolder, string device) string dataFolderPath variable numStringsLoaded @@ -951,8 +936,7 @@ static Function AB_LoadUserCommentFromFile(expFilePath, expFolder, device) return numStringsLoaded End -static Function AB_LoadUserCommentAndHistoryFromNWB(nwbFilePath, expFolder, device) - string nwbFilePath, expFolder, device +static Function AB_LoadUserCommentAndHistoryFromNWB(string nwbFilePath, string expFolder, string device) string groupName, comment, datasetName, history variable h5_fileID, commentGroup, version @@ -977,8 +961,7 @@ static Function AB_LoadUserCommentAndHistoryFromNWB(nwbFilePath, expFolder, devi string/G targetDFR:historyAndLogFile = history End -static Function/S AB_LoadLabNotebook(discLocation) - string discLocation +static Function/S AB_LoadLabNotebook(string discLocation) string device, deviceList, err string deviceListChecked = "" @@ -1012,8 +995,7 @@ static Function/S AB_LoadLabNotebook(discLocation) return deviceListChecked End -static Function/S AB_LoadLabNotebookFromFile(discLocation) - string discLocation +static Function/S AB_LoadLabNotebookFromFile(string discLocation) string deviceList = "" WAVE/T map = AB_GetMap(discLocation) @@ -1031,8 +1013,7 @@ static Function/S AB_LoadLabNotebookFromFile(discLocation) return deviceList End -static Function/S AB_LoadLabNotebookFromIgor(discLocation) - string discLocation +static Function/S AB_LoadLabNotebookFromIgor(string discLocation) string labNotebookWaves, labNotebookPath, type, number, path, basepath, device, str string deviceList = "" @@ -1089,9 +1070,7 @@ End /// @param[in] path datafolder path which holds the labnotebooks (might not exist) /// @param[in] device name of the device /// @param[in, out] deviceList list of loaded devices, for successful loads we add to that list -static Function AB_LoadLabNotebookFromIgorLow(discLocation, path, device, deviceList) - string discLocation, path, device - string &deviceList +static Function AB_LoadLabNotebookFromIgorLow(string discLocation, string path, string device, string &deviceList) string basepath @@ -1159,8 +1138,7 @@ static Function AB_LoadLabNotebookFromIgorLow(discLocation, path, device, device deviceList = AddListItem(device, deviceList, ";", Inf) End -static Function/S AB_LoadLabNotebookFromNWB(discLocation) - string discLocation +static Function/S AB_LoadLabNotebookFromNWB(string discLocation) variable numDevices, numLoaded, i variable h5_fileID, h5_notebooksID @@ -1210,8 +1188,7 @@ End ///@param dfr path to labNoteBook dataFolder reference. ///@return 0 labNotebook does not exist. /// 1 labNoteBook exists. also update dimension lables -static Function AB_checkLabNotebook(dfr) - DFREF dfr +static Function AB_checkLabNotebook(DFREF dfr) WAVE/Z/SDFR=dfr $LBN_NUMERICAL_KEYS_NAME WAVE/Z/SDFR=dfr $LBN_NUMERICAL_VALUES_NAME @@ -1228,8 +1205,7 @@ End /// @brief add dimension labels in older versions of igor-MIES and hdf5-loaded data /// overwrite invalid dim labels (labnotebook waves created with versions prior to a8f0f43) -static Function AB_updateLabelsInLabNotebook(dfr) - DFREF dfr +static Function AB_updateLabelsInLabNotebook(DFREF dfr) string str @@ -1251,8 +1227,7 @@ static Function AB_updateLabelsInLabNotebook(dfr) return 1 End -static Function/S AB_TranslatePath(path, expFolder) - string path, expFolder +static Function/S AB_TranslatePath(string path, string expFolder) DFREF dfr = GetAnalysisExpFolder(expFolder) NVAR pxpVersion = $GetPxpVersionForAB(dfr) @@ -1278,9 +1253,7 @@ static Constant LOAD_CONFIG_CHUNK_SIZE = 50 /// /// The size of `LOAD_CONFIG_CHUNK_SIZE` is limited by a limitation of LoadData as this operations accepts /// only a stringlist of waves shorter than 400 characters. -static Function AB_LoadSweepConfigData(expFilePath, expFolder, device, highestSweepNumber) - string expFilePath, expFolder, device - variable highestSweepNumber +static Function AB_LoadSweepConfigData(string expFilePath, string expFolder, string device, variable highestSweepNumber) string dataFolderPath, listOfWaves variable numWavesLoaded, totalNumWavesLoaded @@ -1311,8 +1284,7 @@ static Function AB_LoadSweepConfigData(expFilePath, expFolder, device, highestSw End /// @brief Expand all tree views in the given column -static Function AB_ExpandListColumn(col) - variable col +static Function AB_ExpandListColumn(variable col) variable numRows, row, i, mask @@ -1341,8 +1313,7 @@ static Function AB_ExpandListColumn(col) End /// @brief Collapse all tree views in the given column -static Function AB_CollapseListColumn(col) - variable col +static Function AB_CollapseListColumn(variable col) variable numRows, row, i, mask @@ -1371,8 +1342,7 @@ End /// @brief Set the selection bits of the experiment browser ListBox selection wave /// /// @param selBits wave returned by AB_ReturnAndClearGUISelBits -static Function AB_SetGUISelBits(selBits) - WAVE selBits +static Function AB_SetGUISelBits(WAVE selBits) WAVE expBrowserSel = GetExperimentBrowserGUISel() expBrowserSel[][0] = expBrowserSel[p][0] | selBits[p] @@ -1477,8 +1447,7 @@ static Function AB_GetListRowWithSameHash(WAVE/T list, string h) End /// @returns 0 if the treeview could be expanded, zero otherwise -static Function AB_ExpandIfCollapsed(row, subSectionColumn) - variable row, subSectionColumn +static Function AB_ExpandIfCollapsed(variable row, variable subSectionColumn) WAVE expBrowserSel = GetExperimentBrowserGUISel() @@ -1499,6 +1468,7 @@ End /// /// @returns valid indizes wave on success static Function/WAVE AB_GetExpandedIndices() + variable i, row, numEntries WAVE expBrowserSel = GetExperimentBrowserGUISel() @@ -1622,9 +1592,7 @@ static Function AB_LoadFromExpandedRange(variable row, variable subSectionColumn End /// @brief Return the row with treeview in the column col starting from startRow -static Function AB_GetRowWithNextTreeView(selWave, startRow, col) - WAVE selWave - variable startRow, col +static Function AB_GetRowWithNextTreeView(WAVE selWave, variable startRow, variable col) variable numRows, i Make/FREE/N=(DimSize(selWave, COLS)) status @@ -1641,9 +1609,7 @@ static Function AB_GetRowWithNextTreeView(selWave, startRow, col) return numRows End -static Function AB_LoadFromFile(loadType, [sweepBrowserDFR]) - variable loadType - DFREF sweepBrowserDFR +static Function AB_LoadFromFile(variable loadType, [DFREF sweepBrowserDFR]) variable mapIndex, sweep, numRows, i, row, overwrite, oneValidLoad, index string dataFolder, fileName, discLocation, fileType, device @@ -1781,9 +1747,7 @@ Function AB_LoadStimsetForSweep(string device, variable index, variable sweep) End // @brief common ASSERT statements for AB_LoadSweepFromFile and AB_LoadStimsetFromFile -static Function AB_LoadFromFileASSERT(discLocation, dataFolder, fileType, device, sweep, overwrite) - string discLocation, dataFolder, fileType, device - variable sweep, overwrite +static Function AB_LoadFromFileASSERT(string discLocation, string dataFolder, string fileType, string device, variable sweep, variable overwrite) ASSERT(!isEmpty(discLocation), "Empty file or Folder name on disc") ASSERT(!isEmpty(dataFolder), "Empty dataFolder") @@ -1795,9 +1759,7 @@ static Function AB_LoadFromFileASSERT(discLocation, dataFolder, fileType, device End /// @returns 0 if the sweeps could be loaded, or already exists, and 1 on error -static Function AB_LoadSweepFromFile(discLocation, dataFolder, fileType, device, sweep, [overwrite]) - string discLocation, dataFolder, fileType, device - variable sweep, overwrite +static Function AB_LoadSweepFromFile(string discLocation, string dataFolder, string fileType, string device, variable sweep, [variable overwrite]) string sweepFolder, sweeps, msg variable h5_fileID, h5_groupID, err @@ -1846,9 +1808,7 @@ static Function AB_LoadSweepFromFile(discLocation, dataFolder, fileType, device, return 0 End -static Function AB_LoadStimsetFromFile(discLocation, dataFolder, fileType, device, sweep, [overwrite]) - string discLocation, dataFolder, fileType, device - variable sweep, overwrite +static Function AB_LoadStimsetFromFile(string discLocation, string dataFolder, string fileType, string device, variable sweep, [variable overwrite]) string loadedStimsets, msg variable h5_fileID, h5_groupID @@ -1900,10 +1860,7 @@ static Function AB_LoadStimsetFromFile(discLocation, dataFolder, fileType, devic return 0 End -static Function AB_LoadSweepFromNWB(discLocation, sweepDFR, device, sweep) - string discLocation, device - DFREF sweepDFR - variable sweep +static Function AB_LoadSweepFromNWB(string discLocation, DFREF sweepDFR, string device, variable sweep) string channelList variable h5_fileID, h5_groupID, numSweeps, version @@ -1956,11 +1913,7 @@ static Function AB_LoadSweepFromNWB(discLocation, sweepDFR, device, sweep) return 0 End -static Function AB_LoadSweepFromNWBgeneric(h5_groupID, nwbVersion, channelList, sweepDFR, configSweep) - variable h5_groupID, nwbVersion - string channelList - DFREF sweepDFR - WAVE/I configSweep +static Function AB_LoadSweepFromNWBgeneric(variable h5_groupID, variable nwbVersion, string channelList, DFREF sweepDFR, WAVE/I configSweep) string channel, channelName variable numChannels, numEntries, i @@ -2067,8 +2020,7 @@ End /// @brief Sorts the faked Config Sweeps Wave to get correct display order in Sweep Browser /// /// function is oriented at MDSort() -static Function AB_SortConfigSweeps(config) - WAVE/I config +static Function AB_SortConfigSweeps(WAVE/I config) string wavenote = Note(config) variable numRows = DimSize(config, ROWS) @@ -2176,9 +2128,7 @@ End /// @param overwrite overwrite flag /// /// @return 1 on error and 0 on success -static Function AB_LoadStimsetsRAW(expFilePath, stimsets, overwrite) - string expFilePath, stimsets - variable overwrite +static Function AB_LoadStimsetsRAW(string expFilePath, string stimsets, variable overwrite) string stimset variable numStimsets, i @@ -2211,9 +2161,7 @@ End /// @param overwrite overwrite flag /// /// @return 1 on error and 0 on success -static Function/S AB_LoadStimsets(expFilePath, stimsets, overwrite, [processedStimsets]) - string expFilePath, stimsets, processedStimsets - variable overwrite +static Function/S AB_LoadStimsets(string expFilePath, string stimsets, variable overwrite, [string processedStimsets]) string stimset, totalStimsets, newStimsets, oldStimsets variable numBefore, numMoved, numAfter, numNewStimsets, i @@ -2260,9 +2208,7 @@ End /// @brief Load specified stimset from Igor experiment file /// /// @return 1 on error and 0 on success -static Function AB_LoadStimset(expFilePath, stimset, overwrite) - string expFilePath, stimset - variable overwrite +static Function AB_LoadStimset(string expFilePath, string stimset, variable overwrite) if(overwrite) WB_KillParameterWaves(stimset) @@ -2290,9 +2236,7 @@ static Function AB_LoadStimset(expFilePath, stimset, overwrite) return 1 End -static Function AB_LoadStimsetRAW(expFilePath, stimset, overwrite) - string expFilePath, stimset - variable overwrite +static Function AB_LoadStimsetRAW(string expFilePath, string stimset, variable overwrite) string dataPath, data variable numWavesLoaded, channelType @@ -2335,8 +2279,7 @@ End /// @brief Load template waves for a specific stimset from Igor experiment file /// /// @return 1 on error and 0 on success -static Function AB_LoadStimsetTemplateWaves(expFilePath, stimset) - string expFilePath, stimset +static Function AB_LoadStimsetTemplateWaves(string expFilePath, string stimset) variable channelType, numWavesLoaded, numStimsets, i string dataPath @@ -2387,9 +2330,7 @@ End /// @brief Load custom waves for specified stimset from Igor experiment file /// /// @return 1 on error and 0 on success -static Function/S AB_LoadCustomWaves(expFilePath, stimsets, overwrite) - string expFilePath, stimsets - variable overwrite +static Function/S AB_LoadCustomWaves(string expFilePath, string stimsets, variable overwrite) string dependentStimsets, stimset, custom_waves, path, customWaveName variable numWaves, numStimsets, i, j, valid @@ -2455,9 +2396,7 @@ End /// @brief Load specified wave from Igor Experiment file. /// /// @return 1 on error and 0 on success -static Function AB_LoadWave(expFilePath, fullPath, overwrite) - string expFilePath, fullPath - variable overwrite +static Function AB_LoadWave(string expFilePath, string fullPath, variable overwrite) variable numWavesLoaded string dataFolder @@ -2495,10 +2434,7 @@ static Function AB_LoadWave(expFilePath, fullPath, overwrite) return 0 End -static Function AB_SplitSweepIntoComponents(expFolder, device, sweep, sweepWave) - string expFolder, device - variable sweep - WAVE sweepWave +static Function AB_SplitSweepIntoComponents(string expFolder, string device, variable sweep, WAVE sweepWave) DFREF sweepFolder = GetAnalysisSweepDataPath(expFolder, device, sweep) WAVE configSweep = GetAnalysisConfigWave(expFolder, device, sweep) @@ -3405,9 +3341,8 @@ static Function AB_ReExport(variable index, variable overwrite) End /// @brief Load dropped NWB files into the analysis browser -static Function BeforeFileOpenHook(refNum, file, pathName, type, creator, kind) - variable refNum, kind - string file, pathName, type, creator +static Function BeforeFileOpenHook(variable refNum, string file, string pathName, string type, string creator, variable kind) + string baseFolder, fileSuffix, entry variable numEntries @@ -3507,10 +3442,7 @@ End /// input numerical and textual values storage waves for current sweep /// /// @returns list of stimsets -static Function/S AB_GetStimsetFromSweepGeneric(sweep, numericalValues, textualValues) - variable sweep - WAVE numericalValues - WAVE/T textualValues +static Function/S AB_GetStimsetFromSweepGeneric(variable sweep, WAVE numericalValues, WAVE/T textualValues) variable i, j, numEntries string ttlList, name diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf index 8a48b44419..a75a5ec081 100644 --- a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf @@ -9,8 +9,7 @@ /// @file MIES_AnalysisBrowser_SweepBrowser.ipf /// @brief __SB__ Visualization of sweep data in the analysis browser -static Function/WAVE SB_GetSweepBrowserMapFromGraph(win) - string win +static Function/WAVE SB_GetSweepBrowserMapFromGraph(string win) return GetSweepBrowserMap(SB_GetSweepBrowserFolder(win)) End @@ -126,8 +125,7 @@ End /// @brief set graph userdata similar to DB_SetUserData() /// /// @param win name of main window or external subwindow in SweepBrowser -static Function SB_SetUserData(win) - string win +static Function SB_SetUserData(string win) SetWindow $win, userdata="" @@ -142,10 +140,7 @@ End /// @param key labnotebook key /// /// @return wave with the setting for each headstage or an invalid wave reference if the setting does not exist -static Function/WAVE SB_GetSweepPropertyFromNumLBN(graph, mapIndex, key) - string graph - variable mapIndex - string key +static Function/WAVE SB_GetSweepPropertyFromNumLBN(string graph, variable mapIndex, string key) string device, expFolder variable sweep diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf index 07b6e48a4c..d4f7997095 100644 --- a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf @@ -21,9 +21,7 @@ static Structure SBE_ExportSettings variable usePulses, numPulses, preFirstPulse, postLastPulse, ADC EndStructure -static Function SBE_FillExportSettings(win, sett) - string win - STRUCT SBE_ExportSettings &sett +static Function SBE_FillExportSettings(string win, STRUCT SBE_ExportSettings &sett) variable redistAxis @@ -109,8 +107,7 @@ End /// /// This function can fill in the available data for traces which are *not* /// shown. -static Function SBE_AddMissingADTraceInfo(traceData) - WAVE/T traceData +static Function SBE_AddMissingADTraceInfo(WAVE/T traceData) variable numPaths, i, j, idx, cnt, sweepNumber variable numEntries, headstage @@ -179,6 +176,7 @@ static Function SBE_AddMissingADTraceInfo(traceData) End static Function/WAVE SBE_GetPulseStartTimesForSel() + string graph, traceName variable region, idx, ADC @@ -275,8 +273,7 @@ End /// /// Creates a new graph from it or appends to an existing one. /// Only duplicates the main graph without external subwindows -static Function SBE_ExportSweepBrowser(sett) - STRUCT SBE_ExportSettings &sett +static Function SBE_ExportSweepBrowser(STRUCT SBE_ExportSettings &sett) string trace, folder, newPrefix, analysisPrefix, relativeDest, win, wvName, unit, stimset string graphName, graphMacro, saveDFR, traceList, line, newGraph, newWvName, traceAxis diff --git a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf index 6fb64ad748..87ca3fa7ea 100644 --- a/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf +++ b/Packages/MIES/MIES_AnalysisFunctionHelpers.ipf @@ -234,9 +234,7 @@ End /// AFH_GetSweepsFromSameRACycle(). /// /// Return an invalid wave reference if not all required labnotebook entries are available -threadsafe static Function/WAVE AFH_GetSweepsFromSameRACycleNC(numericalValues, sweepNo) - WAVE numericalValues - variable sweepNo +threadsafe static Function/WAVE AFH_GetSweepsFromSameRACycleNC(WAVE numericalValues, variable sweepNo) variable sweepCol, raCycleID @@ -333,10 +331,7 @@ End /// AFH_GetSweepsFromSameSCI(). /// /// Return an invalid wave reference if not all required labnotebook entries are available -threadsafe static Function/WAVE AFH_GetSweepsFromSameSCINC(numericalValues, sweepNo, headstage) - WAVE numericalValues - variable sweepNo - variable headstage +threadsafe static Function/WAVE AFH_GetSweepsFromSameSCINC(WAVE numericalValues, variable sweepNo, variable headstage) variable sweepCol diff --git a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf index 056dfc452c..9bd099fc1a 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf @@ -75,6 +75,7 @@ Function AD_Update(string win) End static Function/S AD_GetResultMessage(variable anaFuncType, variable passed, WAVE numericalValues, WAVE/T textualValues, variable sweepNo, DFREF sweepDFR, variable headstage, variable ongoingDAQ, variable waMode) + variable stopReason if(passed) @@ -184,9 +185,7 @@ static Function/S AD_GetResultMessage(variable anaFuncType, variable passed, WAV End /// @brief Get result list of analysis function runs -static Function AD_FillWaves(win, list, info) - string win - WAVE/T list, info +static Function AD_FillWaves(string win, WAVE/T list, WAVE/T info) variable i, j, headstage, passed, sweepNo, numEntries, ongoingDAQ, acqState variable index, anaFuncType, stimsetCycleID, waMode @@ -425,10 +424,7 @@ static Function AD_LabnotebookEntryExistsAndIsTrue(WAVE/Z data) return WaveExists(reduced) && Sum(reduced) > 0 End -static Function/S AD_GetSquarePulseFailMsg(numericalValues, sweepNo, headstage, waMode) - variable sweepNo - WAVE numericalValues - variable headstage, waMode +static Function/S AD_GetSquarePulseFailMsg(WAVE numericalValues, variable sweepNo, variable headstage, variable waMode) string msg, key variable stepSize @@ -482,12 +478,7 @@ static Function/S AD_GetDAScaleOperationMode(WAVE numericalValues, WAVE/T textua return AFH_GetAnalysisParamTextual("OperationMode", params[headstage]) End -static Function/S AD_GetDAScaleFailMsg(numericalValues, textualValues, sweepNo, sweepDFR, headstage) - WAVE numericalValues - WAVE/T textualValues - variable sweepNo - DFREF sweepDFR - variable headstage +static Function/S AD_GetDAScaleFailMsg(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, DFREF sweepDFR, variable headstage) string msg, key, fISlopeStr, opMode variable numPasses, numRequiredPasses, finalSlopePercent, slopePercentage, measuredAllFutureDAScales @@ -592,6 +583,7 @@ static Function/S AD_GetDAScaleFailMsg(numericalValues, textualValues, sweepNo, End static Function/S AD_GetRheobaseFailMsg(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, DFREF sweepDFR, variable headstage) + string key, prefix, msg, pattern prefix = AD_GetPerSweepFailMessage(PSQ_RHEOBASE, numericalValues, textualValues, sweepNo, sweepDFR, headstage) @@ -634,6 +626,7 @@ static Function/S AD_GetSpikeControlFailMsg(WAVE numericalValues, WAVE textualVa End static Function/S AD_GetChirpFailMsg(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, DFREF sweepDFR, variable headstage) + string key, msg, str string text = "" variable i, numSweeps, setPassed, maxOccurences @@ -681,6 +674,7 @@ End /// @retval qc 0/1 for failing or passing, NaN in case it could not be determined /// @retval msg error message for the failure case static Function [variable qc, string msg] AD_GetBaselineFailMsg(variable anaFuncType, WAVE numericalValues, variable sweepNo, variable headstage) + variable i, chunkQC string key @@ -760,6 +754,7 @@ static Function [variable qc, string msg] AD_GetBaselineFailMsg(variable anaFunc End static Function/S AD_GetBaselineChunkFailMsg(variable anaFuncType, WAVE numericalValues, variable sweepNo, variable headstage, variable chunk, string subkey, string testname) + string key, msg variable check @@ -797,6 +792,7 @@ End /// /// @sa AD_GetResultMessage() static Function/S AD_GetPerSweepFailMessage(variable anaFuncType, WAVE numericalValues, WAVE/T textualValues, variable refSweepNo, DFREF sweepDFR, variable headstage, [variable numRequiredPasses]) + string key, msg, str string text = "" variable numPasses, i, numSweeps, sweepNo, boundsAction, spikeCheck, resistancePass, accessRestPass, resistanceRatio @@ -1072,6 +1068,7 @@ static Function/S AD_GetPerSweepFailMessage(variable anaFuncType, WAVE numerical End static Function/S AD_HasAsyncQCFailed(WAVE numericalValues, WAVE/T textualValues, variable anaFuncType, variable sweepNo, variable headstage) + string key, msg, str string text = "" variable chan, asyncAlarm @@ -1121,6 +1118,7 @@ End // Early stopped analysis functions prior to 87f9cbfa (DAQ: Add stopping reason to the labnotebook, 2021-05-13) // need to be handled specially as we can only see if it was stopped early or not, but not why static Function/S AD_HasPrematureStopLegacy(WAVE numericalValues, WAVE/T textualValues, variable anaFuncType, variable sweepNo, DFREF sweepDFR, variable headstage) + variable once DFREF singleSweepDFR = GetSingleSweepFolder(sweepDFR, sweepNo) diff --git a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf index 23d59020c0..1ef84d4064 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq.ipf @@ -65,9 +65,7 @@ static Structure MSQ_PulseSettings EndStructure /// @brief Fills `s` according to the analysis function type -static Function MSQ_GetPulseSettingsForType(type, s) - variable type - STRUCT MSQ_PulseSettings &s +static Function MSQ_GetPulseSettingsForType(variable type, STRUCT MSQ_PulseSettings &s) string msg @@ -83,9 +81,7 @@ End /// Return the pulse durations from the labnotebook or calculate them before if required. /// For convenience unused headstages will have 0 instead of NaN in the returned wave. -static Function/WAVE MSQ_GetPulseDurations(device, type, sweepNo, totalOnsetDelay, headstage, [useSCI, forceRecalculation]) - string device - variable type, sweepNo, totalOnsetDelay, headstage, useSCI, forceRecalculation +static Function/WAVE MSQ_GetPulseDurations(string device, variable type, variable sweepNo, variable totalOnsetDelay, variable headstage, [variable useSCI, variable forceRecalculation]) string key @@ -125,9 +121,7 @@ End /// @brief Determine the pulse duration on each headstage /// /// Returns the labnotebook wave as well. -static Function/WAVE MSQ_DeterminePulseDuration(device, sweepNo, totalOnsetDelay) - string device - variable sweepNo, totalOnsetDelay +static Function/WAVE MSQ_DeterminePulseDuration(string device, variable sweepNo, variable totalOnsetDelay) variable i, level, first, last, duration string key @@ -177,9 +171,7 @@ End /// @brief Return the number of already acquired sweeps /// of the given stimset cycle ID -static Function MSQ_NumAcquiredSweepsInSet(device, sweepNo, headstage) - string device - variable sweepNo, headstage +static Function MSQ_NumAcquiredSweepsInSet(string device, variable sweepNo, variable headstage) WAVE numericalValues = GetLBNumericalValues(device) @@ -194,9 +186,7 @@ End /// @brief Return the number of passed sweeps in all sweeps from the given /// repeated acquisition cycle. -static Function MSQ_NumPassesInSet(numericalValues, type, sweepNo, headstage) - WAVE numericalValues - variable type, sweepNo, headstage +static Function MSQ_NumPassesInSet(WAVE numericalValues, variable type, variable sweepNo, variable headstage) string key @@ -216,9 +206,7 @@ End /// @brief Return the DA stimset length in ms of the given headstage /// /// @return stimset length or -1 on error -static Function MSQ_GetDAStimsetLength(device, headstage) - string device - variable headstage +static Function MSQ_GetDAStimsetLength(string device, variable headstage) string setName variable DAC @@ -329,13 +317,7 @@ End /// @param[in] defaultValue [optiona, defaults to `NaN`] the value of the other headstages in the returned wave /// /// @return labnotebook value wave suitable for ED_AddEntryToLabnotebook() -static Function/WAVE MSQ_SearchForSpikes(device, type, sweepWave, headstage, totalOnsetDelay, [numberOfSpikes, defaultValue, spikePositions]) - string device - variable type - WAVE sweepWave - variable headstage, totalOnsetDelay - variable numberOfSpikes, defaultValue - WAVE spikePositions +static Function/WAVE MSQ_SearchForSpikes(string device, variable type, WAVE sweepWave, variable headstage, variable totalOnsetDelay, [variable numberOfSpikes, variable defaultValue, WAVE spikePositions]) variable level, first, last, overrideValue variable minVal, maxVal @@ -441,11 +423,7 @@ End /// Searches in the complete SCI and assumes that the entries are either 0/1/NaN. /// /// @todo merge with LBN functions once these are reworked. -static Function MSQ_GetLBNEntryForHSSCIBool(numericalValues, sweepNo, type, str, headstage) - WAVE numericalValues - variable sweepNo, type - string str - variable headstage +static Function MSQ_GetLBNEntryForHSSCIBool(WAVE numericalValues, variable sweepNo, variable type, string str, variable headstage) string key @@ -467,11 +445,7 @@ End /// passed headstage must be valid. /// /// @todo merge with LBN functions once these are reworked. -static Function MSQ_GetLBNEntryForHeadstageSCI(numericalValues, sweepNo, type, str, headstage) - WAVE numericalValues - variable sweepNo, type - string str - variable headstage +static Function MSQ_GetLBNEntryForHeadstageSCI(WAVE numericalValues, variable sweepNo, variable type, string str, variable headstage) string key variable numEntries @@ -930,9 +904,7 @@ End /// /// @return wave with #LABNOTEBOOK_LAYER_COUNT entries, each holding the final DA Scale entry /// from the previous fast rheo estimate run. -static Function/WAVE MSQ_DS_GetDAScaleOffset(device, headstage) - string device - variable headstage +static Function/WAVE MSQ_DS_GetDAScaleOffset(string device, variable headstage) variable sweepNo, i @@ -964,9 +936,7 @@ End /// And as usual we want the *last* matching sweep. /// /// @return existing sweep number or -1 in case no such sweep could be found -static Function MSQ_GetLastPassingLongRHSweep(device, headstage) - string device - variable headstage +static Function MSQ_GetLastPassingLongRHSweep(string device, variable headstage) string key variable i, numEntries, sweepNo, sweepCol @@ -1005,9 +975,7 @@ End /// /// Required to do before skipping sweeps. /// @todo this hack must go away. -static Function MSQ_ForceSetEvent(device, headstage) - string device - variable headstage +static Function MSQ_ForceSetEvent(string device, variable headstage) variable DAC diff --git a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf index d42cacb134..2d47fbb08e 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_MultiPatchSeq_SpikeControl.ipf @@ -205,6 +205,7 @@ End /// /// The value part after the `:` is only present if `data` is passed in static Function SC_AddPulseRegionLBNEntries(WAVE/T inputLBN, variable pulseIndex, variable region, variable headstage, [WAVE/Z data]) + string str sprintf str, "P%d_R%d", pulseIndex, region @@ -240,6 +241,7 @@ End /// @brief Return the diagonal pulses for the given sweep static Function/WAVE SC_GetPulseIndizes(WAVE properties, WAVE/WAVE propertiesWaves, variable sweepNo) + variable idx, size, endRow, i, headstageProp, region, pulseIndex, sweepNoProp, pulseFailedState string entry, msg @@ -259,6 +261,7 @@ End /// @brief Return the spike numbers and positions in waves prepared for labnotebook writing static Function [WAVE/T spikeNumbersLBN, WAVE/T spikePositionsLBN] SC_GetSpikeNumbersAndPositions(string device, variable sweepNo) + variable i, idx, numFailedPulses, sweepPassed, size, numPulses variable pulseIndex, region, pulseFailedState, headstageProp, sweepNoProp, numberOfSpikes variable pulseStart, pulseEnd, numSpikes @@ -322,6 +325,7 @@ End /// @brief Fetch the pulses from the PA plot and write the results into the labnotebooks static Function SC_ProcessPulses(string device, variable sweepNo, variable minimumSpikePosition, variable idealNumberOfSpikes) + string key WAVE statusHS = DAG_GetActiveHeadstages(device, I_CLAMP_MODE) @@ -394,6 +398,7 @@ End /// @brief Determine the spike counts state for all headstages static Function/WAVE SC_SpikeCountsCalc(string device, WAVE minimum, WAVE maximum, variable idealNumberOfSpikes) + variable i string msg @@ -418,6 +423,7 @@ End /// /// @return Spike counts state according to @ref SpikeCountsStateConstants stringified static Function/WAVE SC_SpikeCountsQC(string device, WAVE/T spikeNumbersLBN, variable idealNumberOfSpikes) + string msg, str variable i @@ -483,6 +489,7 @@ End /// @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/Z/T spikePositionsLBN, variable minimumSpikePosition) + string list, msg variable numPulses, i, j @@ -536,6 +543,7 @@ End /// @brief Replace all points inside an oodDAQ region with NaN in the data wave static Function/WAVE SC_RegionBlanked(WAVE data, variable totalOnsetDelay, WAVE/T oodDAQRegion) + variable i, numEntries, first, last numEntries = DimSize(oodDAQRegion, ROWS) @@ -616,6 +624,7 @@ End /// @brief Determine the headstage QC result static Function/WAVE SC_HeadstageQC(string device, WAVE/T spikeCountStateLBN, WAVE spontaneousSpikingCheckLBN) + string msg WAVE headstageQCLBN = LBN_GetNumericWave() @@ -633,6 +642,7 @@ End /// @brief Determine and write the QC states to the labnotebook static Function SC_DetermineQCState(string device, variable sweepNo, WAVE spikeNumbersLBN, WAVE/Z spikePositionsLBN, variable minimumSpikePosition, variable idealNumberOfSpikes) + string key, msg // spontaneous spiking check @@ -677,6 +687,7 @@ End /// @brief Perform various actions on QC failures static Function SC_ReactToQCFailures(string device, variable sweepNo, string params) + variable daScaleSpikePositionModifier, daScaleModifier, daScaleTooManySpikesModifier, i, autoBiasV, autobiasModifier, prevSliderPos string daScaleOperator, daScaleSpikePositionOperator, daScaleTooManySpikesOperator string key, msg diff --git a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf index ee46d04f5d..5d429afc15 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf @@ -239,9 +239,7 @@ End /// /// We recalculate the durations on every sweep again as we can not assume that /// it is constant for the whole stimulus set. -static Function/WAVE PSQ_GetPulseDurations(device, type, sweepNo, totalOnsetDelay, [forceRecalculation]) - string device - variable type, sweepNo, totalOnsetDelay, forceRecalculation +static Function/WAVE PSQ_GetPulseDurations(string device, variable type, variable sweepNo, variable totalOnsetDelay, [variable forceRecalculation]) string key @@ -271,9 +269,7 @@ End /// @brief Determine the pulse duration on each headstage /// /// Returns the labnotebook wave as well. -static Function/WAVE PSQ_DeterminePulseDuration(device, sweepNo, type, totalOnsetDelay) - string device - variable sweepNo, type, totalOnsetDelay +static Function/WAVE PSQ_DeterminePulseDuration(string device, variable sweepNo, variable type, variable totalOnsetDelay) variable i @@ -363,6 +359,7 @@ static Function [variable rmsShortThreshold, variable rmsLongThreshold, variable End static Function PSQ_StoreThresholdsInLabnotebook(string device, variable type, variable sweepNo, variable headstage, variable rmsShortThreshold, variable rmsLongThreshold, variable targetVThreshold) + string key WAVE values = LBN_GetNumericWave() @@ -384,6 +381,7 @@ static Function PSQ_StoreThresholdsInLabnotebook(string device, variable type, v End static Function PSQ_EvaluateBaselinePassed(string device, variable type, variable sweepNo, variable headstage, variable chunk, variable ret) + variable baselineQCPassed string key, msg @@ -954,9 +952,7 @@ End // @brief Calculate a value from `startTime` spanning // `rangeTime` milliseconds according to `method` -static Function PSQ_Calculate(wv, column, startTime, rangeTime, method) - WAVE wv - variable column, startTime, rangeTime, method +static Function PSQ_Calculate(WAVE wv, variable column, variable startTime, variable rangeTime, variable method) variable rangePoints, startPoints @@ -992,9 +988,7 @@ End /// @brief Return the number of already acquired sweeps from the given /// stimset cycle -static Function PSQ_NumAcquiredSweepsInSet(device, sweepNo, headstage) - string device - variable sweepNo, headstage +static Function PSQ_NumAcquiredSweepsInSet(string device, variable sweepNo, variable headstage) WAVE numericalValues = GetLBNumericalValues(device) @@ -1026,9 +1020,7 @@ End /// @brief Return the DA stimset length in ms of the given headstage /// /// @return stimset length or -1 on error -static Function PSQ_GetDAStimsetLength(device, headstage) - string device - variable headstage +static Function PSQ_GetDAStimsetLength(string device, variable headstage) string setName variable DAC @@ -1330,9 +1322,7 @@ Function/WAVE PSQ_CreateOverrideResults(string device, variable headstage, varia End /// @brief Store the step size in the labnotebook -static Function PSQ_StoreStepSizeInLBN(device, type, sweepNo, stepsize, [future]) - string device - variable type, sweepNo, stepsize, future +static Function PSQ_StoreStepSizeInLBN(string device, variable type, variable sweepNo, variable stepsize, [variable future]) string key @@ -1365,14 +1355,7 @@ End /// @param[out] numberOfSpikesFound [optional] returns the number of spikes found /// /// @return labnotebook value wave suitable for ED_AddEntryToLabnotebook() -static Function/WAVE PSQ_SearchForSpikes(device, type, sweepWave, headstage, offset, level, [searchEnd, numberOfSpikesReq, spikePositions, numberOfSpikesFound]) - string device - variable type - WAVE sweepWave - variable headstage, offset, level, searchEnd - variable numberOfSpikesReq - WAVE spikePositions - variable &numberOfSpikesFound +static Function/WAVE PSQ_SearchForSpikes(string device, variable type, WAVE sweepWave, variable headstage, variable offset, variable level, [variable searchEnd, variable numberOfSpikesReq, WAVE spikePositions, variable &numberOfSpikesFound]) variable first, last, overrideValue, rangeSearchLevel variable minVal, maxVal, numSpikesFoundOverride @@ -1555,6 +1538,7 @@ End /// /// @return existing sweep number or INVALID_SWEEP_NUMBER in case no such sweep could be found static Function PSQ_GetLastPassingLongRHSweep(string device, variable headstage, variable duration) + string key variable i, j, setSweep, numSetSweeps, numEntries, sweepNo, setQC, numPassingSweeps @@ -1678,6 +1662,7 @@ End /// @brief Return the sweep number of the last sweep using the PSQ_DaScale() /// analysis function, where the set passes and was in the given mode static Function PSQ_GetLastPassingDAScale(string device, variable headstage, string opMode) + variable numEntries, sweepNo, i, setQC string key, modeKey @@ -1731,6 +1716,7 @@ End /// @brief Return the sweep number of the last sweep using the PSQ_TrueRestingMembranePotential() /// analysis function static Function PSQ_GetLastPassingTrueRMP(string device, variable headstage) + variable numEntries, sweepNo, i, setQC string key @@ -1764,9 +1750,7 @@ End /// @brief Return the DAScale offset for PSQ_DaScale() /// /// @return DAScale value in pA or NaN on error -static Function PSQ_DS_GetDAScaleOffset(device, headstage, opMode) - string device, opMode - variable headstage +static Function PSQ_DS_GetDAScaleOffset(string device, variable headstage, string opMode) variable sweepNo @@ -1799,9 +1783,7 @@ End /// /// @return 1 if found at least one, zero if none and `NaN` if no such entry /// could be found -static Function PSQ_FoundAtLeastOneSpike(device, sweepNo) - string device - variable sweepNo +static Function PSQ_FoundAtLeastOneSpike(string device, variable sweepNo) string key @@ -3052,6 +3034,7 @@ static Function/WAVE PSQ_DS_GetPassingDAScaleSweeps(WAVE numericalValues, variab End static Function/WAVE PSQ_DS_GetPassingRheobaseSweeps(WAVE numericalValues, variable passingRheobaseSweep, variable headstage) + string key WAVE/Z sweeps = AFH_GetSweepsFromSameSCI(numericalValues, passingRheobaseSweep, headstage) @@ -3307,6 +3290,7 @@ static Function/S PSQ_GetHelpCommon(variable type, string name) End static Function/S PSQ_CheckParamCommon(string name, STRUCT CheckParametersStruct &s, [variable maxThreshold]) + variable val string str @@ -5755,6 +5739,7 @@ static Function [variable boundsAction, variable scalingFactorDAScale] PSQ_CR_De End static Function/S PSQ_CR_BoundsEvaluationModeToString(variable val) + switch(val) case PSQ_CR_BEM_SYMMETRIC: return "Symmetric" @@ -5768,6 +5753,7 @@ static Function/S PSQ_CR_BoundsEvaluationModeToString(variable val) End static Function PSQ_CR_ParseBoundsEvaluationModeString(string str) + strswitch(str) case "Symmetric": return PSQ_CR_BEM_SYMMETRIC @@ -5781,6 +5767,7 @@ static Function PSQ_CR_ParseBoundsEvaluationModeString(string str) End static Function PSQ_SetAutobiasTargetVIfPresent(string device, variable headstage, string params, string name) + variable value value = AFH_GetAnalysisParamNumerical(name, params) @@ -5794,6 +5781,7 @@ static Function PSQ_SetAutobiasTargetVIfPresent(string device, variable headstag End static Function PSQ_SetAutobiasTargetV(string device, variable headstage, variable value) + variable preActiveHS preActiveHS = GetSliderPositionIndex(device, "slider_DataAcq_ActiveHeadstage") @@ -5817,6 +5805,7 @@ End /// /// @return 0 on success, 1 otherwise static Function PSQ_CR_SetAutobiasTargetVFromTrueRMP(string device, variable headstage, string params) + variable useTrueRestingMembPot, averageVoltage, sweepNo string key @@ -6494,6 +6483,7 @@ End /// /// Zero is the DA/AD wave zero. static Function [variable epBegin, variable epEnd] PSQ_CR_GetSpikeEvaluationRange(string device, variable sweepNo, variable headstage) + variable DAC, totalOnsetDelay WAVE numericalValues = GetLBNumericalValues(device) @@ -6641,9 +6631,7 @@ End /// /// Required to do before skipping sweeps. /// @todo this hack must go away. -static Function PSQ_ForceSetEvent(device, headstage) - string device - variable headstage +static Function PSQ_ForceSetEvent(string device, variable headstage) variable DAC @@ -6656,6 +6644,7 @@ End /// @brief Execute `code` in the SweepFormula notebook static Function/S PSQ_ExecuteSweepFormula(string device, string code) + string databrowser, bsPanel, sfNotebook databrowser = DB_GetBoundDataBrowser(device, mode = BROWSER_MODE_AUTOMATION) @@ -6679,6 +6668,7 @@ static Function PSQ_SetSamplingIntervalMultiplier(string device, variable multip End static Function PSQ_SetStimulusSets(string device, variable headstage, string params) + string ctrl, stimset, stimsetIndex variable DAC, type, enableIndexing, tabID @@ -7009,6 +6999,7 @@ End /// Note: This function always returns the last entry, so this needs to be /// called directly after PSQ_ExecuteSweepFormula without giving control back to Igor Pro. static Function/WAVE PSQ_GetSweepFormulaResultWave(WAVE/T textualResultsValues, string key) + string valueStr valueStr = GetLastSettingTextIndep(textualResultsValues, NaN, key, SWEEP_FORMULA_RESULT) @@ -7104,6 +7095,7 @@ Function PSQ_CreateTestpulseEpochsImpl(WAVE/T epochWave, variable DAC, string se End static Function PSQ_CreateTestpulseLikeEpoch(WAVE/T epochWave, variable DAC, string setName, variable DAScale, variable start, variable epochIndex, variable tpIndex) + variable prePulseTP, signalTP, postPulseTP variable amplitude, epBegin, epEnd string shortName, tags @@ -7557,6 +7549,7 @@ End /// /// @return 0 on success, 1 on failure static Function PSQ_SE_CreateEpochs(string device, variable headstage, string params) + variable DAC, userEpochIndexBLC, userEpochTPIndexBLC, chunkLength, testpulseGroupSel variable amplitude, numEpochs, i, epBegin, epEnd, totalOnsetDelay, duration, DAScale, wbBegin, wbEnd string setName, shortName, tags @@ -7964,6 +7957,7 @@ Function PSQ_TrueRestingMembranePotential(string device, STRUCT AnalysisFunction End static Function [string tags, string shortName] PSQ_CreateBaselineChunkSelectionStrings(variable index) + sprintf tags, "Type=Baseline Chunk QC Selection;Index=%d", index sprintf shortName, "BLS%d", index End @@ -7980,6 +7974,7 @@ End /// /// @return 0 on success, 1 on failure static Function PSQ_CreateBaselineChunkSelectionEpochs(string device, variable headstage, string params, WAVE epochIndizes, [variable numRequiredEpochs]) + variable DAC, index, chunkLength variable amplitude, numEpochs, i, epBegin, epEnd, totalOnsetDelay, duration, wbBegin, wbEnd string setName, shortName, tags @@ -8064,6 +8059,7 @@ End /// /// @return One of @ref DetermineSweepQCReturns static Function PSQ_DetermineSweepQCResults(string device, variable type, variable sweepNo, variable headstage, variable requiredPassesInSet, variable numSweepsFailedAllowed) + variable DAC, sweepsInSet, passesInSet, acquiredSweepsInSet, sweepPassed, samplingFrequencyPassed, failsInSet string stimset, key, msg @@ -8117,6 +8113,7 @@ static Function PSQ_DetermineSweepQCResults(string device, variable type, variab End static Function PSQ_VM_EvaluateAverageVoltage(string device, variable sweepNo, variable headstage, string params, variable baselineQCPassed) + variable absoluteDiff, absoluteDiffAllowed, relativeDiff, relativeDiffAllowed, voltage variable averageQCPassed, averageAbsoluteQCPassed, averageRelativeQCPassed, avgChunk0, avgChunk1 string key, databrowser, formula, str @@ -8204,6 +8201,7 @@ static Function PSQ_VM_EvaluateAverageVoltage(string device, variable sweepNo, v End static Function [variable spikeQCPassed, WAVE spikePositions] PSQ_VM_CheckForSpikes(string device, variable sweepNo, variable headstage, WAVE scaledDACWave, variable level) + variable totalOnsetDelay, numberOfSpikesFound string key @@ -8231,6 +8229,7 @@ static Function [variable spikeQCPassed, WAVE spikePositions] PSQ_VM_CheckForSpi End static Function PSQ_VM_HandleFailingSpikeQC(string device, STRUCT AnalysisFunction_V3 &s, WAVE spikePositions) + variable first, last, totalOnsetDelay, ignoredTime, targetV, position, numRows, iti WAVE sweepWave = GetSweepWave(device, s.sweepNo) @@ -8274,6 +8273,7 @@ static Function PSQ_VM_HandleFailingSpikeQC(string device, STRUCT AnalysisFuncti End static Function PSQ_CheckThatAlarmIsEnabled(string device, WAVE asyncChannels) + variable chan, alarmEnabled, enabled string ctrl @@ -8300,6 +8300,7 @@ static Function PSQ_CheckThatAlarmIsEnabled(string device, WAVE asyncChannels) End static Function PSQ_CheckAsyncAlarmStateAndStoreInLabnotebook(string device, variable type, variable sweepNo, WAVE asyncChannels) + variable chan, alarmState, alarmPassed string key diff --git a/Packages/MIES/MIES_ArtefactRemoval.ipf b/Packages/MIES/MIES_ArtefactRemoval.ipf index e243be9e47..674b893d91 100644 --- a/Packages/MIES/MIES_ArtefactRemoval.ipf +++ b/Packages/MIES/MIES_ArtefactRemoval.ipf @@ -19,10 +19,7 @@ static Constant AR_MIN_RANGE_FACTOR = 0.1 /// - DAC /// - ADC /// - Headstage -static Function/WAVE AR_ComputeRanges(sweepDFR, sweepNo, numericalValues) - DFREF sweepDFR - variable sweepNo - WAVE numericalValues +static Function/WAVE AR_ComputeRanges(DFREF sweepDFR, variable sweepNo, WAVE numericalValues) variable i, dac, adc variable level, index, total @@ -96,10 +93,7 @@ static Function/WAVE AR_ComputeRanges(sweepDFR, sweepNo, numericalValues) return ranges End -static Function AR_UpdatePanel(device, ranges, sweepDFR) - string device - WAVE ranges - DFREF sweepDFR +static Function AR_UpdatePanel(string device, WAVE ranges, DFREF sweepDFR) AR_SetSweepFolder(device, sweepDFR) @@ -113,8 +107,7 @@ static Function AR_UpdatePanel(device, ranges, sweepDFR) AR_UpdateListBoxWave(device) End -static Function AR_UpdateListBoxWave(device) - string device +static Function AR_UpdateListBoxWave(string device) variable cutoffLength_before, cutoffLength_after string extPanel @@ -132,8 +125,7 @@ static Function AR_UpdateListBoxWave(device) End /// @brief Remove the traces used for highlightning the to-be-removed ranges -static Function AR_RemoveTraces(graph) - string graph +static Function AR_RemoveTraces(string graph) string traces, trace variable numEntries, i @@ -149,8 +141,7 @@ static Function AR_RemoveTraces(graph) End /// @brief Return a list of the traces used for highlightning the to-be-removed ranges -static Function/S AR_GetHighlightTraces(graph) - string graph +static Function/S AR_GetHighlightTraces(string graph) WAVE/Z/T traces = TUD_GetUserDataAsWave(graph, "traceName", keys = {"traceType"}, values = {"ArtefactRemoval"}) @@ -198,9 +189,7 @@ Function AR_HighlightArtefactsEntry(string graph) endfor End -static Function AR_HandleRanges(graph, [removeRange]) - string graph - variable removeRange +static Function AR_HandleRanges(string graph, [variable removeRange]) variable first, last, substituteValue variable i, j, k, traceIndex, numEntries @@ -282,8 +271,7 @@ End /// @brief Return the datafolder reference to the folder storing the listbox wave and the artefact data wave /// /// Requires the user data `PANEL_FOLDER` of the external artefact removal panel. -static Function/DF AR_GetFolder(device) - string device +static Function/DF AR_GetFolder(string device) if(!AR_IsActive(device)) return $"" @@ -295,8 +283,7 @@ End /// @brief Return the datafolder reference to the folder storing the single 1D sweep waves /// /// Requires the user data `AR_SWEEPFOLDER` of the external artefact removal panel. -static Function/DF AR_GetSweepFolder(device) - string device +static Function/DF AR_GetSweepFolder(string device) if(!AR_IsActive(device)) return $"" @@ -306,9 +293,7 @@ static Function/DF AR_GetSweepFolder(device) End /// @brief Updates the `AR_SWEEPFOLDER` user data of the artefact removal panel -static Function AR_SetSweepFolder(device, sweepDFR) - string device - DFREF sweepDFR +static Function AR_SetSweepFolder(string device, DFREF sweepDFR) BSP_SetFolder(device, sweepDFR, MIES_BSP_AR_SWEEPFOLDER) End diff --git a/Packages/MIES/MIES_Async.ipf b/Packages/MIES/MIES_Async.ipf index 71389fa53f..424655b9a3 100644 --- a/Packages/MIES/MIES_Async.ipf +++ b/Packages/MIES/MIES_Async.ipf @@ -643,8 +643,7 @@ End /// @brief test if data folder is marked for thread usage /// /// UTF_NOINSTRUMENTATION -static Function ASYNC_IsThreadDF(dfr) - DFREF dfr +static Function ASYNC_IsThreadDF(DFREF dfr) NVAR/Z marker = dfr:$ASYNC_THREAD_MARKER_STR if(NVAR_Exists(marker)) diff --git a/Packages/MIES/MIES_BackgroundWatchdog.ipf b/Packages/MIES/MIES_BackgroundWatchdog.ipf index 8f0ba9ac3f..e0ff2b0fee 100644 --- a/Packages/MIES/MIES_BackgroundWatchdog.ipf +++ b/Packages/MIES/MIES_BackgroundWatchdog.ipf @@ -16,9 +16,7 @@ static Constant YGRID = 20 static Constant CONTROL_TYPE_VALDISPLAY = 4 -static Function ASSERT(var, errorMsg) - variable var - string errorMsg +static Function ASSERT(variable var, string errorMsg) string stracktrace, miesVersionStr, lockedDevicesStr, device string stacktrace = "" @@ -31,10 +29,7 @@ static Function ASSERT(var, errorMsg) endtry End -static Function SetValDisplay(win, control, [var, str, format]) - string win, control - variable var - string str, format +static Function SetValDisplay(string win, string control, [variable var, string str, string format]) string formattedString @@ -62,8 +57,7 @@ static Function SetValDisplay(win, control, [var, str, format]) ValDisplay $control, win=$win, value=#formattedString End -static Function/S GetValDisplayAsString(win, control) - string win, control +static Function/S GetValDisplayAsString(string win, string control) ControlInfo/W=$win $control ASSERT(V_flag != 0, "Non-existing control or window") @@ -71,8 +65,7 @@ static Function/S GetValDisplayAsString(win, control) return S_value End -static Function IsBackgroundTaskRunning(task) - string task +static Function IsBackgroundTaskRunning(string task) CtrlNamedBackground $task, status return NumberByKey("RUN", s_info) diff --git a/Packages/MIES/MIES_Blowout.ipf b/Packages/MIES/MIES_Blowout.ipf index c69cdde290..8c502d21c1 100644 --- a/Packages/MIES/MIES_Blowout.ipf +++ b/Packages/MIES/MIES_Blowout.ipf @@ -65,8 +65,7 @@ End /// @brief Checks that MIES is correctly configured for automated blowout protocol /// /// @returns one if settings are valid, zero otherwise -static Function BWO_CheckGlobalSettings(device) - string device +static Function BWO_CheckGlobalSettings(string device) string stimSetList variable PressureModeStorageCol, Connected, i @@ -111,8 +110,7 @@ static Function BWO_CheckGlobalSettings(device) End /// @brief Initates test pulse -static Function BWO_ConfigureTP(device) - string device +static Function BWO_ConfigureTP(string device) if(!TP_CheckIfTestpulseIsRunning(device)) PGC_SetAndActivateControl(device, "StartTestPulseButton", switchTab = 1) @@ -122,8 +120,7 @@ static Function BWO_ConfigureTP(device) End /// @brief Configures data acquisition settings for blowout -static Function BWO_SetMIESSettings(device) - string device +static Function BWO_SetMIESSettings(string device) // turn on insert TP PGC_SetAndActivateControl(device, "Check_Settings_InsertTP", val = 1) @@ -141,8 +138,7 @@ static Function BWO_SetMIESSettings(device) End /// @brief Applies a pressure pulse to all headstages with valid pressure settings -static Function BWO_InitParaPipetteClear(device) - string device +static Function BWO_InitParaPipetteClear(string device) variable startTime STRUCT BackgroundStruct s @@ -161,8 +157,7 @@ static Function BWO_InitParaPipetteClear(device) End /// @brief Attempts to clear pipettes that have a resistance larger than MAX_RESISTANCE -static Function BWO_CheckAndClearPipettes(device) - string device +static Function BWO_CheckAndClearPipettes(string device) variable i, j, col, initPressure, startTime, pressurePulseStartTime, pressurePulseTime @@ -214,8 +209,7 @@ static Function BWO_CheckAndClearPipettes(device) End /// @brief Turns OFF all relevant MCC amplifier controls in I- and V-clamp modes -static Function BWO_AllMCCCtrlsOFF(device) - string device +static Function BWO_AllMCCCtrlsOFF(string device) PGC_SetAndActivateControl(device, "Check_DataAcq_SendToAllAmp", val = CHECKBOX_SELECTED) BWO_SetClampModeAll(device, I_CLAMP_MODE) @@ -227,9 +221,7 @@ static Function BWO_AllMCCCtrlsOFF(device) End /// @brief Wrapper function for setting the clamp mode on all headstages (T̶h̶o̶m̶a̶s̶ ̶p̶r̶o̶b̶a̶b̶l̶y̶ ̶w̶o̶n̶'̶t̶ ̶l̶i̶k̶e̶ ̶i̶t̶ He liked it!! :/ ). -static Function BWO_SetClampModeAll(device, mode) - string device - variable mode +static Function BWO_SetClampModeAll(string device, variable mode) switch(mode) case V_CLAMP_MODE: @@ -247,8 +239,7 @@ static Function BWO_SetClampModeAll(device, mode) End /// @brief Turns OFF I-clamp controls -static Function BWO_DisableMCCIClampCtrls(device) - string device +static Function BWO_DisableMCCIClampCtrls(string device) PGC_SetAndActivateControl(device, "check_DatAcq_HoldEnable", val = CHECKBOX_UNSELECTED) PGC_SetAndActivateControl(device, "check_DatAcq_BBEnable", val = CHECKBOX_UNSELECTED) @@ -257,8 +248,7 @@ static Function BWO_DisableMCCIClampCtrls(device) End /// @brief Turns OFF V-clamp controls -static Function BWO_DisableMCCVClampCtrls(device) - string device +static Function BWO_DisableMCCVClampCtrls(string device) PGC_SetAndActivateControl(device, "check_DatAcq_HoldEnableVC", val = CHECKBOX_UNSELECTED) PGC_SetAndActivateControl(device, "check_DatAcq_WholeCellEnable", val = CHECKBOX_UNSELECTED) @@ -266,8 +256,7 @@ static Function BWO_DisableMCCVClampCtrls(device) End /// @brief Acquires blowout sweep -static Function BWO_AcquireSweep(device) - string device +static Function BWO_AcquireSweep(string device) PGC_SetAndActivateControl(device, "Radio_ClampMode_AllIClamp", val = CHECKBOX_SELECTED) PGC_SetAndActivateControl(device, "DataAcquireButton") diff --git a/Packages/MIES/MIES_BrowserSettingsPanel.ipf b/Packages/MIES/MIES_BrowserSettingsPanel.ipf index 012b8d0f13..96c0e5b641 100644 --- a/Packages/MIES/MIES_BrowserSettingsPanel.ipf +++ b/Packages/MIES/MIES_BrowserSettingsPanel.ipf @@ -91,8 +91,7 @@ End /// @brief UnHides BrowserSettings side Panel /// /// @param mainPanel mainWindow panel name -static Function BSP_UnHidePanel(mainPanel) - string mainPanel +static Function BSP_UnHidePanel(string mainPanel) BSP_UnHideSweepControls(mainPanel) BSP_UnHideSettingsPanel(mainPanel) @@ -101,8 +100,7 @@ static Function BSP_UnHidePanel(mainPanel) BSP_MainPanelButtonToggle(mainPanel, 0) End -static Function BSP_UnHideSettingsPanel(mainPanel) - string mainPanel +static Function BSP_UnHideSettingsPanel(string mainPanel) string bsPanel @@ -118,8 +116,7 @@ End /// @brief open bottom Panel /// /// @param mainPanel mainWindow panel name -static Function BSP_UnHideSweepControls(mainPanel) - string mainPanel +static Function BSP_UnHideSweepControls(string mainPanel) string scPanel @@ -134,8 +131,7 @@ End /// @brief dynamic settings for bottom panel at initialization /// /// @param mainPanel mainWindow panel name -static Function BSP_DynamicSweepControls(mainPanel) - string mainPanel +static Function BSP_DynamicSweepControls(string mainPanel) string scPanel @@ -449,6 +445,7 @@ End /// @param type One of #BROWSERTYPE_DATABROWSER or #BROWSERTYPE_SWEEPBROWSER /// @param mode One of @ref BrowserModes static Function/S BSP_SetBrowserType(string win, string type, variable mode) + string mainPanel string title, suffix @@ -461,6 +458,7 @@ static Function/S BSP_SetBrowserType(string win, string type, variable mode) End static Function BSP_ParseBrowserMode(string mode) + strswitch(mode) case "User": return BROWSER_MODE_USER @@ -474,6 +472,7 @@ static Function BSP_ParseBrowserMode(string mode) End static Function/S BSP_SerializeBrowserMode(variable mode) + switch(mode) case BROWSER_MODE_USER: return "User" @@ -534,8 +533,7 @@ End /// @brief set the initial state of the enable/disable buttons /// /// @param win name of external panel or main window -static Function BSP_InitMainCheckboxes(win) - string win +static Function BSP_InitMainCheckboxes(string win) string bsPanel @@ -608,9 +606,7 @@ End /// /// @param mainPanel main Panel window /// @param visible set status of external Panel (opened: visible = 1) -static Function BSP_MainPanelButtonToggle(mainPanel, visible) - string mainPanel - variable visible +static Function BSP_MainPanelButtonToggle(string mainPanel, variable visible) string panelButton @@ -877,9 +873,7 @@ End /// @param lastSweepOrIndex last available sweep(DB) or index(SB) /// /// @returns the new sweep number in case of DB or the index for SB -static Function BSP_UpdateSweepControls(win, ctrl, firstSweepOrIndex, lastSweepOrIndex) - string win, ctrl - variable firstSweepOrIndex, lastSweepOrIndex +static Function BSP_UpdateSweepControls(string win, string ctrl, variable firstSweepOrIndex, variable lastSweepOrIndex) string graph, scPanel variable currentSweep, newSweep, step, direction, ret @@ -1495,8 +1489,7 @@ Function BSP_UpdateSweepNote(string win) ReplaceNotebookText(lbPanel, sweepNote) End -static Function BSP_UnHideSettingsHistory(win) - string win +static Function BSP_UnHideSettingsHistory(string win) string settingsHistoryPanel @@ -1509,6 +1502,7 @@ static Function BSP_UnHideSettingsHistory(win) End static Function BSP_RemoveTraces(string graph) + variable i, numEntries string trace diff --git a/Packages/MIES/MIES_Browser_Plotter.ipf b/Packages/MIES/MIES_Browser_Plotter.ipf index d0ee469a77..56fd182a05 100644 --- a/Packages/MIES/MIES_Browser_Plotter.ipf +++ b/Packages/MIES/MIES_Browser_Plotter.ipf @@ -780,9 +780,7 @@ Function PostPlotTransformations(string win, variable mode, [WAVE/Z additionalDa LBV_Update(win) End -static Function InitPostPlotSettings(win, pps) - string win - STRUCT PostPlotSettings &pps +static Function InitPostPlotSettings(string win, STRUCT PostPlotSettings &pps) string bsPanel = BSP_GetPanel(win) @@ -805,11 +803,7 @@ End /// @param averagingEnabled switch if averaging is enabled or not /// @param averageDataFolder permanent datafolder where the average waves can be stored /// @param hideSweep are normal channel traces hidden or not -static Function AverageWavesFromSameYAxisIfReq(graph, averagingEnabled, averageDataFolder, hideSweep) - string graph - variable averagingEnabled - DFREF averageDataFolder - variable hideSweep +static Function AverageWavesFromSameYAxisIfReq(string graph, variable averagingEnabled, DFREF averageDataFolder, variable hideSweep) variable referenceTime, traceIndex string averageWaveName, listOfWaves, listOfChannelTypes, listOfChannelNumbers, listOfHeadstages @@ -964,10 +958,7 @@ static Function AverageWavesFromSameYAxisIfReq(graph, averagingEnabled, averageD End /// @brief Zero all given traces -static Function ZeroTracesIfReq(graph, traces, zeroTraces) - string graph - variable zeroTraces - WAVE/Z/T traces +static Function ZeroTracesIfReq(string graph, WAVE/Z/T traces, variable zeroTraces) string trace variable numTraces, i diff --git a/Packages/MIES/MIES_Cache.ipf b/Packages/MIES/MIES_Cache.ipf index 0e8accca22..4e54e79c87 100644 --- a/Packages/MIES/MIES_Cache.ipf +++ b/Packages/MIES/MIES_Cache.ipf @@ -267,9 +267,7 @@ threadsafe static Function CA_GetWaveModCRC(WAVE wv, variable crc) End /// @brief Calculate the CRC of all metadata of all or the given dimension -threadsafe static Function CA_WaveScalingCRC(crc, wv, [dimension]) - variable crc, dimension - WAVE wv +threadsafe static Function CA_WaveScalingCRC(variable crc, WAVE wv, [variable dimension]) variable dims, i @@ -299,9 +297,7 @@ End /// @param crcMode [optional] parameter to WaveCRC /// @param includeWaveScalingAndUnits [optional] include the wave scaling and units of filled dimensions /// @param dims [optional] number of dimensions to include wave scaling and units in crc -static Function/S CA_WaveCRCs(waveRefs, [crcMode, includeWaveScalingAndUnits, dims]) - WAVE/WAVE waveRefs - variable crcMode, includeWaveScalingAndUnits, dims +static Function/S CA_WaveCRCs(WAVE/WAVE waveRefs, [variable crcMode, variable includeWaveScalingAndUnits, variable dims]) variable rows diff --git a/Packages/MIES/MIES_CheckInstallation.ipf b/Packages/MIES/MIES_CheckInstallation.ipf index 07c0f670da..049416cedd 100644 --- a/Packages/MIES/MIES_CheckInstallation.ipf +++ b/Packages/MIES/MIES_CheckInstallation.ipf @@ -22,15 +22,13 @@ static Structure CHI_InstallationState variable numTries EndStructure -static Function CHI_InitInstallationState(state) - STRUCT CHI_InstallationState &state +static Function CHI_InitInstallationState(STRUCT CHI_InstallationState &state) state.numErrors = 0 state.numTries = 0 End -static Function CHI_CheckJSONXOPVersion(state) - STRUCT CHI_InstallationState &state +static Function CHI_CheckJSONXOPVersion(STRUCT CHI_InstallationState &state) variable id string info, version @@ -42,8 +40,7 @@ static Function CHI_CheckJSONXOPVersion(state) CHI_OutputVersionCheckResult(state, "JSON", CHI_JSON_XOP_VERSION, version) End -static Function CHI_CheckTUFXOPVersion(state) - STRUCT CHI_InstallationState &state +static Function CHI_CheckTUFXOPVersion(STRUCT CHI_InstallationState &state) variable id string version @@ -65,8 +62,7 @@ static Function CHI_OutputVersionCheckResult(STRUCT CHI_InstallationState &state endif End -static Function CHI_CheckITCXOPVersion(state) - STRUCT CHI_InstallationState &state +static Function CHI_CheckITCXOPVersion(STRUCT CHI_InstallationState &state) string version @@ -82,10 +78,7 @@ static Function CHI_CheckITCXOPVersion(state) End /// @brief Search list for matches of item and print the results -static Function CHI_CheckXOP(list, item, name, state, [expectedHash]) - string &list, item, name - STRUCT CHI_InstallationState &state - string expectedHash +static Function CHI_CheckXOP(string &list, string item, string name, STRUCT CHI_InstallationState &state, [string expectedHash]) variable numMatches, i, hashMatches string matches, fileVersion, filepath, existingHash, hashMsg diff --git a/Packages/MIES/MIES_Configuration.ipf b/Packages/MIES/MIES_Configuration.ipf index 697070711a..6fe1780f04 100644 --- a/Packages/MIES/MIES_Configuration.ipf +++ b/Packages/MIES/MIES_Configuration.ipf @@ -355,8 +355,7 @@ End /// /// @param type One of #CONF_AUTO_LOADER_GLOBAL or CONF_AUTO_LOADER_USER /// @returns name of an igor symbolic path to the settings folder -static Function/S CONF_GetSettingsPath(type) - variable type +static Function/S CONF_GetSettingsPath(variable type) variable numItems string symbPath, path @@ -518,8 +517,7 @@ End /// @brief Saves the GUI state of a DA_Ephys panel to a configuration file /// /// @param fName file name of configuration file to store DA_Ephys configuration -static Function CONF_SaveDAEphys(fName) - string fName +static Function CONF_SaveDAEphys(string fName) variable i, jsonID, saveMask, saveResult, prevJsonId, prevRigJsonId string out, wName, errMsg, newFileName, newRigFullFilePath, jsonTxt @@ -776,8 +774,7 @@ Function/S CONF_RestoreDAEphys(variable jsonID, string fullFilePath, [variable m End /// @brief Add the config file paths and SHA-256 hashes to the panel as user data -static Function CONF_AddConfigFileUserData(win, fullFilePath, rigFile) - string win, fullFilePath, rigFile +static Function CONF_AddConfigFileUserData(string win, string fullFilePath, string rigFile) SetWindow $win, userData($EXPCONFIG_UDATA_SOURCEFILE_PATH)=fullFilePath + FILE_LIST_SEP + rigFile @@ -792,8 +789,7 @@ End /// /// @param[in] str string in json format /// @returns jsonID of the json object -static Function CONF_ParseJSON(str) - string str +static Function CONF_ParseJSON(string str) variable err @@ -813,8 +809,7 @@ End /// /// @param jsonID ID of existing json /// @returns List of active head stages -static Function/S CONF_GetDAEphysActiveHeadstages(jsonID) - variable jsonID +static Function/S CONF_GetDAEphysActiveHeadstages(variable jsonID) WAVE hsStates = CONF_GetWaveFromSavedControlArray(jsonID, DAEPHYS_HEADSTAGECTRLARRAYPREFIX) return NumericWaveToList(hsStates, ";") @@ -823,8 +818,7 @@ End /// @brief Checks if EXPCONFIG_RESERVED_DATABLOCK exists in json; ASSERTion is thrown if not found. /// /// @param jsonID ID of existing json -static Function CONF_RequireConfigBlockExists(jsonID) - variable jsonID +static Function CONF_RequireConfigBlockExists(variable jsonID) WAVE/T ctrlGroups = JSON_GetKeys(jsonID, "") FindValue/TXOP=4/TEXT=EXPCONFIG_RESERVED_DATABLOCK ctrlGroups @@ -836,9 +830,7 @@ End /// @param jsonID ID of existing json /// @param keyName key name of setting /// @returns string from member with keyname in the EXPCONFIG_RESERVED_DATABLOCK -static Function/S CONF_GetStringFromSettings(jsonID, keyName) - variable jsonID - string keyName +static Function/S CONF_GetStringFromSettings(variable jsonID, string keyName) CONF_RequireConfigBlockExists(jsonID) return JSON_GetString(jsonID, EXPCONFIG_RESERVED_DATABLOCK + "/" + keyName) @@ -853,10 +845,7 @@ End /// this is returned instead /// /// @returns value of the EXPCONFIG_FIELD_CTRLVVALUE field of the control -static Function CONF_GetVariableFromSettings(jsonID, keyName, [defaultValue]) - variable jsonID - string keyName - variable defaultValue +static Function CONF_GetVariableFromSettings(variable jsonID, string keyName, [variable defaultValue]) variable val @@ -881,9 +870,7 @@ End /// @param jsonID ID of existing json /// @param niceName nice name of control /// @returns Path to control in json, empty string if not found -static Function/S CONF_FindControl(jsonID, niceName) - variable jsonID - string niceName +static Function/S CONF_FindControl(variable jsonID, string niceName) variable i, numWindows string result @@ -907,9 +894,7 @@ End /// @param basePath root of traversal start /// @param niceName nice name of control /// @returns Path to control in json, empty string if not found -static Function/S CONF_TraversalFinder(jsonID, basePath, niceName) - variable jsonID - string basePath, niceName +static Function/S CONF_TraversalFinder(variable jsonID, string basePath, string niceName) variable i, numElems string result @@ -941,9 +926,7 @@ End /// @param jsonID ID of existing json /// @param arrayName name of ControlArray /// @returns text wave with data from ControlArray -static Function/WAVE CONF_GetWaveFromSavedControlArray(jsonID, arrayName) - variable jsonID - string arrayName +static Function/WAVE CONF_GetWaveFromSavedControlArray(variable jsonID, string arrayName) string arrayPath = CONF_FindControl(jsonID, arrayName) ASSERT(!IsEmpty(arrayPath), "Can not find ControlArray " + arrayName + " in config file.") @@ -955,9 +938,7 @@ End /// @param jsonID ID of existing json /// @param niceName nice name of control /// @returns value of the EXPCONFIG_FIELD_CTRLSVALUE field of the control -static Function/S CONF_GetStringFromSavedControl(jsonID, niceName) - variable jsonID - string niceName +static Function/S CONF_GetStringFromSavedControl(variable jsonID, string niceName) string ctrlPath = CONF_FindControl(jsonID, niceName) ASSERT(!IsEmpty(ctrlPath), "Can not find control " + niceName + " in config file.") @@ -969,9 +950,7 @@ End /// @param jsonID ID of existing json /// @param niceName nice name of control /// @returns value of the EXPCONFIG_FIELD_CTRLVVALUE field of the control -static Function CONF_GetVariableFromSavedControl(jsonID, niceName) - variable jsonID - string niceName +static Function CONF_GetVariableFromSavedControl(variable jsonID, string niceName) string ctrlPath = CONF_FindControl(jsonID, niceName) ASSERT(!IsEmpty(ctrlPath), "Can not find control " + niceName + " in config file.") @@ -983,8 +962,7 @@ End /// /// @param[in] jsonID ID of existing json /// @returns Text wave with all named configuration sections -static Function/WAVE CONF_GetWindowNames(jsonID) - variable jsonID +static Function/WAVE CONF_GetWindowNames(variable jsonID) WAVE/T ctrlGroups = JSON_GetKeys(jsonID, "") RemoveTextWaveEntry1D(ctrlGroups, EXPCONFIG_RESERVED_DATABLOCK) @@ -997,8 +975,7 @@ End /// /// @param[in] wName Name of window /// @returns Text wave with two columns and in each row ControlArray name (column ARRAYNAME) and control list (column CTRLNAMELIST) -static Function/WAVE CONF_GetControlArrayList(wName) - string wName +static Function/WAVE CONF_GetControlArrayList(string wName) string ctrlList, ctrlName, arrayName variable i, numWinCtrl, col1, numCtrlArrays @@ -1035,10 +1012,7 @@ End /// @param[in] ctrlData ctrlData wave, 2d four column text wave as created in CONF_JSONToWindow(). This wave is updated by this function. /// @param[in] jsonID json object to traverse /// @param[in] basePath root path for traversal -static Function CONF_GatherControlsFromJSON(ctrlData, jsonID, basePath) - WAVE/T ctrlData - variable jsonID - string basePath +static Function CONF_GatherControlsFromJSON(WAVE/T ctrlData, variable jsonID, string basePath) variable i, numElems, offset @@ -1246,8 +1220,7 @@ End /// @param winHandle window handle /// @param uKey [optional, default = EXPCONFIG_UDATA_WINHANDLE] userdata key that stores the handle value /// @returns Window name of the window with the given handle; empty string if not found. -static Function/S CONF_FindWindow(winHandle, [uKey]) - string winHandle, uKey +static Function/S CONF_FindWindow(string winHandle, [string uKey]) variable i, j, numWin, numSubWin string wList, wName, wSubList @@ -1279,10 +1252,7 @@ End /// @param ctrlName Control name /// @param jsonPath [optional, default = n/a] When given: the control is expected to be a named json object (with the control nice name) /// If not given: the jsons second level (assuming default format) is searched for the associated object. This is slower. -static Function CONF_RestoreControl(wName, restoreMask, jsonID, ctrlName, [jsonPath]) - string wName - variable restoreMask, jsonID - string ctrlName, jsonPath +static Function CONF_RestoreControl(string wName, variable restoreMask, variable jsonID, string ctrlName, [string jsonPath]) string ctrlTypeName, uData, uKey, base64Key, str, wList, niceName, arrayName, arrayElemPath variable i, base64Entries, ctrlType, setVarType, varTypeGlobal, val, numGroups, arrayElemType @@ -1704,8 +1674,7 @@ Function CONF_WindowToJSON(string wName, variable saveMask, [string excCtrlTypes endtry End -static Function/S CONF_GetCompleteJSONCtrlPath(path) - string path +static Function/S CONF_GetCompleteJSONCtrlPath(string path) variable i, numElems string completePath = "" @@ -1741,11 +1710,7 @@ End /// @param jsonID ID of existing json /// @param excCtrlTypes List of excluded control types that are ignored /// @param excUserKeys List of excluded keys of userdata fields that are ignored -static Function CONF_ControlToJSON(wName, ctrlName, saveMask, jsonID, excCtrlTypes, excUserKeys) - string wName, ctrlName - variable saveMask - variable jsonID - string excCtrlTypes, excUserKeys +static Function CONF_ControlToJSON(string wName, string ctrlName, variable saveMask, variable jsonID, string excCtrlTypes, string excUserKeys) variable ctrlType, pos, i, numUdataKeys, setVarType, arrayIndex, oldSize, preferCode, arrayElemType string wList, ctrlPath, controlPath, niceName, jsonPath, udataPath, uDataKey, uData, s, arrayName, arrayElemPath @@ -1963,9 +1928,7 @@ End /// @param[in] device panel title of DA_Ephys panel /// @param[in] jsonID ID of json object with configuration data /// @param[in] midExp middle of experiment - uploads MCC relevant settings from panel to MCC instead -static Function CONF_RestoreHeadstageAssociation(device, jsonID, midExp) - string device - variable jsonID, midExp +static Function CONF_RestoreHeadstageAssociation(string device, variable jsonID, variable midExp) variable i, type, numRows, ampSerial, ampChannel, index, value, warnMissingMCCSync string jsonPath, jsonBasePath, jsonPathAmpBlock @@ -2133,8 +2096,7 @@ End /// @brief Retrieves current User Pressure settings to json /// @param[in] device panel title of DA_Ephys panel /// @returns jsonID ID of json object with user pressure configuration data -static Function CONF_GetUserPressure(device) - string device +static Function CONF_GetUserPressure(string device) variable jsonID @@ -2149,9 +2111,7 @@ End /// @brief Restore User Pressure settings /// @param[in] device panel title of DA_Ephys panel /// @param[in] jsonID ID of json object with configuration data -static Function CONF_RestoreUserPressure(device, jsonID) - string device - variable jsonID +static Function CONF_RestoreUserPressure(string device, variable jsonID) string jsonPath @@ -2169,8 +2129,7 @@ End /// /// @param[in] device device /// @returns jsonID ID of json object with user pressure configuration data -static Function CONF_GetAmplifierSettings(device) - string device +static Function CONF_GetAmplifierSettings(string device) variable jsonID, i, clampMode, ampSerial, ampChannelID, index string jsonPath, amplifierDef, basePath @@ -2316,10 +2275,7 @@ End /// @param[in] headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// @param[in] jsonID ID of json object with configuration data /// @param[in] basePath absolute path in the json file to search the entries -static Function CONF_RestoreAmplifierSettings(device, headStage, jsonID, basePath) - string device - variable headStage, jsonID - string basePath +static Function CONF_RestoreAmplifierSettings(string device, variable headStage, variable jsonID, string basePath) variable clampMode, val, ret string path @@ -2403,8 +2359,7 @@ End /// /// @param ampSerialRef Amplifier Serial Number to search for /// @param ampChannelIDRef Headstage reference number -static Function CONF_FindAmpInList(ampSerialRef, ampChannelIDRef) - variable ampSerialRef, ampChannelIDRef +static Function CONF_FindAmpInList(variable ampSerialRef, variable ampChannelIDRef) string listOfAmps, ampDef variable numAmps, i, ampSerial, ampChannelID @@ -2423,9 +2378,7 @@ static Function CONF_FindAmpInList(ampSerialRef, ampChannelIDRef) ASSERT(0, "Could not find amplifier") End -static Function CONF_MCC_MidExp(device, headStage, jsonID) - string device - variable headStage, jsonID +static Function CONF_MCC_MidExp(string device, variable headStage, variable jsonID) variable settingValue, clampMode @@ -2572,9 +2525,7 @@ End /// @brief Loads, parses and joins a *_rig.json file to a main configuration file. /// @param[in] jsonID jsonID of main configuration /// @param[in] rigFileName full file path of rig file -static Function CONF_JoinRigFile(jsonID, rigFileName) - variable jsonID - string rigFileName +static Function CONF_JoinRigFile(variable jsonID, string rigFileName) string input variable jsonIDRig diff --git a/Packages/MIES/MIES_DAC-Hardware.ipf b/Packages/MIES/MIES_DAC-Hardware.ipf index 6247311853..7b3aaa383f 100644 --- a/Packages/MIES/MIES_DAC-Hardware.ipf +++ b/Packages/MIES/MIES_DAC-Hardware.ipf @@ -656,8 +656,7 @@ End /// @brief Check if the given hardware type is valid /// /// Invalid here means that the value is out-of-range. -static Function HW_IsValidHardwareType(hardwareType) - variable hardwareType +static Function HW_IsValidHardwareType(variable hardwareType) #ifndef EVIL_KITTEN_EATING_MODE return hardwareType == HARDWARE_NI_DAC || hardwareType == HARDWARE_ITC_DAC || hardwareType == HARDWARE_SUTTER_DAC @@ -669,8 +668,7 @@ End /// @brief Check if the given device ID is valid /// /// Invalid here means that the value is out-of-range. -static Function HW_IsValidDeviceID(deviceID) - variable deviceID +static Function HW_IsValidDeviceID(variable deviceID) #ifndef EVIL_KITTEN_EATING_MODE return deviceID >= 0 && deviceID < HARDWARE_MAX_DEVICES @@ -1075,8 +1073,7 @@ End /// @brief Return the error message for the given ITC XOP2 error code /// /// @param errCode one of @ref ITCXOP2Errors -threadsafe static Function/S HW_ITC_GetXOPErrorMessage(errCode) - variable errCode +threadsafe static Function/S HW_ITC_GetXOPErrorMessage(variable errCode) if(errCode < FIRST_XOP_ERROR) return GetErrMessage(errCode) @@ -1388,8 +1385,7 @@ Function HW_ITC_GetCurrentDevice([variable flags]) End /// @brief Create a fifo position wave from a DAQConfigWave -threadsafe static Function/WAVE HW_ITC_GetFifoPosFromConfig(config_t) - WAVE config_t +threadsafe static Function/WAVE HW_ITC_GetFifoPosFromConfig(WAVE config_t) Duplicate/FREE config_t, fifoPos_t @@ -1846,8 +1842,7 @@ Function HW_ITC_HandleReturnValues(variable flags, variable ITCError, variable I DEBUGPRINT("Unimplemented") End -threadsafe static Function/S HW_ITC_GetXOPErrorMessage(errCode) - variable errCode +threadsafe static Function/S HW_ITC_GetXOPErrorMessage(variable errCode) DEBUGPRINT_TS("Unimplemented") End @@ -1902,8 +1897,7 @@ Function HW_ITC_GetCurrentDevice([variable flags]) DEBUGPRINT("Unimplemented") End -threadsafe static Function/WAVE HW_ITC_GetFifoPosFromConfig(config_t) - WAVE config_t +threadsafe static Function/WAVE HW_ITC_GetFifoPosFromConfig(WAVE config_t) DEBUGPRINT_TS("Unimplemented") End @@ -2886,9 +2880,7 @@ End /// /// @param device name of the NI device /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -static Function HW_NI_ResetDevice(device, [flags]) - string device - variable flags +static Function HW_NI_ResetDevice(string device, [variable flags]) variable ret @@ -2938,9 +2930,7 @@ End /// @param device name of the NI device /// @param force [optional, default 0] When not zero, forces a calibration /// @param flags [optional, default none] One or multiple flags from @ref HardwareInteractionFlags -static Function HW_NI_CalibrateDevice(device, [force, flags]) - string device - variable force, flags +static Function HW_NI_CalibrateDevice(string device, [variable force, variable flags]) variable ret @@ -3109,16 +3099,12 @@ Function HW_NI_ZeroDAC(variable deviceID, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -static Function HW_NI_ResetDevice(device, [flags]) - string device - variable flags +static Function HW_NI_ResetDevice(string device, [variable flags]) DoAbortNow("NI-DAQ XOP is not available") End -static Function HW_NI_CalibrateDevice(device, [force, flags]) - string device - variable force, flags +static Function HW_NI_CalibrateDevice(string device, [variable force, variable flags]) DoAbortNow("NI-DAQ XOP is not available") End diff --git a/Packages/MIES/MIES_DAEphys.ipf b/Packages/MIES/MIES_DAEphys.ipf index 8e43d9772c..f19585e551 100644 --- a/Packages/MIES/MIES_DAEphys.ipf +++ b/Packages/MIES/MIES_DAEphys.ipf @@ -861,6 +861,7 @@ Function/S DAP_FormatStimSetPopupValue(variable channelType, [string searchStrin End static Function DAP_UpdateDrawElements(string device, variable tab) + SetDrawLayer/W=$device/K ProgBack switch(tab) @@ -1124,9 +1125,7 @@ End /// @brief Adapt the state of the associated headstage on DA/AD channel change /// -static Function DAP_AdaptAssocHeadstageState(device, checkboxCtrl) - string device - string checkboxCtrl +static Function DAP_AdaptAssocHeadstageState(string device, string checkboxCtrl) string headStageCheckBox variable headstage, idx, channelType, controlType @@ -1177,8 +1176,7 @@ static Function DAP_AdaptAssocHeadstageState(device, checkboxCtrl) End /// @brief Return the repeated acquisition cycle ID for the given devide. -static Function DAP_GetRAAcquisitionCycleID(device) - string device +static Function DAP_GetRAAcquisitionCycleID(string device) DAP_AbortIfUnlocked(device) @@ -1279,16 +1277,14 @@ Function DAP_OneTimeCallBeforeDAQ(string device, variable runMode) endif End -static Function DAP_ResetClampModeTitle(device, ctrl) - string device, ctrl +static Function DAP_ResetClampModeTitle(string device, string ctrl) SetControlTitle(device, ctrl, "") SetControlTitleColor(device, ctrl, 0, 0, 0) End /// @brief Enable all controls which were disabled before DAQ by #DAP_OneTimeCallBeforeDAQ -static Function DAP_ResetGUIAfterDAQ(device) - string device +static Function DAP_ResetGUIAfterDAQ(string device) variable i, ADC, DAC @@ -1400,6 +1396,7 @@ Function DAP_OneTimeCallAfterDAQ(string device, variable stopReason, [variable f End static Function DAP_DocumentStopReason(string device, variable stopReason) + variable sweepNo Make/FREE/N=(3, 1)/T keys @@ -1458,9 +1455,7 @@ Function DAP_CheckProc_ShowScopeWin(STRUCT WMCheckboxAction &cba) : CheckBoxCont return 0 End -static Function DAP_TurnOffAllChannels(device, channelType) - string device - variable channelType +static Function DAP_TurnOffAllChannels(string device, variable channelType) variable i, numEntries string ctrl @@ -1764,8 +1759,7 @@ Function/S DAP_FormatTelegraphServerList(WAVE telegraphServers) return list End -static Function/S DAP_GetAmplifierDef(ampSerial, ampChannel) - variable ampSerial, ampChannel +static Function/S DAP_GetAmplifierDef(variable ampSerial, variable ampChannel) string str @@ -2451,6 +2445,7 @@ static Function DAP_CheckAsyncSettings(string device) End static Function DAP_CheckPressureSettings(string device) + variable ADConfig, ADC string pressureDevice, userPressureDevice @@ -2494,9 +2489,7 @@ static Function DAP_CheckPressureSettings(string device) End /// @brief Returns zero if everything is okay, 1 if a non-recoverable error was found and 2 on recoverable errors -static Function DAP_CheckHeadStage(device, headStage, mode) - string device - variable headStage, mode +static Function DAP_CheckHeadStage(string device, variable headStage, variable mode) string unit, ADUnit, DAUnit variable DACchannel, ADCchannel, DAheadstage, ADheadstage, DAGain, ADGain, realMode @@ -2755,8 +2748,7 @@ static Function DAP_CheckChannel(string device, variable channelType, variable c return 0 End -static Function DAP_CheckAnalysisFunctionAndParameter(device, setName) - string device, setName +static Function DAP_CheckAnalysisFunctionAndParameter(string device, string setName) string func, listOfAnalysisFunctions string info, str @@ -2831,9 +2823,7 @@ static Function DAP_CheckAnalysisFunctionAndParameter(device, setName) endfor End -static Function DAP_CheckStimset(device, channelType, channel, headstage) - string device - variable channelType, channel, headstage +static Function DAP_CheckStimset(string device, variable channelType, variable channel, variable headstage) string setName, setNameEnd, channelTypeStr, str variable i, numSets @@ -2945,8 +2935,7 @@ End /// @brief Synchronizes the contents of `ChanAmpAssign` and /// `ChanAmpAssignUnit` to all active headstages -static Function DAP_SyncChanAmpAssignToActiveHS(device) - string device +static Function DAP_SyncChanAmpAssignToActiveHS(string device) variable i, clampMode WAVE statusHS = DAG_GetChannelState(device, CHANNEL_TYPE_HEADSTAGE) @@ -2963,9 +2952,7 @@ static Function DAP_SyncChanAmpAssignToActiveHS(device) End /// @brief Reads the channel amp waves and inserts that info into the DA_EPHYS panel -static Function DAP_ApplyClmpModeSavdSettngs(device, headStage, clampMode) - string device - variable headStage, clampMode +static Function DAP_ApplyClmpModeSavdSettngs(string device, variable headStage, variable clampMode) string ctrl, ADUnit, DAUnit variable DAGain, ADGain @@ -3024,9 +3011,7 @@ static Function DAP_ApplyClmpModeSavdSettngs(device, headStage, clampMode) ChannelClampMode[ADCchannel][%ADC][%Headstage] = headStage End -static Function DAP_RemoveClampModeSettings(device, headStage, clampMode) - string device - variable headStage, clampMode +static Function DAP_RemoveClampModeSettings(string device, variable headStage, variable clampMode) string ctrl variable DACchannel, ADCchannel @@ -3328,11 +3313,7 @@ End ///@param headstage controls associated with headstage are set ///@param clampMode clamp mode to activate ///@param delayed indicate on the control that the change is delayed -static Function DAP_SetAmpModeControls(device, headstage, clampMode, [delayed]) - string device - variable headstage - variable clampMode - variable delayed +static Function DAP_SetAmpModeControls(string device, variable headstage, variable clampMode, [variable delayed]) if(ParamIsDefault(delayed)) delayed = 0 @@ -3367,10 +3348,7 @@ End /// @param headstage Channels associated with headstage are set /// @param clampMode Clamp mode to activate /// @param delayed [optional, defaults to false] Indicate that this is a delayed clamp mode change -static Function DAP_SetHeadstageChanControls(device, headstage, clampMode, [delayed]) - string device - variable headstage - variable clampMode, delayed +static Function DAP_SetHeadstageChanControls(string device, variable headstage, variable clampMode, [variable delayed]) variable oppositeMode @@ -3384,9 +3362,7 @@ static Function DAP_SetHeadstageChanControls(device, headstage, clampMode, [dela DAP_AllChanDASettings(device, headStage, delayed = delayed) End -static Function DAP_UpdateClampmodeTabs(device, headStage, clampMode) - string device - variable headStage, clampMode +static Function DAP_UpdateClampmodeTabs(string device, variable headStage, variable clampMode) string highlightSpec = "\\f01\\Z11" @@ -3404,9 +3380,7 @@ static Function DAP_UpdateClampmodeTabs(device, headStage, clampMode) TabControl tab_DataAcq_Amp, win=$device, tabLabel(I_EQUAL_ZERO_MODE)=SelectString(clampMode == I_EQUAL_ZERO_MODE, "", highlightSpec) + "I = 0" End -static Function DAP_ChangeHeadstageState(device, headStageCtrl, enabled) - string device, headStageCtrl - variable enabled +static Function DAP_ChangeHeadstageState(string device, string headStageCtrl, variable enabled) variable clampMode, headStage, TPState, ICstate, VCstate, IZeroState variable channelType, controlType, i @@ -3782,9 +3756,7 @@ End /// as a group where only one can be checked at a time. /// /// Write into the GUI state wave as well -static Function DAP_ToggleCheckBoxes(win, ctrl, list, checked) - string win, ctrl, list - variable checked +static Function DAP_ToggleCheckBoxes(string win, string ctrl, string list, variable checked) string partner @@ -3894,8 +3866,7 @@ Function/S DAP_GetCommentNotebook(string device) End /// @brief Create the comment panel -static Function DAP_OpenCommentPanel(device) - string device +static Function DAP_OpenCommentPanel(string device) string commentPanel, commentNotebook @@ -3933,10 +3904,7 @@ Function DAP_ButtonProc_OpenCommentNB(STRUCT WMButtonAction &ba) : ButtonControl return 0 End -static Function/S DAP_FormatCommentString(device, comment, sweepNo) - string device - string comment - variable sweepNo +static Function/S DAP_FormatCommentString(string device, string comment, variable sweepNo) string str, contents, commentNotebook variable length @@ -3963,8 +3931,7 @@ End /// to the comment notebook and to the labnotebook. /// /// The `SetVariable` for the user comment is also cleared -static Function DAP_AddUserComment(device) - string device +static Function DAP_AddUserComment(string device) string commentNotebook, comment, formattedComment variable sweepNo @@ -4363,9 +4330,7 @@ Function DAP_ButProc_Hrdwr_UnlckDev(STRUCT WMButtonAction &ba) : ButtonControl return 0 End -static Function DAP_UpdateDataFolderDisplay(device, locked) - string device - variable locked +static Function DAP_UpdateDataFolderDisplay(string device, variable locked) string title if(locked) @@ -4643,16 +4608,14 @@ static Function DAP_LoadBuiltinStimsets() KillPath $symbPath End -static Function DAP_ClearWaveIfExists(wv) - WAVE/Z wv +static Function DAP_ClearWaveIfExists(WAVE/Z wv) if(WaveExists(wv)) Redimension/N=(0, -1, -1, -1) wv endif End -static Function DAP_UnlockDevice(device) - string device +static Function DAP_UnlockDevice(string device) variable flags, state, hardwareType string lockedDevices, wlName @@ -4764,6 +4727,7 @@ End /// @brief Update the list of locked devices static Function DAP_UpdateListOfLockedDevices() + variable i, numDevs, numItm string NIPanelList = "" string ITCPanelList = WinList("ITC*", ";", "WIN:64") @@ -4783,8 +4747,7 @@ static Function DAP_UpdateListOfLockedDevices() panelList = ITCPanelList + NIPanelList + SUPanelList End -static Function DAP_UpdateChanAmpAssignStorWv(device) - string device +static Function DAP_UpdateChanAmpAssignStorWv(string device) variable HeadStageNo, ampSerial, ampChannelID string amplifierDef @@ -4824,8 +4787,7 @@ static Function DAP_UpdateChanAmpAssignStorWv(device) endif End -static Function DAP_UpdateChanAmpAssignPanel(device) - string device +static Function DAP_UpdateChanAmpAssignPanel(string device) variable HeadStageNo, channel, ampSerial, ampChannelID string entry @@ -4901,9 +4863,7 @@ End /// @param device device /// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES] /// @param delayed [optional, defaults to false] On a delayed clamp mode change the stimulus set is not set. -static Function DAP_AllChanDASettings(device, headStage, [delayed]) - string device - variable headStage, delayed +static Function DAP_AllChanDASettings(string device, variable headStage, [variable delayed]) string ctrl variable scalar, index, indexEnd, DAC, clampMode @@ -5299,6 +5259,7 @@ Function DAP_UpdateDaEphysStimulusSetPopups([string device]) End static Function DAP_UpdateStimulusSetPopup(string device, string ctrl, string stimsets) + string stimset variable index @@ -5406,6 +5367,7 @@ End /// @brief Write a new TP setting value to the wave static Function DAP_TPGUISettingToWave(string device, string ctrl, variable val) + string lbl, entry variable first, last, TPState, needsTPRestart diff --git a/Packages/MIES/MIES_DAEphys_GuiState.ipf b/Packages/MIES/MIES_DAEphys_GuiState.ipf index e935fbf821..140fefcbad 100644 --- a/Packages/MIES/MIES_DAEphys_GuiState.ipf +++ b/Packages/MIES/MIES_DAEphys_GuiState.ipf @@ -456,9 +456,7 @@ End /// /// @param type one of the type constants from @ref ChannelTypeAndControlConstants /// @param device panel title -static Function/WAVE DAG_ControlStatusWave(device, type) - string device - variable type +static Function/WAVE DAG_ControlStatusWave(string device, variable type) string ctrl variable i, numEntries @@ -479,8 +477,7 @@ End /// /// All callers, except the ones updating the GUIState wave, /// should prefer DAG_GetHeadstageMode() instead. -static Function/WAVE DAG_GetAllHSMode(device) - string device +static Function/WAVE DAG_GetAllHSMode(string device) variable i, headStage, clampMode string ctrl @@ -497,8 +494,7 @@ static Function/WAVE DAG_GetAllHSMode(device) End /// @brief Parses a list of controls in the device and returns a list of unique controls -static Function/S DAG_GetUniqueCtrlList(device) - string device +static Function/S DAG_GetUniqueCtrlList(string device) string prunedList = "" string list, ctrlToRemove, ctrl @@ -534,9 +530,7 @@ static Function/S DAG_GetUniqueCtrlList(device) End /// @brief Parses a list of controls and returns numeric checkBox, valDisplay, setVariable, popUpMenu, and slider controls -static Function/S DAG_GetSpecificCtrlNum(device, list) - string device - string list +static Function/S DAG_GetSpecificCtrlNum(string device, string list) string subtypeCtrlList = "" variable i, numEntries, controlType @@ -570,9 +564,7 @@ static Function/S DAG_GetSpecificCtrlNum(device, list) End /// @brief Parses a list of controls and returns textual valDisplay, setVariable and popUpMenu controls -static Function/S DAG_GetSpecificCtrlTxT(device, list) - string device - string list +static Function/S DAG_GetSpecificCtrlTxT(string device, string list) string subtypeCtrlList = "" variable i, numEntries, controlType @@ -604,9 +596,7 @@ static Function/S DAG_GetSpecificCtrlTxT(device, list) End /// @brief Returns the mode of all setVars in the DA_Ephys panel of a controlType -static Function/WAVE GetAllDAEphysSetVarNum(device, channelType, controlType) - string device - variable channelType, controlType +static Function/WAVE GetAllDAEphysSetVarNum(string device, variable channelType, variable controlType) variable CtrlNum = GetNumberFromType(var = channelType) string ctrl @@ -620,9 +610,7 @@ static Function/WAVE GetAllDAEphysSetVarNum(device, channelType, controlType) End /// @brief Returns the mode of all setVars in the DA_Ephys panel of a controlType -static Function/WAVE GetAllDAEphysSetVarTxT(device, channelType, controlType) - string device - variable channelType, controlType +static Function/WAVE GetAllDAEphysSetVarTxT(string device, variable channelType, variable controlType) variable CtrlNum = GetNumberFromType(var = channelType) string ctrl @@ -636,9 +624,7 @@ static Function/WAVE GetAllDAEphysSetVarTxT(device, channelType, controlType) End /// @brief Returns the index of all popupmenus in the DA_Ephys panel of a controlType -static Function/WAVE GetAllDAEphysPopMenuIndex(device, channelType, controlType) - string device - variable channelType, controlType +static Function/WAVE GetAllDAEphysPopMenuIndex(string device, variable channelType, variable controlType) variable CtrlNum = GetNumberFromType(var = channelType) string ctrl @@ -652,9 +638,7 @@ static Function/WAVE GetAllDAEphysPopMenuIndex(device, channelType, controlType) End /// @brief Returns the string contents of all popupmenus in the DA_Ephys panel of a controlType -static Function/WAVE GetAllDAEphysPopMenuString(device, channelType, controlType) - string device - variable channelType, controlType +static Function/WAVE GetAllDAEphysPopMenuString(string device, variable channelType, variable controlType) variable CtrlNum = GetNumberFromType(var = channelType) string ctrl diff --git a/Packages/MIES/MIES_DANDI.ipf b/Packages/MIES/MIES_DANDI.ipf index 361ca125ae..2388749016 100644 --- a/Packages/MIES/MIES_DANDI.ipf +++ b/Packages/MIES/MIES_DANDI.ipf @@ -15,6 +15,7 @@ static Function/S DND_GetDestinationIgorPath() End static Function/S DND_ChooseAsset(WAVE/T props) + variable idx, ret WAVE data = GetDandiDialogWave(props) @@ -42,6 +43,7 @@ End /// /// @return absolute path to the downloaded asset static Function/S DND_FetchAsset(variable setNumber, string assetID, string assetPath) + string url, refHash, downloadUrl, path, name, assetFilePath, data, fname variable jsonID @@ -80,6 +82,7 @@ End /// /// Example: https://api.dandiarchive.org/api/dandisets/000068/versions/draft/assets/ static Function/WAVE DND_ParseSetReponse(string response) + string path variable jsonID, numEntries, i diff --git a/Packages/MIES/MIES_DataAcquisition_Multi.ipf b/Packages/MIES/MIES_DataAcquisition_Multi.ipf index 76ebc4a133..2ef248aa79 100644 --- a/Packages/MIES/MIES_DataAcquisition_Multi.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Multi.ipf @@ -324,12 +324,11 @@ Function DQM_Timer(STRUCT WMBackgroundStruct &s) End static Function DQM_StartBckrdFIFOMonitor() + CtrlNamedBackground $TASKNAME_FIFOMONMD, start End -static Function DQM_StopDataAcq(device, deviceID) - string device - variable deviceID +static Function DQM_StopDataAcq(string device, variable deviceID) variable hardwareType = GetHardwareType(device) if(hardwareType == HARDWARE_ITC_DAC) @@ -341,9 +340,7 @@ static Function DQM_StopDataAcq(device, deviceID) RA_ContinueOrStop(device, multiDevice = 1) End -static Function DQM_BkrdDataAcq(device, [triggerMode]) - string device - variable triggerMode +static Function DQM_BkrdDataAcq(string device, [variable triggerMode]) if(ParamIsDefault(triggerMode)) triggerMode = HARDWARE_DAC_DEFAULT_TRIGGER @@ -374,9 +371,7 @@ End /// /// @param device panel title /// @param deviceID id of the device to be removed -static Function DQM_RemoveDevice(device, deviceID) - string device - variable deviceID +static Function DQM_RemoveDevice(string device, variable deviceID) variable row @@ -405,8 +400,7 @@ End /// @brief Adds a device to the ActiveDeviceList /// /// @param device panel title -static Function DQM_AddDevice(device) - string device +static Function DQM_AddDevice(string device) variable numberOfRows @@ -423,9 +417,7 @@ static Function DQM_AddDevice(device) ActiveDeviceList[numberOfRows][%ActiveChunk] = NaN End -static Function DQM_MakeOrUpdateTimerParamWave(device, listOfFunctions, startTime, RunTime, EndTime, addOrRemoveDevice) - string device, ListOfFunctions - variable startTime, RunTime, EndTime, addOrRemoveDevice +static Function DQM_MakeOrUpdateTimerParamWave(string device, string listOfFunctions, variable startTime, variable RunTime, variable EndTime, variable addOrRemoveDevice) variable rowToRemove = NaN variable numberOfRows @@ -468,9 +460,7 @@ static Function DQM_MakeOrUpdateTimerParamWave(device, listOfFunctions, startTim ASSERT(DimSize(TimerFunctionListWave, ROWS) == DimSize(ActiveDevTimeParam, ROWS), "Number of rows in ActiveDevTimeParam and TimerFunctionListWave must be equal") End -static Function DQM_MakeOrUpdtDevTimerTxtWv(device, listOfFunctions, rowToRemove, addOrRemoveDevice) - string device, listOfFunctions - variable rowToRemove, addOrRemoveDevice +static Function DQM_MakeOrUpdtDevTimerTxtWv(string device, string listOfFunctions, variable rowToRemove, variable addOrRemoveDevice) variable numberOfRows diff --git a/Packages/MIES/MIES_DataAcquisition_Single.ipf b/Packages/MIES/MIES_DataAcquisition_Single.ipf index c1039a1158..adbfaccc20 100644 --- a/Packages/MIES/MIES_DataAcquisition_Single.ipf +++ b/Packages/MIES/MIES_DataAcquisition_Single.ipf @@ -104,6 +104,7 @@ End /// @brief Stop single device data acquisition static Function DQS_StopDataAcq(string device, variable stopReason, [variable forcedStop]) + if(ParamIsDefault(forcedStop)) forcedStop = 0 else diff --git a/Packages/MIES/MIES_DataBrowser.ipf b/Packages/MIES/MIES_DataBrowser.ipf index 1a28499348..235a18f821 100644 --- a/Packages/MIES/MIES_DataBrowser.ipf +++ b/Packages/MIES/MIES_DataBrowser.ipf @@ -297,8 +297,7 @@ Function/S DB_ClearAllGraphs() endfor End -static Function/S DB_LockToDevice(win, device) - string win, device +static Function/S DB_LockToDevice(string win, string device) string newWindow variable first, last @@ -326,8 +325,7 @@ static Function/S DB_LockToDevice(win, device) return win End -static Function DB_SetUserData(win, device) - string win, device +static Function DB_SetUserData(string win, string device) SetWindow $win, userdata="" BSP_SetDevice(win, device) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index c153fea149..ab655e278f 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -116,9 +116,7 @@ Function DC_Configure(string device, variable dataAcqOrTP, [variable multiDevice endif End -static Function DC_UpdateHSProperties(device, ADCs) - string device - WAVE ADCs +static Function DC_UpdateHSProperties(string device, WAVE ADCs) variable i, numChannels, headStage @@ -144,9 +142,7 @@ static Function DC_UpdateHSProperties(device, ADCs) End /// @brief Return the number of selected checkboxes for the given type -static Function DC_NoOfChannelsSelected(device, type) - string device - variable type +static Function DC_NoOfChannelsSelected(string device, variable type) WAVE channelState = DAG_GetChannelState(device, type) @@ -157,9 +153,7 @@ End /// /// @param device panel title /// @param dataAcqOrTP acquisition mode, one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE -static Function DC_ChannelCalcForDAQConfigWave(device, dataAcqOrTP) - string device - variable dataAcqOrTP +static Function DC_ChannelCalcForDAQConfigWave(string device, variable dataAcqOrTP) variable numDACs, numADCs, numTTLsRackZero, numTTLsRackOne, numActiveHeadstages variable numTTLs @@ -208,9 +202,7 @@ End /// /// @param device device /// @param rackNo Only the ITC1600 can have two racks. For all other ITC devices RackNo = 0. -static Function DC_AreTTLsInRackChecked(device, rackNo) - string device - variable rackNo +static Function DC_AreTTLsInRackChecked(string device, variable rackNo) variable first, last @@ -225,9 +217,7 @@ End /// @param device device /// @param dataAcqOrTP acquisition mode, one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE /// @param channelType channel type, one of @ref ChannelTypeAndControlConstants -static Function DC_LongestOutputWave(device, dataAcqOrTP, channelType) - string device - variable dataAcqOrTP, channelType +static Function DC_LongestOutputWave(string device, variable dataAcqOrTP, variable channelType) variable maxNumRows, i, numEntries, numPulses, singlePulseLength @@ -332,9 +322,7 @@ End /// /// @param device panel title /// @param numActiveChannels number of active channels as returned by DC_ChannelCalcForDAQConfigWave() -static Function DC_MakeDAQConfigWave(device, numActiveChannels) - string device - variable numActiveChannels +static Function DC_MakeDAQConfigWave(string device, variable numActiveChannels) WAVE config = GetDAQConfigWave(device) @@ -352,6 +340,7 @@ End /// @param s DataConfigurationResult structure /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE static Function [WAVE/Z DAQDataWave, WAVE/WAVE NIDataWave] DC_MakeAndGetDAQDataWave(string device, STRUCT DataConfigurationResult &s, variable dataAcqOrTP) + variable numRows, i switch(s.hardwareType) @@ -482,6 +471,7 @@ End /// @param device panel title /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE static Function DC_MakeHelperWaves(string device, variable dataAcqOrTP) + variable numRows, col, hardwareType, decimatedNumRows, numPixels, dataPointsPerPixel variable decMethod, decFactor, tpLength, numADCs, numDACs, numTTLs, decimatedSampleInterval variable tpOrPowerSpectrumLength, powerSpectrum @@ -681,9 +671,8 @@ static Function DC_InitScaledDataWave(string device, variable dataAcqOrTP) End /// @brief Initialize OscilloscopeData waves to NaN -static Function DC_InitOscilloscopeDataWave(wv, numRows, sampleInterval, numDACs, numADCs, numTTLs, [type, isFourierTransform]) - WAVE wv - variable numRows, sampleInterval, numDACs, numADCs, numTTLs, type, isFourierTransform +static Function DC_InitOscilloscopeDataWave(WAVE wv, variable numRows, variable sampleInterval, variable numDACs, variable numADCs, variable numTTLs, [variable type, variable isFourierTransform]) + string msg ASSERT(numDACs > 0, "Invalid number of DACs") @@ -791,9 +780,7 @@ End /// /// @param device panel title /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE -static Function DC_PlaceDataInDAQConfigWave(device, dataAcqOrTP) - string device - variable dataAcqOrTP +static Function DC_PlaceDataInDAQConfigWave(string device, variable dataAcqOrTP) variable i, j, numEntries, ret, channel variable col, adc, dac, headstage @@ -935,10 +922,7 @@ End /// @param channelType One of @ref ChannelTypeAndControlConstants /// /// @return number of data points, *not* time -static Function DC_CalculateLongestSweep(device, dataAcqOrTP, channelType) - string device - variable dataAcqOrTP - variable channelType +static Function DC_CalculateLongestSweep(string device, variable dataAcqOrTP, variable channelType) return DC_CalculateGeneratedDataSize(device, dataAcqOrTP, DC_LongestOutputWave(device, dataAcqOrTP, channelType)) End @@ -958,9 +942,7 @@ End /// @param device device /// @param dataAcqOrTP one of #DATA_ACQUISITION_MODE or #TEST_PULSE_MODE /// @param genLength length of a generated data wave -static Function DC_CalculateGeneratedDataSize(device, dataAcqOrTP, genLength) - string device - variable dataAcqOrTP, genLength +static Function DC_CalculateGeneratedDataSize(string device, variable dataAcqOrTP, variable genLength) variable decimationFactor @@ -994,9 +976,7 @@ End /// @param multiDevice Fine tune data handling for single device (false) or multi device (true) /// /// @exception Abort configuration failure -static Function DC_PlaceDataInDAQDataWave(device, numActiveChannels, dataAcqOrTP, multiDevice) - string device - variable numActiveChannels, dataAcqOrTP, multiDevice +static Function DC_PlaceDataInDAQDataWave(string device, variable numActiveChannels, variable dataAcqOrTP, variable multiDevice) variable ret, row, column @@ -1106,6 +1086,7 @@ static Function DC_WriteTTLIntoDAQDataWave(string device, STRUCT DataConfigurati End static Function DC_PrepareLBNEntries(string device, STRUCT DataConfigurationResult &s) + variable i, j, maxITI, channel, headstage, setChecksum, fingerprint, stimsetCycleID, isoodDAQMember, samplingInterval string func, ctrl, str @@ -1288,6 +1269,7 @@ static Function DC_PrepareLBNEntries(string device, STRUCT DataConfigurationResu End static Function DC_FillSetEventFlag(string device, STRUCT DataConfigurationResult &s) + variable i, channel WAVE config = GetDAQConfigWave(device) @@ -1427,6 +1409,7 @@ static Function DC_FillDAQDataWaveForTP(string device, STRUCT DataConfigurationR End static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfigurationResult &s) + variable i, tpAmp, cutOff, channel, headstage, DAScale, singleSetLength, stimsetCol, startOffset variable lastValidRow, isUnAssociated, maxLimit, minLimit @@ -1529,6 +1512,7 @@ static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfiguration End static Function [STRUCT DataConfigurationResult s] DC_GetConfiguration(string device, variable numActiveChannels, variable dataAcqOrTP, variable multiDevice) + variable channel, headstage, channelMode variable scalingZero, indexingLocked, indexing variable i, j, ret, setCycleCountLocal @@ -1806,9 +1790,7 @@ static Function DC_SetupConfigurationTTLstimSets(string device, STRUCT DataConfi End /// @brief Document hardware type/name/serial number into the labnotebook -static Function DC_DocumentHardwareProperties(device, hardwareType) - string device - variable hardwareType +static Function DC_DocumentHardwareProperties(string device, variable hardwareType) string str, key @@ -1852,9 +1834,7 @@ End /// @param device device /// @param fingerprint fingerprint as returned by DC_GenerateStimsetFingerprint() /// @param DAC DA channel -static Function DC_GetStimsetAcqCycleID(device, fingerprint, DAC) - string device - variable fingerprint, DAC +static Function DC_GetStimsetAcqCycleID(string device, variable fingerprint, variable DAC) WAVE stimsetAcqIDHelper = GetStimsetAcqIDHelperWave(device) @@ -1880,10 +1860,7 @@ End /// /// Always then this fingerprint changes, a new stimset acquisition cycle ID has /// to be generated. -static Function DC_GenerateStimsetFingerprint(raCycleID, setName, setCycleCount, setChecksum) - variable raCycleID - string setName - variable setChecksum, setCycleCount +static Function DC_GenerateStimsetFingerprint(variable raCycleID, string setName, variable setCycleCount, variable setChecksum) variable crc @@ -2266,6 +2243,7 @@ End /// @brief Calculate the stop collection point, includes all required global adjustments static Function DC_GetStopCollectionPoint(string device, STRUCT DataConfigurationResult &s) + variable DAClength, TTLlength, totalIncrease DAClength = DC_CalculateLongestSweep(device, s.dataAcqOrTP, CHANNEL_TYPE_DAC) diff --git a/Packages/MIES/MIES_DebugPanel.ipf b/Packages/MIES/MIES_DebugPanel.ipf index 281d943583..0e58c19c09 100644 --- a/Packages/MIES/MIES_DebugPanel.ipf +++ b/Packages/MIES/MIES_DebugPanel.ipf @@ -74,6 +74,7 @@ Function/S DP_OpenDebugPanel() End static Function DP_FillDebugPanelWaves() + string symbPath, path, allProcFiles WAVE/T listWave = GetDebugPanelListWave() diff --git a/Packages/MIES/MIES_Debugging.ipf b/Packages/MIES/MIES_Debugging.ipf index c49f0604cc..f07c74ba42 100644 --- a/Packages/MIES/MIES_Debugging.ipf +++ b/Packages/MIES/MIES_Debugging.ipf @@ -12,8 +12,7 @@ /// @brief Return the first function from the stack trace /// not located in this file. -static Function FindFirstOutsideCaller(func, line, file) - string &func, &line, &file +static Function FindFirstOutsideCaller(string &func, string &line, string &file) string stacktrace, caller variable numCallers, i @@ -318,6 +317,7 @@ End /// Creates a notebook with the special name "HistoryCarbonCopy" /// which will hold a copy of the history static Function CreateHistoryLog() + DoWindow/K HistoryCarbonCopy NewNotebook/V=0/F=0/N=HistoryCarbonCopy End @@ -644,6 +644,7 @@ Function CheckAllDimensionLabels() End threadsafe static Function/S CheckDimensionLabels(WAVE/Z wv) + variable i, numDims, j, size, numMatches, numEntries, idx string entry string msg = "" diff --git a/Packages/MIES/MIES_Downsample.ipf b/Packages/MIES/MIES_Downsample.ipf index 9cc4c0a387..4d13703cce 100644 --- a/Packages/MIES/MIES_Downsample.ipf +++ b/Packages/MIES/MIES_Downsample.ipf @@ -35,6 +35,7 @@ static StrConstant dataPath = "root:MIES:postExperimentProcedures:downsample:" static StrConstant panel = "Downsampling" static Function/DF GetDownsampleDataFolder() + return createDFWithAllParents(dataPath) End @@ -135,12 +136,7 @@ End /// @param deviceType device type /// @param deviceNumber device number /// @returns index of the last valid entry into the passed waves -static Function AppendEntries(list, dataRef, rate, startIndex, deviceType, deviceNumber) - string deviceType, deviceNumber - variable startIndex - WAVE/T list - WAVE/WAVE dataRef - WAVE rate +static Function AppendEntries(WAVE/T list, WAVE/WAVE dataRef, WAVE rate, variable startIndex, string deviceType, string deviceNumber) string listOfDataWaves, name variable numWaves, i, idx, convrate, samplingInterval @@ -173,8 +169,7 @@ static Function AppendEntries(list, dataRef, rate, startIndex, deviceType, devic End /// @brief Updates all waves holding acquired data info -static Function UpdateDataWaves(deviceType, deviceNumber) - string deviceType, deviceNumber +static Function UpdateDataWaves(string deviceType, string deviceNumber) variable i, idx @@ -190,8 +185,7 @@ static Function UpdateDataWaves(deviceType, deviceNumber) Redimension/N=(idx, -1) list, dataRef, rate End -static Function UpdateCurrentSize(win) - string win +static Function UpdateCurrentSize(string win) WAVE/WAVE dataRef = GetDownsampleDataRefWave() variable i, size = 0 @@ -208,8 +202,7 @@ static Function UpdateCurrentSize(win) SetValDisplay(win, valdisp_currentsize, var = size, format = "%3.0f") End -static Function GetTargetRate(win) - string win +static Function GetTargetRate(string win) string str @@ -222,8 +215,7 @@ static Function GetTargetRate(win) return str2num(str) End -static Function UpdateEstimatedSizeAfterwards(win) - string win +static Function UpdateEstimatedSizeAfterwards(string win) WAVE/WAVE dataRef = GetDownsampleDataRefWave() WAVE rate = GetDownsampleRateWave() @@ -245,8 +237,8 @@ static Function UpdateEstimatedSizeAfterwards(win) End /// @brief Disable the equalize checkbox if all data waves have the same rate -static Function ApplyConstantRateChanges(win) - string win +static Function ApplyConstantRateChanges(string win) + variable minimumRate, maximumRate WAVE rate = GetDownsampleRateWave() @@ -265,9 +257,7 @@ End /// @param win panel name /// @param var variable to expand /// @param constantRates boolean switch, defaults to false -static Function/S ExpandRateToList(win, var, [constantRates]) - variable var, constantRates - string win +static Function/S ExpandRateToList(string win, variable var, [variable constantRates]) variable i, count = 10 string list = "" @@ -318,17 +308,14 @@ Function/S GetPopupMenuRates() return ExpandRateToList(panel, maximum / CalculateLCMOfWave(uniqueRates)) End -static Function GetDecimationMethod(win) - string win +static Function GetDecimationMethod(string win) // we niftly exploit the fact that the indizes of the popup // and the DECIMATION_BY_* constants have a mathematical relation return 2^GetPopupMenuIndex(win, popup_decimationMethod) End -static Function UpdateCheckBoxes(win, control, state) - string win, control - variable state +static Function UpdateCheckBoxes(string win, string control, variable state) variable low, high, inc @@ -348,9 +335,7 @@ static Function UpdateCheckBoxes(win, control, state) UpdateEstimatedSizeAfterwards(win) End -static Function UpdatePopupMenuWindowFunction(win, [decimationMethod]) - string win - variable decimationMethod +static Function UpdatePopupMenuWindowFunction(string win, [variable decimationMethod]) if(ParamIsDefault(decimationMethod)) decimationMethod = GetDecimationMethod(win) @@ -591,8 +576,7 @@ Function ButtonDoIt(STRUCT WMButtonAction &ba) : ButtonControl return 0 End -static Function UpdatePopupMenuTargetRate(win) - string win +static Function UpdatePopupMenuTargetRate(string win) variable idx @@ -604,8 +588,7 @@ static Function UpdatePopupMenuTargetRate(win) SetPopupMenuIndex(win, popup_targetrate, idx) End -static Function UpdatePanel(win, [deviceSelectionString]) - string win, deviceSelectionString +static Function UpdatePanel(string win, [string deviceSelectionString]) string deviceType, deviceNumber variable ret diff --git a/Packages/MIES/MIES_EnhancedWMRoutines.ipf b/Packages/MIES/MIES_EnhancedWMRoutines.ipf index ad8500583b..1985d9bfdc 100644 --- a/Packages/MIES/MIES_EnhancedWMRoutines.ipf +++ b/Packages/MIES/MIES_EnhancedWMRoutines.ipf @@ -271,9 +271,7 @@ End // We need the fractional point number but x2pnt // doesn't return that. -threadsafe static Function x2pntWithFrac(wv, scaledDim) - WAVE wv - variable scaledDim +threadsafe static Function x2pntWithFrac(WAVE wv, variable scaledDim) return (scaledDim - DimOffset(wv, 0)) / DimDelta(wv, 0) End diff --git a/Packages/MIES/MIES_ExperimentDocumentation.ipf b/Packages/MIES/MIES_ExperimentDocumentation.ipf index a1af098e3d..32a6e15521 100644 --- a/Packages/MIES/MIES_ExperimentDocumentation.ipf +++ b/Packages/MIES/MIES_ExperimentDocumentation.ipf @@ -36,6 +36,7 @@ Function ED_AddEntriesToResults(WAVE vals, WAVE/T keys, variable entrySourceType End static Function ED_CheckValuesAndKeys(WAVE vals, WAVE keys) + ASSERT(DimSize(vals, ROWS) == 1, "Mismatched row count") ASSERT(DimSize(vals, COLS) == DimSize(keys, COLS), "Mismatched column count") ASSERT(DimSize(vals, LAYERS) <= LABNOTEBOOK_LAYER_COUNT, "Mismatched layer count") @@ -59,6 +60,7 @@ End /// @param entrySourceType type of reporting subsystem, one of @ref DataAcqModes /// @param logbookType type of the logbook, one of @ref LogbookTypes static Function ED_createTextNotes(WAVE/T incomingTextualValues, WAVE/T incomingTextualKeys, variable sweepNo, variable entrySourceType, variable logbookType, [string device]) + variable rowIndex, numCols, i, lastValidIncomingLayer, state string timestamp @@ -179,6 +181,7 @@ End /// @param entrySourceType type of reporting subsystem, one of @ref DataAcqModes /// @param logbookType one of @ref LogbookTypes static Function ED_createWaveNotes(WAVE incomingNumericalValues, WAVE/T incomingNumericalKeys, variable sweepNo, variable entrySourceType, variable logbookType, [string device]) + variable rowIndex, numCols, lastValidIncomingLayer, i, timestamp, state if(ParamIsDefault(device)) @@ -309,9 +312,7 @@ End /// @brief Record changed labnotebook entries compared to the last sweep to the sweep wave note /// /// Honours tolerances defined in the keywave and LABNOTEBOOK_BINARY_UNIT values -static Function ED_WriteChangedValuesToNote(device, sweepNo) - string device - variable sweepNo +static Function ED_WriteChangedValuesToNote(string device, variable sweepNo) string key, factor, unit, text, frontLabel string str = "" @@ -396,9 +397,7 @@ End /// Textual version. /// /// Honours tolerances defined in the keywave and LABNOTEBOOK_BINARY_UNIT values -static Function ED_WriteChangedValuesToNoteText(device, sweepNo) - string device - variable sweepNo +static Function ED_WriteChangedValuesToNoteText(string device, variable sweepNo) string key, factor, text, frontLabel, ignoreKeyList string str = "" @@ -489,6 +488,7 @@ End /// @retval colIndizes column indizes of the entries from incomingKey /// @retval rowIndex returns the row index into values at which the new values should be written static Function [WAVE colIndizes, variable rowIndex] ED_FindIndizesAndRedimension(WAVE/T incomingKey, WAVE incomingValues, WAVE/T key, WAVE values, variable logbookType) + variable numCols, numKeyRows, numKeyCols, i, j, numAdditions, idx variable lastValidIncomingKeyRow, descIndex, isUserEntry, headstageCont, headstageContDesc, isUnAssoc string msg, searchStr @@ -707,9 +707,7 @@ Function ED_WriteUserCommentToLabNB(string device, string comment, variable swee End /// @brief This function is used to create wave notes for the informations found in the Asynchronous tab in the DA_Ephys panel -static Function ED_createAsyncWaveNoteTags(device, sweepCount) - string device - variable sweepCount +static Function ED_createAsyncWaveNoteTags(string device, variable sweepCount) string title, unit, str, ctrl variable minSettingValue, maxSettingValue, i, scaledValue @@ -897,6 +895,7 @@ End /// @param sweepNo sweep number /// @param entrySourceType type of reporting subsystem, one of @ref DataAcqModes static Function ED_TPSettingsDocumentation(string device, variable sweepNo, variable entrySourceType) + WAVE TPSettingsLBN = GetTPSettingsLabnotebook(device) WAVE TPSettingsLBNKeyWave = GetTPSettingsLabnotebookKeyWave(device) diff --git a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf index 25cfe216e8..3a07496fff 100644 --- a/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf +++ b/Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf @@ -56,10 +56,7 @@ /// @param globalVarName name of the global variable /// @param initialValue initial value of the variable. Will only be used if /// it is created. 0 by default. -threadsafe static Function/S GetNVARAsString(dfr, globalVarName, [initialValue]) - DFREF dfr - string globalVarName - variable initialValue +threadsafe static Function/S GetNVARAsString(DFREF dfr, string globalVarName, [variable initialValue]) NVAR/Z/SDFR=dfr var = $globalVarName if(!NVAR_Exists(var)) @@ -84,10 +81,7 @@ End /// @param globalStrName name of the global string /// @param initialValue initial value of the string. Will only be used if /// it is created. null by default. -threadsafe static Function/S GetSVARAsString(dfr, globalStrName, [initialValue]) - DFREF dfr - string globalStrName - string initialValue +threadsafe static Function/S GetSVARAsString(DFREF dfr, string globalStrName, [string initialValue]) SVAR/Z/SDFR=dfr str = $globalStrName if(!SVAR_Exists(str)) diff --git a/Packages/MIES/MIES_GuiPopupMenuExt.ipf b/Packages/MIES/MIES_GuiPopupMenuExt.ipf index 61c33308ab..061626fac7 100644 --- a/Packages/MIES/MIES_GuiPopupMenuExt.ipf +++ b/Packages/MIES/MIES_GuiPopupMenuExt.ipf @@ -537,8 +537,7 @@ Function PEXT_ButtonProc(STRUCT WMButtonAction &ba) : ButtonControl End /// @brief Verifies menu data input wave and transfers it to global -static Function PEXT_VerifyAndSetMenuWave(menuWave) - WAVE/Z/T menuWave +static Function PEXT_VerifyAndSetMenuWave(WAVE/Z/T menuWave) variable subMenuCnt, i string subItem diff --git a/Packages/MIES/MIES_GuiUtilities.ipf b/Packages/MIES/MIES_GuiUtilities.ipf index 7d86a90b77..a04a77e516 100644 --- a/Packages/MIES/MIES_GuiUtilities.ipf +++ b/Packages/MIES/MIES_GuiUtilities.ipf @@ -904,6 +904,7 @@ Function GetAxisLogMode(string graph, string axis) End static Function GetAxisLogModeFromInfo(string info) + string recMacro recMacro = GetAxisRecreationMacro(info) @@ -1873,9 +1874,7 @@ Function/S GetAllWindows(string wName) return windowList End -static Function GetAllWindowsImpl(wName, windowList) - string wName - string &windowList +static Function GetAllWindowsImpl(string wName, string &windowList) string children variable i, numChildren, err @@ -2208,6 +2207,7 @@ Function/S GetControlSettingStr(string recMacro, string setting, [string defValu End static Function [string match, variable found] GetControlSettingImpl(string recMacro, string setting) + string str SplitString/E=("(?i)\\Q" + setting + "\\E[[:space:]]*=[[:space:]]*([^,]+)") recMacro, str diff --git a/Packages/MIES/MIES_IgorHooks.ipf b/Packages/MIES/MIES_IgorHooks.ipf index df174788ef..1f9e392e4a 100644 --- a/Packages/MIES/MIES_IgorHooks.ipf +++ b/Packages/MIES/MIES_IgorHooks.ipf @@ -65,6 +65,7 @@ End /// We also invalidate the stored json ID, so that on the next access /// it is read again. static Function IH_SerializeSettings() + NVAR JSONid = $GetSettingsJSONid() PS_SerializeSettings(PACKAGE_MIES, JSONid) @@ -77,33 +78,28 @@ End #ifdef MIES_PXP_NWB_CONVERSION_SKIP_SAVING -static Function IgorBeforeNewHook(igorApplicationNameStr) - string igorApplicationNameStr +static Function IgorBeforeNewHook(string igorApplicationNameStr) ExperimentModified 0 return 0 End -static Function IgorStartOrNewHook(igorApplicationNameStr) - string igorApplicationNameStr +static Function IgorStartOrNewHook(string igorApplicationNameStr) ExperimentModified 0 return 0 End -static Function BeforeExperimentSaveHook(rN, fileName, path, type, creator, kind) - variable rN, kind - string fileName, path, type, creator +static Function BeforeExperimentSaveHook(variable rN, string fileName, string path, string type, string creator, variable kind) ExperimentModified 0 return 0 End -static Function IgorBeforeQuitHook(unsavedExp, unsavedNotebooks, unsavedProcedures) - variable unsavedExp, unsavedNotebooks, unsavedProcedures +static Function IgorBeforeQuitHook(variable unsavedExp, variable unsavedNotebooks, variable unsavedProcedures) ExperimentModified 0 @@ -112,9 +108,7 @@ End #else -static Function BeforeExperimentSaveHook(rN, fileName, path, type, creator, kind) - variable rN, kind - string fileName, path, type, creator +static Function BeforeExperimentSaveHook(variable rN, string fileName, string path, string type, string creator, variable kind) string device @@ -187,8 +181,7 @@ static Function IH_Cleanup() LOG_AddEntry(PACKAGE_MIES, "end") End -static Function IgorBeforeQuitHook(unsavedExp, unsavedNotebooks, unsavedProcedures) - variable unsavedExp, unsavedNotebooks, unsavedProcedures +static Function IgorBeforeQuitHook(variable unsavedExp, variable unsavedNotebooks, variable unsavedProcedures) variable err @@ -223,8 +216,7 @@ static Function ShowQuitMessage() DoUpdate End -static Function IgorQuitHook(igorApplicationNameStr) - string igorApplicationNameStr +static Function IgorQuitHook(string igorApplicationNameStr) LOG_AddEntry(PACKAGE_MIES, "start") @@ -238,8 +230,7 @@ End /// Called before a new experiment is opened, in response to the New Experiment, /// Revert Experiment, or Open Experiment menu items in the File menu. -static Function IgorBeforeNewHook(igorApplicationNameStr) - string igorApplicationNameStr +static Function IgorBeforeNewHook(string igorApplicationNameStr) variable modifiedBefore, modifiedAfter @@ -268,8 +259,7 @@ static Function IgorBeforeNewHook(igorApplicationNameStr) End /// Called when Igor is first launched and then whenever a new experiment is being created. -static Function IgorStartOrNewHook(igorApplicationNameStr) - string igorApplicationNameStr +static Function IgorStartOrNewHook(string igorApplicationNameStr) string miesVersion variable modifiedBefore @@ -300,10 +290,7 @@ static Function IgorStartOrNewHook(igorApplicationNameStr) return 0 End -static Function BeforeUncompiledHook(changeCode, procedureWindowTitleStr, textChangeStr) - variable changeCode - string procedureWindowTitleStr - string textChangeStr +static Function BeforeUncompiledHook(variable changeCode, string procedureWindowTitleStr, string textChangeStr) LOG_AddEntry(PACKAGE_MIES, "start") @@ -328,6 +315,7 @@ static Function BeforeUncompiledHook(changeCode, procedureWindowTitleStr, textCh End static Function AfterCompiledHook() + ClearRTError() variable modifiedBefore diff --git a/Packages/MIES/MIES_Indexing.ipf b/Packages/MIES/MIES_Indexing.ipf index d27312bf1a..4dcbbfb56f 100644 --- a/Packages/MIES/MIES_Indexing.ipf +++ b/Packages/MIES/MIES_Indexing.ipf @@ -54,8 +54,7 @@ Function IDX_ResetStartFinishForIndexing(string device) End /// @brief Locked indexing, indexes all active channels at once -static Function IDX_IndexingDoIt(device) - string device +static Function IDX_IndexingDoIt(string device) variable i @@ -92,9 +91,7 @@ End /// @brief Indexes a single channel - used when indexing is unlocked /// /// Callers need to call DAP_UpdateDAQControls() with #REASON_STIMSET_CHANGE_DUR_DAQ. -static Function IDX_IndexSingleChannel(device, channelType, channel) - string device - variable channelType, channel +static Function IDX_IndexSingleChannel(string device, variable channelType, variable channel) variable first, last variable waveIdx, indexIdx @@ -149,9 +146,7 @@ Function IDX_MaxSweepsLockedIndexing(string device) End /// @brief Return the number of steps in the largest set for a particular index number -static Function IDX_StepsInSetWithMaxSweeps(device, IndexNo, channelType) - string device - variable IndexNo, channelType +static Function IDX_StepsInSetWithMaxSweeps(string device, variable IndexNo, variable channelType) variable MaxSteps, SetSteps variable ListStartNo, ListEndNo, ListLength, Index @@ -202,9 +197,7 @@ static Function [variable waveIdx, variable indexIdx] IDX_GetCurrentSets(string End /// @brief Return the number of sets on the active channel with the most sets. -static Function IDX_MaxSets(device, channelType) - string device - variable channelType +static Function IDX_MaxSets(string device, variable channelType) variable i, waveIdx, indexIdx, MaxSets @@ -348,9 +341,7 @@ Function/WAVE IDX_GetSetsInRange(string device, variable channel, variable chann End /// @brief Determine the number of sweeps for a DA or TTL channel -static Function IDX_NumberOfSweepsAcrossSets(device, channel, channelType, lockedIndexing) - string device - variable channel, channelType, lockedIndexing +static Function IDX_NumberOfSweepsAcrossSets(string device, variable channel, variable channelType, variable lockedIndexing) variable numSweeps, numEntries, i string setList @@ -384,9 +375,7 @@ Function IDX_NumberOfSweepsInSet(string setName) return max(1, DimSize(wv, COLS)) End -static Function IDX_ApplyUnLockedIndexing(device, count) - string device - variable count +static Function IDX_ApplyUnLockedIndexing(string device, variable count) variable i, update @@ -424,9 +413,7 @@ static Function IDX_ApplyUnLockedIndexing(device, count) endif End -static Function IDX_TotalIndexingListSteps(device, channelNumber, channelType) - string device - variable channelNumber, channelType +static Function IDX_TotalIndexingListSteps(string device, variable channelNumber, variable channelType) variable totalListSteps variable i, first, last, minimum, maximum @@ -472,9 +459,7 @@ Function IDX_UnlockedIndexingStepNo(string device, variable channelNumber, varia return count - StepsInSummedSets End -static Function IDX_DetIfCountIsAtSetBorder(device, count, channelNumber, channelType) - string device - variable count, channelNumber, channelType +static Function IDX_DetIfCountIsAtSetBorder(string device, variable count, variable channelNumber, variable channelType) variable i, stepsInSummedSets, totalListSteps, direction variable first, last @@ -514,9 +499,7 @@ Function IDX_CalculcateActiveSetCount(string device) End /// @brief Extract the list of stimsets from the control user data -static Function/WAVE IDX_GetStimsets(device, channelIdx, channelType) - string device - variable channelIdx, channelType +static Function/WAVE IDX_GetStimsets(string device, variable channelIdx, variable channelType) string ctrl, list @@ -535,9 +518,7 @@ End /// @param idx 0-based index /// @param allowNone [optional, defaults to false] Return the `NONE` stimset for idx `0`. /// Not allowed during DAQ. -static Function/S IDX_GetSingleStimset(listWave, idx, [allowNone]) - WAVE/T listWave - variable idx, allowNone +static Function/S IDX_GetSingleStimset(WAVE/T listWave, variable idx, [variable allowNone]) if(ParamIsDefault(allowNone)) allowNone = 0 diff --git a/Packages/MIES/MIES_InputDialog.ipf b/Packages/MIES/MIES_InputDialog.ipf index 72e4469f0d..0a01ae35f3 100644 --- a/Packages/MIES/MIES_InputDialog.ipf +++ b/Packages/MIES/MIES_InputDialog.ipf @@ -85,6 +85,7 @@ static Function ID_SetTitle(string win, string title) End static Function/S ID_GetControl(variable index) + string ctrl if(index < NUM_HEADSTAGES) @@ -97,6 +98,7 @@ static Function/S ID_GetControl(variable index) End static Function/DF ID_GetFolder(string win) + DFREF dfr = $GetUserData(win, "", "folder") ASSERT(DataFolderExistsDFR(dfr), "Missing folder user data") @@ -104,6 +106,7 @@ static Function/DF ID_GetFolder(string win) End static Function/WAVE ID_GetWave(string win) + DFREF dfr = ID_GetFolder(win) WAVE/WAVE waves = ListToWaveRefWave(GetListOfObjects(dfr, ".*", fullPath = 1), 1) diff --git a/Packages/MIES/MIES_JSONWaveNotes.ipf b/Packages/MIES/MIES_JSONWaveNotes.ipf index 53a0e9b045..56dba54cda 100644 --- a/Packages/MIES/MIES_JSONWaveNotes.ipf +++ b/Packages/MIES/MIES_JSONWaveNotes.ipf @@ -135,6 +135,7 @@ threadsafe Function/WAVE JWN_GetWaveRefTextFromWaveNote(WAVE wv, string jsonPath End threadsafe static Function/WAVE JWN_GetWaveRefFromWaveNote_Impl(WAVE wv, string jsonPath, variable type) + variable jsonID, numRows jsonID = JWN_GetWaveNoteAsJSON(wv) diff --git a/Packages/MIES/MIES_LogbookViewer.ipf b/Packages/MIES/MIES_LogbookViewer.ipf index 199f62bd30..7267f5b283 100644 --- a/Packages/MIES/MIES_LogbookViewer.ipf +++ b/Packages/MIES/MIES_LogbookViewer.ipf @@ -36,6 +36,7 @@ Function/S LBV_GetDescriptionNotebook(string win) End static Function/WAVE LBV_PopupExtFormatEntries(WAVE/Z/T entries) + WAVE/Z/T splittedMenu = PEXT_SplitToSubMenus(entries, method = PEXT_SUBSPLIT_ALPHA) PEXT_GenerateSubMenuNames(splittedMenu) @@ -111,6 +112,7 @@ Function/WAVE LBV_GetAllLogbookParamNames(WAVE/Z/T textualValues, WAVE/Z/T numer End static Function/WAVE LBV_GetAllLogbookParamNames_NoCache(WAVE/Z/T textualValues, WAVE/Z/T numericalValues) + variable existText, existNum WAVE/Z/T textualNames = LBV_GetFilledLabnotebookEntries(textualValues) @@ -172,6 +174,7 @@ End /// @brief Return the datafolder reference where TPStorage waves can be found. static Function/DF LBV_GetTPStorageLocation(string win) + string shPanel, device, dataFolder if(BSP_IsDataBrowser(win)) @@ -387,6 +390,7 @@ End /// @param graph name of the graph /// @param traceList list of traces in the graph static Function LBV_UpdateLBGraphLegend(string graph, [string traceList]) + string str, trace, header, prefix variable numEntries, i, headstage, hasAllEntry @@ -448,6 +452,7 @@ static Function LBV_UpdateLBGraphLegend(string graph, [string traceList]) End static Function/WAVE LBV_GetTraceUserDataNames() + Make/FREE/T wv = {LBV_UD_KEY, LBV_UD_ISTEXT, LBV_UD_KEYS_WAVE, LBV_UD_VALUES_WAVE, LBV_UD_HEADSTAGE, LBV_UD_YAXIS} return wv @@ -469,6 +474,7 @@ End /// @param values labnotebook values wave (numerical or text) /// @param key name of the key to add static Function LBV_AddTraceToLBGraph(string graph, WAVE keys, WAVE values, string key) + string unit, lbl, axis, trace, text, tagString, tmp, axisBaseName string traceList = "" variable i, j, row, col, numRows, sweepCol, marker @@ -610,6 +616,7 @@ Function LBV_UpdateTagsForTextualLBNEntries(string win, variable sweepNo) End static Function LBV_AddTraceToLBGraphTPStorage(string graph, DFREF dfr, string key, [variable isTimeAxis]) + string lbl, axis, trace, text, tagString, tmp, list, lblTemplate string traceList, suffix, axisBasename variable i, j, row, numRows, sweepCol, marker, numEntries, headstage, numCols @@ -742,6 +749,7 @@ static Function LBV_AddTraceToLBGraphTPStorage(string graph, DFREF dfr, string k End 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) @@ -765,6 +773,7 @@ static Function [WAVE/T traces, string niceName] LBV_GenerateTraceNames(string n End static Function LBV_AddTagsForTextualLBNEntries(string graph, WAVE/T keys, WAVE/T values, string key, [variable firstSweep]) + variable i, j, numRows, numEntries, isTimeAxis, col, sweepCol, firstRow, logbookType, lastSweep string tagString, tmp, text, unit, lbl, name, lastTag STRUCT RGBColor s @@ -839,6 +848,7 @@ End /// @brief Switch the labnotebook graph x axis type (time <-> sweep numbers) static Function LBV_SwitchLBGraphXAxis(string graph) + string trace, dataUnits, list, wvName, info, keysToReadd, key variable i, numEntries, isTimeAxis, sweepCol, isTextData, logbookType @@ -926,6 +936,7 @@ End /// @brief Check if the x wave belonging to the first trace in the /// graph has a date/time scale. static Function LBV_CheckIfXAxisIsTime(string graph, [variable logbookType]) + string list, trace, name list = TraceNameList(graph, ";", 0 + 1) @@ -956,6 +967,7 @@ End /// /// Assumes that wave data units are equal for all traces static Function LBV_SetLabNotebookBottomLabel(string graph, variable isTimeAxis) + // top: LBT_TPSTORAGE in delta time mode // bottom: LBT_LABNOTEBOOK/LBT_TPSTORAGE when it is a timestamp axis @@ -1005,6 +1017,7 @@ Function LBV_SelectExperimentAndDevice(string win) End static Function/S LBV_FormatDescription(WAVE/Z/T keys, string name) + variable idx, i, numEntries string template, result, str, text @@ -1154,6 +1167,7 @@ End /// @brief Limit the bottom axis of the settings history graph to the selected/displayed sweeps static Function LBV_LimitXRangeToSelected(string browser) + variable minSweep, maxSweep, first, last string graph, shPanel, scPanel, key diff --git a/Packages/MIES/MIES_Logging.ipf b/Packages/MIES/MIES_Logging.ipf index 57c505b504..c85419f3d0 100644 --- a/Packages/MIES/MIES_Logging.ipf +++ b/Packages/MIES/MIES_Logging.ipf @@ -30,6 +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/Z/T keys = JSON_GetKeys(JSONid, "", ignoreErr = 1) if(!WaveExists(keys)) @@ -73,6 +74,7 @@ End /// @brief Adds the JSONid text to the logfile without any checks threadsafe static Function LOG_AddEntryWithoutChecks(string package, variable JSONid) + string file, str variable refnum diff --git a/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf b/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf index aa0c6d8404..6a3313d19c 100644 --- a/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Algorithm.ipf @@ -340,9 +340,7 @@ End /// @param colInp column in *input* coordinates /// @param colOut column in *output* coordinates /// @param decimationFactor decimation factor -threadsafe static Function DecimateMinMax(input, output, idx, firstRowInp, lastRowInp, colInp, colOut, decimationFactor) - WAVE input, output - variable idx, colInp, colOut, decimationFactor, firstRowInp, lastRowInp +threadsafe static Function DecimateMinMax(WAVE input, WAVE output, variable idx, variable firstRowInp, variable lastRowInp, variable colInp, variable colOut, variable decimationFactor) variable first, last, targetFirst, targetLast diff --git a/Packages/MIES/MIES_MiesUtilities_Channels.ipf b/Packages/MIES/MIES_MiesUtilities_Channels.ipf index 31b780cd77..b11b487141 100644 --- a/Packages/MIES/MIES_MiesUtilities_Channels.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Channels.ipf @@ -33,9 +33,7 @@ End /// /// @param config DAQConfigWave as passed to the ITC XOP /// @param channelType DA/AD/TTL constants, see @ref ChannelTypeAndControlConstants -threadsafe static Function/WAVE GetChanneListFromDAQConfigWave(config, channelType) - WAVE config - variable channelType +threadsafe static Function/WAVE GetChanneListFromDAQConfigWave(WAVE config, variable channelType) variable numRows, i, j @@ -102,9 +100,7 @@ End /// /// @param config DAQConfigWave as passed to the ITC XOP /// @param channelType DA/AD/TTL constants, see @ref ChannelTypeAndControlConstants -static Function/WAVE GetTypeListFromITCConfig(config, channelType) - WAVE config - variable channelType +static Function/WAVE GetTypeListFromITCConfig(WAVE config, variable channelType) variable numRows, i, j diff --git a/Packages/MIES/MIES_MiesUtilities_GUI.ipf b/Packages/MIES/MIES_MiesUtilities_GUI.ipf index a0b4fad69d..1d6e31f5fe 100644 --- a/Packages/MIES/MIES_MiesUtilities_GUI.ipf +++ b/Packages/MIES/MIES_MiesUtilities_GUI.ipf @@ -367,9 +367,7 @@ End /// @brief Find the given feature in the given wave range /// `first` and `last` are in x coordinates and clipped to valid values -static Function CalculateFeatureLoc(wv, mode, level, first, last) - WAVE wv - variable mode, level, first, last +static Function CalculateFeatureLoc(WAVE wv, variable mode, variable level, variable first, variable last) variable edgeType diff --git a/Packages/MIES/MIES_MiesUtilities_Logbook.ipf b/Packages/MIES/MIES_MiesUtilities_Logbook.ipf index cb2f0533a4..ca257505d9 100644 --- a/Packages/MIES/MIES_MiesUtilities_Logbook.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Logbook.ipf @@ -171,6 +171,7 @@ End /// The slice is returned as-is if it exists already. Callers which modify the /// logbook are responsible to resize the slice as well. static Function/WAVE ExtractLogbookSlice(WAVE logbook, variable logbookType, variable colOrLayer, string suffix) + string name, entryName variable col, layer @@ -453,6 +454,7 @@ End /// /// @sa GetLastSettingChannel threadsafe static Function [WAVE/Z wv, variable index] GetLastSettingChannelInternal(WAVE numericalValues, WAVE values, variable sweepNo, string setting, variable channelNumber, variable channelType, variable entrySourceType) + string entryName, settingTTL variable headstage, indep @@ -1277,10 +1279,7 @@ End /// @param[in] entrySourceType type of the labnotebook entry, one of @ref DataAcqModes /// @param[out] first point index of the beginning of the range /// @param[out] last point index of the end of the range -threadsafe static Function FindRange(wv, col, val, entrySourceType, first, last) - WAVE wv - variable col, val, entrySourceType - variable &first, &last +threadsafe static Function FindRange(WAVE wv, variable col, variable val, variable entrySourceType, variable &first, variable &last) variable numRows, i, j, sourceTypeCol, firstRow, lastRow, isNumeric, index, startRow, endRow diff --git a/Packages/MIES/MIES_MiesUtilities_Recreation.ipf b/Packages/MIES/MIES_MiesUtilities_Recreation.ipf index af3078afbc..2e721b4b61 100644 --- a/Packages/MIES/MIES_MiesUtilities_Recreation.ipf +++ b/Packages/MIES/MIES_MiesUtilities_Recreation.ipf @@ -281,6 +281,7 @@ End /// @brief Set `ChannelNumber` and `ChannelType` in configWave static Function AddChannelPropertiesFromLBN(WAVE numericalValues, WAVE textualValues, variable sweepNo, WAVE configWave, variable channelType) + variable i, numEntries, offset WAVE/Z channelLBN = GetActiveChannels(numericalValues, textualValues, sweepNo, channelType, TTLmode = TTL_HARDWARE_CHANNEL) @@ -339,6 +340,7 @@ End /// @brief Set `DAQChannelType` in configWave static Function AddDAQChannelTypeFromLBN(WAVE numericalValues, WAVE textualValues, variable sweepNo, WAVE configWave) + variable i, numEntries, headstage, channelType, index Make/FREE validChannelTypes = {DAQ_CHANNEL_TYPE_DAQ, DAQ_CHANNEL_TYPE_TP, DAQ_CHANNEL_TYPE_UNKOWN} @@ -367,6 +369,7 @@ End /// @brief Set `Headstage` in configWave static Function AddHeadstageFromLBN(WAVE numericalValues, variable sweepNo, WAVE configWave) + variable i, numEntries, headstage, index numEntries = DimSize(configWave, ROWS) @@ -382,6 +385,7 @@ End /// @brief Set `ClampMode` in configWave static Function AddClampModeFromLBN(WAVE numericalValues, variable sweepNo, WAVE configWave) + variable i, numEntries, clampMode, index numEntries = DimSize(configWave, ROWS) @@ -397,6 +401,7 @@ End /// @brief Add wave note entry #CHANNEL_UNIT_KEY for the used channel units static Function AddChannelUnitFromLBN(WAVE numericalValues, WAVE/T textualValues, variable sweepNo, WAVE configWave) + variable i, numEntries, index string key string unitList = "" diff --git a/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf b/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf index b06b0674a1..9b951c462c 100644 --- a/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf +++ b/Packages/MIES/MIES_NeuroDataWithoutBorders.ipf @@ -231,8 +231,7 @@ static Function [variable fileID, variable createdNewNWBFile] NWB_GetFileForExpo return [fileIDExport, createdNewNWBFile] End -static Function NWB_AddGeneratorString(fileID, nwbVersion) - variable fileID, nwbVersion +static Function NWB_AddGeneratorString(variable fileID, variable nwbVersion) EnsureValidNWBVersion(nwbVersion) @@ -273,8 +272,7 @@ static Function NWB_AddGeneratorString(fileID, nwbVersion) endif End -static Function NWB_AddSpecifications(fileID, nwbVersion) - variable fileID, nwbVersion +static Function NWB_AddSpecifications(variable fileID, variable nwbVersion) EnsureValidNWBVersion(nwbVersion) if(nwbVersion == 1) @@ -284,8 +282,7 @@ static Function NWB_AddSpecifications(fileID, nwbVersion) WriteSpecifications(fileID) End -static Function NWB_ReadSessionStartTime(fileID) - variable fileID +static Function NWB_ReadSessionStartTime(variable fileID) string str = ReadTextDataSetAsString(fileID, "/session_start_time") @@ -295,6 +292,7 @@ static Function NWB_ReadSessionStartTime(fileID) End threadsafe static Function NWB_AddDevice(STRUCT NWBAsyncParameters &s) + string deviceDesc deviceDesc = NWB_GenerateDeviceDescription(s.device, s.numericalValues, s.textualValues) @@ -378,6 +376,7 @@ Function NWB_ASYNC_Readout(STRUCT ASYNC_ReadOutStruct &ar) End threadsafe static Function NWB_WriteLabnoteBooksAndComments(STRUCT NWBAsyncParameters &s) + string path variable groupID @@ -433,6 +432,7 @@ threadsafe static Function NWB_WriteLabnoteBooksAndComments(STRUCT NWBAsyncParam End threadsafe static Function NWB_WriteResultsWaves(STRUCT NWBAsyncParameters &s) + string path variable groupID @@ -824,6 +824,7 @@ End /// This is only approximately correct as the file is open in HDF5 and thus /// not everything is flushed. static Function NWB_GetExportedFileSize(string device) + string filePathExport = ROStr(GetNWBFilePathExport(device)) if(IsEmpty(filePathExport)) @@ -956,9 +957,7 @@ Function NWB_ExportWithDialog(variable exportType, [variable nwbVersion]) End /// @brief Write the stored test pulses to the NWB file -static Function NWB_AppendStoredTestPulses(device, nwbVersion, locationID, compressionMode) - string device - variable locationID, nwbVersion, compressionMode +static Function NWB_AppendStoredTestPulses(string device, variable nwbVersion, variable locationID, variable compressionMode) variable index, numZeros, i string name @@ -988,9 +987,7 @@ End /// @param stimsets Single stimset as string /// or list of stimsets sparated by ; /// @param compressionMode Type of compression to use, one of @ref CompressionMode -static Function NWB_AppendStimset(nwbVersion, locationID, stimsets, compressionMode) - variable nwbVersion, locationID, compressionMode - string stimsets +static Function NWB_AppendStimset(variable nwbVersion, variable locationID, string stimsets, variable compressionMode) variable i, numStimsets, numWaves @@ -1089,6 +1086,7 @@ Function NWB_AppendSweepDuringDAQ(string device, WAVE DAQDataWave, WAVE DAQConfi End threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) + variable groupID, numEntries, i, j, ttlBits, dac, adc, col, refTime variable ttlBit, DACUnassoc, ADCUnassoc, index variable dChannelType, dChannelNumber @@ -1343,8 +1341,7 @@ threadsafe static Function NWB_AppendSweepLowLevel(STRUCT NWBAsyncParameters &s) End /// @brief Clear all entries which are channel specific -threadsafe static Function NWB_ClearWriteChannelParams(s) - STRUCT WriteChannelParams &s +threadsafe static Function NWB_ClearWriteChannelParams(STRUCT WriteChannelParams &s) string device variable sweep, startingTime, samplingRate, groupIndex @@ -1378,9 +1375,7 @@ End /// @param locationID Open HDF5 group or file identifier /// @param custom_wave Wave reference to the wave that is to be saved /// @param compressionMode [optional, defaults to NO_COMPRESSION] Type of compression to use, one of @ref CompressionMode -static Function NWB_WriteStimsetCustomWave(nwbVersion, locationID, custom_wave, compressionMode) - variable nwbVersion, locationID, compressionMode - WAVE custom_wave +static Function NWB_WriteStimsetCustomWave(variable nwbVersion, variable locationID, WAVE custom_wave, variable compressionMode) variable groupID, i, numEntries string pathInNWB, custom_wave_name, path @@ -1416,11 +1411,7 @@ static Function NWB_WriteStimsetCustomWave(nwbVersion, locationID, custom_wave, HDF5CloseGroup groupID End -static Function NWB_WriteStimsetTemplateWaves(nwbVersion, locationID, stimSet, customWaves, compressionMode) - variable nwbVersion, locationID - string stimSet - WAVE/WAVE customWaves - variable compressionMode +static Function NWB_WriteStimsetTemplateWaves(variable nwbVersion, variable locationID, string stimSet, WAVE/WAVE customWaves, variable compressionMode) variable groupID string name, path @@ -1505,9 +1496,7 @@ End /// @param overwrite indicate whether the stored stimsets should be deleted if they exist /// /// @return 1 on error -static Function NWB_LoadStimset(locationID, stimset, overwrite, [verbose]) - variable locationID, overwrite, verbose - string stimset +static Function NWB_LoadStimset(variable locationID, string stimset, variable overwrite, [variable verbose]) variable stimsetType string NWBstimsets, WP_name, WPT_name, SegWvType_name @@ -1805,6 +1794,7 @@ Function NWB_LoadCustomWaves(variable groupID, string stimsets, variable overwri End threadsafe static Function NWB_GetTimeSeriesProperties(variable nwbVersion, WAVE/T numericalKeys, WAVE numericalValues, STRUCT WriteChannelParams &p, STRUCT TimeSeriesProperties &tsp) + InitTimeSeriesProperties(tsp, p.channelType, p.clampMode) // unassociated channel @@ -1857,15 +1847,7 @@ threadsafe static Function NWB_GetTimeSeriesProperties(variable nwbVersion, WAVE endif End -threadsafe static Function NWB_AddSweepDataSets(numericalKeys, numericalValues, sweep, settingsProp, nwbProp, headstage, tsp, [factor, enabledProp]) - WAVE/T numericalKeys - WAVE numericalValues - variable sweep - string settingsProp, nwbProp - variable headstage - STRUCT TimeSeriesProperties &tsp - variable factor - string enabledProp +threadsafe static Function NWB_AddSweepDataSets(WAVE/T numericalKeys, WAVE numericalValues, variable sweep, string settingsProp, string nwbProp, variable headstage, STRUCT TimeSeriesProperties &tsp, [variable factor, string enabledProp]) string unit variable col, result @@ -1958,8 +1940,7 @@ static Function NWB_AppendLogFileToString(string path, string &str) str += "\n" + LOGFILE_NWB_MARKER + "\n" + data End -static Function NWB_AppendIgorHistoryAndLogFile(nwbVersion, locationID) - variable nwbVersion, locationID +static Function NWB_AppendIgorHistoryAndLogFile(variable nwbVersion, variable locationID) variable groupID string history, name diff --git a/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf b/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf index 666d8d5f31..2c7a7705ad 100644 --- a/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf +++ b/Packages/MIES/MIES_OptimzedOverlapDistributedAcquisition.ipf @@ -16,8 +16,7 @@ static Constant OOD_SIGNAL_THRESHOLD = 0.1 /// @brief returns the threshold level for ood region detection from a single column stimset /// @param[in] stimset 1d wave containing stimset data /// @return threshold level defining signal above baseline -static Function OOD_GetThresholdLevel(stimset) - WAVE stimset +static Function OOD_GetThresholdLevel(WAVE stimset) variable minVal, maxVal @@ -30,9 +29,7 @@ End /// @param[in] prePoints oodDAQ pre delay in points the regions get expanded at the rising edge /// @param[in] postPoints oodDAQ post delay in points the regions get expanded at the falling edge /// @return 2D wave with region information -static Function/WAVE OOD_GetRegionsFromStimset(stimset, prePoints, postPoints) - WAVE stimset - variable prePoints, postPoints +static Function/WAVE OOD_GetRegionsFromStimset(WAVE stimset, variable prePoints, variable postPoints) variable size, level, expectFalling, position, rIndex @@ -85,8 +82,7 @@ End /// @brief Reduces a 2D region wave by joining overlapping regions to one /// @param[in] regions 2D wave containing region data /// @return 2D wave with compacted regions -static Function/WAVE OOD_CompactRegions(regions) - WAVE regions +static Function/WAVE OOD_CompactRegions(WAVE regions) variable regionNr, size, rIndex, endPoint, startPoint @@ -122,8 +118,7 @@ End /// @brief generates regions data waves from stimsets taking the pre and post delay into account /// @param[in] params OOdDAQParams structure /// @return wave reference wave holding the 2D region waves for each stimset -static Function/WAVE OOD_GetRegionsFromStimsets(params) - STRUCT OOdDAQParams ¶ms +static Function/WAVE OOD_GetRegionsFromStimsets(STRUCT OOdDAQParams ¶ms) variable stimsetNr, numSets, stimsetCol variable level, expectRising, position @@ -141,9 +136,7 @@ End /// @param[in] setRegions wave reference wave of 2D region waves /// @param[in] offsets offset wave storing the offsets per stimset /// @return 1D text wave with lists of regions -static Function/WAVE OOD_GetFeatureRegions(setRegions, offsets) - WAVE/WAVE setRegions - WAVE offsets +static Function/WAVE OOD_GetFeatureRegions(WAVE/WAVE setRegions, WAVE offsets) string list variable setNr, regNr, regCnt @@ -169,8 +162,7 @@ End /// @param setRegions wave reference wave of 2D region waves for each stimset // /// @return 1D wave with offsets for each stimset in points -static Function/WAVE OOD_CalculateOffsetsImpl(setRegions) - WAVE/WAVE setRegions +static Function/WAVE OOD_CalculateOffsetsImpl(WAVE/WAVE setRegions) variable setNr, regNr, regCnt, baseRegCnt, baseRegNr, newOff, resAdjust variable bStart, bEnd, rStart, rEnd, overlap @@ -227,9 +219,7 @@ End /// /// @param[in] device title of the device panel /// @param[in] params OOdDAQParams structure with oodDAQ setup data -static Function OOD_CalculateOffsets(device, params) - string device - STRUCT OOdDAQParams ¶ms +static Function OOD_CalculateOffsets(string device, STRUCT OOdDAQParams ¶ms) WAVE setRegions = OOD_GetRegionsFromStimsets(params) @@ -250,9 +240,7 @@ End /// @param[in] last sample point number in wavebuilder scale with end of region /// @param[in] list list string where the element is added /// @return list string with added element -static Function/S OOD_AddToRegionList(first, last, list) - variable first, last - string list +static Function/S OOD_AddToRegionList(variable first, variable last, string list) string str @@ -263,8 +251,7 @@ End /// @brief Prints various internals useful for oodDAQ debugging, called when DEBUGGING_ENABLED is set /// @param[in] params OOdDAQParams structure with oodDAQ internals -static Function OOD_Debugging(params) - STRUCT OOdDAQParams ¶ms +static Function OOD_Debugging(STRUCT OOdDAQParams ¶ms) variable i, numSets @@ -341,8 +328,7 @@ End /// @param[in] params OOdDAQParams structure with the stimsets and offset information /// /// @return stimsets with offsets, one wave per offset -static Function/WAVE OOD_CreateStimSet(params) - STRUCT OOdDAQParams ¶ms +static Function/WAVE OOD_CreateStimSet(STRUCT OOdDAQParams ¶ms) variable numSets diff --git a/Packages/MIES/MIES_Oscilloscope.ipf b/Packages/MIES/MIES_Oscilloscope.ipf index c73af5ae7f..f3d4f0da79 100644 --- a/Packages/MIES/MIES_Oscilloscope.ipf +++ b/Packages/MIES/MIES_Oscilloscope.ipf @@ -717,9 +717,7 @@ static Function SCOPE_SU_UpdateOscilloscope(string device, variable dataAcqOrTP, endif End -static Function SCOPE_NI_UpdateOscilloscope(device, dataAcqOrTP, deviceiD, fifoPos) - string device - variable dataAcqOrTP, deviceID, fifoPos +static Function SCOPE_NI_UpdateOscilloscope(string device, variable dataAcqOrTP, variable deviceiD, variable fifoPos) variable i, channel, decMethod, decFactor, numCols, numFifoChannels string fifoName, msg, fifoInfo @@ -788,9 +786,7 @@ static Function SCOPE_NI_UpdateOscilloscope(device, dataAcqOrTP, deviceiD, fifoP endif End -static Function SCOPE_ITC_UpdateOscilloscope(device, dataAcqOrTP, chunk, fifoPos) - string device - variable dataAcqOrTP, chunk, fifoPos +static Function SCOPE_ITC_UpdateOscilloscope(string device, variable dataAcqOrTP, variable chunk, variable fifoPos) WAVE OscilloscopeData = GetOscilloscopeWave(device) variable length, first, last @@ -882,9 +878,7 @@ End /// @param fifopos fifo position /// /// @return adjusted fifo position -static Function SCOPE_ITC_AdjustFIFOPos(device, fifopos) - string device - variable fifopos +static Function SCOPE_ITC_AdjustFIFOPos(string device, variable fifopos) variable stopCollectionPoint diff --git a/Packages/MIES/MIES_OverlaySweeps.ipf b/Packages/MIES/MIES_OverlaySweeps.ipf index 6a0b77e488..1d986addf4 100644 --- a/Packages/MIES/MIES_OverlaySweeps.ipf +++ b/Packages/MIES/MIES_OverlaySweeps.ipf @@ -130,6 +130,7 @@ End /// @brief Remove all stimsets which were only acquired once, disregaring RAC/SCI, this means we just look at all sweeps static Function OVS_RemoveLowCountEntries(WAVE/T stimsets, WAVE/T setSweepCounts, WAVE/T dupsRemovedSetSweepCounts, WAVE/T dupsRemovedSetCycleCounts) + variable numEntries, i, j, hasRepetitions string stimset, entry @@ -473,9 +474,7 @@ Function OVS_IsActive(string win) End /// @brief Add `headstage` to the ignore list of the given `sweepNo/index` -static Function OVS_AddToIgnoreList(win, headstage, [sweepNo, index]) - string win - variable headstage, sweepNo, index +static Function OVS_AddToIgnoreList(string win, variable headstage, [variable sweepNo, variable index]) if(!OVS_IsActive(win)) return NaN @@ -639,9 +638,7 @@ Function OVS_CheckBoxProc_HS_Select(STRUCT WMCheckboxAction &cba) : CheckBoxCont return 0 End -static Function OVS_HighlightSweep(win, index) - string win - variable index +static Function OVS_HighlightSweep(string win, variable index) variable sweepNo, i, numTraces string experiment, graph, trace, msg @@ -721,8 +718,7 @@ Function [variable sweepNo, string experiment] OVS_GetSweepAndExperiment(string End /// @brief Change the selected sweep according to one of the popup menu options -static Function OVS_ChangeSweepSelection(win, choiceString) - string win, choiceString +static Function OVS_ChangeSweepSelection(string win, string choiceString) variable i, j, numEntries, numLayers, offset, step string extPanel diff --git a/Packages/MIES/MIES_PackageSettings.ipf b/Packages/MIES/MIES_PackageSettings.ipf index d13775299b..4a97ebfe62 100644 --- a/Packages/MIES/MIES_PackageSettings.ipf +++ b/Packages/MIES/MIES_PackageSettings.ipf @@ -101,8 +101,7 @@ Function/S PS_GetSettingsFolder(string package) End /// @brief Return the absolute path to the JSON settings file for `package` -static Function/S PS_GetSettingsFile(package) - string package +static Function/S PS_GetSettingsFile(string package) string folder diff --git a/Packages/MIES/MIES_PressureControl.ipf b/Packages/MIES/MIES_PressureControl.ipf index ff4805298e..934fc941ef 100644 --- a/Packages/MIES/MIES_PressureControl.ipf +++ b/Packages/MIES/MIES_PressureControl.ipf @@ -114,8 +114,7 @@ Function P_PressureControl(string device) P_RecordUserPressure(device) End -static Function P_RecordUserPressure(device) - string device +static Function P_RecordUserPressure(string device) variable ADC, i, deviceID, hwType @@ -146,9 +145,7 @@ static Function P_RecordUserPressure(device) End /// @brief Record pressure in TPStorage wave -static Function P_UpdateTPStorage(device, headStage) - string device - variable headstage +static Function P_UpdateTPStorage(string device, variable headStage) variable count, old, new @@ -195,6 +192,7 @@ static Function P_FindLastSetEntry(WAVE wv, variable row, variable col, string n End static Function P_AddSealedEntryToTPStorage(string device, variable headstage) + variable count if(!P_ValidatePressureSetHeadstage(device, headstage) || !P_IsHSActiveAndInVClamp(device, headstage)) @@ -211,9 +209,7 @@ static Function P_AddSealedEntryToTPStorage(string device, variable headstage) End /// @brief Sets the pressure to atmospheric -static Function P_MethodAtmospheric(device, headstage) - string device - variable headStage +static Function P_MethodAtmospheric(string device, variable headstage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) P_SetPressureValves(device, headStage, P_GetUserAccess(device, headStage, PRESSURE_METHOD_ATM)) @@ -222,9 +218,7 @@ static Function P_MethodAtmospheric(device, headstage) End /// @brief Applies approach pressures -static Function P_MethodApproach(device, headStage) - string device - variable headStage +static Function P_MethodApproach(string device, variable headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) WAVE AmpStoragewave = GetAmplifierParamStorageWave(device) @@ -254,9 +248,7 @@ static Function P_MethodApproach(device, headStage) End /// @brief Applies seal methods -static Function P_MethodSeal(device, headStage) - string device - variable headStage +static Function P_MethodSeal(string device, variable headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable RSlope @@ -342,9 +334,7 @@ static Function P_MethodSeal(device, headStage) End /// @brief Applies break-in method -static Function P_MethodBreakIn(device, headStage) - string device - variable headStage +static Function P_MethodBreakIn(string device, variable headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable lastRSlopeCheck = PressureDataWv[headStage][%TimeOfLastRSlopeCheck] / 60 @@ -395,9 +385,7 @@ static Function P_MethodBreakIn(device, headStage) End /// @brief Applies pipette clearing method -static Function P_MethodClear(device, headStage) - string device - variable headStage +static Function P_MethodClear(string device, variable headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable lastRpeakCheck = PressureDataWv[headStage][%TimePeakRcheck] / 60 @@ -437,9 +425,7 @@ static Function P_MethodClear(device, headStage) End /// @brief Applies updates the command voltage to the #SEAL_POTENTIAL when #SEAL_RESISTANCE_THRESHOLD is crossed -static Function P_ApplyNegV(device, headStage) - string device - variable headStage +static Function P_ApplyNegV(string device, variable headStage) variable resistance, vCom, lastVcom @@ -461,10 +447,7 @@ static Function P_ApplyNegV(device, headStage) End /// @brief Updates the command voltage -static Function P_UpdateVcom(device, vCom, headStage) - string device - variable vCom - variable headStage +static Function P_UpdateVcom(string device, variable vCom, variable headStage) // apply holding AI_UpdateAmpModel(device, "setvar_DataAcq_Hold_VC", headStage, value = vCom) @@ -476,8 +459,7 @@ End /// @brief Determines which devices to close. Ensures all DA_Ephys panels /// using a particular device for pressure regulation are updated /// correctly. -static Function P_CloseDevice(device) - string device +static Function P_CloseDevice(string device) string ListOfDevicesToClose = P_GetListOfPressureCtrlDevices(device) string ListOfLockedDA_Ephys = GetListOfLockedDevices() @@ -503,8 +485,7 @@ static Function P_CloseDevice(device) End /// @brief Open device used for pressure regulation. -static Function P_OpenDevice(mainDevice, pressureDevice) - string mainDevice, pressureDevice +static Function P_OpenDevice(string mainDevice, string pressureDevice) variable hwType variable headStage, i, j, numEntries, deviceID, numLocked @@ -541,9 +522,7 @@ static Function P_OpenDevice(mainDevice, pressureDevice) End /// @brief Adapt the ITC DAQ waves for hardware specialities -static Function P_PrepareITCWaves(mainDevice, pressureDevice, deviceID) - string mainDevice, pressureDevice - variable deviceID +static Function P_PrepareITCWaves(string mainDevice, string pressureDevice, variable deviceID) WAVE ITCData = P_GetITCData(mainDevice) WAVE ITCConfig = P_GetITCChanConfig(mainDevice) @@ -569,9 +548,7 @@ static Function P_PrepareITCWaves(mainDevice, pressureDevice, deviceID) End /// @brief Used to close the device used for pressure regulation -static Function P_CloseDeviceLowLevel(device, deviceToClose, refHeadstage) - string device, deviceToClose - variable refHeadstage +static Function P_CloseDeviceLowLevel(string device, string deviceToClose, variable refHeadstage) variable headStage, deviceID, hwType, flags variable i, j, doDeRegister, numLocked, numHeadstages @@ -618,9 +595,7 @@ static Function P_CloseDeviceLowLevel(device, deviceToClose, refHeadstage) End /// @brief Returns a list of rows that contain a particular string -static Function/S P_HeadstageUsingDevice(device, pressureDevice) - string device - string pressureDevice +static Function/S P_HeadstageUsingDevice(string device, string pressureDevice) variable i string list = "" @@ -639,8 +614,7 @@ End /// /// Pulls a non repeating list of ITC/NI devices to open from the device /// specific pressure data wave. -static Function/S P_GetListOfPressureCtrlDevices(device) - string device +static Function/S P_GetListOfPressureCtrlDevices(string device) string pressureDeviceList = "" string pressureDevice @@ -871,8 +845,7 @@ End /// @brief Updates resistance slope and the resistance in PressureDataWv from TPStorageWave /// param -static Function P_UpdateSSRSlopeAndSSR(device) - string device +static Function P_UpdateSSRSlopeAndSSR(string device) variable lastValidEntry, i @@ -966,9 +939,7 @@ Function P_UpdatePressureControls(string device, variable headStageNo) End /// @brief Updates the popupmenu popup_Settings_Pressure_dev -static Function P_UpdatePopupDevices(device, headStageNo) - string device - variable headStageNo +static Function P_UpdatePopupDevices(string device, variable headStageNo) string savedDev, popUpMenuString @@ -998,9 +969,7 @@ End /// @brief Initiates a pressure pulse who's settings are are controlled in the /// manual tab of the pressure regulation controls -static Function P_ManPressurePulse(device, headStage) - string device - variable headStage +static Function P_ManPressurePulse(string device, variable headStage) P_ITC_SetChannels(device, headStage) P_DAforManPpulse(device, headstage) @@ -1011,9 +980,7 @@ End /// @brief Sends a negative pressure pulse to the pressure regulator. Gates the /// TTLs apropriately to maintain the exisiting TTL state while opening the TTL /// on the channel with the pressure pulse -static Function P_NegPressurePulse(device, headStage) - string device - variable headStage +static Function P_NegPressurePulse(string device, variable headStage) P_ITC_SetChannels(device, headstage) P_DAforNegPpulse(device, Headstage) @@ -1024,9 +991,7 @@ End /// @brief Initiates a positive pressure pulse to the pressure regulator. Gates /// the TTLs apropriately to maintain the exisiting TTL state while opening the /// TTL on the channel with the pressure pulse -static Function P_PosPressurePulse(device, headStage) - string device - variable headStage +static Function P_PosPressurePulse(string device, variable headStage) P_ITC_SetChannels(device, headstage) P_DAforPosPpulse(device, headstage) @@ -1034,9 +999,7 @@ static Function P_PosPressurePulse(device, headStage) P_DataAcq(device, headStage) End -static Function P_ITC_SetChannels(device, headstage) - string device - variable headstage +static Function P_ITC_SetChannels(string device, variable headstage) WAVE ITCConfig = P_GetITCChanConfig(device) WAVE pressureDataWv = P_GetPressureDataWaveRef(device) @@ -1067,9 +1030,7 @@ Function P_DeviceIsUsedForPressureCtrl(string device, string pressureDevice) End /// @brief Perform an acquisition cycle on the pressure device for pressure control -static Function P_DataAcq(device, headStage) - string device - variable headstage +static Function P_DataAcq(string device, variable headStage) variable deviceID, hwType, TTL, DAC, ADC, startTime, elapsedTime, duration string str, pfi, pressureDevice, endFunc @@ -1187,9 +1148,7 @@ Function P_NI_StopDAQ(string device, variable headStage) End /// @brief Returns the device of the device associated with device conducting a pressure pulse -static Function P_FindDeviceExecutingPP(device, deviceID, headStage) - string &device - variable &deviceID, &headStage +static Function P_FindDeviceExecutingPP(string &device, variable &deviceID, variable &headStage) string ListOfLockedDevices = GetListOfLockedDevices() variable i, numLocked @@ -1215,10 +1174,7 @@ End /// @param[in] headStage headstage /// @param[in] pressureMode one of #P_NEGATIVE_PULSE, #P_POSITIVE_PULSE, #P_MANUAL_PULSE /// @param[out] p pressure details -static Function P_GetPressureForDA(device, headStage, pressureMode, p) - string device - variable headStage, pressureMode - STRUCT P_PressureDA &p +static Function P_GetPressureForDA(string device, variable headStage, variable pressureMode, STRUCT P_PressureDA &p) variable DAGain, hwType @@ -1312,9 +1268,7 @@ static Function P_GetPressureForDA(device, headStage, pressureMode, p) endif End -static Function/WAVE P_NI_GetDAWave(device, headStage) - string device - variable headStage +static Function/WAVE P_NI_GetDAWave(string device, variable headStage) variable DAC string wvName @@ -1336,9 +1290,7 @@ static Function/WAVE P_NI_GetDAWave(device, headStage) endif End -static Function/WAVE P_NI_GetADWave(device, headStage) - string device - variable headStage +static Function/WAVE P_NI_GetADWave(string device, variable headStage) variable ADC string wvName @@ -1360,10 +1312,7 @@ static Function/WAVE P_NI_GetADWave(device, headStage) endif End -static Function P_FillDAQWaves(device, headStage, p) - string device - variable headStage - STRUCT P_PressureDA &p +static Function P_FillDAQWaves(string device, variable headStage, STRUCT P_PressureDA &p) ASSERT(p.first < p.last && p.last - p.first >= 1, "first/last mismatch") @@ -1400,9 +1349,7 @@ static Function P_FillDAQWaves(device, headStage, p) End /// @brief Updates the DA data used for ITC controlled pressure devices for a negative pressure pulse -static Function P_DAforNegPpulse(device, headStage) - string device - variable headStage +static Function P_DAforNegPpulse(string device, variable headStage) STRUCT P_PressureDA p P_GetPressureForDA(device, headStage, P_NEGATIVE_PULSE, p) @@ -1417,9 +1364,7 @@ static Function P_DAforNegPpulse(device, headStage) End /// @brief Returns the negative pressure pulse amplitude -static Function P_GetPulseAmp(device, headStage) - string device - variable headstage +static Function P_GetPulseAmp(string device, variable headStage) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) variable NextPulseCount = P_LastPulseCount(PressureDataWv[headStage][%LastPressureCommand]) + 1 @@ -1428,16 +1373,13 @@ static Function P_GetPulseAmp(device, headStage) End ///@brief Returns the pulse count -static Function P_LastPulseCount(pulseAmp) - variable pulseAmp +static Function P_LastPulseCount(variable pulseAmp) return -MIN_NEG_PRESSURE_PULSE * ((pulseAmp - MIN_NEG_PRESSURE_PULSE) / -1)^0.5 End /// @brief Updates the DA data used for ITC controlled pressure devices for a positive pressure pulse -static Function P_DAforPosPpulse(device, headstage) - string device - variable headstage +static Function P_DAforPosPpulse(string device, variable headstage) STRUCT P_PressureDA p P_GetPressureForDA(device, headstage, P_POSITIVE_PULSE, p) @@ -1452,9 +1394,7 @@ static Function P_DAforPosPpulse(device, headstage) End /// @brief Updates the DA data used for ITC controlled pressure devices for a manual pressure pulse -static Function P_DAforManPpulse(device, Headstage) - string device - variable Headstage +static Function P_DAforManPpulse(string device, variable Headstage) STRUCT P_PressureDA p P_GetPressureForDA(device, headstage, P_MANUAL_PULSE, p) @@ -1472,9 +1412,7 @@ static Function P_DAforManPpulse(device, Headstage) End /// @brief Updates the rack 0 and rack 1 TTL waves used for ITC controlled pressure devices. -static Function P_TTLforPpulse(device, headStage) - string device - variable headStage +static Function P_TTLforPpulse(string device, variable headStage) variable rackZeroState, rackOneState, deviceID, hwType, rack, TTL string pressureDevice @@ -1519,9 +1457,7 @@ static Function P_TTLforPpulse(device, headStage) End /// @brief returns the new TTL state based on the starting TTL state. -static Function P_UpdateTTLdecimal(pressureDevice, dec, ttlBit, ONorOFF) - string pressureDevice - variable dec, ttlBit, ONorOFF +static Function P_UpdateTTLdecimal(string pressureDevice, variable dec, variable ttlBit, variable ONorOFF) WAVE binary = P_DecToBinary(dec) @@ -1589,9 +1525,7 @@ End /// @brief Resets pressure data to base state /// -static Function P_ResetPressureData(device, [headStageNo]) - string device - variable headStageNo +static Function P_ResetPressureData(string device, [variable headStageNo]) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) if(paramIsDefault(headStageNo)) @@ -1608,9 +1542,7 @@ static Function P_ResetPressureData(device, [headStageNo]) End /// @brief Applies pressure mode to all headstages with valid pressure settings -static Function P_CheckAll(device, pressureMode, SavedPressureMode) - string device - variable pressureMode, SavedPressureMode +static Function P_CheckAll(string device, variable pressureMode, variable SavedPressureMode) variable headStage WAVE PressureDataWv = P_GetPressureDataWaveRef(device) @@ -1740,8 +1672,7 @@ Function P_LoadPressureButtonState(string device) End /// @brief Sets the pressure toggle buttons to disabled, default color, default title -static Function SetPressureButtonsToBaseState(device) - string device +static Function SetPressureButtonsToBaseState(string device) DisableControls(device, PRESSURE_CONTROLS_BUTTON_LIST) SetControlTitles(device, PRESSURE_CONTROLS_BUTTON_LIST, PRESSURE_CONTROL_TITLE_LIST) @@ -1749,9 +1680,7 @@ static Function SetPressureButtonsToBaseState(device) End /// @brief Checks if the Approach button can be enabled or all pressure mode buttons can be enabled. Enables buttons that pass checks. -static Function P_EnableButtonsIfValid(device, headStageNo) - string device - variable headStageNo +static Function P_EnableButtonsIfValid(string device, variable headStageNo) string PRESSURE_CONTROLS_BUTTON_subset = RemoveListItem(0, PRESSURE_CONTROLS_BUTTON_LIST) @@ -1881,9 +1810,7 @@ End /// @brief Determines if device is active (i.e. collecting data) /// /// used to determine if pressure pulse has completed. -static Function P_DACIsCollectingData(device, headStage) - string device - variable headStage +static Function P_DACIsCollectingData(string device, variable headStage) variable hwType, deviceID @@ -1899,9 +1826,7 @@ End /// /// Does not check if the headstage has valid settings, see P_ValidatePressureSetHeadstage(), /// or that no pressure pulse is currently ongoing, see P_DACIsCollectingData(). -static Function P_PressureMethodPossible(device, headstage) - string device - variable headstage +static Function P_PressureMethodPossible(string device, variable headstage) NVAR dataAcqRunMode = $GetDataAcqRunMode(device) @@ -1911,16 +1836,13 @@ static Function P_PressureMethodPossible(device, headstage) End /// @brief Determines headStage is on and in V-Clamp mode -static Function P_IsHSActiveAndInVClamp(device, headStage) - string device - variable headStage +static Function P_IsHSActiveAndInVClamp(string device, variable headStage) return V_CLAMP_MODE == DAG_GetHeadstageMode(device, headStage) && DAG_GetHeadstageState(device, headStage) End /// @brief Returns the four pressure buttons to the base state (gray color; removes "Stop" string from button title) -static Function P_ResetAll_P_ButtonsToBaseState(device) - string device +static Function P_ResetAll_P_ButtonsToBaseState(string device) variable i = 0 for(i = 0; i < 4; i += 1) @@ -1968,6 +1890,7 @@ Function P_PressureDisplayHighlite(string device, variable hilite) End static Function [variable result, string msg] P_CheckDeviceAndChannelSelection(string device) + string pressureDevice, userPressureDevice variable DAC, ADC, TTLA, TTLB @@ -2021,6 +1944,7 @@ End /// @brief Enables devices for all locked DA_Ephys panels. Sets the correct pressure button state for all locked DA_Ephys panels. static Function P_Enable() + variable i, j, headstage, numPressureDevices, numLocked string lockedDevice, listOfPressureCtrlDevices, device string listOfLockedDA_Ephys = GetListOfLockedDevices() @@ -2090,8 +2014,7 @@ End /// @brief Decimal to binary in 8bit wave /// /// Wave is always 4 rows long so that each TTL channel on the front of the ITC DAC gets "encoded" -static Function/WAVE P_DecToBinary(dec) - variable dec +static Function/WAVE P_DecToBinary(variable dec) variable bit, i MAKE/FREE/B/U/N=4 binary @@ -2106,9 +2029,7 @@ static Function/WAVE P_DecToBinary(dec) End /// @brief Manual pressure control -static Function P_ManSetPressure(device, headStage, manPressureAll) - string device - variable headStage, manPressureAll +static Function P_ManSetPressure(string device, variable headStage, variable manPressureAll) WAVE PressureDataWv = P_GetPressureDataWaveRef(device) @@ -2261,8 +2182,8 @@ Function ButtonProc_Clear(STRUCT WMButtonAction &ba) : ButtonControl End /// @brief Handles the TP depency of the Manual pressure application -static Function P_SetManual(device, cntrlName) - string device, cntrlName +static Function P_SetManual(string device, string cntrlName) + P_UpdatePressureMode(device, PRESSURE_METHOD_MANUAL, cntrlName, 1) P_RunP_ControlIfTPOFF(device) End @@ -2500,8 +2421,7 @@ Function P_GetAutoUserOff(string device) End /// @brief Sets the value of the headstage LED valDisplays to the correct cell in pressureType wave -static Function P_SetLEDValueAssoc(device) - string device +static Function P_SetLEDValueAssoc(string device) WAVE pressureType = GetPressureTypeWv(device) WAVE GuiState = GetDA_EphysGuiStateNum(device) diff --git a/Packages/MIES/MIES_ProgrammaticGUIControl.ipf b/Packages/MIES/MIES_ProgrammaticGUIControl.ipf index da266ee969..10ce210fce 100644 --- a/Packages/MIES/MIES_ProgrammaticGUIControl.ipf +++ b/Packages/MIES/MIES_ProgrammaticGUIControl.ipf @@ -12,8 +12,7 @@ /// @brief Bring all tabs which hold the control to the front (recursively). /// /// Requires that these are managed by `ACL_TabUtilities.ipf`. -static Function PGC_ShowControlInTab(win, control) - string win, control +static Function PGC_ShowControlInTab(string win, string control) variable idx, numEntries, i, tab string tabnum, tabctrl @@ -56,8 +55,7 @@ static Function PGC_ShowControlInTab(win, control) endfor End -static Function/S PGC_GetProcAndCheckParamType(recMacro) - string recMacro +static Function/S PGC_GetProcAndCheckParamType(string recMacro) variable paramType string procedure diff --git a/Packages/MIES/MIES_Publish.ipf b/Packages/MIES/MIES_Publish.ipf index 873ef16805..8443df668e 100644 --- a/Packages/MIES/MIES_Publish.ipf +++ b/Packages/MIES/MIES_Publish.ipf @@ -11,6 +11,7 @@ /// Publishers in MIES should in general supply additional information like device/sweep number/timestamp. /// This function allows to autofill these entries. static Function PUB_GetJSONTemplate(string device, variable headstage) + variable jsonID jsonID = JSON_New() @@ -25,6 +26,7 @@ End /// @brief Publish the given message as given by the JSON and the filter static Function PUB_Publish(variable jsonID, string messageFilter) + variable err string payload @@ -41,6 +43,7 @@ static Function PUB_Publish(variable jsonID, string messageFilter) End static Function PUB_AddLabnotebookEntriesToJSON(variable jsonID, WAVE values, WAVE keys, variable sweepNo, string key, variable headstage, variable labnotebookLayer) + variable result, col string unit, path diff --git a/Packages/MIES/MIES_PulseAveraging.ipf b/Packages/MIES/MIES_PulseAveraging.ipf index 5da5f7f545..650b3d5564 100644 --- a/Packages/MIES/MIES_PulseAveraging.ipf +++ b/Packages/MIES/MIES_PulseAveraging.ipf @@ -243,6 +243,7 @@ End /// /// @return pulse info wave or if nothing could be found, an invalid wave reference static Function/WAVE PA_CalculatePulseInfos(WAVE DA, string fullPath, variable channelNumber, variable totalOnsetDelay) + variable level, delta, searchStart, numLevels, numPulses string key @@ -393,6 +394,7 @@ End /// @brief Compare epoch and calculated pulse infos static Function PA_DiffPulseInfos(WAVE numericalValues, variable sweepNo, WAVE/Z pulseInfosEpochs, WAVE/Z pulseInfosCalc) + variable i, j, numRowsEpochs, numColsEpochs variable warnDiffms = GetLastSettingIndep(numericalValues, sweepNo, "Sampling interval DA", DATA_ACQUISITION_MODE) * 2 @@ -426,6 +428,7 @@ End /// @param[in] epochInfo epoch data to extract pulse starting times /// @returns pulse info, see GetPulseInfoWave() or an invalid wave reference on error static Function/WAVE PA_RetrievePulseInfosFromEpochs(string epochInfo) + variable numEpochs, idx, pulseNo, epoch, i, first, last, level, hasPerPulseInfo, numWrittenEpochs, hasOneValidEntry string tags @@ -613,6 +616,7 @@ End /// /// All pulses with that key are either failing or passing. static Function/S PA_GenerateFailedPulseKey(variable sweep, variable region, variable pulse) + string key sprintf key, "%d-%d-%d", sweep, region, pulse @@ -1215,9 +1219,7 @@ threadsafe static Function PA_ApplyPulseSortingOrder(WAVE setIndices, variable c End /// @brief Populates pps.pulseAverSett with the user selection from the panel -static Function PA_GatherSettings(win, s) - string win - STRUCT PulseAverageSettings &s +static Function PA_GatherSettings(string win, STRUCT PulseAverageSettings &s) string extPanel @@ -1256,9 +1258,7 @@ static Function PA_GatherSettings(win, s) End /// @brief gather deconvolution settings from PA section in BSP -static Function PA_DeconvGatherSettings(win, deconvolution) - string win - STRUCT PulseAverageDeconvSettings &deconvolution +static Function PA_DeconvGatherSettings(string win, STRUCT PulseAverageDeconvSettings &deconvolution) string bsPanel = BSP_GetPanel(win) @@ -1422,6 +1422,7 @@ End /// @brief Handle marking pulses as failed/passed if required static Function PA_MarkFailedPulses(STRUCT PulseAverageSettings &pa, STRUCT PulseAverageSetIndices &pasi) + variable numTotalPulses, sweepNo variable region, pulse, jsonID, referencePulseHasFailed variable numActive, numEntries, i, j, k, idx, startEntry, entriesToUpdate @@ -2210,6 +2211,7 @@ threadsafe static Function PA_StoreMaxAndUnitsInWaveNote(WAVE/Z w, WAVE/Z unitSo End threadsafe static Function/WAVE PA_ExtractSumsCountsOnly(WAVE/WAVE w) + Make/FREE/WAVE result = {w[1], w[2]} return result End @@ -2644,9 +2646,7 @@ threadsafe static Function PA_ZeroWave(WAVE wv, WAVE noteWave) return 1 End -static Function/WAVE PA_SmoothDeconv(input, deconvolution) - WAVE input - STRUCT PulseAverageDeconvSettings &deconvolution +static Function/WAVE PA_SmoothDeconv(WAVE input, STRUCT PulseAverageDeconvSettings &deconvolution) variable range_pnts, smoothingFactor string key @@ -2670,11 +2670,7 @@ static Function/WAVE PA_SmoothDeconv(input, deconvolution) return wv End -static Function/WAVE PA_Deconvolution(average, outputDFR, outputWaveName, deconvolution) - WAVE average - DFREF outputDFR - string outputWaveName - STRUCT PulseAverageDeconvSettings &deconvolution +static Function/WAVE PA_Deconvolution(WAVE average, DFREF outputDFR, string outputWaveName, STRUCT PulseAverageDeconvSettings &deconvolution) variable step string key @@ -2861,6 +2857,7 @@ End // @param setWave2 a set of waves that need to be tested // @param pa Filled PulseAverageSettings structure. @see PA_GatherSettings static Function PA_ResetWavesIfRequired(WAVE/Z setWave2, STRUCT PulseAverageSettings &pa, variable mode) + variable i, statusZero, statusTimeAlign, numEntries, statusSearchFailedPulse variable failedPulseLevel, failedNumberOfSpikes diff --git a/Packages/MIES/MIES_RepeatedAcquisition.ipf b/Packages/MIES/MIES_RepeatedAcquisition.ipf index b021c9f76c..d51e93df33 100644 --- a/Packages/MIES/MIES_RepeatedAcquisition.ipf +++ b/Packages/MIES/MIES_RepeatedAcquisition.ipf @@ -13,8 +13,7 @@ /// @brief __RA__ Repated acquisition functionality /// @brief Recalculate the Inter trial interval (ITI) for the given device. -static Function RA_RecalculateITI(device) - string device +static Function RA_RecalculateITI(string device) variable ITI, sweepNo @@ -39,8 +38,7 @@ static Function RA_RecalculateITI(device) return ITI End -static Function RA_HandleITI_MD(device) - string device +static Function RA_HandleITI_MD(string device) variable ITI string funcList @@ -71,9 +69,7 @@ static Function RA_HandleITI_MD(device) DQM_StartBackgroundTimer(device, ITI, funcList) End -static Function RA_WaitUntiIITIDone(device, elapsedTime) - string device - variable elapsedTime +static Function RA_WaitUntiIITIDone(string device, variable elapsedTime) variable reftime, timeLeft string oscilloscopeSubwindow @@ -95,8 +91,7 @@ static Function RA_WaitUntiIITIDone(device, elapsedTime) return 1 End -static Function RA_HandleITI(device) - string device +static Function RA_HandleITI(string device) variable ITI, refTime, background, aborted string funcList @@ -146,8 +141,7 @@ static Function RA_HandleITI(device) End /// @brief Calculate the total number of sweeps for repeated acquisition -static Function RA_GetTotalNumberOfSweeps(device) - string device +static Function RA_GetTotalNumberOfSweeps(string device) if(DAG_GetNumericalValue(device, "Check_DataAcq_Indexing")) return GetValDisplayAsNum(device, "valdisp_DataAcq_SweepsInSet") @@ -171,8 +165,7 @@ End /// @brief Function gets called after the first sweep is already /// acquired and if repeated acquisition is on -static Function RA_Start(device) - string device +static Function RA_Start(string device) variable numTotalSweeps @@ -240,8 +233,7 @@ Function RA_Counter(string device) endif End -static Function RA_FinishAcquisition(device) - string device +static Function RA_FinishAcquisition(string device) DQ_StopDAQDeviceTimer(device) @@ -252,8 +244,7 @@ static Function RA_FinishAcquisition(device) DAP_OneTimeCallAfterDAQ(device, DQ_STOP_REASON_FINISHED) End -static Function RA_BckgTPwithCallToRACounter(device) - string device +static Function RA_BckgTPwithCallToRACounter(string device) variable numTotalSweeps NVAR count = $GetCount(device) @@ -267,8 +258,7 @@ static Function RA_BckgTPwithCallToRACounter(device) endif End -static Function RA_StartMD(device) - string device +static Function RA_StartMD(string device) variable i, numTotalSweeps @@ -325,8 +315,7 @@ Function RA_CounterMD(string device) endif End -static Function RA_BckgTPwithCallToRACounterMD(device) - string device +static Function RA_BckgTPwithCallToRACounterMD(string device) variable numTotalSweeps NVAR count = $GetCount(device) @@ -437,9 +426,7 @@ End /// ///@param device device ///@param skipCount The number of sweeps to skip (forward or backwards) during repeated acquisition. -static Function RA_SkipSweepCalc(device, skipCount) - string device - variable skipCount +static Function RA_SkipSweepCalc(string device, variable skipCount) string msg variable totSweeps @@ -458,8 +445,7 @@ static Function RA_SkipSweepCalc(device, skipCount) endif End -static Function RA_PerfInitialize(device) - string device +static Function RA_PerfInitialize(string device) KillOrMoveToTrash(wv = GetRAPerfWave(device)) WAVE perfWave = GetRAPerfWave(device) @@ -467,9 +453,7 @@ static Function RA_PerfInitialize(device) perfWave[0] = RelativeNowHighPrec() End -static Function RA_PerfAddMark(device, idx) - string device - variable idx +static Function RA_PerfAddMark(string device, variable idx) WAVE perfWave = GetRAPerfWave(device) @@ -477,8 +461,7 @@ static Function RA_PerfAddMark(device, idx) perfWave[idx] = RelativeNowHighPrec() End -static Function RA_PerfFinish(device) - string device +static Function RA_PerfFinish(string device) WAVE perfWave = GetRAPerfWave(device) diff --git a/Packages/MIES/MIES_SamplingInterval.ipf b/Packages/MIES/MIES_SamplingInterval.ipf index 8ca67e41f6..fcc59b1d68 100644 --- a/Packages/MIES/MIES_SamplingInterval.ipf +++ b/Packages/MIES/MIES_SamplingInterval.ipf @@ -20,10 +20,7 @@ static Constant MIN_CONSECUTIVE_SAMPINT = 6 /// @brief Fill the passed wave to be used as DAQConfigWave -static Function SI_FillITCConfig(wv, results, idx, totalNumDA, totalNumAD, totalNumTTL) - WAVE wv, results - variable idx - variable totalNumDA, totalNumAD, totalNumTTL +static Function SI_FillITCConfig(WAVE wv, WAVE results, variable idx, variable totalNumDA, variable totalNumAD, variable totalNumTTL) variable first, last variable numDA, numAD, numTTL @@ -84,9 +81,7 @@ static Function SI_FillITCConfig(wv, results, idx, totalNumDA, totalNumAD, total End /// @brief Fill the passed wave to be used as DAQConfigWave for the exhaustive search -static Function SI_FillITCConfigWithPerms(wv, start, value, channelType) - WAVE wv - variable start, value, channelType +static Function SI_FillITCConfigWithPerms(WAVE wv, variable start, variable value, variable channelType) variable idx = start variable count @@ -110,8 +105,7 @@ End /// @brief Removes invalid and duplicated entries from the /// generated table from #SI_CreateLookupWave -static Function SI_CompressWave(wv) - WAVE wv +static Function SI_CompressWave(WAVE wv) variable i, j @@ -139,8 +133,7 @@ static Function SI_CompressWave(wv) End /// @brief Sort the lookup wave -static Function SI_SortWave(wv) - WAVE wv +static Function SI_SortWave(WAVE wv) variable type = WaveType(wv) variable numRows = DimSize(wv, ROWS) @@ -164,9 +157,7 @@ static Function SI_SortWave(wv) End /// @brief Search the given active channel combination in the lookup wave -static Function SI_FindMatchingTableEntry(wv, ac) - WAVE wv - STRUCT ActiveChannels &ac +static Function SI_FindMatchingTableEntry(WAVE wv, STRUCT ActiveChannels &ac) variable i, numRows, start string key @@ -225,9 +216,7 @@ End /// fill it in the passed structure /// /// @return number of active channels -static Function SI_FillActiveChannelsStruct(device, ac) - string device - STRUCT ActiveChannels &ac +static Function SI_FillActiveChannelsStruct(string device, STRUCT ActiveChannels &ac) ASSERT(IsEven(NUM_DA_TTL_CHANNELS), "Expected even number of DA/TTL channels") ASSERT(IsEven(NUM_AD_CHANNELS), "Expected even number of AD channels") @@ -417,8 +406,7 @@ Function SI_CreateLookupWave(string device, [variable ignoreChannelOrder]) End /// @brief Test the preset sampling interval -static Function SI_TestSampInt(device) - string device +static Function SI_TestSampInt(string device) variable i, sampInt, sampIntRead, numChannels, sampIntRef, iLast variable numConsecutive = -1 @@ -485,8 +473,7 @@ Function SI_CreateLookupWave(string device, [variable ignoreChannelOrder]) DEBUGPRINT("Unimplemented") End -static Function SI_TestSampInt(device) - string device +static Function SI_TestSampInt(string device) DEBUGPRINT("Unimplemented") End @@ -521,8 +508,7 @@ End /// @sa SI_CalculateMinSampInterval /// /// @returns sampling interval in microseconds (1e-6) -static Function SI_NI_CalculateMinSampInterval(device) - string device +static Function SI_NI_CalculateMinSampInterval(string device) WAVE channelStatus = DAG_GetChannelState(device, CHANNEL_TYPE_ADC) return HARDWARE_NI_DAC_MIN_SAMPINT * MILLI_TO_MICRO * sum(channelStatus) @@ -536,9 +522,7 @@ End /// @sa SI_CalculateMinSampInterval /// /// @returns sampling interval in microseconds (1e-6) -static Function SI_ITC_CalculateMinSampInterval(device, dataAcqOrTP) - string device - variable dataAcqOrTP +static Function SI_ITC_CalculateMinSampInterval(string device, variable dataAcqOrTP) variable numActiveChannels string deviceType, deviceNumber @@ -581,8 +565,7 @@ End /// /// This functions tries to load the wave from disk on the first /// call so this function might take a while to execute. -static Function/WAVE SI_GetMinSampIntWave(device) - string device +static Function/WAVE SI_GetMinSampIntWave(string device) variable ret string deviceType, deviceNumber diff --git a/Packages/MIES/MIES_StimsetAPI.ipf b/Packages/MIES/MIES_StimsetAPI.ipf index eb468be947..5a1ffa1e90 100644 --- a/Packages/MIES/MIES_StimsetAPI.ipf +++ b/Packages/MIES/MIES_StimsetAPI.ipf @@ -74,6 +74,7 @@ static Function/WAVE ST_GetStimsetParametersEpochType(string setName, variable e End static Function [variable resultColumn, variable resultLayer] ST_GetResultWaveCoordinates(string setName, string entry, WAVE resultWave, variable epochIndex) + variable numEpochs, epochType, idx WAVE SegWvType = WB_GetSegWvTypeForSet(setName) @@ -115,6 +116,7 @@ static Function [variable resultColumn, variable resultLayer] ST_GetResultWaveCo End static Function [WAVE wv, variable row, variable col, variable layer] ST_GetStimsetParameterWaveIndexTuple(string setName, string entry, variable epochIndex) + ST_UpgradeStimset(setName) WAVE SegWvType = WB_GetSegWvTypeForSet(setName) @@ -163,6 +165,7 @@ static Function [WAVE wv, variable row, variable col, variable layer] ST_GetStim End static Function/S ST_ParameterStringValues(string entry) + // translate passed string values which are numeric internally // WBP_GetDeltaModes() WBP_GetNoiseTypes() WBP_GetNoiseBuildResolution() WBP_GetTriggerTypes() WBP_GetPulseTypes() Make/FREE/T translateableEntries = {"^.* op$", "Noise Type [White, Pink, Brown]", "Build resolution (index)", "Trigonometric function Sin/Cos", "Pulse train type (index)"} diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index fa9e649cd1..d13da2d04e 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -3035,6 +3035,7 @@ Function SF_TabProc_Formula(STRUCT WMTabControlAction &tca) : TabControl End static Function/WAVE SF_FilterEpochs(WAVE/Z epochs, WAVE/Z ignoreTPs) + variable i, numEntries, index if(!WaveExists(epochs)) diff --git a/Packages/MIES/MIES_SweepFormula_PSX.ipf b/Packages/MIES/MIES_SweepFormula_PSX.ipf index 784dc6b5ca..82431ab881 100644 --- a/Packages/MIES/MIES_SweepFormula_PSX.ipf +++ b/Packages/MIES/MIES_SweepFormula_PSX.ipf @@ -156,6 +156,7 @@ Menu "GraphMarquee" End static Function/S PSX_GetUserDataForWorkingFolder() + return PSX_USER_DATA_WORKING_FOLDER End @@ -865,6 +866,7 @@ End /// @brief Return the PSX kernel from the cache or create it static Function/WAVE PSX_GetPSXKernel(variable riseTau, variable decayTau, variable amp, variable numPoints, variable dt, WAVE range) + string key key = CA_PSXKernelOperationKey(riseTau, decayTau, amp, numPoints, dt, range) @@ -2150,6 +2152,7 @@ static Function/S PSX_GetPSXParameters(variable jsonID, variable cacheKeyType) End static Function PSX_StoreEventsIntoCache(WAVE psxEvent) + string cacheKey, comboKey, psxParameters variable jsonID @@ -2164,6 +2167,7 @@ static Function PSX_StoreEventsIntoCache(WAVE psxEvent) End static Function/WAVE PSX_LoadEventsFromCache(string comboKey, string psxParameters) + string key key = CA_PSXEventsKey(comboKey, psxParameters) @@ -2285,6 +2289,7 @@ static Function PSX_UpdateHideStateInAllEventGraphImpl(string win, string traceT End static Function PSX_UpdateBlockIndizes(string win) + string extAllGraph, comboKey variable restrictCurrentCombo, numBlocks variable numEntries, i, blockSize, first, last @@ -2733,11 +2738,13 @@ End /// @brief Get the keyboard direction stored in user data in the psx graph static Function PSX_GetKeyboardDirection(string psxGraph) + return str2num(GetUserData(psxGraph, "", USER_DATA_KEYBOARD_DIR)) End /// @brief Set the keyboard direction in user data in the psx graph static Function PSX_SetKeyboardDirection(string psxGraph, variable direction) + SetWindow $psxGraph, userdata($USER_DATA_KEYBOARD_DIR)=num2str(direction) End @@ -3103,6 +3110,7 @@ static Function/WAVE PSX_GetEventContainerFromResults(string id) End static Function/WAVE PSX_FilterEventContainer(WAVE/Z/WAVE eventContainer, string refComboKey) + string comboKey if(!WaveExists(eventContainer)) @@ -3149,6 +3157,7 @@ static Function/S PSX_GetPSXStatsGraph(string win) End static Function/WAVE PSX_GetEventsInsideAxisRange(string win, string traceName, variable first, variable last, WAVE xCrds) + WAVE data = TraceNameToWaveRef(win, traceName) Make/FREE/N=(DimSize(xCrds, ROWS)) subMatches = (data(xCrds[p]) >= first && data(xCrds[p]) <= last) ? p : NaN @@ -3521,6 +3530,7 @@ Function/S PSX_GetAverageFitAcceptNames() End static Function/S PSX_GetUIControlHelp() + return "
" + \ "The following keyboard shortcuts work for either the psx or the psxstats graphs.\r" + \ "All of them require that the cursor A is located on an event, which is by default\r" + \ diff --git a/Packages/MIES/MIES_SweepSaving.ipf b/Packages/MIES/MIES_SweepSaving.ipf index fa719c6430..8949fa77e3 100644 --- a/Packages/MIES/MIES_SweepSaving.ipf +++ b/Packages/MIES/MIES_SweepSaving.ipf @@ -149,6 +149,7 @@ Function [variable plannedTime, variable acquiredTime] SWS_DeterminePlannedAndAc End static Function SWS_SweepSettingsEpochInfoToLBN(string device, variable sweepNo) + variable idx WAVE/T sweepSettingsTxtWave = GetSweepSettingsTextWave(device) diff --git a/Packages/MIES/MIES_TestPulse.ipf b/Packages/MIES/MIES_TestPulse.ipf index 4408d11fa0..eaa16c0317 100644 --- a/Packages/MIES/MIES_TestPulse.ipf +++ b/Packages/MIES/MIES_TestPulse.ipf @@ -47,8 +47,7 @@ End /// /// @param pulseDuration duration of the high portion of the testpulse in points or time /// @param baselineFrac fraction, *not* percentage, of the baseline -static Function TP_CalculateTestPulseLength(pulseDuration, baselineFrac) - variable pulseDuration, baselineFrac +static Function TP_CalculateTestPulseLength(variable pulseDuration, variable baselineFrac) ASSERT(TP_IsValidBaselineFraction(baselineFrac), "baselineFrac is out of range") return pulseDuration / (1 - 2 * baselineFrac) @@ -265,6 +264,7 @@ Function TP_ROAnalysis(STRUCT ASYNC_ReadOutStruct &ar) End static Function/WAVE TP_CreateOverrideResults(string device, variable type) + variable numRows, numCols, numLayers string labels @@ -315,6 +315,7 @@ static Function/WAVE TP_GetTPWaveForAutoTP(string device, variable marker) End static Function TP_AutoBaseline(string device, variable headstage, WAVE TPResults, WAVE TPs) + variable idx, pulseLengthMS, tau, baseline, fac, baselineFracCand, needsUpdate variable rangeExceeded, result string msg @@ -424,6 +425,7 @@ End /// @retval tau time constant of the decay [ms] /// @retval baseline baseline length of one pulse (same as the fitting range) [ms] static Function [variable result, variable tau, variable baseline] TP_AutoFitBaseline(WAVE data, variable pulseLengthMS) + variable first, last, firstPnt, lastPnt, totalLength, debugEnabled, fitQuality, referenceThreshold variable V_FitQuitReason, V_FitOptions, V_FitError, V_AbortCode string msg, win @@ -530,6 +532,7 @@ End /// .. image:: /dot/auto-testpulse.svg /// \endrst static Function TP_AutoAmplitudeAndBaseline(string device, WAVE TPResults, variable marker) + variable i, maximumCurrent, targetVoltage, targetVoltageTol, resistance, voltage, current variable needsUpdate, lastInvocation, curTime, scalar, skipAutoBaseline string msg @@ -684,6 +687,7 @@ Function TP_AutoTPActive(string device) End static Function TP_AutoTPTurnOff(string device, WAVE autoTPEnable, variable headstage, variable QC) + autoTPEnable[headstage] = 0 QC = !!QC @@ -698,6 +702,7 @@ End /// @brief Disable Auto TP if it passed `TP_AUTO_TP_CONSECUTIVE_PASSES` times in a row. static Function TP_AutoDisableIfFinished(string device, WAVE TPStorage) + variable i, needsUpdate, TPState WAVE TPSettings = GetTPSettings(device) @@ -999,6 +1004,7 @@ End /// @brief Calculates running average [box average] for all entries and all headstages static Function TP_CalculateAverage(WAVE TPResultsBuffer, WAVE TPResults) + variable numEntries, numLayers MatrixOp/FREE TPResultsBufferCopy = rotateLayers(TPResultsBuffer, 1) @@ -1024,10 +1030,7 @@ End /// @brief Records values from TPResults into TPStorage at defined intervals. /// /// Used for analysis of TP over time. -static Function TP_RecordTP(device, TPResults, now, tpMarker) - string device - WAVE TPResults - variable now, tpMarker +static Function TP_RecordTP(string device, WAVE TPResults, variable now, variable tpMarker) variable delta, i, ret, lastPressureCtrl, timestamp, cycleID WAVE TPStorage = GetTPStorage(device) @@ -1124,9 +1127,7 @@ static Function TP_RecordTP(device, TPResults, now, tpMarker) End /// @brief Threadsafe wrapper for performing CurveFits on the TPStorage wave -threadsafe static Function TP_FitResistance(TPStorage, startRow, endRow, headstage) - WAVE TPStorage - variable startRow, endRow, headstage +threadsafe static Function TP_FitResistance(WAVE TPStorage, variable startRow, variable endRow, variable headstage) variable V_FitQuitReason, V_FitOptions, V_FitError, V_AbortCode @@ -1158,10 +1159,7 @@ End /// @param device locked device string /// @param TPStorage test pulse storage wave /// @param endRow last valid row index in TPStorage -static Function TP_AnalyzeTP(device, TPStorage, endRow) - string device - WAVE/Z TPStorage - variable endRow +static Function TP_AnalyzeTP(string device, WAVE/Z TPStorage, variable endRow) variable i, startRow, headstage @@ -1212,9 +1210,7 @@ End /// necessary steps for tear down. /// /// @return One of @ref TestPulseRunModes -static Function TP_StopTestPulseWrapper(device, [fast]) - string device - variable fast +static Function TP_StopTestPulseWrapper(string device, [variable fast]) variable runMode @@ -1670,8 +1666,7 @@ Function TP_UpdateTPLBNSettings(string device) End /// @brief Return the TP cycle ID for the given device -static Function TP_GetTPCycleID(device) - string device +static Function TP_GetTPCycleID(string device) DAP_AbortIfUnlocked(device) diff --git a/Packages/MIES/MIES_TestPulse_Multi.ipf b/Packages/MIES/MIES_TestPulse_Multi.ipf index e49522e4bb..cf6d166892 100644 --- a/Packages/MIES/MIES_TestPulse_Multi.ipf +++ b/Packages/MIES/MIES_TestPulse_Multi.ipf @@ -70,8 +70,7 @@ Function TPM_StartTestPulseMultiDevice(string device, [variable fast]) P_InitBeforeTP(device) End -static Function TPM_BkrdTPMD(device) - string device +static Function TPM_BkrdTPMD(string device) variable hardwareType = GetHardwareType(device) @@ -288,13 +287,13 @@ Function TPM_StopTestPulseMultiDevice(string device, [variable fast]) End static Function TPM_HasActiveDevices() + WAVE ActiveDevicesTPMD = GetActiveDevicesTPMD() return GetNumberFromWaveNote(ActiveDevicesTPMD, NOTE_INDEX) > 0 End -static Function TPM_RemoveDevice(device) - string device +static Function TPM_RemoveDevice(string device) variable idx string msg @@ -318,8 +317,7 @@ static Function TPM_RemoveDevice(device) DEBUGPRINT(msg) End -static Function TPM_AddDevice(device) - string device +static Function TPM_AddDevice(string device) variable idx string msg diff --git a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf index 0c3edfb150..c121838a7a 100644 --- a/Packages/MIES/MIES_ThreadedFIFOHandling.ipf +++ b/Packages/MIES/MIES_ThreadedFIFOHandling.ipf @@ -33,8 +33,7 @@ End /// @brief Start the FIFO reset daemon used for TP MD /// /// We create one thread group for each device. -static Function TFH_StartFIFODeamonInternal(hwType, deviceID, mode) - variable hwType, deviceID, mode +static Function TFH_StartFIFODeamonInternal(variable hwType, variable deviceID, variable mode) string device @@ -84,9 +83,7 @@ End /// /// Pushes the following entries into the thread queue: /// - fifoPos: fifo position (relative to offset) -threadsafe static Function TFH_FifoLoop(config, deviceID, stopCollectionPoint, ADChannelToMonitor, mode) - WAVE config - variable deviceID, stopCollectionPoint, ADChannelToMonitor, mode +threadsafe static Function TFH_FifoLoop(WAVE config, variable deviceID, variable stopCollectionPoint, variable ADChannelToMonitor, variable mode) variable flags, moreData, fifoPos diff --git a/Packages/MIES/MIES_TraceUserData.ipf b/Packages/MIES/MIES_TraceUserData.ipf index d1c8657511..c19eaa2521 100644 --- a/Packages/MIES/MIES_TraceUserData.ipf +++ b/Packages/MIES/MIES_TraceUserData.ipf @@ -257,6 +257,7 @@ Function TUD_SetUserDataFromWaves(string graph, string trace, WAVE/T keys, WAVE/ End static Function TUD_GraphIsManaged(string graph) + string path = GetGraphUserDataAsString(graph) return WaveExists($path) diff --git a/Packages/MIES/MIES_Utilities_Algorithm.ipf b/Packages/MIES/MIES_Utilities_Algorithm.ipf index 8ecfae80c2..c6c72fd28d 100644 --- a/Packages/MIES/MIES_Utilities_Algorithm.ipf +++ b/Packages/MIES/MIES_Utilities_Algorithm.ipf @@ -759,6 +759,7 @@ threadsafe static Function FindLevelSingle(WAVE data, variable level, variable e End threadsafe static Function/WAVE FindLevelsMult(WAVE data, variable level, variable edge, variable first, variable last, variable maxNumLevels) + variable found, numLevels Make/FREE/D/N=0 levels diff --git a/Packages/MIES/MIES_Utilities_DataFolder.ipf b/Packages/MIES/MIES_Utilities_DataFolder.ipf index eebbf80150..53c6b8fada 100644 --- a/Packages/MIES/MIES_Utilities_DataFolder.ipf +++ b/Packages/MIES/MIES_Utilities_DataFolder.ipf @@ -79,9 +79,7 @@ threadsafe Function/S GetListOfObjects(DFREF dfr, string matchExpr, [variable ty End /// @brief Return a list of all objects of the given type from dfr -threadsafe static Function/S GetAllObjects(dfr, typeFlag) - DFREF dfr - variable typeFlag +threadsafe static Function/S GetAllObjects(DFREF dfr, variable typeFlag) string list diff --git a/Packages/MIES/MIES_Utilities_SFHCheckers.ipf b/Packages/MIES/MIES_Utilities_SFHCheckers.ipf index 7c9473fbf8..f5f7b8b212 100644 --- a/Packages/MIES/MIES_Utilities_SFHCheckers.ipf +++ b/Packages/MIES/MIES_Utilities_SFHCheckers.ipf @@ -31,6 +31,7 @@ End /// UTF_NOINSTRUMENTATION threadsafe static Function NameChecker(string name, variable liberal) + return !cmpstr(name, CleanupName(name, !!liberal, MAX_OBJECT_NAME_LENGTH_IN_BYTES)) End diff --git a/Packages/MIES/MIES_Utilities_WaveHandling.ipf b/Packages/MIES/MIES_Utilities_WaveHandling.ipf index e4c826497c..f34d05100f 100644 --- a/Packages/MIES/MIES_Utilities_WaveHandling.ipf +++ b/Packages/MIES/MIES_Utilities_WaveHandling.ipf @@ -130,8 +130,7 @@ threadsafe Function/WAVE GetWaveDimensions(WAVE wv) End /// @brief Returns the size of the wave in bytes -threadsafe static Function GetWaveSizeImplementation(wv) - WAVE wv +threadsafe static Function GetWaveSizeImplementation(WAVE wv) return NumberByKey("SizeInBytes", WaveInfo(wv, 0)) End diff --git a/Packages/MIES/MIES_WaveBuilder.ipf b/Packages/MIES/MIES_WaveBuilder.ipf index 4484586278..8cee6e6665 100644 --- a/Packages/MIES/MIES_WaveBuilder.ipf +++ b/Packages/MIES/MIES_WaveBuilder.ipf @@ -189,8 +189,7 @@ End /// * the custom wave that was used to build the stimset was modified /// /// @return 1 if stimset needs to be recreated, 0 otherwise -static Function WB_StimsetNeedsUpdate(setName) - string setName +static Function WB_StimsetNeedsUpdate(string setName) string stimsets variable lastModStimSet, numWaves, numStimsets, i @@ -225,8 +224,8 @@ static Function WB_StimsetNeedsUpdate(setName) End /// @brief Check if the stimset wave note has the latest version -static Function WB_StimsetHasLatestNoteVersion(setName) - string setName +static Function WB_StimsetHasLatestNoteVersion(string setName) + variable type type = WB_GetStimSetType(setName) @@ -250,8 +249,7 @@ End /// @param setName string containing name of stimset /// /// @return 1 if Parameter waves were modified, 0 otherwise -static Function WB_ParameterWvsNewerThanStim(setName) - string setName +static Function WB_ParameterWvsNewerThanStim(string setName) variable lastModStimSet, lastModWP, lastModWPT, lastModSegWvType, channelType string msg, WPModCount, WPTModCount, SegWvTypeModCount @@ -324,9 +322,7 @@ Function WB_GetStimsetChecksum(WAVE stimset, string setName, variable dataAcqOrT End /// @brief Calculcate the checksum of the stimsets and its parameter waves. -static Function WB_CalculateStimsetChecksum(stimset, setName) - WAVE stimset - string setName +static Function WB_CalculateStimsetChecksum(WAVE stimset, string setName) variable crc @@ -381,8 +377,7 @@ End /// @param setName [optional, defaults to WaveBuilderPanel GUI settings] name of the set /// @return free wave with the stim set, invalid wave ref if the `WP*` parameter waves could /// not be found. -static Function/WAVE WB_GetStimSet([setName]) - string setName +static Function/WAVE WB_GetStimSet([string setName]) variable i, numEpochs, numSweeps, numStimsets, updateEpochIDWave variable last, lengthOf1DWaves, length, channelType @@ -532,8 +527,7 @@ End /// @brief Return a free wave with wave references where the values with delta reside in /// /// @sa AddDimLabelsToWP() -static Function/WAVE WB_GetControlWithDeltaWvs(WP, SegWvType) - WAVE WP, SegWvType +static Function/WAVE WB_GetControlWithDeltaWvs(WAVE WP, WAVE SegWvType) Make/FREE/WAVE locations = {WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, WP, SegWvType} return locations @@ -581,12 +575,7 @@ End /// @param SegWvTypeOrig segment parameter wave (original) /// @param sweep sweep number /// @param numSweeps total number of sweeps -static Function WB_AddDelta(setName, WP, WPOrig, WPT, SegWvType, SegWvTypeOrig, sweep, numSweeps) - string setName - WAVE WP, WPOrig - WAVE SegWvType, SegWvTypeOrig - WAVE/T WPT - variable sweep, numSweeps +static Function WB_AddDelta(string setName, WAVE WP, WAVE WPOrig, WAVE/T WPT, WAVE SegWvType, WAVE SegWvTypeOrig, variable sweep, variable numSweeps) variable i, j variable operation @@ -675,14 +664,7 @@ End /// @param[in] numSweeps number of sweeps /// @param[in] setName name of the stimulus set (used for error reporting) /// @param[in] paramName name of the parameter (used for error reporting) -static Function WB_CalculateParameterWithDelta(operation, value, delta, dme, ldelta, originalValue, sweep, numSweeps, setName, paramName) - variable operation - variable &value - variable &delta - variable dme - string ldelta - variable originalValue, sweep, numSweeps - string setName, paramName +static Function WB_CalculateParameterWithDelta(variable operation, variable &value, variable &delta, variable dme, string ldelta, variable originalValue, variable sweep, variable numSweeps, string setName, string paramName) string list, entry variable listDelta, numDeltaEntries @@ -778,12 +760,7 @@ static Structure SegmentParameters variable lastFreq EndStructure -static Function/WAVE WB_MakeWaveBuilderWave(WP, WPT, SegWvType, stepCount, numEpochs, channelType, updateEpochIDWave, [stimset]) - WAVE WP - WAVE/T WPT - WAVE SegWvType - variable stepCount, numEpochs, channelType, updateEpochIDWave - string stimset +static Function/WAVE WB_MakeWaveBuilderWave(WAVE WP, WAVE/T WPT, WAVE SegWvType, variable stepCount, variable numEpochs, variable channelType, variable updateEpochIDWave, [string stimset]) if(ParamIsDefault(stimset)) stimset = "" @@ -1069,9 +1046,7 @@ End /// @param[in] epochIndex index of the epoch /// @param[in] epochDuration duration of the current segment /// @param[in] accumulatedDuration accumulated duration in the stimset for the first step -static Function WB_UpdateEpochID(epochIndex, epochDuration, accumulatedDuration) - variable epochIndex, epochDuration - variable accumulatedDuration +static Function WB_UpdateEpochID(variable epochIndex, variable epochDuration, variable accumulatedDuration) WAVE epochID = GetEpochID() if(epochIndex == 0) @@ -1141,8 +1116,7 @@ Function WB_UpgradeCustomWaveInWPT(WAVE/T wv, variable channelType, variable i) endif End -static Function WB_ApplyOffset(pa) - STRUCT SegmentParameters &pa +static Function WB_ApplyOffset(STRUCT SegmentParameters &pa) if(pa.offset == 0) return NaN @@ -1154,9 +1128,7 @@ static Function WB_ApplyOffset(pa) End /// @brief Initialize the seed value of the pseudo random number generator -static Function WB_InitializeSeed(WP, SegWvType, epoch, type, stepCount) - WAVE WP, SegWvType - variable epoch, type, stepCount +static Function WB_InitializeSeed(WAVE WP, WAVE SegWvType, variable epoch, variable type, variable stepCount) variable j, randomSeed, noiseGenMode @@ -1204,15 +1176,13 @@ End /// @name Functions that build wave types ///@{ -static Function WB_SquareSegment(pa) - STRUCT SegmentParameters &pa +static Function WB_SquareSegment(STRUCT SegmentParameters &pa) WAVE SegmentWave = GetSegmentWave(duration = pa.duration) MultiThread SegmentWave = pa.amplitude End -static Function WB_RampSegment(pa) - STRUCT SegmentParameters &pa +static Function WB_RampSegment(STRUCT SegmentParameters &pa) variable amplitudeIncrement = pa.amplitude * WAVEBUILDER_MIN_SAMPINT / pa.duration @@ -1234,8 +1204,7 @@ Function WB_IsValidScaledCutoffFrequency(variable freq) return freq > 0 && freq <= 0.5 End -static Function WB_NoiseSegment(pa) - STRUCT SegmentParameters &pa +static Function WB_NoiseSegment(STRUCT SegmentParameters &pa) variable samples, filterOrder variable lowPassCutoffScaled, highPassCutoffScaled @@ -1407,6 +1376,7 @@ End /// /// \endrst static Function [WAVE/D inflectionPoints, WAVE/D inflectionIndices] WB_TrigCalculateInflectionPoints(STRUCT SegmentParameters &pa, variable k0, variable k1, variable k2, variable k3) + variable i, idx, xzero, offset, lowerBound, upperBound if(WB_CheckTrigonometricSegmentParameters(pa)) @@ -1495,17 +1465,14 @@ static Function [WAVE/D inflectionPoints, WAVE/D inflectionIndices] WB_TrigSegme return [inflectionPoints, inflectionIndices] End -static Function WB_SawToothSegment(pa) - STRUCT SegmentParameters &pa +static Function WB_SawToothSegment(STRUCT SegmentParameters &pa) WAVE SegmentWave = GetSegmentWave(duration = pa.duration) MultiThread SegmentWave = pa.amplitude * sawtooth(2 * Pi * (pa.frequency * 1000) * (5 / 1000000000) * p) // NOLINT End -static Function WB_CreatePulse(wv, pulseType, amplitude, first, last) - WAVE wv - variable pulseType, amplitude, first, last +static Function WB_CreatePulse(WAVE wv, variable pulseType, variable amplitude, variable first, variable last) if(pulseType == WB_PULSE_TRAIN_TYPE_SQUARE) wv[first, last] = amplitude @@ -1865,8 +1832,7 @@ static Function [WAVE/D pulseStartTimes, WAVE/D pulseStartIndices, WAVE/D pulseE return [pulseStartTimes, pulseStartIndices, pulseEndIndices, pulseToPulseLength] End -static Function WB_PSCSegment(pa) - STRUCT SegmentParameters &pa +static Function WB_PSCSegment(STRUCT SegmentParameters &pa) variable baseline, peak @@ -1888,9 +1854,7 @@ static Function WB_PSCSegment(pa) MultiThread SegmentWave -= baseline End -static Function WB_CustomWaveSegment(pa, customWave) - STRUCT SegmentParameters &pa - WAVE customWave +static Function WB_CustomWaveSegment(STRUCT SegmentParameters &pa, WAVE customWave) pa.duration = DimSize(customWave, ROWS) * WAVEBUILDER_MIN_SAMPINT WAVE segmentWave = GetSegmentWave(duration = pa.duration) @@ -1898,10 +1862,7 @@ static Function WB_CustomWaveSegment(pa, customWave) End /// @brief Create a wave segment as combination of existing stim sets -static Function/WAVE WB_FillWaveFromFormula(formula, channelType, sweep) - string formula - variable channelType - variable sweep +static Function/WAVE WB_FillWaveFromFormula(string formula, variable channelType, variable sweep) STRUCT FormulaProperties fp string shorthandFormula @@ -1982,8 +1943,7 @@ End /// @brief Generate a unique textual representation of an index /// /// Returns the alphabet for 1-26, and then A1, B1, ..., Z1000 -static Function/S WB_GenerateUniqueLabel(idx) - variable idx +static Function/S WB_GenerateUniqueLabel(variable idx) variable number, charNum string str @@ -2115,9 +2075,7 @@ End /// @brief Add wave ranges to every stimset (location marked by `?`) and /// add a left hand side to the formula -static Function WB_PrepareFormulaForExecute(fp, sweep) - STRUCT FormulaProperties &fp - variable sweep +static Function WB_PrepareFormulaForExecute(STRUCT FormulaProperties &fp, variable sweep) string spec sprintf spec, "[p][%d]", sweep @@ -2252,8 +2210,7 @@ End /// a stimset (parent) can depend on other stimsets (child) /// /// @return non-unique list of all (child) stimsets -static Function/S WB_StimsetChildren([stimset]) - string stimset +static Function/S WB_StimsetChildren([string stimset]) variable numEpochs, numStimsets, i, j string formula, regex, prefix, match, suffix @@ -2523,6 +2480,7 @@ Function WB_SetAnalysisFunctionGeneric(variable stimulusType, string analysisFun End static Function WB_SaveStimSetParameterWaves(string setName, WAVE SegWvType, WAVE WP, WAVE/T WPT, variable stimulusType) + string segWvTypeName, WPName, WPTName segWvTypeName = WB_GetParameterWaveName(setName, STIMSET_PARAM_SEGWVTYPE) @@ -2672,6 +2630,7 @@ End /// /// @returns complete stimulus set name or an empty string in case the basename is too long static Function/S WB_AssembleSetName(string basename, variable stimulusType, variable setNumber, [string suffix, variable lengthLimit]) + string result if(ParamIsDefault(suffix)) diff --git a/Packages/MIES/MIES_WaveBuilderPanel.ipf b/Packages/MIES/MIES_WaveBuilderPanel.ipf index 3c2ab3ae2d..df7273d5b9 100644 --- a/Packages/MIES/MIES_WaveBuilderPanel.ipf +++ b/Packages/MIES/MIES_WaveBuilderPanel.ipf @@ -177,9 +177,7 @@ static Constant EPOCH_HL_TYPE_RIGHT = 0x02 /// @brief Add epoch highlightning traces /// Uses fill-to-next on specially created waves added before and after the current trace -static Function WBP_AddEpochHLTraces(dfr, epochHLType, epoch, numEpochs) - DFREF dfr - variable epochHLType, epoch, numEpochs +static Function WBP_AddEpochHLTraces(DFREF dfr, variable epochHLType, variable epoch, variable numEpochs) string nameBegin, nameEnd variable first, last @@ -307,9 +305,7 @@ End /// @brief Reponsible for adjusting controls which depend on other controls /// /// Must be called before the changed settings are written into the parameter waves. -static Function WBP_UpdateDependentControls(checkBoxCtrl, checked) - string checkBoxCtrl - variable checked +static Function WBP_UpdateDependentControls(string checkBoxCtrl, variable checked) variable val @@ -413,8 +409,7 @@ static Function WBP_UpdatePanelIfAllowed() End /// @brief Passes the data from the WP wave to the panel -static Function WBP_ParameterWaveToPanel(stimulusType) - variable stimulusType +static Function WBP_ParameterWaveToPanel(variable stimulusType) string list, control, data, customWaveName, allControls variable segment, numEntries, i, row @@ -467,10 +462,7 @@ static Function WBP_ParameterWaveToPanel(stimulusType) End /// @brief Generic wrapper for setting a control's value -static Function WBP_SetControl(win, control, [value, str]) - string win, control - variable value - string str +static Function WBP_SetControl(string win, string control, [variable value, string str]) variable controlType @@ -617,8 +609,7 @@ Function WBP_ButtonProc_SaveSet(STRUCT WMButtonAction &ba) : ButtonControl endswitch End -static Function WBP_GetWaveTypeFromControl(control) - string control +static Function WBP_GetWaveTypeFromControl(string control) if(GrepString(control, WP_CONTROL_REGEXP)) return WBP_WAVETYPE_WP @@ -638,8 +629,7 @@ End /// /// All entries are per epoch type and per epoch number except when the `$suffix` is `ALL` /// which denotes that it is a setting for the full stimset. -static Function WBP_ExtractRowNumberFromControl(control) - string control +static Function WBP_ExtractRowNumberFromControl(string control) variable start, stop, row string sep @@ -925,8 +915,7 @@ Function WBP_IsBuiltinStimset(string setName) return GrepString(setName, "^MIES_.*") || !CmpStr(setName, STIMSET_TP_WHILE_DAQ) End -static Function WBP_LoadSet(setName) - string setName +static Function WBP_LoadSet(string setName) string funcList, setPrefix variable channelType, setNumber, preventUpdate @@ -999,8 +988,7 @@ static Function WBP_LoadSet(setName) endif End -static Function SetAnalysisFunctionIfFuncExists(win, ctrl, stimset, funcList, func) - string win, ctrl, stimset, funcList, func +static Function SetAnalysisFunctionIfFuncExists(string win, string ctrl, string stimset, string funcList, string func) string entry @@ -1171,9 +1159,7 @@ Function WBP_PopupMenu(STRUCT WMPopupAction &pa) : PopupMenuControl End /// @brief Convert from the row index of a delta related control to a list of control names -static Function/S WBP_ConvertDeltaLblToCtrlNames(allControls, dimLabel) - string allControls - string dimLabel +static Function/S WBP_ConvertDeltaLblToCtrlNames(string allControls, string dimLabel) variable index @@ -1203,8 +1189,7 @@ End /// is adjusted. /// /// @param control delta operation control name -static Function WBP_AdjustDeltaControls(control) - string control +static Function WBP_AdjustDeltaControls(string control) variable deltaMode, index, row string allControls, op, delta, dme, ldelta @@ -1309,6 +1294,7 @@ Function WBP_PopupMenu_AnalysisFunctions(STRUCT WMPopupAction &pa) : PopupMenuCo End static Function WBP_UpgradePRNG() + WAVE WP = GetWaveBuilderWaveParam() WP[%$("Noise RNG type")][][] = NOISE_GEN_XOSHIRO @@ -1447,9 +1433,7 @@ End /// @param control name of WaveBuilder GUI control /// @param direction one of #FROM_PANEL_TO_WAVE or #FROM_WAVE_TO_PANEL /// @param data string to convert -static Function/S WBP_TranslateControlContents(control, direction, data) - string control, data - variable direction +static Function/S WBP_TranslateControlContents(string control, variable direction, string data) strswitch(control) case "setvar_combine_formula_T6": @@ -1470,6 +1454,7 @@ static Function/S WBP_TranslateControlContents(control, direction, data) End static Function WBP_ClearFolders() + KillOrMoveToTrash(dfr = GetWaveBuilderDataPath()) End @@ -1689,8 +1674,7 @@ End /// @brief Delete the given analysis parameter /// /// @param name name of the parameter -static Function WBP_DeleteAnalysisParameter(name) - string name +static Function WBP_DeleteAnalysisParameter(string name) string params @@ -2041,6 +2025,7 @@ End /// @brief Return a list of all parameter names of the given epochType static Function/WAVE WBP_ListControlsPerStimulusType(variable epochType) + string list, control, tab, hiddenControls variable i, numEntries, tabNumber, row, index diff --git a/Packages/MIES/MIES_WaveDataFolderGetters.ipf b/Packages/MIES/MIES_WaveDataFolderGetters.ipf index 105a1b9f26..4ef248ae38 100644 --- a/Packages/MIES/MIES_WaveDataFolderGetters.ipf +++ b/Packages/MIES/MIES_WaveDataFolderGetters.ipf @@ -241,18 +241,14 @@ End /// @brief Check if wv exists and has the correct version /// UTF_NOINSTRUMENTATION -threadsafe static Function ExistsWithCorrectLayoutVersion(wv, versionOfNewWave) - WAVE/Z wv - variable versionOfNewWave +threadsafe static Function ExistsWithCorrectLayoutVersion(WAVE/Z wv, variable versionOfNewWave) // The equality check ensures that you can also downgrade, e.g. from version 5 to 4, although this is *strongly* discouraged. return WaveExists(wv) && GetWaveVersion(wv) == versionOfNewWave End /// @brief Check if the given wave's version is equal or larger than the given version, if version is not set false is returned -threadsafe static Function WaveVersionIsAtLeast(wv, existingVersion) - WAVE/Z wv - variable existingVersion +threadsafe static Function WaveVersionIsAtLeast(WAVE/Z wv, variable existingVersion) variable waveVersion @@ -270,9 +266,7 @@ threadsafe static Function IsWaveVersioned(WAVE wv) End /// @brief Check if the given wave's version is smaller than the given version, if version is not set true is returned -threadsafe static Function WaveVersionIsSmaller(wv, existingVersion) - WAVE/Z wv - variable existingVersion +threadsafe static Function WaveVersionIsSmaller(WAVE/Z wv, variable existingVersion) variable waveVersion @@ -291,9 +285,7 @@ threadsafe Function GetWaveVersion(WAVE/Z wv) End /// @brief Set the wave layout version of wave -threadsafe static Function SetWaveVersion(wv, val) - WAVE wv - variable val +threadsafe static Function SetWaveVersion(WAVE wv, variable val) ASSERT_TS(IsValidWaveVersion(val), "val must be a positive and non-zero integer") SetNumberInWaveNote(wv, WAVE_NOTE_LAYOUT_KEY, val) @@ -301,6 +293,7 @@ End /// @brief A valid wave version is a positive non-zero integer threadsafe static Function IsValidWaveVersion(variable value) + return value > 0 && IsInteger(value) End @@ -1380,8 +1373,7 @@ End /// - Making dimension labels valid liberal object names /// - Extending the row dimension to 6 for the key waves /// - Fixing empty column dimension labels in key waves -static Function UpgradeLabNotebook(device) - string device +static Function UpgradeLabNotebook(string device) variable numCols, i, col, numEntries, sourceCol, timeStampColumn, nextFreeRow string list, key @@ -1657,6 +1649,7 @@ static Function UpgradeLabNotebook(device) End static Function/S FixInvalidLabnotebookKey(string name) + string first, last, result if(strsearch(name, ":", 0) < 0) @@ -2378,9 +2371,7 @@ static Constant SWEEP_SETTINGS_WAVE_VERSION = 39 /// @brief Uses the parameter names from the `sourceKey` columns and /// write them as dimension into the columns of dest. -static Function SetSweepSettingsDimLabels(dest, sourceKey) - WAVE dest - WAVE/T sourceKey +static Function SetSweepSettingsDimLabels(WAVE dest, WAVE/T sourceKey) variable i, numCols @@ -4034,8 +4025,7 @@ Function UpgradeWaveParam(WAVE wv) SetWaveVersion(wv, WP_WAVE_LAYOUT_VERSION) End -static Function AddDimLabelsToWP(wv) - WAVE wv +static Function AddDimLabelsToWP(WAVE wv) variable i @@ -4284,8 +4274,7 @@ Function UpgradeWaveTextParam(WAVE/T wv) End /// @brief Add dimension labels to the WaveBuilder `WPT` wave -static Function AddDimLabelsToWPT(wv) - WAVE wv +static Function AddDimLabelsToWPT(WAVE wv) variable i @@ -4445,8 +4434,7 @@ Function UpgradeSegWvType(WAVE wv) End /// @brief Add dimension labels to the WaveBuilder `SegWvType` wave -static Function AddDimLabelsToSegWvType(wv) - WAVE wv +static Function AddDimLabelsToSegWvType(WAVE wv) variable i @@ -4936,8 +4924,7 @@ Function/WAVE P_GetITCChanConfig(string device) End /// @brief Set the dimension labels for the numeric pressure wave -static Function SetPressureWaveDimLabels(wv) - WAVE wv +static Function SetPressureWaveDimLabels(WAVE wv) SetDimLabel COLS, 0, Approach_Seal_BrkIn_Clear, wv SetDimLabel COLS, 1, DAC_List_Index, wv