Skip to content
Snippets Groups Projects
Commit dd80c5ec authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Update event channel handling in recordnode

parent 7d5423ec
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,10 @@
for (int i = 0; i < nEvents; i++)
eventChannels.add(getEventChannel(i));
int nSpikes = getNumRecordedSpikes();
for (int i = 0; i < nSpikes; i++)
spikeChannels.add(getSpikeChannel(i));
//open the file
recordFile->open(getNumRecordedChannels() + continuousChannels.size() + eventChannels.size() + spikeChannels.size()); //total channels + timestamp arrays, to create a big enough buffer
......@@ -113,19 +117,14 @@
recordFile->stopRecording();
recordFile->close();
recordFile = nullptr;
resetChannels(false);
resetChannels();
}
void NWBRecordEngine::resetChannels()
{
resetChannels(true);
}
void NWBRecordEngine::resetChannels(bool resetSpikes)
void NWBRecordEngine::resetChannels()
{
if (resetSpikes)
spikeChannels.clear();
spikeChannels.clear();
eventChannels.clear();
continuousChannels.clear();
datasetIndexes.clear();
......@@ -171,7 +170,6 @@ void NWBRecordEngine::writeTimestampSyncText(uint16 sourceID, uint16 sourceIdx,
void NWBRecordEngine::addSpikeElectrode(int index,const SpikeChannel* elec)
{
spikeChannels.add(elec);
}
void NWBRecordEngine::writeSpike(int electrodeIndex, const SpikeEvent* spike)
......
......@@ -48,7 +48,6 @@
static RecordEngineManager* getEngineManager();
private:
void resetChannels(bool resetSpikes);
ScopedPointer<NWBFile> recordFile;
Array<int> datasetIndexes;
Array<int> writeChannelIndexes;
......
......@@ -78,7 +78,7 @@ EngineParameterComponent::EngineParameterComponent(EngineParameter& param)
addAndMakeVisible(lab);
control = lab;
}
this->setTooltip(param.name);
this->setTooltip(name);
}
EngineParameterComponent::~EngineParameterComponent()
......
......@@ -44,7 +44,7 @@ public:
OriginalRecording();
~OriginalRecording();
void setParameter(EngineParameter& parameter);
void setParameter(EngineParameter& parameter) override;
String getEngineID() const override;
void openFiles(File rootFolder, int experimentNumber, int recordingNumber) override;
void closeFiles() override;
......
......@@ -108,6 +108,11 @@ int RecordEngine::getNumRecordedEvents() const
return AccessClass::getProcessorGraph()->getRecordNode()->getTotalEventChannels();
}
int RecordEngine::getNumRecordedSpikes() const
{
return AccessClass::getProcessorGraph()->getRecordNode()->getTotalSpikeChannels();
}
void RecordEngine::registerSpikeSource (const GenericProcessor* processor) {}
int RecordEngine::getNumRecordedProcessors() const
......@@ -186,6 +191,10 @@ EngineParameter::EngineParameter (EngineParameter::EngineParameterType paramType
{
strParam.value = defaultValue;
}
else if (paramType == MULTI)
{
multiParam.value = defaultValue;
}
}
......
......@@ -167,7 +167,7 @@ protected:
/** Generate a Matlab-compatible datestring */
String generateDateString() const;
/** Gets the current block's first timestamp for a given channel */
/** Gets the current block's first timestamp for a given recorded channel */
int64 getTimestamp (int channel) const;
/** Gets the actual channel number from a recorded channel index */
......@@ -180,8 +180,9 @@ protected:
(right now all channels are recorded) */
int getNumRecordedEvents() const;
/** TODO: to fill when the probe system is implemented*/
//int getNumRecordedSpikes() const;
/** Gets the number of recorded spike channels
(right now all channels are recorded) */
int getNumRecordedSpikes() const;
/** Gets the number of processors being recorded
*/
......
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