forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WriterQosDialog.cpp
63 lines (53 loc) · 1.32 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
#include <WriterQosDialog.hpp>
#include <iostream>
WriterQosDialog::WriterQosDialog()
{
qosForm_.setupUi(this);
this->setVisible(false);
}
WriterQosDialog::~WriterQosDialog() { }
void
WriterQosDialog::setPublisher(DDS::Publisher_var publisher)
{
publisher_ = publisher;
}
void
WriterQosDialog::accept()
{
this->setVisible(false);
}
void
WriterQosDialog::reject()
{
this->setVisible(false);
}
DDS::DataWriterQos
WriterQosDialog::get_qos()
{
publisher_->get_default_datawriter_qos(qos_);
if (!qosForm_.reliableRButt->isChecked()) {
qos_.reliability.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
}
switch (qosForm_.durabilityComboBox->currentIndex()) {
case 0:
qos_.durability.kind = DDS::VOLATILE_DURABILITY_QOS;
break;
case 1:
qos_.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
break;
case 2:
qos_.durability.kind = DDS::TRANSIENT_DURABILITY_QOS;
break;
case 3:
qos_.durability.kind = DDS::PERSISTENT_DURABILITY_QOS;
break;
};
qos_.transport_priority.value = qosForm_.prioritySpinBox->value();
if (qosForm_.ownershipExclusiveRButt->isChecked()) {
qos_.ownership.kind = DDS::EXCLUSIVE_OWNERSHIP_QOS;
qos_.ownership_strength.value = qosForm_.strengthSpinBox->value();
}
qos_.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
qos_.history.depth = 100;
return qos_;
}