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_tracker_udp/ftnoir_ftnclientcontrols.ui | 208 ----------------------- ftnoir_tracker_udp/ftnoir_tracker_udp.cpp | 70 -------- ftnoir_tracker_udp/ftnoir_tracker_udp.h | 60 ------- ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp | 26 --- 4 files changed, 364 deletions(-) delete mode 100644 ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui delete mode 100644 ftnoir_tracker_udp/ftnoir_tracker_udp.cpp delete mode 100644 ftnoir_tracker_udp/ftnoir_tracker_udp.h delete mode 100644 ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp (limited to 'ftnoir_tracker_udp') diff --git a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui deleted file mode 100644 index cb9362ca..00000000 --- a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui +++ /dev/null @@ -1,208 +0,0 @@ - - - UICFTNClientControls - - - Qt::NonModal - - - - 0 - 0 - 195 - 224 - - - - UDP tracker settings - - - - ../facetracknoir/images/facetracknoir.png../facetracknoir/images/facetracknoir.png - - - Qt::LeftToRight - - - false - - - - - - - 0 - 0 - - - - - - - - - - Port - - - - - - - 0 - - - 65535 - - - - - - - - - - Add to axis - - - - - - yaw - - - - - - - - 0 - - - - - +90 - - - - - -90 - - - - - +180 - - - - - -180 - - - - - - - - pitch - - - - - - - roll - - - - - - - - 0 - - - - - +90 - - - - - -90 - - - - - +180 - - - - - -180 - - - - - - - - - 0 - - - - - +90 - - - - - -90 - - - - - +180 - - - - - -180 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - startEngineClicked() - stopEngineClicked() - cameraSettingsClicked() - - diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp deleted file mode 100644 index 1610f917..00000000 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2014, Stanislaw Halik - - * 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_tracker_udp.h" -#include "opentrack/plugin-api.hpp" - -FTNoIR_Tracker::FTNoIR_Tracker() : last_recv_pose { 0,0,0, 0,0,0 }, should_quit(false) {} - -FTNoIR_Tracker::~FTNoIR_Tracker() -{ - should_quit = true; - wait(); -} - -void FTNoIR_Tracker::run() { - QByteArray datagram; - datagram.resize(sizeof(last_recv_pose)); - (void) sock.bind(QHostAddress::Any, (int) s.port, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); - for (;;) { - if (should_quit) - break; - { - QMutexLocker foo(&mutex); - while (sock.hasPendingDatagrams()) { - sock.readDatagram((char * ) last_recv_pose, sizeof(double[6])); - } - } - msleep(1); - } -} - -void FTNoIR_Tracker::start_tracker(QFrame*) -{ - start(); - sock.moveToThread(this); -} - -void FTNoIR_Tracker::data(double *data) -{ - QMutexLocker foo(&mutex); - for (int i = 0; i < 6; i++) - data[i] = last_recv_pose[i]; - - int values[] = { - 0, - 90, - -90, - 180, - -180, - }; - int indices[] = { - s.add_yaw, - s.add_pitch, - s.add_roll, - }; - - for (int i = 0; i < 3; i++) - { - int k = std::min(sizeof(values)/sizeof(values[0]), std::max(0, indices[i])); - data[Yaw + i] += values[k]; - } -} - - -OPENTRACK_DECLARE_TRACKER(FTNoIR_Tracker, TrackerControls, FTNoIR_TrackerDll) diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h deleted file mode 100644 index 6de5b295..00000000 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once -#include "ui_ftnoir_ftnclientcontrols.h" -#include -#include -#include -#include "opentrack/plugin-api.hpp" -#include "opentrack/options.hpp" -using namespace options; - -struct settings : opts { - value port; - value add_yaw, add_pitch, add_roll; - settings() : - opts("udp-tracker"), - port(b, "port", 4242), - add_yaw(b, "add-yaw", 0), - add_pitch(b, "add-pitch", 0), - add_roll(b, "add-roll", 0) - {} -}; - -class FTNoIR_Tracker : public ITracker, protected QThread -{ -public: - FTNoIR_Tracker(); - ~FTNoIR_Tracker() override; - void start_tracker(QFrame *) override; - void data(double *data) override; -protected: - void run() override; -private: - QUdpSocket sock; - double last_recv_pose[6]; - QMutex mutex; - settings s; - volatile bool should_quit; -}; - -class TrackerControls: public ITrackerDialog -{ - Q_OBJECT -public: - TrackerControls(); - void register_tracker(ITracker *) override {} - void unregister_tracker() override {} -private: - Ui::UICFTNClientControls ui; - settings s; -private slots: - void doOK(); - void doCancel(); -}; - -class FTNoIR_TrackerDll : public Metadata -{ -public: - QString name() { return QString("UDP sender"); } - QIcon icon() { return QIcon(":/images/facetracknoir.png"); } -}; - diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp deleted file mode 100644 index 5e7d5437..00000000 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "ftnoir_tracker_udp.h" -#include "opentrack/plugin-api.hpp" - -TrackerControls::TrackerControls() -{ - ui.setupUi( this ); - - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - - tie_setting(s.port, ui.spinPortNumber); - tie_setting(s.add_yaw, ui.add_yaw); - tie_setting(s.add_pitch, ui.add_pitch); - tie_setting(s.add_roll, ui.add_roll); -} - -void TrackerControls::doOK() { - s.b->save(); - this->close(); -} - -void TrackerControls::doCancel() { - s.b->reload(); - this->close(); -} - -- cgit v1.2.3