From 17fcad9850754d2d0ec662c46e7940b07b64804c Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Sat, 22 Oct 2011 15:28:38 +0000 Subject: git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@94 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Protocol_FG/FTNoIR_FGcontrols.ui | 2 +- FTNoIR_Protocol_FTN/FTNoIR_FTNControls.ui | 2 +- FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp | 4 +++ FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h | 1 + FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui | 36 +++++++++++++++------- FaceTrackNoIR/FaceTrackNoIR.cpp | 19 ++++++++++-- FaceTrackNoIR/FaceTrackNoIR.qrc | 1 + .../FaceTrackNoIR.exe.intermediate.manifest | 4 +-- faceAPI/main.cpp | 13 +++++++- 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 @@ - 5550 + 1000 10000 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 @@ - 5550 + 1000 10000 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 @@ - + Yaw angle for Reverse Axis - + @@ -585,7 +585,7 @@ - + Qt::Horizontal @@ -598,21 +598,21 @@ - + degrees - + - Yaw angle for Reverse Axis + Z-position for Reverse Axis - + @@ -631,21 +631,21 @@ - + cm - + When Reverse: - + @@ -664,13 +664,27 @@ - + cm + + + + Enable Revers Axis + + + + + + + + + + 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 @@ images/FSX.ico images/PPJoy.ico images/TrackIR.ico + UIElements/aboutFaceTrackNoIR.png 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 @@ - + - + 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! // -- cgit v1.2.3