Mercurial > hg > aimc
diff src/Modules/Output/Graphics/GraphicsViewTime.cc @ 508:d609725e568a
Re-add support for plotting strobes (untested).
author | tomwalters@google.com |
---|---|
date | Fri, 22 Jun 2012 12:17:24 +0000 |
parents | e35740ed81f3 |
children |
line wrap: on
line diff
--- a/src/Modules/Output/Graphics/GraphicsViewTime.cc Wed May 30 20:54:57 2012 +0000 +++ b/src/Modules/Output/Graphics/GraphicsViewTime.cc Fri Jun 22 12:17:24 2012 +0000 @@ -93,6 +93,31 @@ m_pDev->gText2f(0.8f, 0.0025f, sTxt, false); } +void GraphicsViewTime::PlotStrobes(const vector<float>& signal, + const vector<int>& strobes, + float sample_rate, + float y_offset, + float height, + float x_scale, + float diameter) { + x_scale *= 1000.0 / sample_rate; + m_pDev->gColor3f(1.0f, 0.0f, 0.0f); + for (vector<int>::const_iterator i = strobes.begin(); + i != strobes.end(); ++i) { + float x = *i * x_scale; + float y = signal[*i]; + x = m_pAxisX->m_pScale->FromLinearScaled(x) + 0.5f; + y = m_pAxisY->m_pScale->FromLinearScaled(y); + + if (x < 0.0) + continue; + + // Now fit it into the drawing area. + x = x * (1.0f - m_fMarginLeft - m_fMarginRight) + m_fMarginLeft; // fit inside x-axis area + PlotStrobe(x, y_offset, y, height, diameter); + } +} + void GraphicsViewTime::PlotData(const vector<float> &signal, float sample_rate, float yOffset,