OpenHantek
Loading...
Searching...
No Matches
GlScope Class Reference

OpenGL accelerated widget that displays the oscilloscope screen. More...

#include <glscope.h>

Inheritance diagram for GlScope:

Data Structures

struct  Vertices

Signals

void markerMoved (int cursorIndex, int marker)
void cursorMeasurement (QPointF measurePosition=QPointF(), QPoint globalPosition=QPoint(), bool status=false)

Public Member Functions

void showData (std::shared_ptr< PPresult > newData)
void selectCursor (int index)
void updateCursor (int index=0)
void generateGrid (int index=-1, double value=0.0, bool pressed=false)
void setVisible (bool visible) override

Static Public Member Functions

static GlScopecreateNormal (DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent=nullptr)
static GlScopecreateZoomed (DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent=nullptr)
static void useOpenGLSLversion (QString version=GLSL120)
static QString getOpenGLversion ()
static QString getGLSLversion ()

Protected Member Functions

 GlScope (DsoSettingsScope *scope, DsoSettingsView *view, QWidget *parent=nullptr)
 Initializes the scope widget.
 ~GlScope () override
 GlScope (const GlScope &)=delete
void initializeGL () override
 Initializes OpenGL output.
void paintGL () override
 Draw the graphs, marker and the grid.
void resizeGL (int width, int height) override
 Resize the widget.
