Commit afa95f7c authored by Oliver Bock's avatar Oliver Bock
Browse files

Refactored marker into y-axis and added simpler x-axis drawing (removed cruft)

parent 5667766d
......@@ -21,8 +21,7 @@
#include "pulsescopewidget.h"
PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent),
m_scene(),
m_data()
m_scene()
{
setViewport(new QGLWidget(QGLFormat(QGL::AlphaChannel | QGL::SampleBuffers)));
QGLWidget *glScope = (QGLWidget*) viewport();
......@@ -52,17 +51,16 @@ PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent),
m_scopeSizeH = 360.0 * PERIODS;
m_scopeSizeV = 10.0;
m_pathZero = NULL;
m_pathLHO = NULL;
m_pathLLO = NULL;
m_pathVirgo = NULL;
m_marker = m_scene.addLine(0.0, 0.0, 0.0, m_scopeSizeV);
m_marker->setZValue(1);
setScene(&m_scene);
m_xAxis = m_scene.addLine(0.0, m_scopeSizeV/2.0, m_scopeSizeH, m_scopeSizeV/2.0, QPen(QColor("white")));
m_xAxis->setZValue(1);
m_yAxis = m_scene.addLine(0.0, 0.0, 0.0, m_scopeSizeV);
m_yAxis->setZValue(1);
m_data.fill(0.0, qRound(m_scopeSizeH));
drawCurve(m_pathZero, m_data, "white");
setScene(&m_scene);
}
PulseScopeWidget::~PulseScopeWidget()
......
......@@ -48,12 +48,12 @@ public slots:
private:
QGraphicsScene m_scene;
QVector<double> m_data;
QGraphicsPathItem *m_pathZero;
QGraphicsPathItem *m_pathLHO;
QGraphicsPathItem *m_pathLLO;
QGraphicsPathItem *m_pathVirgo;
QGraphicsLineItem *m_marker;
QGraphicsLineItem *m_xAxis;
QGraphicsLineItem *m_yAxis;
double m_scopeSizeH;
double m_scopeSizeV;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment