-
Notifications
You must be signed in to change notification settings - Fork 5
/
ReaderQosDialog.cpp
96 lines (82 loc) · 2.11 KB
/
ReaderQosDialog.cpp
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
/**
* @file
*/
#include <ReaderQosDialog.hpp>
#include <iostream>
namespace demo { namespace ishapes {
ReaderQosDialog::ReaderQosDialog()
{
qosForm_.setupUi(this);
this->setVisible(false);
#ifdef Cyclone
qosForm_.durabilityComboBox->removeItem(3);
qosForm_.durabilityComboBox->removeItem(2);
qosForm_.groupBox_3->setVisible(false);
#endif
}
ReaderQosDialog::~ReaderQosDialog() { }
void
ReaderQosDialog::accept()
{
this->setVisible(false);
}
void
ReaderQosDialog::reject()
{
this->setVisible(false);
}
dds::sub::qos::DataReaderQos
ReaderQosDialog::get_qos()
{
dds::sub::qos::DataReaderQos tmpQos;
qos_ = tmpQos;
qos_ << dds::core::policy::LatencyBudget(dds::core::Duration::infinite());
if (qosForm_.reliableRButt->isChecked())
{
qos_ << dds::core::policy::Reliability::Reliable();
}
else
{
qos_ << dds::core::policy::Reliability::BestEffort();
}
switch (qosForm_.durabilityComboBox->currentIndex())
{
case 0:
qos_ << dds::core::policy::Durability::Volatile();
break;
case 1:
qos_ << dds::core::policy::Durability::TransientLocal();
break;
case 2:
qos_ << dds::core::policy::Durability::Transient();
break;
case 3:
qos_ << dds::core::policy::Durability::Persistent();
break;
};
if (qosForm_.exclusiveRButt->isChecked())
{
qos_ << dds::core::policy::Ownership::Exclusive();
}
else
{
qos_ << dds::core::policy::Ownership::Shared();
}
if (qosForm_.keepLastRButton->isChecked())
{
qos_ << dds::core::policy::History::KeepLast(qosForm_.depthSpinBox->value());
}
else
{
dds::core::policy::History h = dds::core::policy::History::KeepAll();
h.depth(-1);
qos_ << h;
}
if (qosForm_.timeBasedFilterActive->isChecked()) {
int64_t period = qosForm_.timeBasedFilterValue->text().toInt();
dds::core::Duration d;
qos_ << dds::core::policy::TimeBasedFilter(d.from_millisecs(period));
}
return qos_;
}
}}