Skip to content

Commit dd80c5e

Browse files
committed
Update event channel handling in recordnode
1 parent 7d5423e commit dd80c5e

6 files changed

Lines changed: 22 additions & 15 deletions

File tree

Source/Plugins/NWBFormat/NWBRecording.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
for (int i = 0; i < nEvents; i++)
9999
eventChannels.add(getEventChannel(i));
100100

101+
int nSpikes = getNumRecordedSpikes();
102+
for (int i = 0; i < nSpikes; i++)
103+
spikeChannels.add(getSpikeChannel(i));
104+
101105
//open the file
102106
recordFile->open(getNumRecordedChannels() + continuousChannels.size() + eventChannels.size() + spikeChannels.size()); //total channels + timestamp arrays, to create a big enough buffer
103107

@@ -113,19 +117,14 @@
113117
recordFile->stopRecording();
114118
recordFile->close();
115119
recordFile = nullptr;
116-
resetChannels(false);
120+
resetChannels();
117121
}
118122

119-
void NWBRecordEngine::resetChannels()
120-
{
121-
resetChannels(true);
122-
}
123123

124124

125-
void NWBRecordEngine::resetChannels(bool resetSpikes)
125+
void NWBRecordEngine::resetChannels()
126126
{
127-
if (resetSpikes)
128-
spikeChannels.clear();
127+
spikeChannels.clear();
129128
eventChannels.clear();
130129
continuousChannels.clear();
131130
datasetIndexes.clear();
@@ -171,7 +170,6 @@ void NWBRecordEngine::writeTimestampSyncText(uint16 sourceID, uint16 sourceIdx,
171170

172171
void NWBRecordEngine::addSpikeElectrode(int index,const SpikeChannel* elec)
173172
{
174-
spikeChannels.add(elec);
175173
}
176174

177175
void NWBRecordEngine::writeSpike(int electrodeIndex, const SpikeEvent* spike)

Source/Plugins/NWBFormat/NWBRecording.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
static RecordEngineManager* getEngineManager();
4949

5050
private:
51-
void resetChannels(bool resetSpikes);
5251
ScopedPointer<NWBFile> recordFile;
5352
Array<int> datasetIndexes;
5453
Array<int> writeChannelIndexes;

Source/Processors/RecordNode/EngineConfigWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ EngineParameterComponent::EngineParameterComponent(EngineParameter& param)
7878
addAndMakeVisible(lab);
7979
control = lab;
8080
}
81-
this->setTooltip(param.name);
81+
this->setTooltip(name);
8282
}
8383

8484
EngineParameterComponent::~EngineParameterComponent()

Source/Processors/RecordNode/OriginalRecording.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class OriginalRecording : public RecordEngine
4444
OriginalRecording();
4545
~OriginalRecording();
4646

47-
void setParameter(EngineParameter& parameter);
47+
void setParameter(EngineParameter& parameter) override;
4848
String getEngineID() const override;
4949
void openFiles(File rootFolder, int experimentNumber, int recordingNumber) override;
5050
void closeFiles() override;

Source/Processors/RecordNode/RecordEngine.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ int RecordEngine::getNumRecordedEvents() const
108108
return AccessClass::getProcessorGraph()->getRecordNode()->getTotalEventChannels();
109109
}
110110

111+
int RecordEngine::getNumRecordedSpikes() const
112+
{
113+
return AccessClass::getProcessorGraph()->getRecordNode()->getTotalSpikeChannels();
114+
}
115+
111116
void RecordEngine::registerSpikeSource (const GenericProcessor* processor) {}
112117

113118
int RecordEngine::getNumRecordedProcessors() const
@@ -186,6 +191,10 @@ EngineParameter::EngineParameter (EngineParameter::EngineParameterType paramType
186191
{
187192
strParam.value = defaultValue;
188193
}
194+
else if (paramType == MULTI)
195+
{
196+
multiParam.value = defaultValue;
197+
}
189198
}
190199

191200

Source/Processors/RecordNode/RecordEngine.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class PLUGIN_API RecordEngine
167167
/** Generate a Matlab-compatible datestring */
168168
String generateDateString() const;
169169

170-
/** Gets the current block's first timestamp for a given channel */
170+
/** Gets the current block's first timestamp for a given recorded channel */
171171
int64 getTimestamp (int channel) const;
172172

173173
/** Gets the actual channel number from a recorded channel index */
@@ -180,8 +180,9 @@ class PLUGIN_API RecordEngine
180180
(right now all channels are recorded) */
181181
int getNumRecordedEvents() const;
182182

183-
/** TODO: to fill when the probe system is implemented*/
184-
//int getNumRecordedSpikes() const;
183+
/** Gets the number of recorded spike channels
184+
(right now all channels are recorded) */
185+
int getNumRecordedSpikes() const;
185186

186187
/** Gets the number of processors being recorded
187188
*/

0 commit comments

Comments
 (0)