Skip to content

Commit f157f16

Browse files
committed
Merge branch 'development' of https://github.com/open-ephys/plugin-GUI into development
2 parents e2257aa + 9f52887 commit f157f16

6 files changed

Lines changed: 36 additions & 35 deletions

File tree

Source/Plugins/SpikeSorter/SpikeSortBoxes.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,8 @@ void SpikeSortBoxes::resizeWaveform(int numSamples)
626626
const ScopedLock myScopedLock(mut);
627627
//StartCriticalSection();
628628
waveformLength = numSamples;
629-
delete pc1;
630-
delete pc2;
629+
delete[] pc1;
630+
delete[] pc2;
631631
pc1 = new float[numChannels * waveformLength];
632632
pc2 = new float[numChannels * waveformLength];
633633
spikeBuffer.clear();
@@ -681,8 +681,8 @@ void SpikeSortBoxes::loadCustomParametersFromXml(XmlElement* electrodeNode)
681681
bPCAjobFinished = UnitNode->getBoolAttribute("PCAjobFinished");
682682
bPCAcomputed = UnitNode->getBoolAttribute("PCAcomputed");
683683

684-
delete(pc1);
685-
delete(pc2);
684+
delete[] pc1;
685+
delete[] pc2;
686686

687687
pc1 = new float[waveformLength*numChannels];
688688
pc2 = new float[waveformLength*numChannels];
@@ -833,8 +833,8 @@ void SpikeSortBoxes::saveCustomParametersToXml(XmlElement* electrodeNode)
833833
SpikeSortBoxes::~SpikeSortBoxes()
834834
{
835835
// wait until PCA job is done (if one was submitted).
836-
delete pc1;
837-
delete pc2;
836+
delete[] pc1;
837+
delete[] pc2;
838838
pc1 = nullptr;
839839
pc2 = nullptr;
840840
}
@@ -1974,7 +1974,7 @@ int PCAjob::svdcmp(float** a, int nRows, int nCols, float* w, float** v)
19741974
}
19751975
}
19761976

1977-
delete rv1;
1977+
delete[] rv1;
19781978

19791979
return (0);
19801980
}
@@ -2122,16 +2122,16 @@ void PCAjob::computeSVD()
21222122
// clear memory
21232123
for (int k = 0; k < dim; k++)
21242124
{
2125-
delete eigvec[k];
2125+
delete[] eigvec[k];
21262126
}
2127-
delete eigvec;
2128-
delete sigvalues;
2127+
delete[] eigvec;
2128+
delete[] sigvalues;
21292129

21302130
// delete covariances
21312131
for (int k = 0; k < dim; k++)
21322132
delete cov[k];
21332133

2134-
delete(cov);
2134+
delete[] cov;
21352135
cov = nullptr;
21362136

21372137
}

Source/Plugins/SpikeSorter/SpikeSortBoxes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SorterSpikeContainer : public ReferenceCountedObject
4040
const SpikeChannel* getChannel() const;
4141
int64 getTimestamp() const;
4242
uint8 color[3];
43-
uint8 pcProj[2];
43+
float pcProj[2];
4444
uint16 sortedId;
4545
private:
4646
int64 timestamp;

Source/Plugins/SpikeSorter/SpikeSorter.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,13 @@ void SpikeSorter::updateSettings()
207207

208208
Electrode::~Electrode()
209209
{
210-
delete thresholds;
211-
delete isActive;
212-
delete voltageScale;
213-
delete channels;
214-
delete spikeSort;
215-
delete runningStats;
210+
delete[] thresholds;
211+
delete[] isActive;
212+
delete[] voltageScale;
213+
delete[] channels;
214+
delete[] runningStats;
215+
216+
delete spikeSort;
216217

217218
}
218219

Source/Plugins/SpikeSorter/SpikeSorterCanvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ void WaveformAxes::setRange(float r)
10701070

10711071
void WaveformAxes::plotSpike(SorterSpikePtr s, Graphics& g)
10721072
{
1073-
1073+
if (s.get() == nullptr) return;
10741074
float h = getHeight();
10751075
g.setColour(Colour(s->color[0], s->color[1], s->color[2]));
10761076
//g.setColour(Colours::pink);

Source/Plugins/SpikeSorter/SpikeSorterEditor.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ SpikeSorterEditor::SpikeSorterEditor(GenericProcessor* parentNode, bool useDefau
148148
channelSelector->paramButtonsToggledByDefault(false);
149149
// updateAdvancerList();
150150

151-
dacAssignmentLabel= new Label("DAC output","DAC output");
151+
/* dacAssignmentLabel= new Label("DAC output","DAC output");
152152
dacAssignmentLabel->setFont(Font("Default", 10, Font::plain));
153153
dacAssignmentLabel->setEditable(false);
154154
dacAssignmentLabel->setBounds(210,115,80,20);
@@ -164,7 +164,7 @@ SpikeSorterEditor::SpikeSorterEditor(GenericProcessor* parentNode, bool useDefau
164164
dacCombo->addItem("DAC"+String(k+1),k+2);
165165
}
166166
dacCombo->setSelectedId(1);
167-
addAndMakeVisible(dacCombo);
167+
addAndMakeVisible(dacCombo);*/
168168

169169
}
170170

@@ -211,13 +211,13 @@ void SpikeSorterEditor::sliderEvent(Slider* slider)
211211

212212

213213

214-
//Array<int> dacChannels = processor->getDACassignments;
214+
/* //Array<int> dacChannels = processor->getDACassignments;
215215
int dacChannel = dacCombo->getSelectedId()-2;
216216
if (dacChannel >= 0)
217217
{
218218
// update dac threshold.
219219
processor->updateDACthreshold(dacChannel, slider->getValue());
220-
}
220+
}*/
221221

222222
}
223223
repaint();
@@ -259,7 +259,7 @@ void SpikeSorterEditor::buttonEvent(Button* button)
259259
electrodeButtons.indexOf((ElectrodeButton*) button)));
260260

