ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
GigEPlayer Class Reference

Connects to a GigE Vision device, starts acquisition and displays the frames. More...

#include <gige_player.h>

Inheritance diagram for GigEPlayer:
Inheritance graph
Collaboration diagram for GigEPlayer:
Collaboration graph

Public Slots

void play (const QString name, const QString ip_address)
 Connect to a device and start acquisition.
void renderFrame ()
 Render the latest received frame at the display rate.
void noFrame ()
 Blank the display when no frames are arriving.

Public Member Functions

 GigEPlayer (QWidget *parent=nullptr)
 Construct a new GigE player and show the window.
 ~GigEPlayer () final
 Stop the acquisition and close the window.

Static Public Member Functions

static int activeCount ()
 The number of open GigE player windows.

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 Event filter to keep the image fitted to the dialog on resize.

Private Member Functions

void connectionResult (bool success, const QString &message)
 Called on the GUI thread when the connection attempt completes.
void onFrame (::mediax::gev::Frame &&frame)
 Frame callback, runs on the receive thread.
void shutdown ()
 Stop the connection thread and the camera.

Private Attributes

QPointer< QDialog > m_dialog
 The player dialog.
QGraphicsScene * m_scene = nullptr
 The scene.
QGraphicsView * m_view = nullptr
 The view.
QGraphicsPixmapItem * m_pixmapItem = nullptr
 The pixmap item, kept to avoid flicker.
QPixmap m_pixmap
 The displayed image.
QStatusBar * m_status_bar = nullptr
 The status bar.
QLabel * m_stream_label = nullptr
 Device address label.
QLabel * m_format_label = nullptr
 Resolution and pixel format label.
QLabel * m_frame_label = nullptr
 Frame counter label.
QTimer m_render_timer
 Display refresh timer.
QTimer m_blank_timer
 No-frame blanking timer.
std::unique_ptr<::mediax::gev::Camera > m_camera
 The device, set by the connection thread. Acquisition runs while it is held.
std::thread m_connect_thread
 Connects and starts acquisition without blocking the GUI.
std::atomic< bool > m_closing { false }
 Set when the player is being destroyed.
std::atomic< bool > m_connected { false }
 The connection succeeded, the camera can be read from the GUI thread.
std::mutex m_frame_mutex
 Guards the pending frame.
::mediax::gev::Frame m_pending_frame
 The latest frame from the receive thread.
bool m_frame_pending = false
 A new frame is waiting to be rendered.
std::atomic< uint64_t > m_frame_count { 0 }
 Frames received.
std::vector< uint8_t > m_convert_buffer
 Conversion buffer (RGB24).

Detailed Description

Connects to a GigE Vision device, starts acquisition and displays the frames.

The window closes and the acquisition stops when the dialog is closed.

Constructor & Destructor Documentation

◆ GigEPlayer()

GigEPlayer::GigEPlayer ( QWidget * parent = nullptr)
explicit

Construct a new GigE player and show the window.

Parameters
parentthe parent widget (the player closes when the parent closes)

Member Function Documentation

◆ activeCount()

int GigEPlayer::activeCount ( )
static

The number of open GigE player windows.

Returns
the number of live players

◆ play

void GigEPlayer::play ( const QString name,
const QString ip_address )
slot

Connect to a device and start acquisition.

Parameters
namethe device name shown in the window title
ip_addressthe dotted-decimal IP address of the device

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