From c6bf844769902c2eda1cb0789dd5872fe9d962ac Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Sun, 13 Jun 2010 15:44:02 +0000 Subject: PPJoy settings dialog added. First try. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@12 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FaceTrackNoIR/ClientFiles/FlightGear/Readme.txt | 3 + FaceTrackNoIR/ClientFiles/FreeTrackTest/Readme.txt | 20 +++ .../ClientFiles/GlovePIE/FaceTrackNoIR2TrackIR.PIE | 16 ++ FaceTrackNoIR/ClientFiles/GlovePIE/Readme.txt | 24 +++ .../PPJoy/PPJoy mapping for FaceTrackNoIR.jpg | Bin 0 -> 155205 bytes FaceTrackNoIR/ClientFiles/PPJoy/Readme.txt | 24 +++ FaceTrackNoIR/ClientFiles/Tir4Fun/NPClient.dll | Bin 0 -> 53248 bytes FaceTrackNoIR/ClientFiles/Tir4Fun/readme.txt | 9 + FaceTrackNoIR/ClientFiles/Tir4Fun/tir4fun.exe | Bin 0 -> 36864 bytes FaceTrackNoIR/FTNoIR_ppjoycontrols.ui | 184 +++++++++++++++++++++ FaceTrackNoIR/FaceTrackNoIR.cpp | 19 +++ FaceTrackNoIR/FaceTrackNoIR.h | 2 + FaceTrackNoIR/FaceTrackNoIR.ui | 22 +++ FaceTrackNoIR/FaceTrackNoIR.vcproj | 32 +++- FaceTrackNoIR/GeneratedFiles/qrc_FaceTrackNoIR.cpp | 2 +- .../GeneratedFiles/ui_FTNoIR_ppjoycontrols.h | 148 +++++++++++++++++ FaceTrackNoIR/GeneratedFiles/ui_FaceTrackNoIR.h | 12 +- FaceTrackNoIR/PPJoyServer.cpp | 51 +++++- FaceTrackNoIR/PPJoyServer.h | 22 ++- FaceTrackNoIR/Release/BuildLog.htm | Bin 10992 -> 11008 bytes FaceTrackNoIR/Release/mt.dep | 2 +- FaceTrackNoIR/Release/vc90.idb | Bin 2624512 -> 2624512 bytes 22 files changed, 578 insertions(+), 14 deletions(-) create mode 100644 FaceTrackNoIR/ClientFiles/FreeTrackTest/Readme.txt create mode 100644 FaceTrackNoIR/ClientFiles/GlovePIE/FaceTrackNoIR2TrackIR.PIE create mode 100644 FaceTrackNoIR/ClientFiles/GlovePIE/Readme.txt create mode 100644 FaceTrackNoIR/ClientFiles/PPJoy/PPJoy mapping for FaceTrackNoIR.jpg create mode 100644 FaceTrackNoIR/ClientFiles/PPJoy/Readme.txt create mode 100644 FaceTrackNoIR/ClientFiles/Tir4Fun/NPClient.dll create mode 100644 FaceTrackNoIR/ClientFiles/Tir4Fun/readme.txt create mode 100644 FaceTrackNoIR/ClientFiles/Tir4Fun/tir4fun.exe create mode 100644 FaceTrackNoIR/FTNoIR_ppjoycontrols.ui create mode 100644 FaceTrackNoIR/GeneratedFiles/ui_FTNoIR_ppjoycontrols.h (limited to 'FaceTrackNoIR') diff --git a/FaceTrackNoIR/ClientFiles/FlightGear/Readme.txt b/FaceTrackNoIR/ClientFiles/FlightGear/Readme.txt index db3bdd8e..c86ffffe 100644 --- a/FaceTrackNoIR/ClientFiles/FlightGear/Readme.txt +++ b/FaceTrackNoIR/ClientFiles/FlightGear/Readme.txt @@ -14,3 +14,6 @@ The FaceTrackNoIR team: Wim Vriend Ron Hendriks + + +Disclaimer: For usage of 3rd party software like FlightGear, the FaceTrackNoIR team is not responsible. Use it at your own risk. \ No newline at end of file diff --git a/FaceTrackNoIR/ClientFiles/FreeTrackTest/Readme.txt b/FaceTrackNoIR/ClientFiles/FreeTrackTest/Readme.txt new file mode 100644 index 00000000..54f3ccd1 --- /dev/null +++ b/FaceTrackNoIR/ClientFiles/FreeTrackTest/Readme.txt @@ -0,0 +1,20 @@ +FaceTrackNoIR for Free-track 'enabled' games. + +FaceTrackNoIR was made compatible with the Free-track protocol, for which the Free-track source (a well, part of it) was +translated from Delphi Pascal to C++ (Visual Studio C++, with Qt). + +To start the Free-track protocol-server in FaceTrackNoIR, select Free-track in the 'game-protocol' listbox. The program +'FreeTrackTest.exe' is provided to check, if the protocol-server is running. + +FreeTrackTest.exe was created by the Free-track team. + + + +The FaceTrackNoIR team: + +Wim Vriend +Ron Hendriks + + + +Disclaimer: For usage of 3rd party software like FreeTrackTest, the FaceTrackNoIR team is not responsible. Use it at your own risk. \ No newline at end of file diff --git a/FaceTrackNoIR/ClientFiles/GlovePIE/FaceTrackNoIR2TrackIR.PIE b/FaceTrackNoIR/ClientFiles/GlovePIE/FaceTrackNoIR2TrackIR.PIE new file mode 100644 index 00000000..745da7c6 --- /dev/null +++ b/FaceTrackNoIR/ClientFiles/GlovePIE/FaceTrackNoIR2TrackIR.PIE @@ -0,0 +1,16 @@ +// +// 6 Degrees of Freedom Headtracking with FaceTrackNoIR +// 2010 by Wim Vriend +// +pie.FrameRate = 120Hz +var.multiply = 1.5 +var.R2D = 57.295781 +FakeTrackIR.pitch=(Joystick.pitch - 0.10) * var.R2D * var.multiply +FakeTrackIR.yaw=(Joystick.yaw - 0.10) * var.R2D * var.multiply +FakeTrackIR.roll=(Joystick.roll - 0.10) * var.R2D * var.multiply +FakeTrackIR.x=(Joystick.x - 0.10) * var.R2D * var.multiply +FakeTrackIR.y=(Joystick.y - 0.10) * var.R2D * var.multiply +FakeTrackIR.z=(Joystick.z - 0.10) * var.R2D * var.multiply +debug = 'pitch='+FakeTrackIR.pitch+' roll='+FakeTrackIR.roll+' yaw='+FakeTrackIR.yaw+' xyz=('+FakeTrackIR.x+','+FakeTrackIR.y+','+FakeTrackIR.z+')' +//debug = FakeTrackIR.active + diff --git a/FaceTrackNoIR/ClientFiles/GlovePIE/Readme.txt b/FaceTrackNoIR/ClientFiles/GlovePIE/Readme.txt new file mode 100644 index 00000000..db88fdc8 --- /dev/null +++ b/FaceTrackNoIR/ClientFiles/GlovePIE/Readme.txt @@ -0,0 +1,24 @@ +FaceTrackNoIR for PPJoy 'enabled' games/programs. + +FaceTrackNoIR was made compatible with the PPJoy virtual joystick(s), that can be used by various other programs as input. GlovePIE is one of the most powerfull we know (we have also tried tir4fun, but that is quite limited). + +To start the PPJoy protocol-server in FaceTrackNoIR, select Virtual Joystick in the 'game-protocol' listbox. The +settings, necessary to configure PPJoy for FaceTrackNoIR as included in the PPJoy folder. + +GlovePIE was made by Carl Kenner and may NOT be used for military purposes. You can download it from the website +http://glovepie.org/glovepie.php + +The script FaceTrackNoIR2TrackIR.PIE, which was included in this folder, surves as an example for GlovePIE. If anyone +want to use, change or improve it: feel free to do so. In fact, if you do, we would like to receive a copy :-) + +Regards, + + +The FaceTrackNoIR team: + +Wim Vriend +Ron Hendriks + + + +Disclaimer: For usage of 3rd party software like GlovePIE, the FaceTrackNoIR team is not responsible. Use it at your own risk. \ No newline at end of file diff --git a/FaceTrackNoIR/ClientFiles/PPJoy/PPJoy mapping for FaceTrackNoIR.jpg b/FaceTrackNoIR/ClientFiles/PPJoy/PPJoy mapping for FaceTrackNoIR.jpg new file mode 100644 index 00000000..052c6899 Binary files /dev/null and b/FaceTrackNoIR/ClientFiles/PPJoy/PPJoy mapping for FaceTrackNoIR.jpg differ diff --git a/FaceTrackNoIR/ClientFiles/PPJoy/Readme.txt b/FaceTrackNoIR/ClientFiles/PPJoy/Readme.txt new file mode 100644 index 00000000..3000ece6 --- /dev/null +++ b/FaceTrackNoIR/ClientFiles/PPJoy/Readme.txt @@ -0,0 +1,24 @@ +FaceTrackNoIR for PPJoy 'enabled' games/programs. + +FaceTrackNoIR was made compatible with the PPJoy virtual joystick(s), that can be used by various other programs as input. + +To start the PPJoy protocol-server in FaceTrackNoIR, select Virtual Joystick in the 'game-protocol' listbox. The +settings, necessary to configure PPJoy for FaceTrackNoIR as included in the PPJoy folder, in the file +PPJoy mapping for FaceTrackNoIR.jpg. + +PPJoy was made by Deon van der Westhuysen and is unfortunately not updated anymore. You can download it from the website +http://shareware.pcmag.com/free/Miscellaneous-Utilities/PPJoy/75176.html, but possibly from others as well... + + +Regards, + + +The FaceTrackNoIR team: + +Wim Vriend +Ron Hendriks + + + + +Disclaimer: For usage of 3rd party software like PPJoy, the FaceTrackNoIR team is not responsible. Use it at your own risk. \ No newline at end of file diff --git a/FaceTrackNoIR/ClientFiles/Tir4Fun/NPClient.dll b/FaceTrackNoIR/ClientFiles/Tir4Fun/NPClient.dll new file mode 100644 index 00000000..e392442e Binary files /dev/null and b/FaceTrackNoIR/ClientFiles/Tir4Fun/NPClient.dll differ diff --git a/FaceTrackNoIR/ClientFiles/Tir4Fun/readme.txt b/FaceTrackNoIR/ClientFiles/Tir4Fun/readme.txt new file mode 100644 index 00000000..010510db --- /dev/null +++ b/FaceTrackNoIR/ClientFiles/Tir4Fun/readme.txt @@ -0,0 +1,9 @@ +What is TIR4FUN? + +TIR4FUN is a free utility for dedicated gamers. It enables 6DOF POV control with mouse and joystick axes. + +Software is provided as it is. Configuration is straightforward. GUI says it all! + +Installation: + +Copy all files to a directory. Launch tir4fun.exe to bring up the GUI. diff --git a/FaceTrackNoIR/ClientFiles/Tir4Fun/tir4fun.exe b/FaceTrackNoIR/ClientFiles/Tir4Fun/tir4fun.exe new file mode 100644 index 00000000..a51eced0 Binary files /dev/null and b/FaceTrackNoIR/ClientFiles/Tir4Fun/tir4fun.exe differ diff --git a/FaceTrackNoIR/FTNoIR_ppjoycontrols.ui b/FaceTrackNoIR/FTNoIR_ppjoycontrols.ui new file mode 100644 index 00000000..91e1c0c6 --- /dev/null +++ b/FaceTrackNoIR/FTNoIR_ppjoycontrols.ui @@ -0,0 +1,184 @@ + + + UICPPJoyControls + + + + 0 + 0 + 346 + 180 + + + + Engine Controls + + + + :/Icons/sm_api_qt_icon.png:/Icons/sm_api_qt_icon.png + + + Qt::LeftToRight + + + false + + + + + + + + + 0 + 0 + + + + Virtual Joystick number: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + + + + + + 0 + 0 + + + + QFrame::Panel + + + QFrame::Sunken + + + TERMINATED + + + false + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + OK + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Cancel + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index de73a0b4..3f665e8b 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -24,6 +24,7 @@ #include "FaceTrackNoIR.h" #include "tracker.h" +#include "PPJoyServer.h" using namespace sm::faceapi; using namespace sm::faceapi::qt; @@ -36,6 +37,7 @@ QMainWindow(parent, flags) { cameraDetected = false; _engine_controls = 0; + _server_controls = 0; tracker = 0; _display = 0; l = 0; @@ -62,6 +64,7 @@ void FaceTrackNoIR::setupFaceTrackNoIR() { connect(ui.actionVideoWidget, SIGNAL(triggered()), this, SLOT(showVideoWidget())); connect(ui.actionHeadPoseWidget, SIGNAL(triggered()), this, SLOT(showHeadPoseWidget())); connect(ui.btnShowEngineControls, SIGNAL(clicked()), this, SLOT(showEngineControls())); + connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showServerControls())); // button methods connect with methods in this class connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); @@ -627,6 +630,22 @@ void FaceTrackNoIR::showEngineControls() { } } +/** toggles Server Controls Dialog **/ +void FaceTrackNoIR::showServerControls() { + if (!_server_controls) + { + qDebug() << "showServerControls says: No server_controls yet!"; + _server_controls = new PPJoyControls( this, Qt::Dialog ); + qDebug() << "showServerControls says: After new!"; + } + + if (_server_controls) { + qDebug() << "showServerControls says: Before show!"; + _server_controls->show(); + _server_controls->raise(); + } +} + /** exit application **/ void FaceTrackNoIR::exit() { QCoreApplication::exit(0); diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index e8ddda12..70f3f08d 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -61,6 +61,7 @@ private: VideoDisplayWidget *_display; QVBoxLayout *l; QWidget *_engine_controls; + QWidget *_server_controls; /** QT objects **/ QDialog aboutDialog; @@ -101,6 +102,7 @@ private: void showVideoWidget(); void showHeadPoseWidget(); void showEngineControls(); + void showServerControls(); // sensibility sliders void setSensYaw( int sens ); diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index 0cab62bc..cbd4c769 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -917,6 +917,28 @@ color:#000; 3 + + + true + + + + 10 + 80 + 161 + 23 + + + + Change tracker settings + + + + + + Settings + + diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj index da799291..9995eec2 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.vcproj +++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj @@ -1,7 +1,7 @@ + + + + + + + + @@ -566,6 +592,10 @@ RelativePath=".\GeneratedFiles\ui_FaceTrackNoIR.h" > + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_UICPPJoyControls +{ +public: + QVBoxLayout *_vertical_layout; + QHBoxLayout *hboxLayout; + QLabel *textLabel2; + QLabel *_engine_state_label; + QSpacerItem *verticalSpacer; + QHBoxLayout *horizontalLayout; + QSpacerItem *horizontalSpacer_2; + QHBoxLayout *horizontalLayout_2; + QPushButton *btnOK; + QPushButton *btnCancel; + QSpacerItem *horizontalSpacer; + + void setupUi(QWidget *UICPPJoyControls) + { + if (UICPPJoyControls->objectName().isEmpty()) + UICPPJoyControls->setObjectName(QString::fromUtf8("UICPPJoyControls")); + UICPPJoyControls->resize(346, 180); + QIcon icon; + icon.addFile(QString::fromUtf8(":/Icons/sm_api_qt_icon.png"), QSize(), QIcon::Normal, QIcon::Off); + UICPPJoyControls->setWindowIcon(icon); + UICPPJoyControls->setLayoutDirection(Qt::LeftToRight); + UICPPJoyControls->setAutoFillBackground(false); + _vertical_layout = new QVBoxLayout(UICPPJoyControls); + _vertical_layout->setObjectName(QString::fromUtf8("_vertical_layout")); + hboxLayout = new QHBoxLayout(); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + textLabel2 = new QLabel(UICPPJoyControls); + textLabel2->setObjectName(QString::fromUtf8("textLabel2")); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(textLabel2->sizePolicy().hasHeightForWidth()); + textLabel2->setSizePolicy(sizePolicy); + textLabel2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + textLabel2->setWordWrap(false); + + hboxLayout->addWidget(textLabel2); + + _engine_state_label = new QLabel(UICPPJoyControls); + _engine_state_label->setObjectName(QString::fromUtf8("_engine_state_label")); + QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(_engine_state_label->sizePolicy().hasHeightForWidth()); + _engine_state_label->setSizePolicy(sizePolicy1); + _engine_state_label->setFrameShape(QFrame::Panel); + _engine_state_label->setFrameShadow(QFrame::Sunken); + _engine_state_label->setWordWrap(false); + + hboxLayout->addWidget(_engine_state_label); + + + _vertical_layout->addLayout(hboxLayout); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + _vertical_layout->addItem(verticalSpacer); + + horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer_2); + + horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setSizeConstraint(QLayout::SetDefaultConstraint); + btnOK = new QPushButton(UICPPJoyControls); + btnOK->setObjectName(QString::fromUtf8("btnOK")); + sizePolicy1.setHeightForWidth(btnOK->sizePolicy().hasHeightForWidth()); + btnOK->setSizePolicy(sizePolicy1); + btnOK->setMinimumSize(QSize(100, 0)); + btnOK->setMaximumSize(QSize(100, 16777215)); + + horizontalLayout_2->addWidget(btnOK); + + btnCancel = new QPushButton(UICPPJoyControls); + btnCancel->setObjectName(QString::fromUtf8("btnCancel")); + sizePolicy1.setHeightForWidth(btnCancel->sizePolicy().hasHeightForWidth()); + btnCancel->setSizePolicy(sizePolicy1); + btnCancel->setMinimumSize(QSize(100, 0)); + btnCancel->setMaximumSize(QSize(100, 16777215)); + + horizontalLayout_2->addWidget(btnCancel); + + + horizontalLayout->addLayout(horizontalLayout_2); + + horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer); + + + _vertical_layout->addLayout(horizontalLayout); + + + retranslateUi(UICPPJoyControls); + + QMetaObject::connectSlotsByName(UICPPJoyControls); + } // setupUi + + void retranslateUi(QWidget *UICPPJoyControls) + { + UICPPJoyControls->setWindowTitle(QApplication::translate("UICPPJoyControls", "Engine Controls", 0, QApplication::UnicodeUTF8)); + textLabel2->setText(QApplication::translate("UICPPJoyControls", "Virtual Joystick number:", 0, QApplication::UnicodeUTF8)); + _engine_state_label->setText(QApplication::translate("UICPPJoyControls", "TERMINATED", 0, QApplication::UnicodeUTF8)); + btnOK->setText(QApplication::translate("UICPPJoyControls", "OK", 0, QApplication::UnicodeUTF8)); + btnCancel->setText(QApplication::translate("UICPPJoyControls", "Cancel", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class UICPPJoyControls: public Ui_UICPPJoyControls {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_FTNOIR_PPJOYCONTROLS_H diff --git a/FaceTrackNoIR/GeneratedFiles/ui_FaceTrackNoIR.h b/FaceTrackNoIR/GeneratedFiles/ui_FaceTrackNoIR.h index e6a0fa02..03e07ccb 100644 --- a/FaceTrackNoIR/GeneratedFiles/ui_FaceTrackNoIR.h +++ b/FaceTrackNoIR/GeneratedFiles/ui_FaceTrackNoIR.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'FaceTrackNoIR.ui' ** -** Created: Tue 8. Jun 22:08:00 2010 +** Created: Sun 13. Jun 16:10:04 2010 ** by: Qt User Interface Compiler version 4.6.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -87,6 +87,7 @@ public: QPushButton *btnStopTracker; QGroupBox *groupGameProtocol; QComboBox *iconcomboBox; + QPushButton *btnShowServerControls; QGridLayout *gridLayout_2; QLabel *lblSensYaw_3; QSlider *slideSmoothing; @@ -522,6 +523,11 @@ public: iconcomboBox->setGeometry(QRect(10, 20, 151, 22)); iconcomboBox->setStyleSheet(QString::fromUtf8("")); iconcomboBox->setMaxVisibleItems(3); + btnShowServerControls = new QPushButton(groupGameProtocol); + btnShowServerControls->setObjectName(QString::fromUtf8("btnShowServerControls")); + btnShowServerControls->setEnabled(true); + btnShowServerControls->setGeometry(QRect(10, 80, 161, 23)); + btnShowServerControls->setStyleSheet(QString::fromUtf8("")); horizontalLayout_3->addWidget(groupGameProtocol); @@ -1218,6 +1224,10 @@ public: #endif // QT_NO_TOOLTIP btnStopTracker->setText(QApplication::translate("FaceTrackNoIRClass", "Stop", 0, QApplication::UnicodeUTF8)); groupGameProtocol->setTitle(QApplication::translate("FaceTrackNoIRClass", "Game protocol", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + btnShowServerControls->setToolTip(QApplication::translate("FaceTrackNoIRClass", "Change tracker settings", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + btnShowServerControls->setText(QApplication::translate("FaceTrackNoIRClass", "Settings", 0, QApplication::UnicodeUTF8)); lblSensYaw_3->setText(QApplication::translate("FaceTrackNoIRClass", "Global settings", 0, QApplication::UnicodeUTF8)); chkUseEWMA->setText(QString()); lblSensYaw_5->setText(QApplication::translate("FaceTrackNoIRClass", "Use EWMA filtering:", 0, QApplication::UnicodeUTF8)); diff --git a/FaceTrackNoIR/PPJoyServer.cpp b/FaceTrackNoIR/PPJoyServer.cpp index 53b6322b..a33ceb34 100644 --- a/FaceTrackNoIR/PPJoyServer.cpp +++ b/FaceTrackNoIR/PPJoyServer.cpp @@ -30,8 +30,8 @@ #include "Tracker.h" #include -long PPJoyServer::PPJoyCorrection = 1470; -long PPJoyServer::analogDefault = (PPJOY_AXIS_MIN+PPJOY_AXIS_MAX)/2 - PPJoyServer::PPJoyCorrection; +//long PPJoyServer::PPJoyCorrection = 1470; +//long PPJoyServer::analogDefault = (PPJOY_AXIS_MIN+PPJOY_AXIS_MAX)/2 - PPJoyServer::PPJoyCorrection; static const char* DevName = "\\\\.\\PPJoyIOCTL1"; /** constructor **/ @@ -51,7 +51,7 @@ PPJoyServer::PPJoyServer( Tracker *parent ) { } /* Open a handle to the control device for the first virtual joystick. */ - /* Virtual joystick devices are names PPJoyIOCTL1 to PPJoyIOCTL16. */ + /* Virtual joystick devices are named PPJoyIOCTL1 to PPJoyIOCTL16. */ h = CreateFileA((LPCSTR) DevName,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL); /* Make sure we could open the device! */ @@ -111,16 +111,15 @@ void PPJoyServer::run() { } // The effective angle for faceTracking will be < 90 degrees, so we assume a smaller range here - Analog[0] = scale2AnalogLimits( virtRotX, -50.0f, 50.0f ); // Pitch - qDebug() << "PPJoyServer says: Pitch =" << Analog[0] << " VirtRotX =" << virtRotX ; - Analog[1] = scale2AnalogLimits( virtRotY, -50.0f, 50.0f ); // Yaw - Analog[2] = scale2AnalogLimits( virtRotZ, -50.0f, 50.0f ); // Roll + Analog[0] = scale2AnalogLimits( virtRotX, -50.0f, 50.0f ); // Pitch + Analog[1] = scale2AnalogLimits( virtRotY, -50.0f, 50.0f ); // Yaw + Analog[2] = scale2AnalogLimits( virtRotZ, -50.0f, 50.0f ); // Roll // The effective movement for faceTracking will be < 50 cm, so we assume a smaller range here Analog[3] = scale2AnalogLimits( virtPosX, -40.0f, 40.0f ); // X - Analog[5] = scale2AnalogLimits( virtPosY, -40.0f, 40.0f ); // Y (5?) - Analog[6] = scale2AnalogLimits( virtPosZ, -40.0f, 40.0f ); // Z (6?) + Analog[4] = scale2AnalogLimits( virtPosY, -40.0f, 40.0f ); // Y + Analog[5] = scale2AnalogLimits( virtPosZ, -40.0f, 40.0f ); // Z checkAnalogLimits(); @@ -162,4 +161,38 @@ double y; return (long) y; } + +// +// Constructor for server-settings-dialog +// +PPJoyControls::PPJoyControls( QWidget *parent, Qt::WindowFlags f ) : +QWidget( parent , f) +{ + ui.setupUi( this ); + + connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); + connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); +} + +// +// Destructor for server-dialog +// +PPJoyControls::~PPJoyControls() { +} + +// +// OK clicked on server-dialog +// +void PPJoyControls::doOK() { + qDebug() << "doOK clicked"; +} + +// +// Cancel clicked on server-dialog +// +void PPJoyControls::doCancel() { + qDebug() << "doCancel clicked"; + this->close(); +} + //END diff --git a/FaceTrackNoIR/PPJoyServer.h b/FaceTrackNoIR/PPJoyServer.h index 83b3617a..72d17bd1 100644 --- a/FaceTrackNoIR/PPJoyServer.h +++ b/FaceTrackNoIR/PPJoyServer.h @@ -39,6 +39,8 @@ #include #include +#include "ui_FTNoIR_ppjoycontrols.h" + using namespace std; class Tracker; // pre-define parent-class to avoid circular includes @@ -87,7 +89,7 @@ private: long *Analog; char *Digital; - static long analogDefault,PPJoyCorrection; +// static long analogDefault,PPJoyCorrection; long centerPos[3],centerRot[3]; /** member variables for saving the head pose **/ @@ -112,6 +114,24 @@ public: }; +// Widget that has controls for PPJoy server-settings. +class PPJoyControls: public QWidget, public Ui::UICPPJoyControls +{ + Q_OBJECT +public: + + explicit PPJoyControls( QWidget *parent=0, Qt::WindowFlags f=0 ); + virtual ~PPJoyControls(); + +private: + Ui::UICPPJoyControls ui; + +private slots: + void doOK(); + void doCancel(); + +}; + #endif//INCLUDED_PPJOYSERVER_H //END diff --git a/FaceTrackNoIR/Release/BuildLog.htm b/FaceTrackNoIR/Release/BuildLog.htm index 2d07dae3..036a7314 100644 Binary files a/FaceTrackNoIR/Release/BuildLog.htm and b/FaceTrackNoIR/Release/BuildLog.htm differ diff --git a/FaceTrackNoIR/Release/mt.dep b/FaceTrackNoIR/Release/mt.dep index 506fca00..68cbc7ef 100644 --- a/FaceTrackNoIR/Release/mt.dep +++ b/FaceTrackNoIR/Release/mt.dep @@ -1 +1 @@ -Manifest resource last updated at 11:22:50.41 on za 12-06-2010 +Manifest resource last updated at 17:39:08.17 on zo 13-06-2010 diff --git a/FaceTrackNoIR/Release/vc90.idb b/FaceTrackNoIR/Release/vc90.idb index 1015061a..7adfbd55 100644 Binary files a/FaceTrackNoIR/Release/vc90.idb and b/FaceTrackNoIR/Release/vc90.idb differ -- cgit v1.2.3