summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-17 07:55:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-17 08:01:32 +0200
commitfff539163e23c687ef32d61aa91c16b2e616ec63 (patch)
tree30fbd827123e0e93f3c3657d9603ccef3bcf8968 /ftnoir_tracker_joystick
parentf8b65030eefbb8bf7ce09d5c0adbfd3192f1cf24 (diff)
remove win32-joystick axis remap
Feature provided for all trackers in core. Only confuses when both remaps used at the same time. Issue: #52
Diffstat (limited to 'ftnoir_tracker_joystick')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp21
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.h12
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui394
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp7
4 files changed, 16 insertions, 418 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index e1d92b78..0e95f57d 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -196,26 +196,9 @@ void FTNoIR_Tracker::GetHeadPoseData(double *data)
90,
180
};
-
- int axes[] = {
- s.axis_0,
- s.axis_1,
- s.axis_2,
- s.axis_3,
- s.axis_4,
- s.axis_5
- };
-
+
for (int i = 0; i < 6; i++)
- {
- auto idx = axes[i] - 1;
- if (idx < 0 || idx > 7)
- {
- data[i] = 0;
- }
- else
- data[i] = values[i] * limits[i] / AXIS_MAX;
- }
+ data[i] = values[i] * limits[i] / AXIS_MAX;
}
extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor()
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
index 1135b609..75ea9f52 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
@@ -32,21 +32,9 @@ using namespace options;
struct settings {
pbundle b;
- value<int> axis_0;
- value<int> axis_1;
- value<int> axis_2;
- value<int> axis_3;
- value<int> axis_4;
- value<int> axis_5;
value<QString> joyid;
settings() :
b(bundle("tracker-joystick")),
- axis_0(b, "axis-0", 0),
- axis_1(b, "axis-1", 0),
- axis_2(b, "axis-2", 0),
- axis_3(b, "axis-3", 0),
- axis_4(b, "axis-4", 0),
- axis_5(b, "axis-5", 0),
joyid(b, "joy-id", "")
{}
};
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui
index 5d349169..b0e010a1 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>216</width>
- <height>259</height>
+ <width>326</width>
+ <height>88</height>
</rect>
</property>
<property name="sizePolicy">
@@ -32,385 +32,25 @@
<property name="autoFillBackground">
<bool>false</bool>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="groupBox_3">
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Joystick</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="joylist">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>85</height>
- </size>
- </property>
- <property name="title">
- <string>Axis enablement</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="1" column="0">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>X</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Y</string>
- </property>
- </widget>
- </item>
- <item row="7" column="0">
- <widget class="QLabel" name="label_16">
- <property name="text">
- <string>Roll</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QComboBox" name="comboBox_5">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="7" column="1">
- <widget class="QComboBox" name="comboBox_6">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QComboBox" name="comboBox_4">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QComboBox" name="comboBox_2">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="comboBox">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_14">
- <property name="text">
- <string>Yaw</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QComboBox" name="comboBox_3">
- <item>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#3</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#4</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#5</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#6</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#7</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>#8</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Z</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_15">
- <property name="text">
- <string>Pitch</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Joy Id</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="joylist">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
</widget>
</item>
- <item>
+ <item row="1" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
@@ -421,12 +61,6 @@
</widget>
<tabstops>
<tabstop>joylist</tabstop>
- <tabstop>comboBox</tabstop>
- <tabstop>comboBox_2</tabstop>
- <tabstop>comboBox_3</tabstop>
- <tabstop>comboBox_4</tabstop>
- <tabstop>comboBox_5</tabstop>
- <tabstop>comboBox_6</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
index 7f24a8f1..eea7f916 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
@@ -19,13 +19,6 @@ TrackerControls::TrackerControls() : tracker(nullptr)
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
- tie_setting(s.axis_0, ui.comboBox);
- tie_setting(s.axis_1, ui.comboBox_2);
- tie_setting(s.axis_2, ui.comboBox_3);
- tie_setting(s.axis_3, ui.comboBox_4);
- tie_setting(s.axis_4, ui.comboBox_5);
- tie_setting(s.axis_5, ui.comboBox_6);
-
{
auto hr = CoInitialize( nullptr );
LPDIRECTINPUT8 g_pDI = nullptr;