From 1ef199b2369d78558df6c706592ae1def10adfd7 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Mon, 15 Aug 2011 11:48:23 +0000 Subject: Some minor changes to the interface. Also moved to new dev.hardware git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@89 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj | 8 +- FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj | 12 +- .../FTNoIR_Protocol_FSUIPC.vcproj | 16 +- FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj | 12 +- FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui | 201 +++++++++++++++------ FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp | 17 +- FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h | 1 + FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj | 12 +- FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj | 12 +- FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj | 12 +- FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj | 12 +- FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj | 14 +- FTNoIR_Tracker_Base/ftnoir_tracker_sm_types.h | 1 + FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj | 12 +- FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp | 19 +- FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP.vcproj | 12 +- FaceTrackNoIR.suo | Bin 417792 -> 449536 bytes FaceTrackNoIR/FaceTrackNoIR.cpp | 15 +- FaceTrackNoIR/FaceTrackNoIR.vcproj | 18 +- .../FaceTrackNoIR.exe.intermediate.manifest | 5 + faceAPI/FaceAPI2FSX.vcproj | 6 +- faceAPI/main.cpp | 4 +- 22 files changed, 269 insertions(+), 152 deletions(-) diff --git a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj index 4ff53df2..ebea3e36 100644 --- a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj +++ b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj @@ -1,7 +1,7 @@ @@ -209,7 +209,7 @@ @@ -318,7 +318,7 @@ /> @@ -206,7 +206,7 @@ @@ -315,7 +315,7 @@ /> @@ -205,7 +205,7 @@ @@ -318,7 +318,7 @@ /> 0 0 - 411 - 157 + 588 + 216 @@ -25,31 +25,151 @@ - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - Use TIRViews - - - - + + + + 0 + 70 + + + + TIRViews + + + + + 70 + 20 + 88 + 17 + + + + Qt::RightToLeft + + + Use TIRViews + + + + + + 180 + 10 + 301 + 16 + + + + TIRViews is only required for some older games (like CFS3). + + + + + + 180 + 30 + 421 + 16 + + + + For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder. + + + true + + + + + + 180 + 50 + 251 + 16 + + + + If the checkbox is disabled, the DLL was not found. + + + + + + + + + 0 + 70 + + + + TrackIR.exe + + + + + 13 + 20 + 145 + 17 + + + + Qt::RightToLeft + + + Start dummy TrackIR.exe + + + + + + 180 + 10 + 351 + 16 + + + + Some programs check, to see if a process called TrackIR.exe is running, + + + + + + 180 + 30 + 261 + 16 + + + + before enabling head-tracking (EZCA is one of them). + + + true + + + + + + 180 + 50 + 231 + 16 + + + + Check the checkbox, to overcome this problem. + + + chkStartDummy + label_2 + label + label_3 + groupBox + @@ -65,32 +185,7 @@ - - - - - TIRViews is only required for some older games (like CFS3). - - - - - - - For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder. - - - true - - - - - - - If the checkbox is disabled, the DLL was not found. - - - - + diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp index 83b21f7b..82857745 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp @@ -62,9 +62,11 @@ FTNoIR_Protocol_FTIR::~FTNoIR_Protocol_FTIR() // // Kill the dummy TrackIR process. // - qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; +// qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; try { if (dummyTrackIR) { + qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; +// dummyTrackIR->close(); dummyTrackIR->kill(); } } @@ -115,6 +117,7 @@ void FTNoIR_Protocol_FTIR::loadSettings() { iniFile.beginGroup ( "FTIR" ); useTIRViews = iniFile.value ( "useTIRViews", 0 ).toBool(); + useDummyExe = iniFile.value ( "useDummyExe", 1 ).toBool(); iniFile.endGroup (); } @@ -217,9 +220,11 @@ bool FTNoIR_Protocol_FTIR::checkServerInstallationOK( HANDLE handle ) // Some TrackIR clients check if a process called TrackIR.exe is running. // This should do the trick // - QString program = "TrackIR.exe"; - dummyTrackIR = new QProcess(); - dummyTrackIR->start(program); + if (useDummyExe) { + QString program = "TrackIR.exe"; + dummyTrackIR = new QProcess(); + dummyTrackIR->start(program); + } } catch(...) { settings.~QSettings(); @@ -380,6 +385,7 @@ QWidget() connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); connect(ui.chkTIRViews, SIGNAL(stateChanged(int)), this, SLOT(chkTIRViewsChanged())); + connect(ui.chkStartDummy, SIGNAL(stateChanged(int)), this, SLOT(settingChanged())); aFileName = QCoreApplication::applicationDirPath() + "/"; aFileName.append(FTIR_VIEWS_FILENAME); @@ -479,6 +485,8 @@ void FTIRControls::loadSettings() { iniFile.beginGroup ( "FTIR" ); ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool()); + ui.chkStartDummy->setChecked (iniFile.value ( "useDummyExe", 1 ).toBool()); + iniFile.endGroup (); settingsDirty = false; @@ -495,6 +503,7 @@ void FTIRControls::save() { iniFile.beginGroup ( "FTIR" ); iniFile.setValue ( "useTIRViews", ui.chkTIRViews->isChecked() ); + iniFile.setValue ( "useDummyExe", ui.chkStartDummy->isChecked() ); iniFile.endGroup (); settingsDirty = false; diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h index 59454e90..6307c6a1 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h @@ -76,6 +76,7 @@ private: QLibrary FTIRViewsLib; QProcess *dummyTrackIR; bool useTIRViews; + bool useDummyExe; float scale2AnalogLimits( float x, float min_x, float max_x ); void loadSettings(); diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj index ca3f797e..6e4b6c35 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj @@ -1,7 +1,7 @@ @@ -209,7 +209,7 @@ @@ -318,7 +318,7 @@ /> @@ -205,7 +205,7 @@ @@ -314,7 +314,7 @@ /> @@ -205,7 +205,7 @@ @@ -314,7 +314,7 @@ /> @@ -205,7 +205,7 @@ @@ -318,7 +318,7 @@ /> @@ -206,7 +206,7 @@ @@ -315,7 +315,7 @@ /> @@ -197,7 +197,7 @@ @@ -306,7 +306,7 @@ /> command = 0; // Reset any and all commands pMemData->handle = videoframe->winId(); // Handle of Videoframe widget @@ -158,9 +159,11 @@ void FTNoIR_Tracker_SM::loadSettings() { qDebug() << "FTNoIR_Tracker_SM::loadSettings says: iniFile = " << currentFile; - //iniFile.beginGroup ( "FTNClient" ); - //setParameterValue(kPortAddress, (float) iniFile.value ( "PortNumber", 5550 ).toInt()); - //iniFile.endGroup (); + iniFile.beginGroup ( "SMTracker" ); + if (pMemData) { + pMemData->initial_filter_level = iniFile.value ( "FilterLevel", 1 ).toInt(); + } + iniFile.endGroup (); } // @@ -359,9 +362,8 @@ void SMClientControls::loadSettings() { // qDebug() << "loadSettings says: iniFile = " << currentFile; - iniFile.beginGroup ( "SMClient" ); - -// ui.spinPortNumber->setValue( iniFile.value ( "PortNumber", 5550 ).toInt() ); + iniFile.beginGroup ( "SMTracker" ); + ui.cbxFilterSetting->setCurrentIndex(iniFile.value ( "FilterLevel", 1 ).toInt()); iniFile.endGroup (); settingsDirty = false; @@ -377,7 +379,8 @@ void SMClientControls::save() { QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - iniFile.beginGroup ( "SMClient" ); + iniFile.beginGroup ( "SMTracker" ); + iniFile.setValue ( "FilterLevel", ui.cbxFilterSetting->currentIndex() ); iniFile.endGroup (); settingsDirty = false; diff --git a/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP.vcproj b/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP.vcproj index 2e01f009..b1b383c0 100644 --- a/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP.vcproj +++ b/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP.vcproj @@ -1,7 +1,7 @@ @@ -205,7 +205,7 @@ @@ -314,7 +314,7 @@ /> display((double) (((int)(newdata.x * 10.0f))/10.0f)); - ui.lcdNumY->display((double) (((int)(newdata.y * 10.0f))/10.0f)); - ui.lcdNumZ->display((double) (((int)(newdata.z * 10.0f))/10.0f)); + ui.lcdNumX->display(QString("%1").arg(newdata.x, 0, 'f', 1)); + ui.lcdNumY->display(QString("%1").arg(newdata.y, 0, 'f', 1)); + ui.lcdNumZ->display(QString("%1").arg(newdata.z, 0, 'f', 1)); - ui.lcdNumRotX->display((double) (((int)(newdata.yaw * 10.0f))/10.0f)); - ui.lcdNumRotY->display((double) (((int)(newdata.pitch * 10.0f))/10.0f)); - ui.lcdNumRotZ->display((double) (((int)(newdata.roll * 10.0f))/10.0f)); + ui.lcdNumRotX->display(QString("%1").arg(newdata.yaw, 0, 'f', 1)); + ui.lcdNumRotY->display(QString("%1").arg(newdata.pitch, 0, 'f', 1)); + ui.lcdNumRotZ->display(QString("%1").arg(newdata.roll, 0, 'f', 1)); ui.txtTracking->setVisible(Tracker::getTrackingActive()); ui.txtAxisReverse->setVisible(Tracker::getAxisReverse()); diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj index 837d7f69..e682f785 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.vcproj +++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj @@ -1,7 +1,7 @@ @@ -264,7 +264,7 @@ @@ -290,7 +290,7 @@ @@ -316,7 +316,7 @@ @@ -342,7 +342,7 @@ @@ -372,7 +372,7 @@ diff --git a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest index 324c707e..c534db75 100644 --- a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest +++ b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest @@ -5,4 +5,9 @@ + + + + + diff --git a/faceAPI/FaceAPI2FSX.vcproj b/faceAPI/FaceAPI2FSX.vcproj index e936c79c..ce6249d9 100644 --- a/faceAPI/FaceAPI2FSX.vcproj +++ b/faceAPI/FaceAPI2FSX.vcproj @@ -1,7 +1,7 @@ handle,TRUE)); + THROW_ON_ERROR(smHTV2SetHeadPoseFilterLevel(engine_handle, pMemData->initial_filter_level)); } else { THROW_ON_ERROR(smVideoDisplayCreate(engine_handle,&video_display_handle,0,TRUE)); -- cgit v1.2.3