#pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 // Use modern global access method and strict wave access. //Ben Murphy-Baum, 09/2016 //Generates a graphical representation of the waves contained in every subfolder for a given parent folder //Good for cleaning out unnecessary waves that are making the experiment file really big //Run from command line using graphMem(folder), where folder is the path to a parent folder (string). //Put a colon after the path name. i.e. graphMem("root:Traces:") Function graphMem(folder) //Generates the graphical display of the waves (non-text) string folder string nameWave String/G root:folder SVAR parentFolder = root:folder parentFolder = folder String/G root:subFolder String/G root:previewHolder SVAR previewHolder = root:previewHolder Variable/G root:itemNum NVAR itemNum = root:itemNum itemNum = 0 Variable/G root:sampleRate Variable/G root:samplePeriod NVAR samplePeriod=root:samplePeriod Variable/G root:undoCount variable numFolders = CountObjects(parentFolder,4) //counts # data folders in parent Make/O/N=(numFolders) root:folderNumber = x wave folderNumber = root:folderNumber variable n,i Make/O/T/N=(10000,numFolders) root:WaveNames //makes folder list and size/name matrix waves Make/O/T/N=(numFolders) root:folderList Make/O/N=(10000,numFolders) root:waveMatrix Make/O/N=(numFolders) root:totalFolderSize wave/T waveNames = root:WaveNames wave/T folderList = root:folderList wave waveMatrix = root:waveMatrix wave totalFolderSize = root:totalFolderSize variable left = 0 String/G root:list SVAR list = root:list list = folder+";" variable/G root:folderSizeHolder NVAR folderSizeHolder = root:folderSizeHolder folderSizeHolder = 0 totalFolderSize = 0 root:waveMatrix = 0 variable numWaves,count,yppp //Outer loop runs through each subfolder in the parent //Inner loop runs through each wave in a given subfolder, finds its name and size and puts those values in the corresponding matrix wave For(n=0;n count) ? numWaves : count EndIf folderList[n] = GetIndexedObjName(parentFolder,4,n) list += folderList[n]+";" For(i=0;i