-
Notifications
You must be signed in to change notification settings - Fork 5
/
WriterQosDialog.cpp
91 lines (77 loc) · 1.94 KB
/
WriterQosDialog.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
/**
* @file
*/
#include <WriterQosDialog.hpp>
#include <iostream>
namespace demo { namespace ishapes {
WriterQosDialog::WriterQosDialog()
{
qosForm_.setupUi(this);
this->setVisible(false);
#ifdef Cyclone
qosForm_.durabilityComboBox->removeItem(3);
qosForm_.durabilityComboBox->removeItem(2);
#endif
}
WriterQosDialog::~WriterQosDialog() { }
void
WriterQosDialog::accept()
{
this->setVisible(false);
}
void
WriterQosDialog::reject()
{
this->setVisible(false);
}
dds::pub::qos::DataWriterQos
WriterQosDialog::get_qos()
{
dds::pub::qos::DataWriterQos tmpQos;
qos_ = tmpQos;
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;
};
qos_ << dds::core::policy::TransportPriority(qosForm_.prioritySpinBox->value());
if (qosForm_.ownershipExclusiveRButt->isChecked())
{
qos_ << dds::core::policy::Ownership::Exclusive();
qos_ << dds::core::policy::OwnershipStrength(qosForm_.strengthSpinBox->value());
}
else
{
qos_ << dds::core::policy::Ownership::Shared();
}
if (qosForm_.keepLastWButton->isChecked())
{
qos_ << dds::core::policy::History::KeepLast(qosForm_.depthSpinBoxW->value());
}
else
{
dds::core::policy::History h = dds::core::policy::History::KeepAll();
h.depth(-1);
qos_ << h;
}
return qos_;
}
}}