261261

262-
if (processor->getAutoDacAssignmentStatus())
262+
/* if (processor->getAutoDacAssignmentStatus())
263263
{
264264
processor->assignDACtoChannel(0, channelNum);
265265
processor->assignDACtoChannel(1, channelNum);
@@ -274,7 +274,7 @@ void SpikeSorterEditor::buttonEvent(Button* button)
274274
dacCombo->setSelectedId(i+2, sendNotification);
275275
break;
276276
}
277-
}
277+
}*/
278278

279279
}
280280
}
@@ -517,7 +517,7 @@ void SpikeSorterEditor::channelChanged (int channel, bool newState)
517517
i,
518518
channel - 1);
519519

520-
// if DAC is selected, update the mapping.
520+
/* // if DAC is selected, update the mapping.
521521
int dacchannel = dacCombo->getSelectedId() - 2;
522522
if (dacchannel >=0)
523523
{
@@ -528,7 +528,7 @@ void SpikeSorterEditor::channelChanged (int channel, bool newState)
528528
processor->assignDACtoChannel (0, channel - 1);
529529
processor->assignDACtoChannel (1, channel - 1);
530530
break;
531-
}
531+
}*/
532532
}
533533
}
534534
}
@@ -587,7 +587,7 @@ void SpikeSorterEditor::refreshElectrodeList(int selected)
587587
processor->assignDACtoChannel(0, e->channels[0]);
588588
processor->assignDACtoChannel(1, e->channels[0]);
589589
}
590-
Array<int> dacAssignmentToChannels = processor->getDACassignments();
590+
/* Array<int> dacAssignmentToChannels = processor->getDACassignments();
591591
// search for channel[0]. If found, set the combo box accordingly...
592592
dacCombo->setSelectedId(1, sendNotification);
593593
for (int i=0; i<dacAssignmentToChannels.size(); i++)
@@ -598,7 +598,7 @@ void SpikeSorterEditor::refreshElectrodeList(int selected)
598598
processor->updateDACthreshold(i+2, e->thresholds[0]);
599599
break;
600600
}
601-
}
601+
}*/
602602

603603

604604

@@ -664,7 +664,7 @@ void SpikeSorterEditor::comboBoxChanged(ComboBox* comboBox)
664664
{
665665
SpikeSorter* processor = (SpikeSorter*) getProcessor();
666666

667-
if (comboBox == dacCombo)
667+
/* if (comboBox == dacCombo)
668668
{
669669
int selection = dacCombo->getSelectedId();
670670
// modify the dac channel assignment...
@@ -688,7 +688,7 @@ void SpikeSorterEditor::comboBoxChanged(ComboBox* comboBox)
688688
}
689689
690690
}
691-
else if (comboBox == electrodeList)
691+
else*/ if (comboBox == electrodeList)
692692
{
693693
int ID = comboBox->getSelectedId();
694694

@@ -726,7 +726,7 @@ void SpikeSorterEditor::comboBoxChanged(ComboBox* comboBox)
726726
processor->assignDACtoChannel(0, e->channels[0]);
727727
processor->assignDACtoChannel(1, e->channels[0]);
728728
}
729-
Array<int> dacAssignmentToChannels = processor->getDACassignments();
729+
/* Array<int> dacAssignmentToChannels = processor->getDACassignments();
730730
// search for channel[0]. If found, set the combo box accordingly...
731731
dacCombo->setSelectedId(1, sendNotification);
732732
for (int i=0; i<dacAssignmentToChannels.size(); i++)
@@ -736,7 +736,7 @@ void SpikeSorterEditor::comboBoxChanged(ComboBox* comboBox)
736736
dacCombo->setSelectedId(i+2, sendNotification);
737737
break;
738738
}
739-
}
739+
}*/
740740

741741
}
742742

Source/Plugins/SpikeSorter/SpikeSorterEditor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ class SpikeSorterEditor : public VisualizerEditor,
7373

7474

7575
// ComboBox* electrodeTypes;
76-
ScopedPointer<ComboBox> electrodeList,dacCombo;
76+
ScopedPointer<ComboBox> electrodeList;// , dacCombo;
7777
ScopedPointer<ComboBox> advancerList;
7878
ScopedPointer<Label> advancerLabel, depthOffsetLabel, depthOffsetEdit;
7979
ScopedPointer<Label> numElectrodes;
80-
ScopedPointer<Label> thresholdLabel,dacAssignmentLabel;
80+
ScopedPointer<Label> thresholdLabel; // , dacAssignmentLabel;
8181
ScopedPointer<TriangleButton> upButton;
8282
ScopedPointer<TriangleButton> downButton;
8383
ScopedPointer<UtilityButton> plusButton;

0 commit comments

Comments
 (0)