diff options
Diffstat (limited to 'filter-accela')
| -rw-r--r-- | filter-accela/accela-settings.hpp | 70 | ||||
| -rw-r--r-- | filter-accela/ftnoir_accela_filtercontrols.ui | 333 | ||||
| -rw-r--r-- | filter-accela/ftnoir_filter_accela.cpp | 203 | ||||
| -rw-r--r-- | filter-accela/ftnoir_filter_accela.h | 44 | ||||
| -rw-r--r-- | filter-accela/ftnoir_filter_accela_dialog.cpp | 93 | ||||
| -rw-r--r-- | filter-accela/lang/de_DE.ts | 57 | ||||
| -rw-r--r-- | filter-accela/lang/nl_NL.ts | 59 | ||||
| -rw-r--r-- | filter-accela/lang/ru_RU.ts | 65 | ||||
| -rw-r--r-- | filter-accela/lang/stub.ts | 57 | ||||
| -rw-r--r-- | filter-accela/lang/zh_CN.ts | 82 |
10 files changed, 445 insertions, 618 deletions
diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp index 6b264f2e..b2f62a43 100644 --- a/filter-accela/accela-settings.hpp +++ b/filter-accela/accela-settings.hpp @@ -1,30 +1,38 @@ #pragma once +#include "spline/spline.hpp" #include "options/options.hpp" + +namespace detail::accela { + using namespace options; -#include "spline/spline.hpp" + +// ------------------------------------ +// debug knobs +// ------------------------------------ + +//#define DEBUG_ACCELA +//#define SPLINE_ROT_DEBUG +//#define SPLINE_TRANS_DEBUG struct settings_accela : opts { - static constexpr double rot_gains[16][2] = + struct gains { - { 12, 500 }, - { 11, 450 }, - { 10, 400 }, - { 9, 350 }, - { 8, 300 }, - { 7, 250 }, - { 6, 200 }, - { 2.66, 50 }, - { 1.66, 17 }, - { 1, 4 }, - { .5, .53 }, - { 0, 0 }, - { -1, 0 } + double x, y; }; - static constexpr double pos_gains[16][2] = - { + static constexpr gains const rot_gains[] { + { 9, 300 }, + { 8, 200 }, + { 5, 100 }, + { 2.5, 35 }, + { 1.5, 8 }, + { 1, 1.5 }, + { .5, .4 }, + }; + + static constexpr gains const pos_gains[] { { 9, 200 }, { 8, 150 }, { 7, 110 }, @@ -36,22 +44,18 @@ struct settings_accela : opts { .66, .75 }, { .33, .375 }, { 0, 0 }, - { -1, 0 } }; - static void make_splines(spline& rot, spline& trans); - - value<slider_value> rot_sensitivity, pos_sensitivity; - value<slider_value> rot_deadzone, pos_deadzone; - value<slider_value> ewma; - value<slider_value> rot_nonlinearity; - settings_accela() : - opts("accela-sliders"), - rot_sensitivity(b, "rotation-sensitivity", slider_value(1.5, .1, 2)), - pos_sensitivity(b, "translation-sensitivity", slider_value(1., .05, 1.5)), - rot_deadzone(b, "rotation-deadzone", slider_value(.03, 0, .1)), - pos_deadzone(b, "translation-deadzone", slider_value(.1, 0, 1)), - ewma(b, "ewma", slider_value(0, 0, 15)), - rot_nonlinearity(b, "rotation-nonlinearity", slider_value(1.2, 1, 1.3)) - {} + static void make_splines(spline& rot, spline& pos); + + value<slider_value> rot_smoothing { b, "rotation-sensitivity", { 1.5, .05, 2.5 } }, + pos_smoothing { b, "translation-sensitivity", { 1., .05, 1.5 } }, + rot_deadzone { b, "rotation-deadzone", { .03, 0, .2 } }, + pos_deadzone { b, "translation-deadzone", { .1, 0, 1 } }; + + settings_accela() : opts("accela-sliders") {} }; + +} // ns detail::accela + +using detail::accela::settings_accela; diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui index 621d32f7..899f4920 100644 --- a/filter-accela/ftnoir_accela_filtercontrols.ui +++ b/filter-accela/ftnoir_accela_filtercontrols.ui @@ -10,7 +10,7 @@ <x>0</x> <y>0</y> <width>550</width> - <height>431</height> + <height>279</height> </rect> </property> <property name="sizePolicy"> @@ -37,74 +37,11 @@ <number>5</number> </property> <item row="0" column="0"> - <widget class="QGroupBox" name="groupBox66"> - <property name="title"> - <string>General</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Smoothing</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="ewma_label"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>0 ms</string> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="ewma_slider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>0</number> - </property> - <property name="maximum"> - <number>15</number> - </property> - <property name="pageStep"> - <number>3</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> - </property> - <property name="tickInterval"> - <number>5</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="0"> - <widget class="QGroupBox" name="groupBox_2"> + <widget class="QGroupBox" name="groupBox44"> <property name="title"> - <string>Position filtering (X, Y, Z - translation)</string> + <string>Rotation filtering (Yaw, pitch, and roll)</string> </property> - <layout class="QGridLayout" name="gridLayout_2"> + <layout class="QGridLayout" name="gridLayout"> <property name="topMargin"> <number>4</number> </property> @@ -118,7 +55,7 @@ <number>2</number> </property> <item row="0" column="0"> - <widget class="QLabel" name="label"> + <widget class="QLabel" name="lblSensYaw_6"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -126,12 +63,12 @@ </sizepolicy> </property> <property name="text"> - <string>Sensitivity</string> + <string>Smoothing</string> </property> </widget> </item> <item row="0" column="1"> - <widget class="QLabel" name="trans_gain"> + <widget class="QLabel" name="rot_gain"> <property name="minimumSize"> <size> <width>50</width> @@ -139,12 +76,12 @@ </size> </property> <property name="text"> - <string>0mm</string> + <string>0°</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QSlider" name="trans_dz_slider"> + <item row="0" column="2"> + <widget class="QSlider" name="rotation_slider"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -155,18 +92,31 @@ <number>0</number> </property> <property name="maximum"> - <number>20</number> + <number>49</number> </property> <property name="pageStep"> - <number>5</number> + <number>1</number> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>50</number> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Deadzone</string> + </property> </widget> </item> <item row="1" column="1"> - <widget class="QLabel" name="trans_dz"> + <widget class="QLabel" name="rot_dz"> <property name="minimumSize"> <size> <width>50</width> @@ -174,19 +124,12 @@ </size> </property> <property name="text"> - <string>0mm</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Deadzone</string> + <string>0°</string> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QSlider" name="translation_slider"> + <item row="1" column="2"> + <widget class="QSlider" name="rot_dz_slider"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -197,37 +140,25 @@ <number>0</number> </property> <property name="maximum"> - <number>29</number> + <number>20</number> </property> <property name="pageStep"> - <number>15</number> + <number>1</number> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> - </property> - <property name="tickInterval"> - <number>40</number> - </property> </widget> </item> </layout> - <zorder>trans_dz_slider</zorder> - <zorder>translation_slider</zorder> - <zorder>trans_dz</zorder> - <zorder>label_6</zorder> - <zorder>trans_gain</zorder> - <zorder>label</zorder> </widget> </item> <item row="1" column="0"> - <widget class="QGroupBox" name="groupBox44"> + <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>Rotation filtering (Yaw, pitch, and roll)</string> + <string>Position filtering (X, Y, Z - translation)</string> </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QGridLayout" name="gridLayout_2"> <property name="topMargin"> <number>4</number> </property> @@ -241,7 +172,7 @@ <number>2</number> </property> <item row="0" column="0"> - <widget class="QLabel" name="lblSensYaw_6"> + <widget class="QLabel" name="label"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -249,12 +180,12 @@ </sizepolicy> </property> <property name="text"> - <string>Sensitivity</string> + <string>Smoothing</string> </property> </widget> </item> <item row="0" column="1"> - <widget class="QLabel" name="rot_gain"> + <widget class="QLabel" name="trans_gain"> <property name="minimumSize"> <size> <width>50</width> @@ -262,12 +193,12 @@ </size> </property> <property name="text"> - <string>0°</string> + <string>0mm</string> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QSlider" name="rotation_slider"> + <item row="1" column="2"> + <widget class="QSlider" name="trans_dz_slider"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -278,31 +209,18 @@ <number>0</number> </property> <property name="maximum"> - <number>38</number> + <number>20</number> </property> <property name="pageStep"> - <number>5</number> + <number>1</number> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> - </property> - <property name="tickInterval"> - <number>50</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Deadzone</string> - </property> </widget> </item> <item row="1" column="1"> - <widget class="QLabel" name="rot_dz"> + <widget class="QLabel" name="trans_dz"> <property name="minimumSize"> <size> <width>50</width> @@ -310,12 +228,19 @@ </size> </property> <property name="text"> - <string>0°</string> + <string>0mm</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QSlider" name="rot_dz_slider"> + <item row="1" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>Deadzone</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QSlider" name="translation_slider"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -326,122 +251,45 @@ <number>0</number> </property> <property name="maximum"> - <number>10</number> + <number>29</number> </property> <property name="pageStep"> - <number>5</number> + <number>1</number> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>40</number> + </property> </widget> </item> </layout> + <zorder>trans_dz_slider</zorder> + <zorder>translation_slider</zorder> + <zorder>trans_dz</zorder> + <zorder>label_6</zorder> + <zorder>trans_gain</zorder> + <zorder>label</zorder> </widget> </item> <item row="3" column="0"> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Rotation nonlinearity</string> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Setting it higher will filter out rotation noise but may cause sudden jumps on very high settings.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QFrame" name="frame"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>6</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Value</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="rot_nl"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>12</pointsize> - </font> - </property> - <property name="text"> - <string><html><head/><body><p>x<span style=" vertical-align:super;">2</span></p></body></html></string> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="rot_nl_slider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>0</number> - </property> - <property name="maximum"> - <number>12</number> - </property> - <property name="pageStep"> - <number>2</number> - </property> - <property name="value"> - <number>1</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> - </property> - <property name="tickInterval"> - <number>3</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> </widget> </item> - <item row="4" column="0"> + <item row="2" column="0"> <widget class="QLabel" name="label_9"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> @@ -458,7 +306,7 @@ <enum>QFrame::NoFrame</enum> </property> <property name="text"> - <string><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2015</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></string> + <string><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> @@ -486,23 +334,26 @@ </property> </widget> </item> - <item row="5" column="0"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="4" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>1</height> + </size> </property> - </widget> + </spacer> </item> </layout> </widget> <tabstops> - <tabstop>buttonBox</tabstop> + <tabstop>rotation_slider</tabstop> + <tabstop>rot_dz_slider</tabstop> + <tabstop>translation_slider</tabstop> + <tabstop>trans_dz_slider</tabstop> </tabstops> <resources> <include location="../gui/opentrack-res.qrc"/> diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index ccf74b7e..940ac50c 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -5,93 +5,56 @@ * copyright notice and this permission notice appear in all copies. */ #include "ftnoir_filter_accela.h" +#include "compat/math.hpp" +#include "api/plugin-api.hpp" +#include "opentrack/defs.hpp" + #include <algorithm> -#include <cmath> #include <QDebug> #include <QMutexLocker> -#include "api/plugin-api.hpp" - -using std::fabs; -using std::sqrt; -using std::pow; -using std::copysign; -using std::max; -constexpr double settings_accela::rot_gains[16][2]; -constexpr double settings_accela::pos_gains[16][2]; +#include "compat/math-imports.hpp" +#include "compat/time.hpp" -accela::accela() : first_run(true) +accela::accela() { s.make_splines(spline_rot, spline_pos); } -double accela::get_rot_delta(double val, double prev, double& degen) -{ - using std::fabs; - using std::copysign; - - // HACK: don't set degen to 180 on startup - if (fabs(prev) < 128) - { - degen = 0; - return val - prev; - } - - const double a = fabs(val - prev), b = fabs(val + prev); - - if (b < a) - { - degen = copysign(360, -b); - return val + prev; - } - else - { - degen = 0; - return val - prev; - } -} - -template <typename T> -static inline constexpr T signum(T x) -{ - return T((T(0) < x) - (x < T(0))); -} - -template<int N = 3, typename F> +template<typename F> +never_inline static void do_deltas(const double* deltas, double* output, F&& fun) { + constexpr unsigned N = 3; + double norm[N]; + double dist = 0; - const double dist = progn( - double ret = 0; - for (unsigned k = 0; k < N; k++) - ret += deltas[k]*deltas[k]; - return sqrt(ret); - ); + for (unsigned k = 0; k < N; k++) + dist += deltas[k]*deltas[k]; + dist = sqrt(dist); - const double value = double(fun(dist)); + const double value = fun(dist); for (unsigned k = 0; k < N; k++) { - const double c = dist > 1e-6 ? clamp((fabs(deltas[k]) / dist), 0., 1.) : 0; + const double c = dist > 1e-6 ? std::clamp((fabs(deltas[k]) / dist), 0., 1.) : 0; norm[k] = c; } - progn( - double n = 0; - for (unsigned k = 0; k < N; k++) - n += norm[k]; + double n = 0; + for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert) + n += norm[k]; - if (n > 1e-6) - { - const double ret = 1./n; - for (unsigned k = 0; k < N; k++) - norm[k] *= ret; - } - else - for (unsigned k = 0; k < N; k++) - norm[k] = 0; - ); + if (n > 1e-6) + { + const double ret = 1./n; + for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert) + norm[k] *= ret; + } + else + for (unsigned k = 0; k < N; k++) // NOLINT(modernize-loop-convert) + norm[k] = 0; for (unsigned k = 0; k < N; k++) { @@ -100,72 +63,90 @@ static void do_deltas(const double* deltas, double* output, F&& fun) } } +template<typename F> +[[maybe_unused]] +never_inline +static void do_delta(double delta, double* output, F&& fun) +{ + *output = fun(fabs(delta)) * signum(delta); +} + void accela::filter(const double* input, double *output) { - if (first_run) + static constexpr double full_turn = 360.0; + static constexpr double half_turn = 180.0; + + if (unlikely(first_run)) { + first_run = false; + for (int i = 0; i < 6; i++) { const double f = input[i]; output[i] = f; last_output[i] = f; - smoothed_input[i] = f; } - first_run = false; + t.start(); +#if defined DEBUG_ACCELA + debug_max = 0; + debug_timer.start(); +#endif + return; } - const double rot_thres = s.rot_sensitivity.to<double>(); - const double pos_thres = s.pos_sensitivity.to<double>(); + const double rot_thres{s.rot_smoothing}; + const double pos_thres{s.pos_smoothing}; const double dt = t.elapsed_seconds(); t.start(); - const double RC = s.ewma.to<double>() / 1000.; // seconds - const double alpha = dt/(dt+RC); - const double rot_dz = s.rot_deadzone.to<double>(); - const double pos_dz = s.pos_deadzone.to<double>(); - const double nl = s.rot_nonlinearity.to<double>(); - double deltas[6]; - - for (unsigned i = 0; i < 6; i++) - smoothed_input[i] = smoothed_input[i] * (1-alpha) + input[i] * alpha; + const double rot_dz{ s.rot_deadzone}; + const double pos_dz{ s.pos_deadzone}; // rot for (unsigned i = 3; i < 6; i++) { - double degen; - double d = get_rot_delta(smoothed_input[i], last_output[i], degen); - d += copysign(rot_dz, -d); - deltas[i] = d / rot_thres; - last_output[i] += degen; - } + double d = input[i] - last_output[i]; + if (fabs(d) > half_turn) d -= copysign(full_turn, d); - if (nl > 1.) - { - for (unsigned k = 3; k < 6; k++) - { - static constexpr double nl_end = 1.5; + if (fabs(d) > rot_dz) + d -= copysign(rot_dz, d); + else + d = 0; - if (fabs(deltas[k]) <= nl_end) - deltas[k] = copysign(pow(fabs(deltas[k]/nl_end), nl) * nl_end, deltas[k]); - } + deltas[i] = d / rot_thres; } - do_deltas(&deltas[Yaw], &output[Yaw], [this](double x) { return spline_rot.get_value_no_save(x); }); +#ifdef UI_ACCELA_OLD_STAIRCASE + for (int i = Yaw; i <= Roll; i++) + do_delta(deltas[i], &output[i], [this](double x) { + return spline_rot.get_value_no_save(x); + }); +#else + do_deltas(&deltas[Yaw], &output[Yaw], [this](double x) { + return spline_rot.get_value_no_save(x); + }); +#endif // pos for (unsigned i = 0; i < 3; i++) { - double d = smoothed_input[i] - last_output[i]; - d += copysign(pos_dz, -d); + double d = input[i] - last_output[i]; + if (fabs(d) > pos_dz) + d -= copysign(pos_dz, d); + else + d = 0; + deltas[i] = d / pos_thres; } - do_deltas(&deltas[TX], &output[TX], [this](double x) { return spline_pos.get_value_no_save(x); }); + do_deltas(&deltas[TX], &output[TX], [this](double x) { + return spline_pos.get_value_no_save(x); + }); // end @@ -173,26 +154,26 @@ void accela::filter(const double* input, double *output) { output[k] *= dt; output[k] += last_output[k]; + if (k >= Yaw && fabs(output[k]) > half_turn) + output[k] -= copysign(full_turn, output[k]); + last_output[k] = output[k]; } } -void settings_accela::make_splines(spline& rot, spline& trans) -{ - rot = spline(); - trans = spline(); +namespace detail::accela { - rot.set_max_input(rot_gains[0][0]); - trans.set_max_input(pos_gains[0][0]); - rot.set_max_output(rot_gains[0][1]); - trans.set_max_output(pos_gains[0][1]); +void settings_accela::make_splines(spline& rot, spline& pos) +{ + rot.clear(); pos.clear(); - for (int i = 0; rot_gains[i][0] >= 0; i++) - rot.add_point(QPointF(rot_gains[i][0], rot_gains[i][1])); + for (const auto& val : rot_gains) + rot.add_point({ val.x, val.y }); - for (int i = 0; pos_gains[i][0] >= 0; i++) - trans.add_point(QPointF(pos_gains[i][0], pos_gains[i][1])); + for (const auto& val : pos_gains) + pos.add_point({ val.x, val.y }); } -OPENTRACK_DECLARE_FILTER(accela, dialog_accela, accelaDll) +} // ns detail::accela +OPENTRACK_DECLARE_FILTER(accela, dialog_accela, accelaDll) diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h index b23b8e88..0d6dca1b 100644 --- a/filter-accela/ftnoir_filter_accela.h +++ b/filter-accela/ftnoir_filter_accela.h @@ -5,57 +5,61 @@ * copyright notice and this permission notice appear in all copies. */ #pragma once + +#include "ui_ftnoir_accela_filtercontrols.h" + #include "accela-settings.hpp" #include "api/plugin-api.hpp" #include "compat/timer.hpp" -#include "ui_ftnoir_accela_filtercontrols.h" +#include "compat/variance.hpp" -#include <atomic> #include <QMutex> #include <QTimer> -class accela : public IFilter +//#define DEBUG_ACCELA + +struct accela : IFilter { -public: accela(); void filter(const double* input, double *output) override; void center() override { first_run = true; } spline spline_rot, spline_pos; + module_status initialize() override { return status_ok(); } private: settings_accela s; - bool first_run; - double last_output[6]; - double smoothed_input[6]; + double last_output[6] {}, deltas[6] {}; Timer t; - - static double get_rot_delta(double val, double prev, double& degen); +#if defined DEBUG_ACCELA + Timer debug_timer; + double debug_max; + variance var; +#endif + bool first_run = true; }; -class dialog_accela: public IFilterDialog +class dialog_accela : public IFilterDialog { Q_OBJECT public: dialog_accela(); void register_filter(IFilter*) override {} void unregister_filter() override {} + void save() override; + void reload() override; + bool embeddable() noexcept override { return true; } + void set_buttons_visible(bool x) override; private: Ui::AccelaUICdialog_accela ui; - void save(); settings_accela s; private slots: void doOK(); void doCancel(); - void update_ewma_display(const slider_value& value); - void update_rot_display(const slider_value& value); - void update_pos_display(const slider_value& value); - void update_rot_dz_display(const slider_value& value); - void update_pos_dz_display(const slider_value&); - void update_rot_nl_slider(const slider_value& sl); }; class accelaDll : public Metadata { -public: - QString name() { return QString(QCoreApplication::translate("accelaDll", "Accela")); } - QIcon icon() { return QIcon(":/images/filter-16.png"); } + Q_OBJECT + + QString name() override { return tr("Accela"); } + QIcon icon() override { return QIcon(":/images/filter-16.png"); } }; diff --git a/filter-accela/ftnoir_filter_accela_dialog.cpp b/filter-accela/ftnoir_filter_accela_dialog.cpp index 637bee86..6a0a35b0 100644 --- a/filter-accela/ftnoir_filter_accela_dialog.cpp +++ b/filter-accela/ftnoir_filter_accela_dialog.cpp @@ -13,6 +13,8 @@ #include "spline/spline-widget.hpp" #include <QDialog> +using namespace options; + dialog_accela::dialog_accela() { ui.setupUi(this); @@ -20,55 +22,43 @@ dialog_accela::dialog_accela() connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - connect(&s.rot_sensitivity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_display(const slider_value&))); - connect(&s.pos_sensitivity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_pos_display(const slider_value&))); - connect(&s.ewma, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_ewma_display(const slider_value&))); - connect(&s.rot_deadzone, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_dz_display(const slider_value&))); - connect(&s.pos_deadzone, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_pos_dz_display(const slider_value&))); - connect(&s.rot_nonlinearity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_nl_slider(const slider_value&))); - - tie_setting(s.rot_sensitivity, ui.rotation_slider); - tie_setting(s.pos_sensitivity, ui.translation_slider); - tie_setting(s.ewma, ui.ewma_slider); + tie_setting(s.rot_smoothing, ui.rotation_slider); + tie_setting(s.pos_smoothing, ui.translation_slider); tie_setting(s.rot_deadzone, ui.rot_dz_slider); tie_setting(s.pos_deadzone, ui.trans_dz_slider); - tie_setting(s.rot_nonlinearity, ui.rot_nl_slider); - update_rot_display(s.rot_sensitivity); - update_pos_display(s.pos_sensitivity); - update_ewma_display(s.ewma); - update_rot_dz_display(s.rot_deadzone); - update_pos_dz_display(s.pos_deadzone); - update_rot_nl_slider(s.rot_nonlinearity); + tie_setting(s.rot_smoothing, ui.rot_gain, [](const slider_value& s) { return tr("%1°").arg(s, 0, 'g', 4); }); + tie_setting(s.pos_smoothing, ui.trans_gain, [](const slider_value& s) { return tr("%1mm").arg(s, 0, 'g', 4); }); + tie_setting(s.rot_deadzone, ui.rot_dz, [](const slider_value& s) { return tr("%1°").arg(s, 0, 'g', 4); }); + tie_setting(s.pos_deadzone, ui.trans_dz, [](const slider_value& s) { return tr("%1mm").arg(s); }); //#define SPLINE_ROT_DEBUG //#define SPLINE_TRANS_DEBUG #if defined SPLINE_ROT_DEBUG || defined SPLINE_TRANS_DEBUG { - spline rot, trans; - s.make_splines(rot, trans); - QDialog dr, dt; - spline_widget r(&dr); - spline_widget t(&dt); - dr.setWindowTitle("Accela rotation gain"); r.set_preview_only(true); r.setEnabled(false); - r.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); r.setConfig(&rot); - dt.setWindowTitle("Accela translation gain"); t.set_preview_only(true); t.setEnabled(false); - r.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); t.setConfig(&trans); - r.setFixedSize(1024, 600); t.setFixedSize(1024, 600); + spline rot, pos; + s.make_splines(rot, pos); #ifdef SPLINE_ROT_DEBUG + QDialog dr; + spline_widget r(&dr); + dr.setWindowTitle("Accela rotation gain"); r.set_preview_only(true); r.setEnabled(true); + r.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); r.set_config(&rot); + r.setFixedSize(1024, 600); dr.show(); + dr.exec(); #endif #ifdef SPLINE_TRANS_DEBUG + QDialog dt; + spline_widget t(&dt); + dt.setWindowTitle("Accela translation gain"); t.set_preview_only(true); t.setEnabled(true); + dt.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); t.set_config(&pos); + t.setFixedSize(1024, 600); dt.show(); + dt.exec(); #endif - - if (dr.isVisible()) - dr.exec(); - if (dt.isVisible()) - dt.exec(); } #endif } @@ -89,43 +79,12 @@ void dialog_accela::save() s.b->save(); } -#define FIELD(x, a) ((a).arg(double((x)), 0, 'g', 4)) -#define LIT(x) QStringLiteral(x) - -void dialog_accela::update_rot_display(const slider_value& val) -{ - static const QString str(QString::fromUtf8("%1°")); - ui.rot_gain->setText(FIELD(val, str)); -} - -void dialog_accela::update_pos_display(const slider_value& val) +void dialog_accela::reload() { - ui.trans_gain->setText(FIELD(val, LIT("%1mm"))); + s.b->reload(); } -void dialog_accela::update_ewma_display(const slider_value& val) +void dialog_accela::set_buttons_visible(bool x) { - ui.ewma_label->setText(FIELD(val, LIT("%1ms"))); + ui.buttonBox->setVisible(x); } - -void dialog_accela::update_rot_dz_display(const slider_value& val) -{ - static const QString str(QString::fromUtf8("%1°")); - ui.rot_dz->setText(FIELD(val, str)); -} - -void dialog_accela::update_pos_dz_display(const slider_value& val) -{ - ui.trans_dz->setText(FIELD(val, LIT("%1mm"))); -} - -void dialog_accela::update_rot_nl_slider(const slider_value& val) -{ - ui.rot_nl->setText(FIELD(val, LIT( - "<html><head/><body>" - "<p>x<span style='vertical-align:super;'>" - "%1" - "</span></p>" - "</body></html>"))); -} - diff --git a/filter-accela/lang/de_DE.ts b/filter-accela/lang/de_DE.ts new file mode 100644 index 00000000..9ab4e8c5 --- /dev/null +++ b/filter-accela/lang/de_DE.ts @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de_DE"> +<context> + <name>AccelaUICdialog_accela</name> + <message> + <source>Filter settings</source> + <translation>Filter-Einstellungen</translation> + </message> + <message> + <source>Rotation filtering (Yaw, pitch, and roll)</source> + <translation>Rotationsfilterung (Gieren, Nicken und Rollen)</translation> + </message> + <message> + <source>Smoothing</source> + <translation>Glättung</translation> + </message> + <message> + <source>0°</source> + <translation>0°</translation> + </message> + <message> + <source>Deadzone</source> + <translation>Totbereich</translation> + </message> + <message> + <source>Position filtering (X, Y, Z - translation)</source> + <translation>Positionsfilterung (X, Y, Z-Übersetzung)</translation> + </message> + <message> + <source>0mm</source> + <translation>0 mm</translation> + </message> + <message> + <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <translation><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">In </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">unserem Wiki</span></a><span style=" font-size:8pt;"> gibt es eine Beschreibung der Einstellungen.</span></p></body></html></translation> + </message> +</context> +<context> + <name>accelaDll</name> + <message> + <source>Accela</source> + <translation>Accela</translation> + </message> +</context> +<context> + <name>dialog_accela</name> + <message> + <source>%1°</source> + <translation>%1°</translation> + </message> + <message> + <source>%1mm</source> + <translation>%1 mm</translation> + </message> +</context> +</TS> diff --git a/filter-accela/lang/nl_NL.ts b/filter-accela/lang/nl_NL.ts index e563effa..5a4d1f58 100644 --- a/filter-accela/lang/nl_NL.ts +++ b/filter-accela/lang/nl_NL.ts @@ -4,90 +4,53 @@ <context> <name>AccelaUICdialog_accela</name> <message> - <location filename="../ftnoir_accela_filtercontrols.ui" line="+29"/> <source>Filter settings</source> <translation type="unfinished">Filter-instellingen</translation> </message> <message> - <location line="+13"/> - <source>General</source> - <translation type="unfinished">Algemeen</translation> - </message> - <message> - <location line="+12"/> <source>Smoothing</source> <translation type="unfinished">Verzachten</translation> </message> <message> - <location line="+13"/> - <source>0 ms</source> - <translation type="unfinished">0 ms</translation> - </message> - <message> - <location line="+38"/> <source>Position filtering (X, Y, Z - translation)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+24"/> - <location line="+123"/> - <source>Sensitivity</source> - <translation type="unfinished">Gevoeligheid</translation> + <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <translation type="unfinished"></translation> </message> <message> - <location line="-110"/> - <location line="+35"/> <source>0mm</source> <translation type="unfinished">0mm</translation> </message> <message> - <location line="+7"/> - <location line="+116"/> <source>Deadzone</source> <translation type="unfinished">Deadzone</translation> </message> <message> - <location line="-72"/> <source>Rotation filtering (Yaw, pitch, and roll)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+37"/> - <location line="+48"/> <source>0°</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>accelaDll</name> <message> - <location line="+32"/> - <source>Rotation nonlinearity</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Setting it higher will filter out rotation noise but may cause sudden jumps on very high settings.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+52"/> - <source><html><head/><body><p>x<span style=" vertical-align:super;">2</span></p></body></html></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-18"/> - <source>Value</source> + <source>Accela</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>dialog_accela</name> <message> - <location line="+76"/> - <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2015</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <source>%1°</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>accelaDll</name> <message> - <location filename="../ftnoir_filter_accela.h" line="+66"/> - <source>Accela</source> + <source>%1mm</source> <translation type="unfinished"></translation> </message> </context> diff --git a/filter-accela/lang/ru_RU.ts b/filter-accela/lang/ru_RU.ts index 235aa7be..c2eb175d 100644 --- a/filter-accela/lang/ru_RU.ts +++ b/filter-accela/lang/ru_RU.ts @@ -4,91 +4,54 @@ <context> <name>AccelaUICdialog_accela</name> <message> - <location filename="../ftnoir_accela_filtercontrols.ui" line="+29"/> <source>Filter settings</source> <translation>Настройка фильтра</translation> </message> <message> - <location line="+13"/> - <source>General</source> - <translation>Основные настройки</translation> - </message> - <message> - <location line="+12"/> <source>Smoothing</source> <translation>Сглаживание</translation> </message> <message> - <location line="+13"/> - <source>0 ms</source> - <translation>0 мс</translation> - </message> - <message> - <location line="+38"/> <source>Position filtering (X, Y, Z - translation)</source> <translation>Фильтрация смещений (X, Y, Z)</translation> </message> <message> - <location line="+24"/> - <location line="+123"/> - <source>Sensitivity</source> - <translation>Чувствительность</translation> + <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <translation type="unfinished"><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela-фильтр создан </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;">'ом<br/>Спасибо за помощь </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2016</span></p><p align="right"><br/><span style=" font-size:8pt;">Посетите </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">нашу вики</span></a><span style=" font-size:8pt;"> для понимания процесса настройки.</span></p></body></html> {10p?} {10p?} {0057a?} {10p?} {10p?} {0057a?} {10p?} {2012-2017<?} {8p?} {2.3"?} {8p?} {0000f?} {8p?}</translation> </message> <message> - <location line="-110"/> - <location line="+35"/> <source>0mm</source> <translation>0мм</translation> </message> <message> - <location line="+7"/> - <location line="+116"/> <source>Deadzone</source> <translation>Мертвая зона</translation> </message> <message> - <location line="-72"/> <source>Rotation filtering (Yaw, pitch, and roll)</source> <translation>Фильтрация поворотов (Рысканье, тангаж, крен)</translation> </message> <message> - <location line="+37"/> - <location line="+48"/> <source>0°</source> <translation></translation> </message> - <message> - <location line="+32"/> - <source>Rotation nonlinearity</source> - <translation>Нелинейность поворотов</translation> - </message> - <message> - <location line="+6"/> - <source>Setting it higher will filter out rotation noise but may cause sudden jumps on very high settings.</source> - <translation>Чем выше значения, тем сильнее будут отсекаться мелкие движения, но могут появиться скачкообразные движения на высоких значениях. </translation> - </message> - <message> - <location line="+52"/> - <source><html><head/><body><p>x<span style=" vertical-align:super;">2</span></p></body></html></source> - <translation></translation> - </message> - <message> - <location line="-18"/> - <source>Value</source> - <translation>Значение</translation> - </message> - <message> - <location line="+76"/> - <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2015</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> - <translation><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela-фильтр создан </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;">'ом<br/>Спасибо за помощь </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2016</span></p><p align="right"><br/><span style=" font-size:8pt;">Посетите </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">нашу вики</span></a><span style=" font-size:8pt;"> для понимания процесса настройки.</span></p></body></html></translation> - </message> </context> <context> <name>accelaDll</name> <message> - <location filename="../ftnoir_filter_accela.h" line="+66"/> <source>Accela</source> - <translation></translation> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>dialog_accela</name> + <message> + <source>%1°</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>%1mm</source> + <translation type="unfinished"></translation> </message> </context> </TS> diff --git a/filter-accela/lang/stub.ts b/filter-accela/lang/stub.ts index f58321f8..4a3e27ff 100644 --- a/filter-accela/lang/stub.ts +++ b/filter-accela/lang/stub.ts @@ -4,90 +4,53 @@ <context> <name>AccelaUICdialog_accela</name> <message> - <location filename="../ftnoir_accela_filtercontrols.ui" line="+29"/> <source>Filter settings</source> <translation type="unfinished"></translation> </message> <message> - <location line="+13"/> - <source>General</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+12"/> <source>Smoothing</source> <translation type="unfinished"></translation> </message> <message> - <location line="+13"/> - <source>0 ms</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+38"/> <source>Position filtering (X, Y, Z - translation)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+24"/> - <location line="+123"/> - <source>Sensitivity</source> + <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <location line="-110"/> - <location line="+35"/> <source>0mm</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> - <location line="+116"/> <source>Deadzone</source> <translation type="unfinished"></translation> </message> <message> - <location line="-72"/> <source>Rotation filtering (Yaw, pitch, and roll)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+37"/> - <location line="+48"/> <source>0°</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>accelaDll</name> <message> - <location line="+32"/> - <source>Rotation nonlinearity</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Setting it higher will filter out rotation noise but may cause sudden jumps on very high settings.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+52"/> - <source><html><head/><body><p>x<span style=" vertical-align:super;">2</span></p></body></html></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-18"/> - <source>Value</source> + <source>Accela</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>dialog_accela</name> <message> - <location line="+76"/> - <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2015</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <source>%1°</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>accelaDll</name> <message> - <location filename="../ftnoir_filter_accela.h" line="+66"/> - <source>Accela</source> + <source>%1mm</source> <translation type="unfinished"></translation> </message> </context> diff --git a/filter-accela/lang/zh_CN.ts b/filter-accela/lang/zh_CN.ts new file mode 100644 index 00000000..1deb8288 --- /dev/null +++ b/filter-accela/lang/zh_CN.ts @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="zh_CN"> +<context> + <name>AccelaUICdialog_accela</name> + <message> + <source>Filter settings</source> + <translation>过滤器设置</translation> + </message> + <message> + <source>Rotation filtering (Yaw, pitch, and roll)</source> + <translation>旋转过滤器 (偏航, 俯仰, 滚转)</translation> + </message> + <message> + <source>Smoothing</source> + <translation type="unfinished">平滑</translation> + </message> + <message> + <source>0°</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Deadzone</source> + <translation>死区</translation> + </message> + <message> + <source>Position filtering (X, Y, Z - translation)</source> + <translation>方位过滤器 (X, Y, Z - 变换)</translation> + </message> + <message> + <source>0mm</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head/><body><p align="right"><br/><span style=" font-size:10pt;">Accela by </span><a href="https://github.com/sthalik"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><span style=" font-size:10pt;"><br/>Thanks to </span><a href="https://github.com/dbaarda"><span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="right"><span style=" font-size:10pt;">2012-2017</span></p><p align="right"><br/><span style=" font-size:8pt;">Visit </span><a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">our wiki</span></a><span style=" font-size:8pt;"> for description of the settings.</span></p></body></html></source> + <translation type="unfinished"><html> + +<body> + <p align="right"><br /> + <span style=" font-size:10pt;">Accela by </span> + <a href="https://github.com/sthalik"> + <span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Stanisław Halik</span> + </a> + <span style=" font-size:10pt;"><br />Thanks to </span> + <a href="https://github.com/dbaarda"> + <span style=" font-size:10pt; text-decoration: underline; color:#0057ae;">Donovan Baarda</span> + </a> + </p> + <p align="right"> + <span style=" font-size:10pt;">2012-2017</span> + </p> + <p align="right"><br /> + <span style=" font-size:8pt;">访问</span> + <a href="https://github.com/opentrack/opentrack/wiki/Accela-in-opentrack-2.3"> + <span style=" font-size:8pt; text-decoration: underline; color:#0066bb;">我们的 wiki</span> + </a> + <span style=" font-size:8pt;"> 了解设置的描述.</span> + </p> +</body> + +</html></translation> + </message> +</context> +<context> + <name>accelaDll</name> + <message> + <source>Accela</source> + <translation></translation> + </message> +</context> +<context> + <name>dialog_accela</name> + <message> + <source>%1°</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>%1mm</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> |
