summaryrefslogtreecommitdiffhomepage
path: root/gui/wizard.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-30 09:01:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-30 09:01:32 +0100
commitd785d3616500d5846ac8c5f5a6347da832a593b4 (patch)
treeac670a125c5b880ad7e4b4f24a8635da4e66f0da /gui/wizard.cpp
parent232c2ba8aca7900eaa950c48813ddfaca8a749a8 (diff)
parent9b736d361bcde7a2ddaf3fe54b471c0e658e94f4 (diff)
Merge branch 'unstable' into trackhat
* unstable: cmake: cleanup hydra rename gui directory move to subdirectory-based build system cmake: switch to GNU CC 5.2.0 in mingw-w64 toolchain file rift-080: forgot ovr_Initialize() rift 025: fix name
Diffstat (limited to 'gui/wizard.cpp')
-rw-r--r--gui/wizard.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/gui/wizard.cpp b/gui/wizard.cpp
new file mode 100644
index 00000000..4b0ccba0
--- /dev/null
+++ b/gui/wizard.cpp
@@ -0,0 +1,80 @@
+#include "wizard.h"
+#include "opentrack/state.hpp"
+#include "tracker-pt/ftnoir_tracker_pt_settings.h"
+#include "filter-accela/ftnoir_filter_accela.h"
+
+Wizard::Wizard() : QWizard(nullptr)
+{
+ ui.setupUi(this);
+ connect(this, SIGNAL(accepted()), this, SLOT(set_data()));
+}
+
+static constexpr double tz[][2] = {
+ { 16.5327205657959, 13.0232553482056 },
+ { 55.4535026550293, 100 },
+ { 56.8312301635742, 100 },
+ { -1, -1 },
+};
+
+static constexpr double yaw[][2] = {
+ { 10.7462686567164, 20.9302325581395 },
+ { 41.9517784118652, 180 },
+ { -1, -1 },
+};
+
+static constexpr double pitch[][2] = {
+ { 10.1262916188289, 27.6279069767442 },
+ { 32.4454649827784, 180 },
+ { -1, -1 },
+};
+
+static constexpr double roll[][2] = {
+ { 12.3995409011841, 25.9534893035889 },
+ { 54.3513221740723, 180 },
+ { -1, -1 },
+};
+
+static void set_mapping(Mapping& m, const double spline[][2])
+{
+ m.opts.altp = false;
+ m.curve.removeAllPoints();
+ for (int i = 0; spline[i][0] >= 0; i++)
+ m.curve.addPoint(QPointF(spline[i][0], spline[i][1]));
+}
+
+void Wizard::set_data()
+{
+ Model m;
+
+ if (ui.clip_model->isChecked())
+ m = ClipRight;
+ else if (ui.clip_model_left->isChecked())
+ m = ClipLeft;
+ else // ui.cap_model
+ m = Cap;
+
+ State state;
+
+ set_mapping(state.pose(TZ), tz);
+ set_mapping(state.pose(Yaw), yaw);
+ set_mapping(state.pose(Pitch), pitch);
+ set_mapping(state.pose(Roll), roll);
+ state.pose.save_mappings();
+
+ settings_pt pt;
+ pt.threshold = 31;
+ pt.min_point_size = 0;
+ pt.max_point_size = 50;
+ pt.fov = 1;
+ pt.camera_mode = 0;
+ pt.model_used = m;
+ pt.b->save();
+
+ settings_accela acc;
+ acc.ewma = 49;
+ acc.rot_threshold = 29;
+ acc.rot_deadzone = 29;
+ acc.trans_deadzone = 33;
+ acc.trans_threshold = 19;
+ acc.b->save();
+}