summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-20 05:34:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-20 05:34:51 +0200
commitacb60d2264fb203898b16f01952cdb3498ffac20 (patch)
tree9261a5e0c67147dd22333f5cd29e8d35c91a8541 /logic
parent3ffb397c4dfd6d00383f62a9e8814f4670c240be (diff)
logic/main-settings: simplify
Diffstat (limited to 'logic')
-rw-r--r--logic/main-settings.cpp1
-rw-r--r--logic/main-settings.hpp8
-rw-r--r--logic/state.hpp2
3 files changed, 9 insertions, 2 deletions
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<double> zero;
value<int> src;
value<bool> invert, altp;
- value<max_clamp> clamp;
+ value<max_clamp> 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<axis_opts*> all_axis_opts;
value<bool> tcomp_p, tcomp_disable_tx, tcomp_disable_ty, tcomp_disable_tz;
value<bool> tcomp_disable_src_yaw, tcomp_disable_src_pitch, tcomp_disable_src_roll;
value<bool> tray_enabled, tray_start;
@@ -91,5 +96,6 @@ struct OTR_LOGIC_EXPORT main_settings final
key_opts key_zero_press1, key_zero_press2;
value<bool> tracklogging_enabled;
value<QString> 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<axis_opts*>{&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;