From acb60d2264fb203898b16f01952cdb3498ffac20 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 20 Oct 2017 05:34:51 +0200 Subject: logic/main-settings: simplify --- logic/main-settings.cpp | 1 + logic/main-settings.hpp | 8 +++++++- logic/state.hpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'logic') diff --git a/logic/main-settings.cpp b/logic/main-settings.cpp index 1b94fbe8..a706abe6 100644 --- a/logic/main-settings.cpp +++ b/logic/main-settings.cpp @@ -9,6 +9,7 @@ main_settings::main_settings() : a_yaw(b, b_map, "yaw", Yaw), a_pitch(b, b_map, "pitch", Pitch), a_roll(b, b_map, "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), tcomp_disable_ty(b, "compensate-translation-disable-y-axis", false), diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp index 18c6f19a..4b29157f 100644 --- a/logic/main-settings.hpp +++ b/logic/main-settings.hpp @@ -40,6 +40,10 @@ struct OTR_LOGIC_EXPORT axis_opts final t20 = 20, t15 = 15, t10 = 10, + + o_r180 = -180, + o_r90 = -90, + o_t75 = -75, }; // note, these two bundles can be the same value with no issues @@ -47,7 +51,7 @@ struct OTR_LOGIC_EXPORT axis_opts final value zero; value src; value invert, altp; - value clamp; + value clamp_x, clamp_y; axis_opts(bundle b_settings_window, bundle b_mapping_window, QString pfx, Axis idx); private: static inline QString n(QString pfx, QString name); @@ -73,6 +77,7 @@ struct OTR_LOGIC_EXPORT main_settings final bundle b, b_map; axis_opts a_x, a_y, a_z; axis_opts a_yaw, a_pitch, a_roll; + std::vector all_axis_opts; value tcomp_p, tcomp_disable_tx, tcomp_disable_ty, tcomp_disable_tz; value tcomp_disable_src_yaw, tcomp_disable_src_pitch, tcomp_disable_src_roll; value tray_enabled, tray_start; @@ -91,5 +96,6 @@ struct OTR_LOGIC_EXPORT main_settings final key_opts key_zero_press1, key_zero_press2; value tracklogging_enabled; value tracklogging_filename; + main_settings(); }; diff --git a/logic/state.hpp b/logic/state.hpp index 589de5ff..fb9587bf 100644 --- a/logic/state.hpp +++ b/logic/state.hpp @@ -23,7 +23,7 @@ struct State State(const QString& library_path) : modules(library_path), ev(modules.extensions()), - pose(std::vector{&s.a_x, &s.a_y, &s.a_z, &s.a_yaw, &s.a_pitch, &s.a_roll}) + pose(s.all_axis_opts) {} Modules modules; event_handler ev; -- cgit v1.2.3