Skip to content

Commit 47b3193

Browse files
committed
Fix SpikeDetector numChannels reference
1 parent 546745a commit 47b3193

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

Plugins/BasicSpikeDisplay/SpikeDetector/PopupConfigurationWindow.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ void PopupThresholdComponent::buttonClicked(Button* button)
226226

227227
ThresholdSelectorCustomComponent::ThresholdSelectorCustomComponent(SpikeChannel* channel_, bool acquisitionIsActive_)
228228
: channel(channel_),
229-
numChannels(channel_->getNumChannels()),
230229
acquisitionIsActive(acquisitionIsActive_)
231230
{
232231
thresholder_type = (CategoricalParameter*) channel->getParameter("thrshlder_type");
@@ -253,7 +252,7 @@ void ThresholdSelectorCustomComponent::mouseDown(const MouseEvent& event)
253252
auto* popupComponent = new PopupThresholdComponent(table,
254253
this,
255254
row,
256-
numChannels,
255+
channel->getNumChannels(),
257256
ThresholderType(thresholder_type->getSelectedIndex()),
258257
abs_thresholds,
259258
std_thresholds,
@@ -288,6 +287,7 @@ void ThresholdSelectorCustomComponent::setSpikeChannel(SpikeChannel* ch)
288287
std_thresholds.add((FloatParameter*)channel->getParameter("std_threshold" + String(ch + 1)));
289288
dyn_thresholds.add((FloatParameter*)channel->getParameter("dyn_threshold" + String(ch + 1)));
290289
}
290+
291291
}
292292

293293
void ThresholdSelectorCustomComponent::setRowAndColumn(const int newRow, const int newColumn)
@@ -317,7 +317,7 @@ void ThresholdSelectorCustomComponent::paint(Graphics& g)
317317
break;
318318
}
319319

320-
for (int i = 0; i < numChannels; i++)
320+
for (int i = 0; i < channel->getNumChannels(); i++)
321321
{
322322
switch (thresholder_type->getSelectedIndex())
323323
{
@@ -762,7 +762,7 @@ void SpikeDetectorTableModel::update(Array<SpikeChannel*> spikeChannels_)
762762
waveformComponents.clear();
763763
thresholdComponents.clear();
764764

765-
for (int i = 0; i < getNumRows(); i++)
765+
for (int i = 0; i < getNumRows(); i++)
766766
{
767767

768768
Component* c = table->getCellComponent(SpikeDetectorTableModel::Columns::THRESHOLD, i);

Plugins/BasicSpikeDisplay/SpikeDetector/PopupConfigurationWindow.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ class ThresholdSelectorCustomComponent : public Component
239239
juce::Colour textColour;
240240
bool acquisitionIsActive;
241241

242-
int numChannels;
243-
244242
Array<FloatParameter*> dyn_thresholds;
245243
Array<FloatParameter*> abs_thresholds;
246244
Array<FloatParameter*> std_thresholds;

0 commit comments

Comments
 (0)