diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-04-07 17:42:45 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-04-07 17:42:45 +0000 |
commit | ee1e90c6e0eba92b69cdeb2dffb3a246d006dda1 (patch) | |
tree | 21d331b5f8c95bfdf01ad0c3bebd91dc691a7c38 | |
parent | 415eab9477fb8d8550cdb17c00d4c41c0dc33f88 (diff) |
PPJoy in DLL
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@63 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r-- | FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.cpp b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.cpp index 95c83958..3adfa8d4 100644 --- a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.cpp +++ b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.cpp @@ -32,9 +32,11 @@ is called from run() of Tracker.cpp
*/
#include "ftnoir_protocol_fg.h"
+#include <QFile>
// For Todd
-//#define SEND_ASCII_DATA
+//#define SEND_ASCII_DATA
+//#define LOG_OUTPUT
/** constructor **/
FTNoIR_Protocol_FG::FTNoIR_Protocol_FG()
@@ -107,9 +109,9 @@ char data[100]; //
// Copy the Raw measurements directly to the client.
//
- FlightData.x = headpose->position.x / 100.0f;
- FlightData.y = headpose->position.y / 100.0f;
- FlightData.z = headpose->position.z / 100.0f;
+ FlightData.x = headpose->position.x;
+ FlightData.y = headpose->position.y;
+ FlightData.z = headpose->position.z;
FlightData.p = headpose->position.pitch;
FlightData.h = headpose->position.yaw;
FlightData.r = headpose->position.roll;
@@ -120,7 +122,7 @@ char data[100]; //
#ifdef SEND_ASCII_DATA
- sprintf_s(data, "%.4f;%.4f;%.4f;%.2f;%.2f;%.2f\n\0", FlightData.x, FlightData.y, FlightData.z, FlightData.p, FlightData.h, FlightData.r);
+ sprintf_s(data, "%.2f;%.2f;%.2f;%.2f;%.2f;%.2f\n\0", FlightData.x, FlightData.y, FlightData.z, FlightData.p, FlightData.h, FlightData.r);
if (outSocket != 0) {
no_bytes = outSocket->writeDatagram((const char *) &data, strlen( data ), destIP, destPort);
@@ -134,6 +136,15 @@ char data[100]; #endif
+ #ifdef LOG_OUTPUT
+ // Use this for some debug-output to file...
+ QFile datafile(QCoreApplication::applicationDirPath() + "\\FG_output.txt");
+ if (datafile.open(QFile::WriteOnly | QFile::Append)) {
+ QTextStream out(&datafile);
+ out << "output:\t" << FlightData.x << "\t" << FlightData.y << "\t" << FlightData.z << "\t" << FlightData.p << "\t" << FlightData.h << "\t" << FlightData.r << '\n';
+ }
+ #endif
+
#ifndef SEND_ASCII_DATA
//! [1]
// no_bytes = outSocket->writeDatagram((const char *) &FlightData, sizeof( FlightData ), QHostAddress::LocalHost, 5550);
|