ddt  0.1
ddtTestViewer.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file ddtTestViewer.hpp
8 // @brief Class for the DDT Test Viewer
9 //
10 // This is the main class for the DDT Test Viewer. This test viewer can be used
11 // to test some features of the DDT widget library.
12 //
13 // @author Carsten Mannel, CGI
14 // @since 2021/06/28
15 
16 #ifndef DDT_DATAVISUALISATION_DDTTESTVIEWER_DDTTESTVIEWER_H
17 #define DDT_DATAVISUALISATION_DDTTESTVIEWER_DDTTESTVIEWER_H
18 
19 #include <QMainWindow>
20 
22 
24 #include "ddt/ddtLogger.hpp"
25 #include "ddt/ddtRemoteControl.hpp"
27 
28 namespace Ui {
29 
30 class DdtTestViewerForm;
31 }
32 
37 class DdtTestViewer : public QMainWindow {
38  Q_OBJECT
39 
40  public:
44  explicit DdtTestViewer(QWidget* parent = nullptr);
45 
51  ~DdtTestViewer() override;
52 
61  bool Init(int argc, char* argv[]);
62 
68  void LastSegment(void);
69 
70  protected:
75 
80 
81  private:
82  Ui::DdtTestViewerForm* ui;
83  QMap<QString, DdtDialog*> dialog_map_left;
84  QMap<QString, DdtDialog*> dialog_map_right;
85 
86  QString startup_filename;
87  QString startup_data_stream;
88  QString startup_image_scale;
89  QString startup_server_uri;
90  bool startup_timestamp;
91  bool startup_no_wait_new_data;
92 
93  bool debug_log_enabled;
94 
95  MyPickObjectDialog* my_dialog;
96 
97  DdtRenderingPluginCPLInvers* my_rendering_plugin;
98  int current_rendering_id;
99 
100  boost::signals2::connection left_connection;
101  boost::signals2::connection right_connection;
102 
103  public slots:
108  void HandleArguments();
109 
110  private:
114  void ConnectWidgets();
115 
116  void ConnectWidgetPanning();
117  void ConnectWidgetScaleButton();
118 
119  void ConnectWidgetLeftImageWidget();
120  void ConnectWidgetRightImageWidget();
121 
122  // Create instances of all supported dialogs
123  void CreateDialogsLeft();
124  void CreateDialogsRight();
125 
126  const void RegisterMetaTypes();
127 
131  void ConnectRemoteControl();
132 
140  void ProcessRemoteCommand(const std::string& image_widget_name,
141  const std::string& command_name,
142  const std::vector<std::string>& command_arguments);
143 
144  protected:
150  void closeEvent(QCloseEvent* event) override;
151 
158  bool ParseCommandline(int argc, char* argv[]);
159 
160  public slots:
161  void LoadTransparentPNG();
162 
163  void ShowModifiedDialog();
164 
165  void SwitchRendering();
166 
167  signals:
172  void AttachDataFile(QString filename);
173 
178  void AttachDataStream(QString data_stream);
179 
183  void DetachStream();
184 
189  void SetDataStream(QString startup_data_stream);
190 
195  void SetImageScale(const QString startup_image_scale);
196 
201  void SetNoWaitNewData(const bool startup_no_wait_new_data);
202 };
203 
204 #endif // DDT_DATAVISUALISATION_DDTTESTVIEWER_DDTTESTVIEWER_H
DdtTestViewer
The DdtViewer class Main class of the DDT Standard Viewer.
Definition: ddtTestViewer.hpp:37
DdtRenderingPluginCPLInvers
Definition: ddtRenderingPluginCPLInvers.hpp:25
commandLineParserBuilder.hpp
DdtTestViewer::SetNoWaitNewData
void SetNoWaitNewData(const bool startup_no_wait_new_data)
DdtTestViewer::LastSegment
void LastSegment(void)
Definition: ddtTestViewer.cpp:350
ddtRenderingPluginCPLInvers.hpp
DdtTestViewer::AttachDataFile
void AttachDataFile(QString filename)
ddt::DdtLogger
Definition: ddtLogger.hpp:48
DdtTestViewer::closeEvent
void closeEvent(QCloseEvent *event) override
closeEvent Close event which is triggered when the main window shell be closed.
Definition: ddtTestViewer.cpp:450
DdtTestViewer::Init
bool Init(int argc, char *argv[])
Definition: ddtTestViewer.cpp:29
DdtTestViewer::DdtTestViewer
DdtTestViewer(QWidget *parent=nullptr)
Definition: ddtTestViewer.cpp:26
ddt::DdtRemoteControl
Definition: ddtRemoteControl.hpp:51
DdtTestViewer::LoadTransparentPNG
void LoadTransparentPNG()
Definition: ddtTestViewer.cpp:356
DdtTestViewer::AttachDataStream
void AttachDataStream(QString data_stream)
ddtRemoteControl.hpp
DdtTestViewer::ParseCommandline
bool ParseCommandline(int argc, char *argv[])
Definition: ddtTestViewer.cpp:488
Ui
Definition: ddtTestViewer.hpp:28
DdtTestViewer::~DdtTestViewer
~DdtTestViewer() override
Definition: ddtTestViewer.cpp:93
DdtTestViewer::SetImageScale
void SetImageScale(const QString startup_image_scale)
DdtTestViewer::HandleArguments
void HandleArguments()
HandleArguments Slot to handle commandline arguments after initialisation of the GUI.
Definition: ddtTestViewer.cpp:470
ddtLogger.hpp
DdtTestViewer::remote_control
ddt::DdtRemoteControl * remote_control
Definition: ddtTestViewer.hpp:79
DdtTestViewer::SetDataStream
void SetDataStream(QString startup_data_stream)
MyPickObjectDialog
Definition: myPickObjectDialog.hpp:21
DdtTestViewer::logger
ddt::DdtLogger * logger
Definition: ddtTestViewer.hpp:74
DdtTestViewer::SwitchRendering
void SwitchRendering()
Definition: ddtTestViewer.cpp:365
myPickObjectDialog.hpp
DdtTestViewer::ShowModifiedDialog
void ShowModifiedDialog()
Definition: ddtTestViewer.cpp:387
DdtTestViewer::DetachStream
void DetachStream()