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

Change visualizer refresh rate

parent 4e43b764
No related branches found
No related tags found
No related merge requests found
......@@ -82,14 +82,14 @@ void LfpDisplayCanvas::beginAnimation()
screenBufferIndex = 0;
startTimer(500);
startCallbacks();
}
void LfpDisplayCanvas::endAnimation()
{
std::cout << "Ending animation." << std::endl;
stopTimer();
stopCallbacks();
}
void LfpDisplayCanvas::update()
......@@ -254,19 +254,22 @@ void LfpDisplayCanvas::paint(Graphics& g)
{
//std::cout << "Painting" << std::endl;
updateScreenBuffer();
g.setColour(Colours::grey);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColour(Colours::yellow);
// g.setColour(Colours::yellow);
g.drawLine(screenBufferIndex, 0, screenBufferIndex, getHeight());
// g.drawLine(screenBufferIndex, 0, screenBufferIndex, getHeight());
}
void LfpDisplayCanvas::refresh()
{
updateScreenBuffer();
}
// -------------------------------------------------------------
LfpTimescale::LfpTimescale(LfpDisplayCanvas* c) : canvas(c)
......
......@@ -60,6 +60,8 @@ public:
void paint(Graphics& g);
void refresh();
void resized();
float getXCoord(int chan, int samp);
......
......@@ -48,6 +48,9 @@ public:
/** Called when parameters of underlying data processor are changed.*/
virtual void update() = 0;
/** Called instead of "repaint" to avoid redrawing underlying components if not necessary.*/
virtual void refresh() = 0;
/** Called when data acquisition is active.*/
virtual void beginAnimation() = 0;
......@@ -67,7 +70,7 @@ public:
void stopCallbacks() { stopTimer(); }
/** Called whenever the timer is triggered. */
void timerCallback() { repaint(); }
void timerCallback() { refresh(); }
/** Refresh rate in Hz. */
float refreshRate;
......
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