Skip to content
Snippets Groups Projects
Commit 73dfd1aa authored by jsiegle's avatar jsiegle
Browse files

Switch order of channels in RHD2000Thread so all neural data channels are grouped together

parent 8eebf62c
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,11 @@ String Channel::getName() ...@@ -61,6 +61,11 @@ String Channel::getName()
} }
void Channel::setName(String name_)
{
name = name_;
}
void Channel::reset() void Channel::reset()
{ {
createDefaultName(); createDefaultName();
......
...@@ -61,6 +61,9 @@ public: ...@@ -61,6 +61,9 @@ public:
/** Returns the name of a given channel. */ /** Returns the name of a given channel. */
String getName(); String getName();
/** Sets the name of a given channel. */
void setName(String);
/** Restores the default settings for a given channel. */ /** Restores the default settings for a given channel. */
void reset(); void reset();
......
...@@ -826,6 +826,7 @@ bool RHD2000Thread::updateBuffer() ...@@ -826,6 +826,7 @@ bool RHD2000Thread::updateBuffer()
int streamNumber = -1; int streamNumber = -1;
int channel = -1; int channel = -1;
// do the neural data channels first
for (int dataStream = 0; dataStream < MAX_NUM_DATA_STREAMS; dataStream++) for (int dataStream = 0; dataStream < MAX_NUM_DATA_STREAMS; dataStream++)
{ {
if (numChannelsPerDataStream[dataStream] > 0) if (numChannelsPerDataStream[dataStream] > 0)
...@@ -842,48 +843,64 @@ bool RHD2000Thread::updateBuffer() ...@@ -842,48 +843,64 @@ bool RHD2000Thread::updateBuffer()
thisSample[channel] = float(value-32768)*0.195f; thisSample[channel] = float(value-32768)*0.195f;
} }
// TEMPORARILY DISABLED -- causing problems }
if (samp % 4 == 1) { // every 4th sample should have auxiliary input data
channel++;
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+0]);
auxBuffer[channel]=thisSample[channel];
channel++; }
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+1]);
auxBuffer[channel]=thisSample[channel];
streamNumber = -1;
channel++;
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+2]);
auxBuffer[channel]=thisSample[channel];
} else{ // repeat last values from buffer // then do the ADC channels
channel++; for (int dataStream = 0; dataStream < MAX_NUM_DATA_STREAMS; dataStream++)
thisSample[channel] = auxBuffer[channel]; {
channel++; if (numChannelsPerDataStream[dataStream] > 0)
thisSample[channel] = auxBuffer[channel]; {
channel++; streamNumber++;
thisSample[channel] = auxBuffer[channel];
} if (samp % 4 == 1) { // every 4th sample should have auxiliary input data
channel++;
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+0]);
auxBuffer[channel]=thisSample[channel];
channel++;
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+1]);
auxBuffer[channel]=thisSample[channel];
channel++;
thisSample[channel] = 0.0374 *
float(dataBlock->auxiliaryData[dataStream][1][samp+2]);
auxBuffer[channel]=thisSample[channel];
} else{ // repeat last values from buffer
if (acquireAdcChannels)
{
for (int adcChan = 0; adcChan < 8; ++adcChan) {
channel++; channel++;
// ADC waveform units = volts thisSample[channel] = auxBuffer[channel];
thisSample[channel] = channel++;
0.000050354 * float(dataBlock->boardAdcData[adcChan][samp]); thisSample[channel] = auxBuffer[channel];
} channel++;
thisSample[channel] = auxBuffer[channel];
} }
}
}
} }
// finally, loop through ADC channels if necessary
if (acquireAdcChannels)
{
for (int adcChan = 0; adcChan < 8; ++adcChan) {
channel++;
// ADC waveform units = volts
thisSample[channel] =
0.000050354 * float(dataBlock->boardAdcData[adcChan][samp]);
}
}
// std::cout << channel << std::endl; // std::cout << channel << std::endl;
timestamp = dataBlock->timeStamp[samp]; timestamp = dataBlock->timeStamp[samp];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment