1. Richard Gerkin
  2. Recording Artist

Commits

Richard Gerkin  committed b7723ca

NoDAQ implementation

  • Participants
  • Parent commits e6853de
  • Branches default

Comments (0)

Files changed (9)

File Acquisition/Analysis.ipf

View file
 		analysisMethods=SelectedMethod() // Plural here, the local variable to loop through.  Will have only one element because analysis is restricted to the argument.  
 	endif
 	wave /T Labels=GetChanLabels()
-	dfref df=Core#PackageHome(module,"analysisWin")
+	dfref df=Core#InstanceHome(module,"analysisWin","win0")
 	wave /t/sdfr=df ListWave
 	wave /sdfr=df SelWave
 	string measurementCompleted=""

File Acquisition/DAQ Interface.ipf

View file
 #endif
 
 function /s DAQTypes()
-	return "ITC;LIH;NIDAQmx;"
+	return "ITC;LIH;NIDAQmx;NoDAQ"
 end
 
 function /s GetDAQDevices([types])
 	string DAQ
 	variable quiet
 	
-	return Core#StrPackageSetting(module,"DAQs",DAQ,"type",quiet=quiet)
+	if(strlen(DAQ) && !stringmatch(DAQ,"_default_"))
+		string result = Core#StrPackageSetting(module,"DAQs",DAQ,"type",quiet=quiet)
+	else
+		result = ""
+		string types=DAQTypes() 
+		variable i
+		for(i=0;i<itemsinlist(types);i+=1)
+			string type=stringfromlist(i,types)
+			string funcName=type+"#"+GetRTStackInfo(1)
+			if(exists(funcName)==6 && strlen(type))
+				FuncRef DAQType f=$funcName
+				if(!numberbykey("ISPROTO",FuncRefInfo(f)))
+					result = f(DAQ,quiet=quiet) 
+					break
+				endif
+			endif
+		endfor
+	endif
+	return result
 end
 
 //// Returns 1 if this channel name is consistent with this type of DAQ.  

File Acquisition/ITC Wrappers.ipf

View file
 static strconstant module="Acq"
 static strconstant type="ITC"
 
+static function /s DAQType(DAQ[,quiet])
+	string DAQ
+	variable quiet
+	
+	return "ITC"
+end
+
 static function /s InputChannelList([DAQ])
 	string DAQ
 	

File Acquisition/LIH Wrappers.ipf

View file
 static strconstant module="Acq"
 static strconstant type=LIH
 
+static function /s DAQType(DAQ[,quiet])
+	string DAQ
+	variable quiet
+	
+	return "LIH"
+end
+
+
 static function /s InputChannelList([DAQ])
 	string DAQ
 	

File Acquisition/NIDAQmx Wrappers.ipf

View file
 	return fDAQmx_DeviceNames()
 end
 
-static function /s DAQType(DAQ)
+static function /s DAQType(DAQ[,quiet])
 	string DAQ
+	variable quiet
 	
 	return "NIDAQmx"
 end
 
+
 static function /s DAQ2Device(DAQ) // TO DO: Make DAQ map onto a device number.  
 	string DAQ
 	

File Acquisition/No DAQ Wrappers.ipf

View file
 	return "dev1"
 end
 
-static function /s DAQType(DAQ)
+static function /s DAQType(DAQ[,quiet])
 	string DAQ
+	variable quiet
 	
 	return "NoDAQ"
 end
 		variable start = numpnts(buffer)
 		redimension /n=(start+dimsize(w,0)) buffer
 		buffer[start,] = w[p-start]
-		printf "Speaking wrote to the buffer...\r"
+		//printf "Speaking wrote to the buffer...\r"
 		if(numpnts(buffer)>max_buffer_size)
 			PurgeOutput(i)
 			buffer = w[0]
 		wave /sdfr=df buffer = $("ch"+num2str(i))
 		nvar /sdfr=df xx = $("x"+num2str(i))
 		if(numpnts(buffer)-xx >=numpnts(w))
-			print numpnts(buffer),xx,numpnts(w)
 			w = buffer[p+xx]
 			xx += numpnts(w)
-			printf "Listening read from the buffer...\r"
+			//printf "Listening read from the buffer...\r"
 		endif
 		if(numpnts(buffer)>max_buffer_size)
 			PurgeInput(i)
 		out_x += numpnts(response)
 		wave /sdfr=inDF in = $("ch"+num2str(i))
 		concatenate /np {response},in
-		printf "Added %d points to the input buffer.\r",numpnts(response)
+		//printf "Added %d points to the input buffer.\r",numpnts(response)
 	endfor
 	
 	// Extra inputs not matched up to any output.  
 		in = gnoise(1)
 	endfor	
 	
-	printf "Waiting executed once...\r"
+	//printf "Waiting executed once...\r"
 	t_update = now*1e6 + t_init
+	string DAQ = MasterDAQ()
+	CollectSweep(DAQ)
 	return 0
 end
 
 	Convolve expo,convolved
 	copyscales /p w,convolved
 	duplicate /free/r=[start,] convolved,result
+	result += gnoise(0.0001)
 	return result
 end

File Basics/Graphing.ipf

View file
 	endif
 End
 
+function /s IgorWinCoords2()
+	Struct rect coords
+	IgorWinCoords(coords)
+	string result = num2str(coords.left)+";"+num2str(coords.top)+";"
+	result += num2str(coords.right)+";"+num2str(coords.bottom)+";"
+	return result
+end
+
 Function RegenLayout([replace,with,win])
 	String replace,with,win
 	

File Core/Settings.ipf

View file
 		endif
 		instance = "_default_"
 	endif
-	if(stringmatch(instance,"_default_") || stringmatch(instance,"")) // If copying from default instance.  
+	if(stringmatch(instance,defaultInstance_) || stringmatch(instance,"_default_") || stringmatch(instance,"")) // If copying from default instance.  
 		if(!InstanceExists(module,package,defaultInstance_,quiet=quiet))
 			LoadPackageInstance(module,package,defaultInstance_,quiet=quiet)
 		endif

File Modules/Acq/Manifest.pxp

Binary file modified.