ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
gige_discovery_tab.h
Go to the documentation of this file.
1//
2// Copyright (c) 2026, Astute Systems PTY LTD
3//
4// This file is part of the VivoeX project developed by Astute Systems.
5//
6// License. See the LICENSE file in the project root for full license details.
7//
13
14#ifndef STREAMS_GIGE_DISCOVERY_TAB_H
15#define STREAMS_GIGE_DISCOVERY_TAB_H
16
17#include <atomic>
18#include <cstdint>
19#include <map>
20#include <set>
21#include <string>
22#include <thread>
23#include <vector>
24
25#include <QDateTime>
26#include <QObject>
27#include <QSap>
28#include <QString>
29#include <QTimer>
30#include <QWidget>
31
32#include "mediax/gev/gev.h"
33#include "../ui_toolx.h"
34
35class SapManager;
36
37class GigEDiscoveryTab : public QObject
38{
39 Q_OBJECT
40
41public:
49 explicit GigEDiscoveryTab(Ui::Dialog &ui, SapManager *sap, QWidget *parent = nullptr);
50
54 ~GigEDiscoveryTab() final;
55
56public slots:
60 void discover();
61
68 void sapReceived(const QString name, const ::mediax::sap::SdpMessage message);
69
73 void playSelected();
74
75private slots:
77 void updateTable();
78
79private:
81 struct Device
82 {
83 QString model;
84 QString manufacturer;
85 QString user_name;
86 QString serial;
87 QString ip;
88 QString mac;
89 QString pixel_format;
90 uint32_t width = 0;
91 uint32_t height = 0;
92 double framerate = 0;
93 bool gvcp = false;
94 bool sap = false;
95 QDateTime last_seen;
96 };
97
99 struct Result
100 {
101 ::mediax::gev::DeviceInfo info;
102 bool probed = false;
103 ::mediax::gev::ImageFormat format;
104 };
105
107 void gvcpResults(const std::vector<Result> &results);
108
110 Ui::Dialog &m_ui;
112 QWidget *m_parent;
114 std::map<QString, Device> m_devices;
116 std::map<QString, QDateTime> m_probed;
118 std::set<QString> m_probe_ok;
120 std::thread m_thread;
122 std::atomic<bool> m_discovering{ false };
124 std::atomic<bool> m_closing{ false };
129};
130
131#endif // STREAMS_GIGE_DISCOVERY_TAB_H
QTimer m_refresh_timer
Auto refresh timer.
Definition gige_discovery_tab.h:126
std::map< QString, Device > m_devices
The known devices keyed by IP address.
Definition gige_discovery_tab.h:114
std::thread m_thread
GVCP broadcast thread.
Definition gige_discovery_tab.h:120
GigEDiscoveryTab(Ui::Dialog &ui, SapManager *sap, QWidget *parent=nullptr)
Construct a new GigE discovery tab and wire up the widgets.
Definition gige_discovery_tab.cpp:57
void playSelected()
Open a player for the selected device.
Definition gige_discovery_tab.cpp:312
std::atomic< bool > m_closing
Set when the tab is being destroyed.
Definition gige_discovery_tab.h:124
void discover()
Broadcast a GVCP discovery command and collect the replies.
Definition gige_discovery_tab.cpp:106
QTimer m_update_timer
Table redraw timer, keeps the status column current.
Definition gige_discovery_tab.h:128
QWidget * m_parent
Parent widget for player windows.
Definition gige_discovery_tab.h:112
std::set< QString > m_probe_ok
Devices whose last read worked.
Definition gige_discovery_tab.h:118
Ui::Dialog & m_ui
The main dialogue UI.
Definition gige_discovery_tab.h:110
std::atomic< bool > m_discovering
A discovery broadcast is in progress.
Definition gige_discovery_tab.h:122
void gvcpResults(const std::vector< Result > &results)
Merge the GVCP results into the known devices (GUI thread).
Definition gige_discovery_tab.cpp:165
~GigEDiscoveryTab() final
Stop any discovery in progress.
Definition gige_discovery_tab.cpp:96
std::map< QString, QDateTime > m_probed
When the image format of a device was last read (or tried), keyed by IP address.
Definition gige_discovery_tab.h:116
void updateTable()
Redraw the table from the known devices.
Definition gige_discovery_tab.cpp:253
void sapReceived(const QString name, const ::mediax::sap::SdpMessage message)
A GigE Vision SAP announcement was received.
Definition gige_discovery_tab.cpp:209
Definition sap_manager.h:31
A discovered device, merged from GVCP and SAP by IP address.
Definition gige_discovery_tab.h:82
A device found by the GVCP broadcast with its image format, if it could be read.
Definition gige_discovery_tab.h:100