forked from atolab/dds-ishapes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShapesDialog.hpp
121 lines (102 loc) · 2.63 KB
/
ShapesDialog.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef _ISHAPESFORM_HPP
#define _ISHAPESFORM_HPP
/** @file */
#include <dds/dds.hpp>
#include <QtWidgets/QtWidgets>
#if (ISHAPES_WIDE_FORMAT == 1)
# include <ui_iShapesForm.h>
#else
# include <ui_iShapesForm-small.h>
#endif
#include <WriterQosDialog.hpp>
#include <ReaderQosDialog.hpp>
#include <FilterDialog.hpp>
#include <ShapesWidget.hpp>
#include <Circle.hpp>
#include <topic-traits.hpp>
#ifdef TESTBUILD
#include <QtTest/QtTest>
#endif
#define CN 9
/**
* @addtogroup demos_iShapes
*/
/** @{*/
namespace demo { namespace ishapes {
class ShapesDialog : public QDialog
{
Q_OBJECT
public:
enum { CIRCLE = 0, SQUARE = 1, TRIANGLE = 2 };
enum
{
BLUE = 0,
RED = 1,
GREEN = 2,
ORANGE = 3,
YELLOW = 4,
MAGENTA = 5,
CYAN = 6,
GRAY = 7,
BLACK = 8
};
public:
ShapesDialog();
virtual ~ShapesDialog();
void setDomainID(int DomainID);
void setPartition(dds::core::StringSeq Partition);
bool eventFilter(QObject* object, QEvent* event)
{
QString objname(object->objectName());
QEvent ev = (QEvent)event->type();
if(event->type() == QEvent::MouseButtonPress && object->objectName() == QString("renderFrame"))
{
if(!shapesWidget->paused())
{
shapesWidget->paused(true);
mainWidget.PausedLabel->setVisible(true);
}
else
{
shapesWidget->paused(false);
mainWidget.PausedLabel->setVisible(false);
}
}
return QObject::eventFilter(object,event);
}
public slots:
virtual void onPublishButtonClicked();
virtual void onSubscribeButtonClicked();
virtual void onReaderQosButtonClicked();
virtual void onWriterQosButtonClicked();
virtual void onFilterButtonClicked();
private:
ShapesDialog(const ShapesDialog& orig);
//Tests
private slots:
#ifdef TESTBUILD
//Publisher or Subscriber with default QoS
void CreatePublisher();
void CreateSubscriber();
//Publisher or Subscriber with mismatching QoS
void CreatePublisherMMQos();
void CreateSubscriberMMQos();
//Comparison tests
void logShape();
void logDDSShape();
#endif
private:
QTimer timer;
Ui::ShapesDialog mainWidget;
ShapesWidget* shapesWidget;
ReaderQosDialog readerQos_;
WriterQosDialog writerQos_;
FilterDialog* filterDialog_;
dds::domain::DomainParticipant dp_;
dds::core::policy::Partition gQos_;
std::vector<std::string> filterParams_;
};
}
}
/** @}*/
#endif /* _ISHAPESFORM_HPP */