void mousePressEvent (QMouseEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
void mouseReleaseEvent (QMouseEvent *event) override
void mouseDoubleClickEvent (QMouseEvent *event) override
void wheelEvent (QWheelEvent *event) override
void paintEvent (QPaintEvent *event) override
void drawGrid ()
 Draw the grid.
void drawMarkers ()
 Draw vertical lines at marker positions.
void generateVertices (int marker, const DsoSettingsScopeCursor &cursor)
void drawVertices (QOpenGLFunctions *gl, int marker, QColor color)
void drawVoltageChannelGraph (ChannelID channel, Graph &graph, int historyIndex)
void drawHistogramChannelGraph (ChannelID channel, Graph &graph, int historyIndex)
void drawSpectrumChannelGraph (ChannelID channel, Graph &graph, int historyIndex)
QPointF posToScopePos (QPointF pos)
void rightMouseEvent (QMouseEvent *event)

Private Member Functions

void draw4Cross (std::vector< QVector3D > &va, int section, float x, float y)

Private Attributes

DsoSettingsScopescope
DsoSettingsViewview
bool zoomed = false
const int NO_MARKER = INT_MAX
const int VERTICES_ARRAY_SIZE = sizeof( Vertices ) / sizeof( QVector3D )
std::vector< VerticesvaMarker
int selectedMarker = NO_MARKER
QOpenGLBuffer m_marker
QOpenGLVertexArrayObject m_vaoMarker
std::vector< DsoSettingsScopeCursor * > cursorInfo
int selectedCursor = 0
bool rightMouseInside = false
QOpenGLBuffer m_grid
QOpenGLVertexArrayObject m_vaoGrid [gridItems]
GLsizei gridDrawCounts [gridItems]
QColor triggerLineColor = QColor( "black" )
std::list< Graphm_GraphHistory
unsigned currentGraphInHistory = 0
QString renderInfo
bool shaderCompileSuccess = false
QString errorMessage
std::unique_ptr< QOpenGLShaderProgram > m_program
QMatrix4x4 pmvMatrix
 projection, view matrix
int colorLocation
int vertexLocation
int matrixLocation
int selectionLocation

Static Private Attributes

static const int gridItems = 4
static QString OpenGLversion
static QString GLSLversion

Detailed Description

OpenGL accelerated widget that displays the oscilloscope screen.

Constructor & Destructor Documentation

◆ GlScope() [1/2]

GlScope::GlScope ( DsoSettingsScope * scope,
DsoSettingsView * view,
QWidget * parent = nullptr )
protected

Initializes the scope widget.

Parameters
settingsThe settings that should be used.
parentThe parent widget.

◆ ~GlScope()

GlScope::~GlScope ( )
overrideprotected

◆ GlScope() [2/2]

GlScope::GlScope ( const GlScope & )
protecteddelete

Member Function Documentation

◆ createNormal()

GlScope * GlScope::createNormal ( DsoSettingsScope * scope,
DsoSettingsView * view,
QWidget * parent = nullptr )
static

◆ createZoomed()

GlScope * GlScope::createZoomed ( DsoSettingsScope * scope,
DsoSettingsView * view,
QWidget * parent = nullptr )
static

◆ cursorMeasurement

void GlScope::cursorMeasurement ( QPointF measurePosition = QPointF(),
QPoint globalPosition = QPoint(),
bool status = false )
signal

◆ draw4Cross()

void GlScope::draw4Cross ( std::vector< QVector3D > & va,
int section,
float x,
float y )
private

◆ drawGrid()

void GlScope::drawGrid ( )
protected

Draw the grid.

◆ drawHistogramChannelGraph()

void GlScope::drawHistogramChannelGraph ( ChannelID channel,
Graph & graph,
int historyIndex )
protected

◆ drawMarkers()

void GlScope::drawMarkers ( )
protected

Draw vertical lines at marker positions.

◆ drawSpectrumChannelGraph()

void GlScope::drawSpectrumChannelGraph ( ChannelID channel,
Graph & graph,
int historyIndex )
protected

◆ drawVertices()

void GlScope::drawVertices ( QOpenGLFunctions * gl,
int marker,
QColor color )
protected

◆ drawVoltageChannelGraph()

void GlScope::drawVoltageChannelGraph ( ChannelID channel,
Graph & graph,
int historyIndex )
protected

◆ generateGrid()

void GlScope::generateGrid ( int index = -1,
double value = 0.0,
bool pressed = false )

◆ generateVertices()

void GlScope::generateVertices ( int marker,
const DsoSettingsScopeCursor & cursor )
protected

◆ getGLSLversion()

QString GlScope::getGLSLversion ( )
inlinestatic

◆ getOpenGLversion()

QString GlScope::getOpenGLversion ( )
static

◆ initializeGL()

void GlScope::initializeGL ( )
overrideprotected

Initializes OpenGL output.

◆ markerMoved

void GlScope::markerMoved ( int cursorIndex,
int marker )
signal

◆ mouseDoubleClickEvent()

void GlScope::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotected

◆ mouseMoveEvent()

void GlScope::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

◆ mousePressEvent()

void GlScope::mousePressEvent ( QMouseEvent * event)
overrideprotected

◆ mouseReleaseEvent()

void GlScope::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

◆ paintEvent()

void GlScope::paintEvent ( QPaintEvent * event)
overrideprotected

◆ paintGL()

void GlScope::paintGL ( )
overrideprotected

Draw the graphs, marker and the grid.

◆ posToScopePos()

QPointF GlScope::posToScopePos ( QPointF pos)
protected

◆ resizeGL()

void GlScope::resizeGL ( int width,
int height )
overrideprotected

Resize the widget.

Parameters
widthThe new width of the widget.
heightThe new height of the widget.

◆ rightMouseEvent()

void GlScope::rightMouseEvent ( QMouseEvent * event)
protected

◆ selectCursor()

void GlScope::selectCursor ( int index)

◆ setVisible()

void GlScope::setVisible ( bool visible)
override

◆ showData()

void GlScope::showData ( std::shared_ptr< PPresult > newData)

Show new post processed data

Parameters
data

◆ updateCursor()

void GlScope::updateCursor ( int index = 0)

◆ useOpenGLSLversion()

void GlScope::useOpenGLSLversion ( QString version = GLSL120)
static

◆ wheelEvent()

void GlScope::wheelEvent ( QWheelEvent * event)
overrideprotected

Field Documentation

◆ colorLocation

int GlScope::colorLocation
private

◆ currentGraphInHistory

unsigned GlScope::currentGraphInHistory = 0
private

◆ cursorInfo

std::vector< DsoSettingsScopeCursor * > GlScope::cursorInfo
private

◆ errorMessage

QString GlScope::errorMessage
private

◆ GLSLversion

QString GlScope::GLSLversion
staticprivate

◆ gridDrawCounts

GLsizei GlScope::gridDrawCounts[gridItems]
private

◆ gridItems

const int GlScope::gridItems = 4
staticprivate

◆ m_GraphHistory

std::list< Graph > GlScope::m_GraphHistory
private

◆ m_grid

QOpenGLBuffer GlScope::m_grid
private

◆ m_marker

QOpenGLBuffer GlScope::m_marker
private

◆ m_program

std::unique_ptr< QOpenGLShaderProgram > GlScope::m_program
private

◆ m_vaoGrid

QOpenGLVertexArrayObject GlScope::m_vaoGrid[gridItems]
private

◆ m_vaoMarker

QOpenGLVertexArrayObject GlScope::m_vaoMarker
private

◆ matrixLocation

int GlScope::matrixLocation
private

◆ NO_MARKER

const int GlScope::NO_MARKER = INT_MAX
private

◆ OpenGLversion

QString GlScope::OpenGLversion
staticprivate

◆ pmvMatrix

QMatrix4x4 GlScope::pmvMatrix
private

projection, view matrix

◆ renderInfo

QString GlScope::renderInfo
private

◆ rightMouseInside

bool GlScope::rightMouseInside = false
private

◆ scope

DsoSettingsScope* GlScope::scope
private

◆ selectedCursor

int GlScope::selectedCursor = 0
private

◆ selectedMarker

int GlScope::selectedMarker = NO_MARKER
private

◆ selectionLocation

int GlScope::selectionLocation
private

◆ shaderCompileSuccess

bool GlScope::shaderCompileSuccess = false
private

◆ triggerLineColor

QColor GlScope::triggerLineColor = QColor( "black" )
private

◆ vaMarker

std::vector< Vertices > GlScope::vaMarker
private

◆ vertexLocation

int GlScope::vertexLocation
private

◆ VERTICES_ARRAY_SIZE

const int GlScope::VERTICES_ARRAY_SIZE = sizeof( Vertices ) / sizeof( QVector3D )
private

◆ view

DsoSettingsView* GlScope::view
private

◆ zoomed

bool GlScope::zoomed = false
private

The documentation for this class was generated from the following files: