Skip to content

Commit 1dbe0eb

Browse files
authored
Merge pull request #202 from tne-lab/lfpviewer-changes
Some bug fixes for new LFP viewer
2 parents a604733 + 7cc93c3 commit 1dbe0eb

3 files changed

Lines changed: 15 additions & 19 deletions

File tree

Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void LfpDisplayCanvas::update()
230230
channelOverlapFactor = options->selectedOverlapValue.getFloatValue();
231231

232232
std::cout << "Checking channels: " << nChans << std::endl;
233-
for (int i = 0; i <= processor->getNumInputs() + 1; i++) // extra channel for events
233+
for (int i = 0; i < processor->getNumInputs() + 1; i++) // extra channel for events
234234
{
235235
//std::cout << i << std::endl;
236236
if (processor->getNumInputs() > 0)
@@ -282,7 +282,7 @@ void LfpDisplayCanvas::update()
282282

283283
std::cout << "Changing channels on LFP display" << std::endl;
284284
if (nChans > 0)
285-
lfpDisplay->setNumChannels(nChans + 1); // add an extra channel for events
285+
lfpDisplay->setNumChannels(nChans);
286286

287287
// update channel names
288288
//std::cout << "Updating channel names" << std::endl;

Source/Plugins/LfpDisplayNode/LfpDisplayEditor.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LfpDisplayEditor::LfpDisplayEditor(GenericProcessor* parentNode, bool useDefault
3737

3838
subprocessorSelection = new ComboBox("Subprocessor sample rate");
3939
// subprocessorSelection->setBounds(subprocessorSelectionLabel->getX()+5, subprocessorSelectionLabel->getBottom(), 60, 22);
40-
subprocessorSelection->setBounds(10, 30, 50, 22);
40+
subprocessorSelection->setBounds(10, 30, 55, 22);
4141
subprocessorSelection->addListener(this);
4242
addAndMakeVisible(subprocessorSelection);
4343

@@ -148,18 +148,17 @@ void LfpDisplayEditor::updateSubprocessorSelectorOptions()
148148

149149
subprocessorSampleRateLabel->setText(sampleRateLabelText, dontSendNotification);
150150
//setCanvasDrawableSubprocessor(defaultSubprocessor);
151-
}
152-
else
153-
{
154-
subprocessorSelection->addItem("None", 1);
155-
subprocessorSelection->setSelectedId(1, dontSendNotification);
156-
157-
String sampleRateLabelText = "Sample Rate: <not available>";
158-
subprocessorSampleRateLabel->setText(sampleRateLabelText, dontSendNotification);
159-
//setCanvasDrawableSubprocessor(-1);
160151

152+
return;
161153
}
162154
}
155+
156+
subprocessorSelection->addItem("None", 1);
157+
subprocessorSelection->setSelectedId(1, dontSendNotification);
158+
159+
String sampleRateLabelText = "Sample Rate: <not available>";
160+
subprocessorSampleRateLabel->setText(sampleRateLabelText, dontSendNotification);
161+
//setCanvasDrawableSubprocessor(-1);
163162
}
164163

165164
void LfpDisplayEditor::setCanvasDrawableSubprocessor(int index)

Source/Plugins/LfpDisplayNode/LfpDisplayNode.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,10 @@ void LfpDisplayNode::updateSettings()
123123
displayBufferIndex.clear();
124124
displayBufferIndex.insertMultiple(0, 0, numChannelsInSubprocessor + numEventChannels);
125125

126-
// update the editor's subprocessor selection display, only if there's a mismatch in # of subprocessors
127-
if (numSubprocessors != totalSubprocessors)
128-
{
129-
LfpDisplayEditor * ed = (LfpDisplayEditor*)getEditor();
130-
ed->updateSubprocessorSelectorOptions();
131-
numSubprocessors = totalSubprocessors;
132-
}
126+
// update the editor's subprocessor selection display and sample rate
127+
LfpDisplayEditor * ed = (LfpDisplayEditor*)getEditor();
128+
ed->updateSubprocessorSelectorOptions();
129+
numSubprocessors = totalSubprocessors;
133130
}
134131

135132
uint32 LfpDisplayNode::getChannelSourceID(const EventChannel* event) const

0 commit comments

Comments
 (0)