From aa066bdd4622d4f6824fee864f6be6806813f04d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 30 Oct 2015 07:37:41 +0100 Subject: move to subdirectory-based build system Closes #224 --- ftnoir_protocol_fg/fg-protocol.qrc | 5 - ftnoir_protocol_fg/fgtypes.h | 27 ----- ftnoir_protocol_fg/ftnoir_fgcontrols.ui | 143 ----------------------- ftnoir_protocol_fg/ftnoir_protocol_fg.cpp | 38 ------ ftnoir_protocol_fg/ftnoir_protocol_fg.h | 69 ----------- ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp | 46 -------- ftnoir_protocol_fg/images/flightgear.png | Bin 979 -> 0 bytes 7 files changed, 328 deletions(-) delete mode 100644 ftnoir_protocol_fg/fg-protocol.qrc delete mode 100644 ftnoir_protocol_fg/fgtypes.h delete mode 100644 ftnoir_protocol_fg/ftnoir_fgcontrols.ui delete mode 100644 ftnoir_protocol_fg/ftnoir_protocol_fg.cpp delete mode 100644 ftnoir_protocol_fg/ftnoir_protocol_fg.h delete mode 100644 ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp delete mode 100644 ftnoir_protocol_fg/images/flightgear.png (limited to 'ftnoir_protocol_fg') diff --git a/ftnoir_protocol_fg/fg-protocol.qrc b/ftnoir_protocol_fg/fg-protocol.qrc deleted file mode 100644 index 1c685437..00000000 --- a/ftnoir_protocol_fg/fg-protocol.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - images/flightgear.png - - diff --git a/ftnoir_protocol_fg/fgtypes.h b/ftnoir_protocol_fg/fgtypes.h deleted file mode 100644 index 2e493f46..00000000 --- a/ftnoir_protocol_fg/fgtypes.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of the some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* Homepage * -* * -* Type definitions for the FlightGear server. * -********************************************************************************/ -#pragma once -#ifndef INCLUDED_FGTYPES_H -#define INCLUDED_FGTYPES_H - -// -// x,y,z position in metres, heading, pitch and roll in degrees... -// -#pragma pack(push, 2) -struct TFlightGearData { - double x, y, z, h, p, r; - int status; -}; -#pragma pack(pop) - -#endif//INCLUDED_FGTYPES_H diff --git a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui deleted file mode 100644 index 575549d6..00000000 --- a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui +++ /dev/null @@ -1,143 +0,0 @@ - - - UICFGControls - - - Qt::NonModal - - - - 0 - 0 - 415 - 112 - - - - FlightGear protocol settings - - - - :/images/filter-16.png:/images/filter-16.png - - - Qt::LeftToRight - - - false - - - - - - IP-address remote PC - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - Port-number - - - - - - - 1000 - - - 10000 - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - spinIPFirstNibble - spinIPSecondNibble - spinIPThirdNibble - spinIPFourthNibble - spinPortNumber - - - - - - - startEngineClicked() - stopEngineClicked() - cameraSettingsClicked() - - diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp deleted file mode 100644 index 660a7352..00000000 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_fg.h" -#include "opentrack/plugin-api.hpp" - -// For Todd and Arda Kutlu - -void FTNoIR_Protocol::pose(const double* headpose) { - FlightData.x = headpose[TX] * 1e-2; - FlightData.y = headpose[TY] * 1e-2; - FlightData.z = headpose[TZ] * 1e-2; - FlightData.p = headpose[Pitch]; - FlightData.h = headpose[Yaw]; - FlightData.r = headpose[Roll]; - FlightData.status = 1; - QHostAddress destIP(QString("%1.%2.%3.%4").arg( - QString::number(static_cast(s.ip1)), - QString::number(static_cast(s.ip2)), - QString::number(static_cast(s.ip3)), - QString::number(static_cast(s.ip4)))); - int destPort = s.port; - (void) outSocket.writeDatagram(reinterpret_cast(&FlightData), sizeof(FlightData), destIP, static_cast(destPort)); -} - -bool FTNoIR_Protocol::correct() -{ - return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); -} - -OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FGControls, FTNoIR_ProtocolDll) diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h deleted file mode 100644 index de528270..00000000 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#pragma once -#include "ui_ftnoir_fgcontrols.h" -#include "fgtypes.h" -#include -#include -#include -#include "opentrack/plugin-api.hpp" -#include "opentrack/options.hpp" -using namespace options; - -struct settings : opts { - value ip1, ip2, ip3, ip4; - value port; - settings() : - opts("flightgear-proto"), - ip1(b, "ip1", 192), - ip2(b, "ip2", 168), - ip3(b, "ip3", 0), - ip4(b, "ip4", 2), - port(b, "port", 5542) - {} -}; - -class FTNoIR_Protocol : public IProtocol -{ -public: - bool correct(); - void pose(const double *headpose); - QString game_name() { - return "FlightGear"; - } -private: - settings s; - TFlightGearData FlightData; - QUdpSocket outSocket; -}; - -// Widget that has controls for FTNoIR protocol client-settings. -class FGControls: public IProtocolDialog -{ - Q_OBJECT -public: - FGControls(); - void register_protocol(IProtocol *) {} - void unregister_protocol() {} -private: - Ui::UICFGControls ui; - settings s; -private slots: - void doOK(); - void doCancel(); -}; - -class FTNoIR_ProtocolDll : public Metadata -{ -public: - QString name() { return QString("FlightGear"); } - QIcon icon() { return QIcon(":/images/flightgear.png"); } -}; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp deleted file mode 100644 index 1d583115..00000000 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_fg.h" -#include -#include -#include "opentrack/plugin-api.hpp" - -//******************************************************************************************************* -// FaceTrackNoIR Client Settings-dialog. -//******************************************************************************************************* - -// -// Constructor for server-settings-dialog -// -FGControls::FGControls() -{ - ui.setupUi( this ); - - tie_setting(s.ip1, ui.spinIPFirstNibble); - tie_setting(s.ip2, ui.spinIPSecondNibble); - tie_setting(s.ip3, ui.spinIPThirdNibble); - tie_setting(s.ip4, ui.spinIPFourthNibble); - tie_setting(s.port, ui.spinPortNumber); - - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); -} - -void FGControls::doOK() { - s.b->save(); - this->close(); -} - -void FGControls::doCancel() { - s.b->reload(); - this->close(); -} - diff --git a/ftnoir_protocol_fg/images/flightgear.png b/ftnoir_protocol_fg/images/flightgear.png deleted file mode 100644 index 2a546642..00000000 Binary files a/ftnoir_protocol_fg/images/flightgear.png and /dev/null differ -- cgit v1.2.3