9#include <QOpenGLBuffer>
10#include <QOpenGLFunctions>
11#include <QOpenGLShaderProgram>
12#include <QOpenGLVertexArrayObject>
13#include <QOpenGLWidget>
15#include "glscopegraph.h"
16#include "hantekdso/enums.h"
17#include "hantekprotocol/types.h"
38 static void fixOpenGLversion(QSurfaceFormat::RenderableType t=QSurfaceFormat::DefaultRenderableType);
43 void showData(std::shared_ptr<PPresult> data);
44 void updateCursor(
unsigned index = 0);
45 void cursorSelected(
unsigned index) { selectedCursor = index; updateCursor(index); }
59 virtual void paintGL()
override;
64 virtual void resizeGL(
int width,
int height)
override;
66 virtual void mousePressEvent(QMouseEvent *event)
override;
67 virtual void mouseMoveEvent(QMouseEvent *event)
override;
68 virtual void mouseReleaseEvent(QMouseEvent *event)
override;
69 virtual void paintEvent(QPaintEvent *event)
override;
76 void drawVertices(QOpenGLFunctions *gl,
unsigned marker, QColor color);
78 void drawVoltageChannelGraph(ChannelID channel,
Graph &graph,
int historyIndex);
79 void drawSpectrumChannelGraph(ChannelID channel,
Graph &graph,
int historyIndex);
80 QPointF eventToPosition(QMouseEvent *event);
82 void markerMoved(
unsigned cursorIndex,
unsigned marker);
91 const unsigned NO_MARKER = UINT_MAX;
97 const unsigned VERTICES_ARRAY_SIZE =
sizeof(Vertices) /
sizeof(QVector3D);
98 std::vector<Vertices> vaMarker;
99 unsigned selectedMarker = NO_MARKER;
100 QOpenGLBuffer m_marker;
101 QOpenGLVertexArrayObject m_vaoMarker;
104 std::vector<DsoSettingsScopeCursor *> cursorInfo;
105 unsigned selectedCursor = 0;
108 QOpenGLBuffer m_grid;
109 QOpenGLVertexArrayObject m_vaoGrid[3];
110 GLsizei gridDrawCounts[3];
111 void generateGrid(QOpenGLShaderProgram *program);
114 std::list<Graph> m_GraphHistory;
115 unsigned currentGraphInHistory = 0;
118 bool shaderCompileSuccess =
false;
119 QString errorMessage;
120 std::unique_ptr<QOpenGLShaderProgram> m_program;
121 QMatrix4x4 pmvMatrix;
125 int selectionLocation;
OpenGL accelerated widget that displays the oscilloscope screen.
Definition glscope.h:25
void drawGrid()
Draw the grid.
Definition glscope.cpp:513
static void fixOpenGLversion(QSurfaceFormat::RenderableType t=QSurfaceFormat::DefaultRenderableType)
Definition glscope.cpp:37
void drawMarkers()
Draw vertical lines at marker positions.
Definition glscope.cpp:546
GlScope(DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent=0)
Initializes the scope widget.
Definition glscope.cpp:55
virtual void resizeGL(int width, int height) override
Resize the widget.
Definition glscope.cpp:397
virtual void paintGL() override
Draw the graphs, marker and the grid.
Definition glscope.cpp:358
virtual void initializeGL() override
Initializes OpenGL output.
Definition glscope.cpp:176
void showData(std::shared_ptr< PPresult > data)
Definition glscope.cpp:278
Post processing results.
Definition ppresult.h:31
Holds the cursor parameters.
Definition scopesettings.h:17
Holds the settings for the oscilloscope.
Definition scopesettings.h:77
Holds all view settings.
Definition viewsettings.h:30
Definition glscopegraph.h:14