summaryrefslogtreecommitdiffhomepage
path: root/tracker-s2bot
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-s2bot')
-rw-r--r--tracker-s2bot/ftnoir_tracker_s2bot.cpp27
-rw-r--r--tracker-s2bot/ftnoir_tracker_s2bot.h5
-rw-r--r--tracker-s2bot/lang/de_DE.ts90
-rw-r--r--tracker-s2bot/lang/nl_NL.ts7
-rw-r--r--tracker-s2bot/lang/ru_RU.ts7
-rw-r--r--tracker-s2bot/lang/stub.ts7
-rw-r--r--tracker-s2bot/lang/zh_CN.ts41
7 files changed, 156 insertions, 28 deletions
diff --git a/tracker-s2bot/ftnoir_tracker_s2bot.cpp b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
index 44ae6132..98a299ca 100644
--- a/tracker-s2bot/ftnoir_tracker_s2bot.cpp
+++ b/tracker-s2bot/ftnoir_tracker_s2bot.cpp
@@ -27,13 +27,22 @@ static constexpr int add_cbx[] =
-180,
};
+#ifdef __GNUG__
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
void tracker_s2bot::run() {
- if (s.freq == 0) s.freq = 10;
- timer.setInterval(1000.0/s.freq);
+ int freq = s.freq;
+ if (freq <= 0)
+ freq = 10;
+ timer.setInterval((int)(1000./freq));
timer.setSingleShot(false);
- connect(&timer, &QTimer::timeout, [this]() {
- auto reply = m_nam->get(QNetworkRequest(QUrl("http://localhost:17317/poll")));
- connect(reply, &QNetworkReply::finished, [this, reply]() {
+ connect(&timer, &QTimer::timeout, [this] {
+ QNetworkRequest req{QUrl("http://localhost:17317/poll")};
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+ auto* reply = m_nam->get(req);
+
+ connect(reply, &QNetworkReply::finished, [this, reply] {
if (reply->error() == QNetworkReply::NoError) {
//qDebug() << "Request submitted OK";
}
@@ -48,15 +57,15 @@ void tracker_s2bot::run() {
int order[] =
{
- clamp(s.idx_x, 0, 3),
- clamp(s.idx_y, 0, 3),
- clamp(s.idx_z, 0, 3),
+ std::clamp(*s.idx_x, 0, 3),
+ std::clamp(*s.idx_y, 0, 3),
+ std::clamp(*s.idx_z, 0, 3),
};
int add_indices[] = { s.add_yaw, s.add_pitch, s.add_roll, };
double orient[4] {};
- for (auto line : slist)
+ for (auto const& line : slist)
{
QStringList keyval = line.split(' ');
if (keyval.count() < 2) continue;
diff --git a/tracker-s2bot/ftnoir_tracker_s2bot.h b/tracker-s2bot/ftnoir_tracker_s2bot.h
index eddf58f4..b05a226c 100644
--- a/tracker-s2bot/ftnoir_tracker_s2bot.h
+++ b/tracker-s2bot/ftnoir_tracker_s2bot.h
@@ -65,8 +65,9 @@ private slots:
class meta_s2bot : public Metadata
{
-public:
- QString name() { return otr_tr("S2Bot receiver"); }
+ Q_OBJECT
+
+ QString name() { return tr("S2Bot receiver"); }
QIcon icon() { return QIcon(":/s2bot.png"); }
};
diff --git a/tracker-s2bot/lang/de_DE.ts b/tracker-s2bot/lang/de_DE.ts
new file mode 100644
index 00000000..4071d117
--- /dev/null
+++ b/tracker-s2bot/lang/de_DE.ts
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name>UI_s2bot_dialog</name>
+ <message>
+ <source>Tracker settings</source>
+ <translation>Tracker-Einstellungen</translation>
+ </message>
+ <message>
+ <source>Update frequency (Hz)</source>
+ <translation>Aktualisierungsfrequenz (Hz)</translation>
+ </message>
+ <message>
+ <source>Axis order</source>
+ <translation>Achsen-Reihenfolge</translation>
+ </message>
+ <message>
+ <source>output yaw</source>
+ <translation>Gieren-Ausgabe</translation>
+ </message>
+ <message>
+ <source>input yaw</source>
+ <translation>Gieren-Eingabe</translation>
+ </message>
+ <message>
+ <source>input pitch</source>
+ <translation>Nicken-Eingabe</translation>
+ </message>
+ <message>
+ <source>input roll</source>
+ <translation>Rollen-Eingabe</translation>
+ </message>
+ <message>
+ <source>input bearing</source>
+ <translation>Peilung-Eingabe</translation>
+ </message>
+ <message>
+ <source>output pitch</source>
+ <translation>Nicken-Ausgabe</translation>
+ </message>
+ <message>
+ <source>output roll</source>
+ <translation>Rollen-Ausgabe</translation>
+ </message>
+ <message>
+ <source>Add to axis</source>
+ <translation>Zur Achse hinzufügen</translation>
+ </message>
+ <message>
+ <source>yaw</source>
+ <translation>Gieren</translation>
+ </message>
+ <message>
+ <source>0</source>
+ <translation>0</translation>
+ </message>
+ <message>
+ <source>+90</source>
+ <translation>+90</translation>
+ </message>
+ <message>
+ <source>-90</source>
+ <translation>-90</translation>
+ </message>
+ <message>
+ <source>+180</source>
+ <translation>+180</translation>
+ </message>
+ <message>
+ <source>-180</source>
+ <translation>-180</translation>
+ </message>
+ <message>
+ <source>pitch</source>
+ <translation>Nicken</translation>
+ </message>
+ <message>
+ <source>roll</source>
+ <translation>Rollen</translation>
+ </message>
+</context>
+<context>
+ <name>meta_s2bot</name>
+ <message>
+ <source>S2Bot receiver</source>
+ <translation>S2Bot-Empfänger</translation>
+ </message>
+</context>
+</TS>
diff --git a/tracker-s2bot/lang/nl_NL.ts b/tracker-s2bot/lang/nl_NL.ts
index 12e39d07..8ea33f46 100644
--- a/tracker-s2bot/lang/nl_NL.ts
+++ b/tracker-s2bot/lang/nl_NL.ts
@@ -80,4 +80,11 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>meta_s2bot</name>
+ <message>
+ <source>S2Bot receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/tracker-s2bot/lang/ru_RU.ts b/tracker-s2bot/lang/ru_RU.ts
index 22b8000e..2d5c479b 100644
--- a/tracker-s2bot/lang/ru_RU.ts
+++ b/tracker-s2bot/lang/ru_RU.ts
@@ -80,4 +80,11 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>meta_s2bot</name>
+ <message>
+ <source>S2Bot receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/tracker-s2bot/lang/stub.ts b/tracker-s2bot/lang/stub.ts
index 692400cf..babca884 100644
--- a/tracker-s2bot/lang/stub.ts
+++ b/tracker-s2bot/lang/stub.ts
@@ -80,4 +80,11 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>meta_s2bot</name>
+ <message>
+ <source>S2Bot receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/tracker-s2bot/lang/zh_CN.ts b/tracker-s2bot/lang/zh_CN.ts
index 692400cf..f9cc2a4b 100644
--- a/tracker-s2bot/lang/zh_CN.ts
+++ b/tracker-s2bot/lang/zh_CN.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1">
+<TS version="2.1" language="zh_CN">
<context>
<name>UI_s2bot_dialog</name>
<message>
@@ -9,27 +9,27 @@
</message>
<message>
<source>Update frequency (Hz)</source>
- <translation type="unfinished"></translation>
+ <translation>刷新率(Hz)</translation>
</message>
<message>
<source>Axis order</source>
- <translation type="unfinished"></translation>
+ <translation>输出重映射</translation>
</message>
<message>
<source>output yaw</source>
- <translation type="unfinished"></translation>
+ <translation>输出的航向</translation>
</message>
<message>
<source>input yaw</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">输入航向</translation>
</message>
<message>
<source>input pitch</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">输入俯仰</translation>
</message>
<message>
<source>input roll</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">输入滚转</translation>
</message>
<message>
<source>input bearing</source>
@@ -37,46 +37,53 @@
</message>
<message>
<source>output pitch</source>
- <translation type="unfinished"></translation>
+ <translation>输出的俯仰</translation>
</message>
<message>
<source>output roll</source>
- <translation type="unfinished"></translation>
+ <translation>输出的滚转</translation>
</message>
<message>
<source>Add to axis</source>
- <translation type="unfinished"></translation>
+ <translation>添加到轴</translation>
</message>
<message>
<source>yaw</source>
- <translation type="unfinished"></translation>
+ <translation>航向</translation>
</message>
<message>
<source>0</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>+90</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>-90</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>+180</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>-180</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>pitch</source>
- <translation type="unfinished"></translation>
+ <translation>俯仰</translation>
</message>
<message>
<source>roll</source>
+ <translation>滚转</translation>
+ </message>
+</context>
+<context>
+ <name>meta_s2bot</name>
+ <message>
+ <source>S2Bot receiver</source>
<translation type="unfinished"></translation>
</message>
</context>