@@ -54,11 +54,14 @@ void SourceSimThread::registerParameters()
5454 settings.channelsPerProbe = 384 ;
5555 settings.numNIDAQ = 1 ;
5656 settings.channelsPerNIDAQ = 16 ;
57+ settings.probeType = true ;
5758
5859 addIntParameter (Parameter::PROCESSOR_SCOPE, " clk_hz" , " Clock Frequency" , " Clock Frequency" , settings.clkFreq , 1 , 10000 , false );
5960
6061 addIntParameter (Parameter::PROCESSOR_SCOPE, " npx_chans" , " NPX Chans" , " Number of channels per probe" , settings.channelsPerProbe , 1 , 10000 , true );
6162
63+ addBooleanParameter (Parameter::PROCESSOR_SCOPE, " npx_type" , " NPX Type" , " Toggle Neuropixels probe type (1.0 = true, 2.0 = false)" , true , true );
64+
6265 addIntParameter (Parameter::PROCESSOR_SCOPE, " npx_probes" , " NPX Probes" , " Number of probes" , settings.numProbes , 0 , 20 , true );
6366
6467 addIntParameter (Parameter::PROCESSOR_SCOPE, " nidaq_chans" , " NIDAQ Chans" , " Number of channels per device" , settings.channelsPerNIDAQ , 1 , 32 , true );
@@ -84,7 +87,7 @@ void SourceSimThread::updateSettings (OwnedArray<ContinuousChannel>* continuousC
8487 sources.clear ();
8588
8689 std::vector<std::string> probeNames = {
87- " A" , " B" , " C" , " D" , " E" , " F" , " G" , " H" , " I" , " J" , " K" , " L" , " M" , " N" , " O" , " P" , " Q" , " R" , " S" , " T" , " U" , " V" , " W" , " X" , " Y" , " Z"
90+ " A" , " B" , " C" , " D" , " E" , " F" , " G" , " H" , " I" , " J" , " K" , " L" , " M" , " N" , " O" , " P" , " Q" , " R" , " S" , " T" , " U" , " V" , " W" , " X" , " Y" , " Z" , " AA " , " BB " , " CC " , " DD " , " EE " , " FF "
8891 };
8992
9093 for (int i = 0 ; i < settings.numProbes ; i++)
@@ -137,44 +140,48 @@ void SourceSimThread::updateSettings (OwnedArray<ContinuousChannel>* continuousC
137140
138141 // std::cout << "Probe " << i << " LFP; " << settings.channelsPerProbe << " channels." << std::endl;
139142
140- DataStream::Settings lfpSettings {
141- lfpBandName,
142- " Neural data sampled @ 2.5kHz " ,
143- " SP" + String (i) + " _LFP" ,
144- 2500 .0f
145- };
146-
147- dataStreams->add (new DataStream (lfpSettings));
148- sources.add (new SimulatedSource (lfpBandName, settings.channelsPerProbe , 2500.0 , SimulatedSourceType::LFP_BAND));
149- sourceBuffers.add (new DataBuffer (settings.channelsPerProbe , 48000 ));
150- sources.getLast ()->buffer = sourceBuffers.getLast ();
151-
152- for (int j = 0 ; j < settings.channelsPerProbe ; j++)
143+ if (settings.probeType ) // NP 1.0 = true
153144 {
154- ContinuousChannel::Settings channelSettings {
155- ContinuousChannel::Type::ELECTRODE,
156- " CH" + String (j + 1 ),
157- " LFP voltage from electrode " + String (j + 1 ),
158- " source" ,
159- 0 .195f , // BITVOLTS VALUE
145+ DataStream::Settings lfpSettings {
146+ lfpBandName,
147+ " Neural data sampled @ 2.5kHz " ,
148+ " SP" + String (i) + " _LFP" ,
149+ 2500 .0f
150+ };
151+
152+ dataStreams->add (new DataStream (lfpSettings));
153+ sources.add (new SimulatedSource (lfpBandName, settings.channelsPerProbe , 2500.0 , SimulatedSourceType::LFP_BAND));
154+ sourceBuffers.add (new DataBuffer (settings.channelsPerProbe , 48000 ));
155+ sources.getLast ()->buffer = sourceBuffers.getLast ();
156+
157+ for (int j = 0 ; j < settings.channelsPerProbe ; j++)
158+ {
159+ ContinuousChannel::Settings channelSettings {
160+ ContinuousChannel::Type::ELECTRODE,
161+ " CH" + String (j + 1 ),
162+ " LFP voltage from electrode " + String (j + 1 ),
163+ " source" ,
164+ 0 .195f , // BITVOLTS VALUE
165+ dataStreams->getLast ()
166+ };
167+
168+ continuousChannels->add (new ContinuousChannel (channelSettings));
169+ }
170+
171+ EventChannel* lfpSyncLine;
172+
173+ EventChannel::Settings lfpSyncSettings {
174+ EventChannel::Type::TTL,
175+ " LFP Sync Line" ,
176+ " Synchronization signal from the LFP band of simulated probe " + String (i),
177+ " probe.sync" ,
160178 dataStreams->getLast ()
161179 };
162180
163- continuousChannels->add (new ContinuousChannel (channelSettings));
181+ lfpSyncLine = new EventChannel (lfpSyncSettings);
182+ eventChannels->add (lfpSyncLine);
164183 }
165184
166- EventChannel* lfpSyncLine;
167-
168- EventChannel::Settings lfpSyncSettings {
169- EventChannel::Type::TTL,
170- " LFP Sync Line" ,
171- " Synchronization signal from the LFP band of simulated probe " + String (i),
172- " probe.sync" ,
173- dataStreams->getLast ()
174- };
175-
176- lfpSyncLine = new EventChannel (lfpSyncSettings);
177- eventChannels->add (lfpSyncLine);
178185 }
179186
180187 for (int i = 0 ; i < settings.numNIDAQ ; i++)
@@ -242,6 +249,10 @@ void SourceSimThread::parameterValueChanged (Parameter* param)
242249 {
243250 settings.numProbes = ((IntParameter*) param)->getIntValue ();
244251 }
252+ else if (param->getName ().equalsIgnoreCase (" npx_type" ))
253+ {
254+ settings.probeType = ((BooleanParameter*) param)->getBoolValue ();
255+ }
245256 else if (param->getName ().equalsIgnoreCase (" nidaq_chans" ))
246257 {
247258 settings.channelsPerNIDAQ = ((IntParameter*) param)->getIntValue ();
0 commit comments