Skip to content
Snippets Groups Projects
Commit 33abc099 authored by jsiegle's avatar jsiegle
Browse files

In the process of making it possible to provide custom names for channels

parent 73dfd1aa
Branches
Tags
No related merge requests found
......@@ -93,6 +93,9 @@ public:
return 0;
}
/** Changes the names of channels, if the thread needs custom names. */
virtual void updateChannelNames() { }
SourceNode* sn;
int16 eventCode;
......
......@@ -28,7 +28,7 @@ RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn), isTransmitting(fa
fastSettleEnabled(false), chipRegisters(30000.0f), dspEnabled(true), boardSampleRate(30000.0f),
desiredDspCutoffFreq(0.5f), desiredUpperBandwidth(7500.0f), desiredLowerBandwidth(1.0f),
savedSampleRateIndex(16), audioOutputL(-1), audioOutputR(-1), dacOutputShouldChange(false),
acquireAdcChannels(false),
acquireAdcChannels(false), acquireAuxChannels(true),
cableLengthPortA(0.914f), cableLengthPortB(0.914f), cableLengthPortC(0.914f), cableLengthPortD(0.914f) // default is 3 feet (0.914 m)
{
evalBoard = new Rhd2000EvalBoard;
......@@ -407,6 +407,57 @@ int RHD2000Thread::getNumChannels()
return 1; // to prevent crashing with 0 channels
}
void RHD2000Thread::updateChannelNames()
{
int chNum = -1;
for (int i = 0; i < MAX_NUM_DATA_STREAMS; i++)
{
for (int j = 0; j < numChannelsPerDataStream[i]; j++)
{
chNum++;
sn->channels[chNum]->setName(String(chNum));
}
}
if (acquireAuxChannels)
{
for (int i = 0; i < MAX_NUM_DATA_STREAMS; i++)
{
for (int j = 0; j < 3; j++)
{
chNum++;
String chName = "AUX";
// chName += (j+1);
// sn->channels[chNum]->setName(chName);
}
}
}
if (acquireAdcChannels)
{
for (int j = 0; j < 8; j++)
{
chNum++;
String chName = "ADC";
// chName += (j+1);
// sn->channels[chNum]->setName(chName);
}
}
}
int RHD2000Thread::getNumEventChannels()
{
return 16; // 8 inputs, 8 outputs
......
......@@ -82,6 +82,8 @@ public:
bool isAcquisitionActive();
void updateChannelNames();
private:
ScopedPointer<Rhd2000EvalBoard> evalBoard;
......@@ -104,6 +106,7 @@ private:
bool dacOutputShouldChange;
bool acquireAdcChannels;
bool acquireAuxChannels;
bool fastSettleEnabled;
......
......@@ -114,6 +114,7 @@ void SourceNode::updateSettings()
{
inputBuffer = dataThread->getBufferAddress();
dataThread->updateChannelNames();
std::cout << "Input buffer address is " << inputBuffer << std::endl;
}
......@@ -125,6 +126,7 @@ void SourceNode::updateSettings()
eventChannels.add(ch);
}
}
void SourceNode::actionListenerCallback(const String& msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment