diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 00:45:20 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-13 00:45:20 +0200 |
commit | b89195cee53549704e0807a802f5f05ed5d4e87a (patch) | |
tree | 1042585a3bc0a9deabe491d5c00322736e37d99f /facetracknoir | |
parent | c98efcbfdebd2e6ce85cb1b3b08a1bc48f3d968b (diff) |
Fix last commit, remove duplicated code
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 32 | ||||
-rw-r--r-- | facetracknoir/tracker.cpp | 3 | ||||
-rw-r--r-- | facetracknoir/tracker.h | 3 |
3 files changed, 22 insertions, 16 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index 7442940f..37f54aaa 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -740,9 +740,22 @@ void FaceTrackNoIR::startTracker( ) { delete tracker;
}
- if (GlobalPose)
- delete GlobalPose;
- GlobalPose = new HeadPoseData();
+ QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
+ QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
+ QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
+ GlobalPose->X.curvePtr->loadSettings(iniFile);
+ GlobalPose->Y.curvePtr->loadSettings(iniFile);
+ GlobalPose->Z.curvePtr->loadSettings(iniFile);
+ GlobalPose->Yaw.curvePtr->loadSettings(iniFile);
+ GlobalPose->Pitch.curvePtr->loadSettings(iniFile);
+ GlobalPose->Roll.curvePtr->loadSettings(iniFile);
+
+ GlobalPose->X.curvePtrAlt->loadSettings(iniFile);
+ GlobalPose->Y.curvePtrAlt->loadSettings(iniFile);
+ GlobalPose->Z.curvePtrAlt->loadSettings(iniFile);
+ GlobalPose->Yaw.curvePtrAlt->loadSettings(iniFile);
+ GlobalPose->Pitch.curvePtrAlt->loadSettings(iniFile);
+ GlobalPose->Roll.curvePtrAlt->loadSettings(iniFile);
tracker = new Tracker ( this );
@@ -788,11 +801,10 @@ void FaceTrackNoIR::startTracker( ) { // Get the TimeOut value for minimizing FaceTrackNoIR
// Only start the Timer if value > 0
//
- QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
- int timevalue = settings.value ( "AutoMinimizeTime", 0 ).toInt() * 1000;
+ int timevalue = iniFile.value ( "AutoMinimizeTime", 0 ).toInt() * 1000;
if (timevalue > 0) {
- bool minimizeTaskBar = settings.value ( "MinimizeTaskBar", 1 ).toBool();
+ bool minimizeTaskBar = iniFile.value ( "MinimizeTaskBar", 1 ).toBool();
if (minimizeTaskBar) {
connect(timMinimizeFTN, SIGNAL(timeout()), this, SLOT(showMinimized()));
}
@@ -1958,14 +1970,6 @@ void CurveConfigurationDialog::loadSettings() { iniFile.beginGroup ( "Tracking" );
iniFile.endGroup ();
- ui.rxconfig->loadSettings(currentFile);
- ui.ryconfig->loadSettings(currentFile);
- ui.rzconfig->loadSettings(currentFile);
-
- ui.rxconfig_alt->loadSettings(currentFile);
- ui.ryconfig_alt->loadSettings(currentFile);
- ui.rzconfig_alt->loadSettings(currentFile);
-
GlobalPose->Yaw.altp = iniFile.value("rx_alt", false).toBool();
GlobalPose->Pitch.altp = iniFile.value("ry_alt", false).toBool();
GlobalPose->Roll.altp = iniFile.value("rz_alt", false).toBool();
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index c3a61263..ed39765d 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -169,6 +169,8 @@ void Tracker::run() { if (Libraries->pTracker) {
bTracker1Confid = Libraries->pTracker->GiveHeadPoseData(&newpose);
}
+
+ confid = (bTracker1Confid || bTracker2Confid);
bool newp = last.yaw != newpose.yaw ||
last.pitch != newpose.pitch ||
@@ -301,7 +303,6 @@ void Tracker::run() { }
//for lower cpu load
- confid = (bTracker1Confid || bTracker2Confid);
usleep(1000);
}
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index d67fc533..e413c8d7 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -108,7 +108,8 @@ public: curvePtr = new FunctionConfig(primary, maxInput1, maxOutput1); // Create the Function-config for input-output translation
curvePtr->loadSettings(iniFile); // Load the settings from the INI-file
- if (secondary != "") {
+ if (secondary != "")
+ {
curvePtrAlt = new FunctionConfig(secondary, maxInput2, maxOutput2);
curvePtrAlt->loadSettings(iniFile);
}
|