Skip to content

Commit c30ac5f

Browse files
committed
Match stream name when re-loading electrodes
1 parent 47b3193 commit c30ac5f

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Plugins/BasicSpikeDisplay/SpikeDetector/SpikeDetector.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ void SpikeDetector::loadCustomParametersFromXml(XmlElement* xml)
818818

819819
SpikeChannel::Type type = SpikeChannel::typeFromNumChannels(spikeParamsXml->getIntAttribute("num_channels", 1));
820820

821-
if (!alreadyLoaded(name, type, stream_source))
821+
if (!alreadyLoaded(name, type, stream_source, stream_name))
822822
{
823823
uint16 streamId = findSimilarStream(stream_source, stream_name, sample_rate, true);
824824

@@ -849,7 +849,7 @@ void SpikeDetector::loadCustomParametersFromXml(XmlElement* xml)
849849
}
850850
}
851851

852-
bool SpikeDetector::alreadyLoaded(String name, SpikeChannel::Type type, int stream_source)
852+
bool SpikeDetector::alreadyLoaded(String name, SpikeChannel::Type type, int stream_source, String stream_name)
853853
{
854854
//std::cout << "Next channel: " << name << ", " << (int) type << ", " << stream_source << std::endl;
855855

@@ -862,7 +862,9 @@ bool SpikeDetector::alreadyLoaded(String name, SpikeChannel::Type type, int stre
862862

863863
//std::cout << "LOCAL" << std::endl;
864864

865-
if (ch->getName() == name && ch->getChannelType() == type && getDataStream(ch->getStreamId())->getSourceNodeId() == stream_source)
865+
if (ch->getName() == name && ch->getChannelType() == type
866+
&& getDataStream(ch->getStreamId())->getSourceNodeId() == stream_source
867+
&& getDataStream(ch->getStreamId())->getName() == stream_name)
866868
{
867869
//std::cout << "found match." << std::endl;
868870
return true;

Plugins/BasicSpikeDisplay/SpikeDetector/SpikeDetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class SpikeDetector : public GenericProcessor
258258

259259
/** Checks whether a spike channel has been loaded, to prevent double-loading
260260
when there is a Merger in the signal chain */
261-
bool alreadyLoaded(String name, SpikeChannel::Type type, int stream_source);
261+
bool alreadyLoaded(String name, SpikeChannel::Type type, int stream_source, String stream_name);
262262

263263
StreamSettings<SpikeDetectorSettings> settings;
264264

Plugins/BasicSpikeDisplay/SpikeDisplayNode/SpikePlots.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ float SpikePlot::getDisplayThresholdForChannel(int i)
364364

365365
void SpikePlot::setDisplayThresholdForChannel(int i, float thresh)
366366
{
367-
//std::cout << "Setting threshold to " << thresh << std::endl;
368367
waveAxes[i]->setDisplayThreshold(thresh);
369368
}
370369

0 commit comments

Comments
 (0)