diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 07:55:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 07:55:51 +0200 |
commit | 458335e772b7ad790954351859d9f754a797bd80 (patch) | |
tree | 8606ae339d05650d6e927d415e3151dace6fd3c3 | |
parent | 7fd80129f3961465ce485a6ab7d873005b9c9427 (diff) |
Fix alt axes, finally
-rw-r--r-- | bin/settings/default.ini | 14 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 36 | ||||
-rw-r--r-- | facetracknoir/tracker.cpp | 6 | ||||
-rw-r--r-- | facetracknoir/tracker.h | 4 |
4 files changed, 35 insertions, 25 deletions
diff --git a/bin/settings/default.ini b/bin/settings/default.ini index 7ca466a5..1ac62b8f 100644 --- a/bin/settings/default.ini +++ b/bin/settings/default.ini @@ -1,11 +1,3 @@ -[General]
-rx_alt=false
-ry_alt=true
-rz_alt=false
-tx_alt=false
-ty_alt=false
-tz_alt=true
-
[Curves-rx]
point-count=4
point-0-x=0
@@ -61,6 +53,12 @@ invertRoll=false invertX=false
invertY=false
invertZ=false
+rx_alt=false
+ry_alt=true
+rz_alt=false
+tx_alt=false
+ty_alt=false
+tz_alt=false
[GameProtocol]
DLL=FTNoIR_Protocol_FT.dll
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index c19585b2..41c456ce 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -751,18 +751,20 @@ void FaceTrackNoIR::startTracker( ) { }
static const char* names[] = {
+ "tx_alt",
+ "ty_alt",
+ "tz_alt",
"rx_alt",
"ry_alt",
"rz_alt",
- "tx_alt",
- "ty_alt",
- "tz_alt"
};
+ iniFile.beginGroup("Tracking");
+
for (int i = 0; i < 6; i++)
- {
GlobalPose->axes[i].altp = iniFile.value(names[i], false).toBool();
- }
+
+ iniFile.endGroup();
tracker = new Tracker ( this );
@@ -1942,24 +1944,28 @@ void CurveConfigurationDialog::loadSettings() { qDebug() << "loadSettings says: iniFile = " << currentFile;
static const char* names[] = {
- "rx_alt",
- "ry_alt",
- "rz_alt",
"tx_alt",
"ty_alt",
- "tz_alt"
+ "tz_alt",
+ "rx_alt",
+ "ry_alt",
+ "rz_alt"
};
+ iniFile.beginGroup("Tracking");
+
for (int i = 0; i < 6; i++)
GlobalPose->axes[i].altp = iniFile.value(names[i], false).toBool();
+ iniFile.endGroup();
+
static QCheckBox* widgets[] = {
- ui.rx_altp,
- ui.ry_altp,
- ui.rz_altp,
ui.tx_altp,
ui.ty_altp,
- ui.tz_altp
+ ui.tz_altp,
+ ui.rx_altp,
+ ui.ry_altp,
+ ui.rz_altp
};
for (int i = 0; i < 6; i++)
@@ -1995,6 +2001,8 @@ void CurveConfigurationDialog::save() { QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
+ iniFile.beginGroup("Tracking");
+
iniFile.setValue("rx_alt", ui.rx_altp->checkState() != Qt::Unchecked);
iniFile.setValue("ry_alt", ui.ry_altp->checkState() != Qt::Unchecked);
iniFile.setValue("rz_alt", ui.rz_altp->checkState() != Qt::Unchecked);
@@ -2002,6 +2010,8 @@ void CurveConfigurationDialog::save() { iniFile.setValue("ty_alt", ui.ty_altp->checkState() != Qt::Unchecked);
iniFile.setValue("tz_alt", ui.tz_altp->checkState() != Qt::Unchecked);
+ iniFile.endGroup();
+
settingsDirty = false;
//
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index e6dde008..ca7d71fb 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -336,12 +336,12 @@ void Tracker::loadSettings() { Z_PosWhenReverseAxis = iniFile.value ( "RA_ToZPos", 80 ).toInt();
static const char* names[] = {
- "Inhibit_Yaw",
- "Inhibit_Pitch",
- "Inhibit_Roll",
"Inhibit_X",
"Inhibit_Y",
"Inhibit_Z"
+ "Inhibit_Yaw",
+ "Inhibit_Pitch",
+ "Inhibit_Roll",
};
for (int i = 0; i < 6; i++)
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index 5dc48f60..8bf1f6dc 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -117,10 +117,12 @@ public: {
curvePtrAlt = new FunctionConfig(secondary, maxInput2, maxOutput2);
curvePtrAlt->loadSettings(iniFile);
+ iniFile.beginGroup("Tracking");
+ altp = iniFile.value(secondary).toBool();
+ iniFile.endGroup();
}
headPos = 0.0f;
invert = 1;
- altp = false;
}
float headPos; // Current position (from faceTracker, radials or meters)
float invert; // Invert measured value (= 1.0f or -1.0f)
|