summaryrefslogtreecommitdiffhomepage
path: root/logic/main-settings.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-20 17:53:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-20 17:53:21 +0200
commit39e209983bd1f04fb0beefef754d7430c8b7fb9f (patch)
treeec41545dda2d33d316adc6466f21138a280db6a8 /logic/main-settings.cpp
parent092e2910ae8f6c2e188e930b9540d58e145c9142 (diff)
logic, spline: more spline work/fixes
- mapping window clamps are now value<max_clamp> in spline - clamp won't mess up saved spline content - clean up artifacts on spline widget
Diffstat (limited to 'logic/main-settings.cpp')
-rw-r--r--logic/main-settings.cpp39
1 files changed, 6 insertions, 33 deletions
diff --git a/logic/main-settings.cpp b/logic/main-settings.cpp
index b1b9a132..e2d1b41f 100644
--- a/logic/main-settings.cpp
+++ b/logic/main-settings.cpp
@@ -3,12 +3,12 @@
main_settings::main_settings() :
b(make_bundle("opentrack-ui")),
b_map(make_bundle("opentrack-mappings")),
- a_x(b, b_map, "x", TX),
- a_y(b, b_map, "y", TY),
- a_z(b, b_map, "z", TZ),
- a_yaw(b, b_map, "yaw", Yaw),
- a_pitch(b, b_map, "pitch", Pitch),
- a_roll(b, b_map, "roll", Roll),
+ a_x("x", TX),
+ a_y("y", TY),
+ a_z("z", TZ),
+ a_yaw("yaw", Yaw),
+ a_pitch("pitch", Pitch),
+ a_roll("roll", Roll),
all_axis_opts { &a_x, &a_y, &a_z, &a_yaw, &a_pitch, &a_roll },
tcomp_p(b, "compensate-translation", false),
tcomp_disable_tx(b, "compensate-translation-disable-x-axis", false),
@@ -59,30 +59,3 @@ key_opts::key_opts(bundle b, const QString& name) :
guid(b, QString("guid-%1").arg(name), ""),
button(b, QString("button-%1").arg(name), -1)
{}
-
-using max_clamp = axis_opts::max_clamp;
-
-static max_clamp get_max_x(Axis k)
-{
- if (k == Pitch)
- return max_clamp::r90;
- if (k >= Yaw)
- return max_clamp::r180;
- return max_clamp::t30;
-}
-
-axis_opts::axis_opts(bundle b_settings_window, bundle b_mapping_window, QString pfx, Axis idx) :
- b_settings_window(b_settings_window),
- b_mapping_window(b_mapping_window),
- zero(b_settings_window, n(pfx, "zero-pos"), 0),
- src(b_settings_window, n(pfx, "source-index"), idx),
- invert(b_settings_window, n(pfx, "invert-sign"), false),
- altp(b_mapping_window, n(pfx, "alt-axis-sign"), false),
- clamp_x(b_mapping_window, n(pfx, "max-value"), get_max_x(idx)),
- clamp_y(b_mapping_window, n(pfx, "max-output-value"), idx >= Yaw ? o_r90 : o_t75)
-{}
-
-QString axis_opts::n(QString pfx, QString name)
-{
- return QString("%1-%2").arg(pfx, name);
-}