ddt 1.2.1
Loading...
Searching...
No Matches
ddtViewer.hpp
Go to the documentation of this file.
1
20#ifndef DDT_DATAVISUALISATION_DDTVIEWER_DDTVIEWER_H
21#define DDT_DATAVISUALISATION_DDTVIEWER_DDTVIEWER_H
22
23#include <QMainWindow>
24#include <QSettings>
25
26#include "ddt/ddtLogger.hpp"
29
33
34#include "ui_ddtviewerform.h"
35
36
37namespace Ui {
38
39class DdtViewerForm;
40}
41
46class DdtViewer : public QMainWindow {
47 Q_OBJECT
48
49 public:
55 explicit DdtViewer(const char* exec_path, QWidget* parent = nullptr);
56
62 virtual ~DdtViewer();
63
67 ddt::CommandLineParserResult ParseCommandLine(int argc, char* argv[]);
68
72 void Init();
73
79 void LastSegment(void);
80
92 void connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
93 void connect(const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method);
94 void connect(const QObject *sender, const char *signal, const char *member);
95
106 template <typename Func1, typename Func2>
107 void connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot);
108
109 protected:
114
118 std::unique_ptr<ddt::DdtRemoteControl> remote_control;
119
120 private:
121 Ui::DdtViewerForm ui;
122 QSettings main_settings;
123 QMap<QString, DdtDialog*> dialog_map;
124
125 QString startup_filename;
126 QString startup_localbroker_uri;
127 QString startup_remotebroker_uri;
128 QString startup_data_stream;
129 QString startup_server_uri;
130 QString startup_image_scale;
131 bool startup_no_wait_new_data = false;
132 bool startup_timestamp = false;
133 QString startup_overlay_file;
134
135 bool debug_log_enabled = false;
136
137 boost::signals2::connection connection;
138
139 public slots:
144 void HandleArguments();
145
151
152 private:
156 void ConnectWidgets();
157
158 void ConnectWidgetDataStream();
159 void ConnectWidgetFlipRotate();
160 void ConnectWidgetPanning();
161 void ConnectWidgetMagnification();
162 void ConnectWidgetScaleButton();
163 void ConnectWidgetImageScale();
164 void ConnectWidgetCursorInfo();
165 void ConnectWidgetCutValues();
166 void ConnectWidgetColourmap();
167 void ConnectWidgetImageWidget();
168 void ConnectWidgetCubeNavigation();
169
170 // Create instances of all supported dialogs
171 void CreateDialogs();
172
173 // Create main menu display on MainWindow top area
174 void CreateMenuBar();
175
179 void ConnectRemoteControl();
180
188 void ProcessRemoteCommand(const std::string& image_widget_name,
189 const std::string& command_name,
190 const std::vector<std::string>& command_arguments);
191
192 protected:
198 void closeEvent(QCloseEvent* event) override;
199
200 signals:
205 void AttachDataFile(QString filename);
206
211 void AttachDataStream(QString data_stream);
212
217
223 void PopulatePublisherListCombo(QString startup_localbroker_uri, QString startup_remotebroker_uri);
224
229 void SetDataStream(QString startup_data_stream);
230
235 void SetImageScale(const QString startup_image_scale);
236
242 void SetNoWaitNewData(const bool startup_no_wait_new_data);
243
248 void LoadOverlayFile(const QString startup_overlay_file);
249};
250
261template <typename Func1, typename Func2>
262void DdtViewer::connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot) {
263 QObject::connect(sender, signal, context, slot, Qt::QueuedConnection);
264}
265
266#endif // DDT_DATAVISUALISATION_DDTVIEWER_DDTVIEWER_H
267
The DdtViewer class Main class of the DDT Standard Viewer.
Definition ddtViewer.hpp:46
void HandleArguments()
HandleArguments Slot to handle commandline arguments after initialisation of the GUI.
Definition ddtViewer.cpp:444
ddt::DdtLogger logger
Definition ddtViewer.hpp:113
std::unique_ptr< ddt::DdtRemoteControl > remote_control
Definition ddtViewer.hpp:118
void SetImageScale(const QString startup_image_scale)
virtual ~DdtViewer()
Definition ddtViewer.cpp:36
void ResetDockWidgetsLayout()
ResetDockWidgetsLayout Slot to handle the reconfiguration of dock widgets layout to default state.
Definition ddtViewer.cpp:474
void closeEvent(QCloseEvent *event) override
closeEvent Close event which is triggered when the main window shell be closed.
Definition ddtViewer.cpp:434
DdtViewer(const char *exec_path, QWidget *parent=nullptr)
Definition ddtViewer.cpp:30
void SetNoWaitNewData(const bool startup_no_wait_new_data)
void PopulatePublisherListCombo(QString startup_localbroker_uri, QString startup_remotebroker_uri)
ddt::CommandLineParserResult ParseCommandLine(int argc, char *argv[])
Definition ddtViewer.cpp:42
void connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
connect Group of overloaded functions that use the QObject::connect method with the Qt::QueuedConnect...
Definition ddtViewer.cpp:486
void LoadOverlayFile(const QString startup_overlay_file)
void LastSegment(void)
Definition ddtViewer.cpp:428
void DetachStream()
void Init()
Definition ddtViewer.cpp:67
void AttachDataStream(QString data_stream)
void AttachDataFile(QString filename)
void SetDataStream(QString startup_data_stream)
Definition ddtLogger.hpp:51
Class for parsing command line arguments. The commandline parser shall parse the required arguments f...
DDT Dialogs. Factory class for the DDT dialogs. Factory class for the DDT dialogs.
DDT Dialog IDs. ID values for all used dialogs. IDs for the used dialogs.
DDT Dialogs. Base class for the DDT dialogs. Base class for the DDT dialogs.
Class to wrap the usage of log4cplus as logging utility. This file provides a wrapper class for the u...
DDT Remote Control. Remote control interface for the DDT GUIs. Library class for the remote control i...
Definition ddtTestViewer.hpp:31
CommandLineParserResult
Definition commandLineParser.hpp:38