Skip to content
Snippets Groups Projects
Commit 1b2b04ed authored by jsiegle's avatar jsiegle
Browse files

Create new classes for tetrode, stereotrode, and single electrode plots

parent 1779698d
No related branches found
No related tags found
No related merge requests found
...@@ -328,9 +328,9 @@ SpikeDisplay::SpikeDisplay(SpikeDisplayCanvas* sdc, Viewport* v) : ...@@ -328,9 +328,9 @@ SpikeDisplay::SpikeDisplay(SpikeDisplayCanvas* sdc, Viewport* v) :
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
SpikePlot* spikePlot = new SpikePlot(canvas, i, 2); TetrodePlot* tetrodePlot = new TetrodePlot(canvas, i);
spikePlots.add(spikePlot); tetrodePlots.add(tetrodePlot);
addAndMakeVisible(spikePlot); addAndMakeVisible(tetrodePlot);
} }
} }
...@@ -362,12 +362,12 @@ void SpikeDisplay::resized() ...@@ -362,12 +362,12 @@ void SpikeDisplay::resized()
float width = (float) w / (float) numColumns; float width = (float) w / (float) numColumns;
float height = width * 0.75; float height = width * 0.75;
for (int i = 0; i < spikePlots.size(); i++) for (int i = 0; i < tetrodePlots.size(); i++)
{ {
column = i % numColumns; column = i % numColumns;
row = i / numColumns; row = i / numColumns;
spikePlots[i]->setBounds(width*column,row*height,width,height); tetrodePlots[i]->setBounds(width*column,row*height,width,height);
} }
...@@ -440,9 +440,113 @@ void SpikePlot::deselect() ...@@ -440,9 +440,113 @@ void SpikePlot::deselect()
isSelected = false; isSelected = false;
} }
void SpikePlot::resized()
// --------------------------------------------------
TetrodePlot::TetrodePlot(SpikeDisplayCanvas* sdc, int elecNum) :
SpikePlot(sdc, elecNum, 4)
{
for (int i = 0; i < numChannels; i++)
{
WaveformPlot* wp = new WaveformPlot();
addAndMakeVisible(wp);
waveformPlots.add(wp);
}
for (int i = 0; i < 6; i++)
{
ProjectionPlot* pp = new ProjectionPlot();
addAndMakeVisible(pp);
projectionPlots.add(pp);
}
}
void TetrodePlot::resized()
{
float w = (float) getWidth() / 5.0f;
float h = (float) getHeight() / 2.0f;
waveformPlots[0]->setBounds(0, 0, w, h);
waveformPlots[1]->setBounds(w, 0, w, h);
waveformPlots[2]->setBounds(0, h, w, h);
waveformPlots[3]->setBounds(w, h, w, h);
projectionPlots[0]->setBounds(w*2, 0, w, h);
projectionPlots[1]->setBounds(w*3, 0, w, h);
projectionPlots[2]->setBounds(w*4, 0, w, h);
projectionPlots[3]->setBounds(w*2, h, w, h);
projectionPlots[4]->setBounds(w*3, h, w, h);
projectionPlots[5]->setBounds(w*4, h, w, h);
}
StereotrodePlot::StereotrodePlot(SpikeDisplayCanvas* sdc, int elecNum) :
SpikePlot(sdc, elecNum, 2)
{
for (int i = 0; i < numChannels; i++)
{
WaveformPlot* wp = new WaveformPlot();
addAndMakeVisible(wp);
waveformPlots.add(wp);
}
ProjectionPlot* pp = new ProjectionPlot();
addAndMakeVisible(pp);
projectionPlots.add(pp);
}
void StereotrodePlot::resized()
{ {
float w = (float) getWidth() / 3.0f;
float h = (float) getHeight() / 1.0f;
waveformPlots[0]->setBounds(0, 0, w, h);
waveformPlots[1]->setBounds(w, 0, w, h);
projectionPlots[0]->setBounds(w*2, 0, w, h);
} }
SingleElectrodePlot::SingleElectrodePlot(SpikeDisplayCanvas* sdc, int elecNum) :
SpikePlot(sdc, elecNum, 1)
{
WaveformPlot* wp = new WaveformPlot();
addAndMakeVisible(wp);
waveformPlots.add(wp);
}
void SingleElectrodePlot::resized()
{
float w = (float) getWidth() / 1.0f;
float h = (float) getHeight() / 1.0f;
waveformPlots[0]->setBounds(0, 0, w, h);
}
WaveformPlot::WaveformPlot()
{
}
void WaveformPlot::paint(Graphics& g)
{
g.fillAll(Colours::red);
}
ProjectionPlot::ProjectionPlot()
{
}
void ProjectionPlot::paint(Graphics& g)
{
g.fillAll(Colours::pink);
}
\ No newline at end of file
...@@ -39,6 +39,11 @@ class SpikeDisplayNode; ...@@ -39,6 +39,11 @@ class SpikeDisplayNode;
class SpikeDisplay; class SpikeDisplay;
class SpikePlot; class SpikePlot;
class TetrodePlot;
class StereotrodePlot;
class SingleElectrodePlot;
class WaveformPlot;
class ProjectionPlot;
/** /**
...@@ -122,12 +127,16 @@ private: ...@@ -122,12 +127,16 @@ private:
SpikeDisplayCanvas* canvas; SpikeDisplayCanvas* canvas;
Viewport* viewport; Viewport* viewport;
OwnedArray<SpikePlot> spikePlots; OwnedArray<TetrodePlot> tetrodePlots;
OwnedArray<StereotrodePlot> stereotrodePlots;
OwnedArray<SingleElectrodePlot> singleElectrodePlots;
int maxWidth, maxHeight, minWidth, minHeight; float tetrodePlotMinWidth, stereotrodePlotMinWidth, singleElectrodePlotMinWidth;
float tetrodePlotRatio, stereotrodePlotRatio, singleElectrodePlotRatio;
}; };
class SpikePlot : public Component class SpikePlot : public Component
{ {
public: public:
...@@ -139,10 +148,6 @@ public: ...@@ -139,10 +148,6 @@ public:
void select(); void select();
void deselect(); void deselect();
void resized();
private:
SpikeDisplayCanvas* canvas; SpikeDisplayCanvas* canvas;
bool isSelected; bool isSelected;
...@@ -151,6 +156,73 @@ private: ...@@ -151,6 +156,73 @@ private:
int numChannels; int numChannels;
OwnedArray<ProjectionPlot> projectionPlots;
OwnedArray<WaveformPlot> waveformPlots;
private:
};
class TetrodePlot : public SpikePlot
{
public:
TetrodePlot(SpikeDisplayCanvas*, int elecNum);
~TetrodePlot() {}
void resized();
private:
};
class StereotrodePlot : public SpikePlot
{
public:
StereotrodePlot(SpikeDisplayCanvas*, int elecNum);
~StereotrodePlot() {}
void resized();
private:
};
class SingleElectrodePlot : public SpikePlot
{
public:
SingleElectrodePlot(SpikeDisplayCanvas*, int elecNum);
~SingleElectrodePlot() {}
void resized();
private:
};
class WaveformPlot : public Component
{
public:
WaveformPlot();
~WaveformPlot() {}
void paint(Graphics& g);
private:
};
class ProjectionPlot : public Component
{
public:
ProjectionPlot();
~ProjectionPlot() {}
void paint(Graphics& g);
private:
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment