Skip to content

Commit 7095e29

Browse files
committed
Merge pull request #290 from cstawarz/bug_fixes
Some bug fixes
2 parents 9cbc3b1 + 3be53d8 commit 7095e29

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

Source/Processors/DataThreads/RHD2000Thread.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
#define REGISTER_59_MISO_B 58
4545
#define RHD2132_16CH_OFFSET 8
4646

47+
#ifndef DEBUG_EMULATE_HEADSTAGES
48+
#define DEBUG_EMULATE_HEADSTAGES 0
49+
#endif
50+
4751
// Allocates memory for a 3-D array of doubles.
4852
void allocateDoubleArray3D(std::vector<std::vector<std::vector<double> > >& array3D,
4953
int xSize, int ySize, int zSize)
@@ -583,14 +587,14 @@ void RHD2000Thread::scanPorts()
583587
#if DEBUG_EMULATE_HEADSTAGES > 0
584588
for (int nd = 0; nd < MAX_NUM_DATA_STREAMS; ++nd)
585589
{
586-
if ((nd < DEBUG_EMULATE_HEADSTAGES) &&(tmpChipId[0] > 0))
590+
if (nd < DEBUG_EMULATE_HEADSTAGES)
587591
{
588592
evalBoard->setDataSource(nd,initStreamPorts[0]);
589593
enableHeadstage(nd,true);
590594
}
591595
else
592596
{
593-
enableHeadstage(stream,false);
597+
enableHeadstage(nd,false);
594598
}
595599
}
596600
#else

Source/Processors/Editors/ChannelSelector.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ void ChannelSelector::setActiveChannels(Array<int> a)
329329

330330
for (int i = 0; i < a.size(); i++)
331331
{
332-
parameterButtons[a[i]]->setToggleState(true, dontSendNotification);
332+
if (a[i] < parameterButtons.size())
333+
{
334+
parameterButtons[a[i]]->setToggleState(true, dontSendNotification);
335+
}
333336
}
334337
}
335338

Source/Processors/PSTH/PeriStimulusTimeHistogramNode.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ void PeriStimulusTimeHistogramNode::updateSettings()
133133

134134
void PeriStimulusTimeHistogramNode::setHardwareTriggerAlignmentChannel(int chan)
135135
{
136-
trialCircularBuffer->setHardwareTriggerAlignmentChannel(chan);
136+
if (trialCircularBuffer != nullptr)
137+
{
138+
trialCircularBuffer->setHardwareTriggerAlignmentChannel(chan);
139+
}
137140
}
138141

139142
bool PeriStimulusTimeHistogramNode::enable()

0 commit comments

Comments
 (0)