summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-10-22 15:28:38 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-10-22 15:28:38 +0000
commit17fcad9850754d2d0ec662c46e7940b07b64804c (patch)
tree5875c85a90c8ff3b52bb360f0f1dde9a81b85544
parentc4f8fe0c097a3282270db7eecda4c7eb533b99fc (diff)
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@94 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r--FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui2
-rw-r--r--FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui2
-rw-r--r--FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp4
-rw-r--r--FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h1
-rw-r--r--FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui36
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp19
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.qrc1
-rw-r--r--FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest4
-rw-r--r--faceAPI/main.cpp13
9 files changed, 63 insertions, 19 deletions
diff --git a/FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui b/FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui
index c5f81c29..3469e7aa 100644
--- a/FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui
+++ b/FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui
@@ -117,7 +117,7 @@
<item row="3" column="1">
<widget class="QSpinBox" name="spinPortNumber">
<property name="minimum">
- <number>5550</number>
+ <number>1000</number>
</property>
<property name="maximum">
<number>10000</number>
diff --git a/FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui b/FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui
index 03de6e59..56983fbe 100644
--- a/FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui
+++ b/FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui
@@ -107,7 +107,7 @@
<item row="2" column="1">
<widget class="QSpinBox" name="spinPortNumber">
<property name="minimum">
- <number>5550</number>
+ <number>1000</number>
</property>
<property name="maximum">
<number>10000</number>
diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp
index 70556835..9326c544 100644
--- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp
+++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp
@@ -94,7 +94,9 @@ quint16 senderPort;
//
// Copy the Raw measurements directly to the client.
//
+ frame_counter += 1;
TestData = headpose->position;
+ TestData.frame_number = frame_counter;
//
// Try to send an UDP-message to the receiver
@@ -149,6 +151,8 @@ bool FTNoIR_Protocol_FTN::checkServerInstallationOK( HANDLE handle )
inSocket = 0;
outSocket = 0;
+ frame_counter = 0;
+
//
// Create UDP-sockets.
//
diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h
index 5f8d6b10..f90c0eac 100644
--- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h
+++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h
@@ -54,6 +54,7 @@ public:
private:
THeadPoseData TestData;
+ long frame_counter;
QUdpSocket *inSocket; // Receive from FaceTrackNoIR
QUdpSocket *outSocket; // Send to FaceTrackNoIR
qint32 cmd;
diff --git a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
index 39a3de0d..41fc4d36 100644
--- a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
+++ b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
@@ -562,14 +562,14 @@
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QLabel" name="lblYawAngle4ReverseAxis">
<property name="text">
<string>Yaw angle for Reverse Axis</string>
</property>
</widget>
</item>
- <item row="1" column="2">
+ <item row="2" column="2">
<widget class="QSpinBox" name="spinYawAngle4ReverseAxis">
<property name="maximumSize">
<size>
@@ -585,7 +585,7 @@
</property>
</widget>
</item>
- <item row="1" column="7">
+ <item row="2" column="7">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -598,21 +598,21 @@
</property>
</spacer>
</item>
- <item row="1" column="3">
+ <item row="2" column="3">
<widget class="QLabel" name="lblYawAngle4ReverseAxisEgu">
<property name="text">
<string>degrees</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QLabel" name="lblZ_Pos4ReverseAxis">
<property name="text">
- <string>Yaw angle for Reverse Axis</string>
+ <string>Z-position for Reverse Axis</string>
</property>
</widget>
</item>
- <item row="2" column="2">
+ <item row="3" column="2">
<widget class="QSpinBox" name="spinZ_Pos4ReverseAxis">
<property name="maximumSize">
<size>
@@ -631,21 +631,21 @@
</property>
</widget>
</item>
- <item row="2" column="3">
+ <item row="3" column="3">
<widget class="QLabel" name="lblZ_Pos4ReverseAxisEgu">
<property name="text">
<string>cm</string>
</property>
</widget>
</item>
- <item row="2" column="4">
+ <item row="3" column="4">
<widget class="QLabel" name="label_7">
<property name="text">
<string>When Reverse:</string>
</property>
</widget>
</item>
- <item row="2" column="5">
+ <item row="3" column="5">
<widget class="QSpinBox" name="spinZ_PosWhenReverseAxis">
<property name="maximumSize">
<size>
@@ -664,13 +664,27 @@
</property>
</widget>
</item>
- <item row="2" column="6">
+ <item row="3" column="6">
<widget class="QLabel" name="lblZ_PosWhenReverseAxisEgu">
<property name="text">
<string>cm</string>
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="lblZ_Pos4ReverseAxis_2">
+ <property name="text">
+ <string>Enable Revers Axis</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QCheckBox" name="chkEnableReverseAxis">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index d71f5954..a9334752 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -427,9 +427,9 @@ void FaceTrackNoIR::loadSettings() {
disconnect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int)));
ui.iconcomboProfile->clear();
for ( int i = 0; i < iniFileList.size(); i++) {
- ui.iconcomboProfile->addItem(QIcon(QCoreApplication::applicationDirPath() + "/images/Settings16.png"), iniFileList.at(i));
+ ui.iconcomboProfile->addItem(QIcon(":/images/Settings16.png"), iniFileList.at(i));
if (iniFileList.at(i) == pathInfo.fileName()) {
- ui.iconcomboProfile->setItemIcon(i, QIcon(QCoreApplication::applicationDirPath() + "/images/SettingsOpen16.png"));
+ ui.iconcomboProfile->setItemIcon(i, QIcon(":/images/SettingsOpen16.png"));
ui.iconcomboProfile->setCurrentIndex( i );
}
}
@@ -491,7 +491,7 @@ void FaceTrackNoIR::about() {
aboutDialog.setMinimumWidth(270);
aboutDialog.setMinimumHeight(440);
- aboutDialog.setStyleSheet("background:#fff url(UIElements/aboutFaceTrackNoIR.png) no-repeat;");
+ aboutDialog.setStyleSheet("background:#fff url(:/UIElements/aboutFaceTrackNoIR.png) no-repeat;");
}
/** start tracking the face **/
@@ -1533,6 +1533,13 @@ int keyindex;
ui.chkInhibitY->setChecked (iniFile.value ( "Inhibit_Y", 0 ).toBool());
ui.chkInhibitZ->setChecked (iniFile.value ( "Inhibit_Z", 0 ).toBool());
+
+ // Reverse Axis
+ ui.chkEnableReverseAxis->setChecked (iniFile.value ( "Enable_ReverseAxis", 0 ).toBool());
+ ui.spinYawAngle4ReverseAxis->setValue( settings.value ( "RA_Yaw", 40 ).toInt() );
+ ui.spinZ_Pos4ReverseAxis->setValue( settings.value ( "RA_ZPos", -20 ).toInt() );
+ ui.spinZ_PosWhenReverseAxis->setValue( settings.value ( "RA_ToZPos", 50 ).toInt() );
+
iniFile.endGroup ();
settingsDirty = false;
@@ -1581,6 +1588,12 @@ void KeyboardShortcutDialog::save() {
iniFile.setValue ( "Inhibit_Y", ui.chkInhibitY->isChecked() );
iniFile.setValue ( "Inhibit_Z", ui.chkInhibitZ->isChecked() );
+ // Reverse Axis
+ iniFile.setValue ( "Enable_ReverseAxis", ui.chkEnableReverseAxis->isChecked() );
+ settings.setValue( "RA_Yaw", ui.spinYawAngle4ReverseAxis->value() );
+ settings.setValue( "RA_ZPos", ui.spinZ_Pos4ReverseAxis->value() );
+ settings.setValue( "RA_ToZPos", ui.spinZ_PosWhenReverseAxis->value() );
+
iniFile.endGroup ();
settingsDirty = false;
diff --git a/FaceTrackNoIR/FaceTrackNoIR.qrc b/FaceTrackNoIR/FaceTrackNoIR.qrc
index 10cdcd14..b24c4e2f 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.qrc
+++ b/FaceTrackNoIR/FaceTrackNoIR.qrc
@@ -16,5 +16,6 @@
<file>images/FSX.ico</file>
<file>images/PPJoy.ico</file>
<file>images/TrackIR.ico</file>
+ <file>UIElements/aboutFaceTrackNoIR.png</file>
</qresource>
</RCC>
diff --git a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest
index c534db75..9ae90f83 100644
--- a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest
+++ b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest
@@ -2,12 +2,12 @@
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
+ <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
+ <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
diff --git a/faceAPI/main.cpp b/faceAPI/main.cpp
index 48b7300b..2b46c713 100644
--- a/faceAPI/main.cpp
+++ b/faceAPI/main.cpp
@@ -328,6 +328,7 @@ void run()
if (pMemData) {
THROW_ON_ERROR(smVideoDisplayCreate(engine_handle,&video_display_handle,(smWindowHandle) pMemData->handle,TRUE));
THROW_ON_ERROR(smHTV2SetHeadPoseFilterLevel(engine_handle, pMemData->initial_filter_level));
+ pMemData->handshake = 0;
}
else {
THROW_ON_ERROR(smVideoDisplayCreate(engine_handle,&video_display_handle,0,TRUE));
@@ -385,7 +386,17 @@ void run()
//
THROW_ON_ERROR(smEngineGetState(engine_handle, &state));
pMemData->state = state;
-
+ pMemData->handshake += 1;
+
+ //
+ // Check if FaceTrackNoIR is still 'in contact'.
+ // FaceTrackNoIR will reset the handshake, every time in writes data.
+ // If the value rises too high, this exe will stop itself...
+ //
+ if ( pMemData->handshake > 200) {
+ stopCommand = TRUE;
+ }
+
//
// Check if a command was issued and do something with it!
//