From ad37ec007baf1170657ba51baea44688c52290e0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 Sep 2013 22:16:21 +0200 Subject: initial libevdev impl --- .../ftnoir_libevdev_controls.ui | 111 +++++++++++++++++++++ .../ftnoir_protocol_libevdev.cpp | 77 ++++++++++++++ .../ftnoir_protocol_libevdev.h | 72 +++++++++++++ .../ftnoir_protocol_libevdev_dialog.cpp | 41 ++++++++ .../ftnoir_protocol_libevdev_dll.cpp | 16 +++ ftnoir_protocol_libevdev/libevdev-protocol.qrc | 5 + 6 files changed, 322 insertions(+) create mode 100644 ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui create mode 100644 ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp create mode 100644 ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h create mode 100644 ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp create mode 100644 ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp create mode 100644 ftnoir_protocol_libevdev/libevdev-protocol.qrc (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui new file mode 100644 index 00000000..f9a55547 --- /dev/null +++ b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui @@ -0,0 +1,111 @@ + + + UICVJoyControls + + + Qt::ApplicationModal + + + + 0 + 0 + 228 + 69 + + + + VJoy + + + + :/images/vjoy.png:/images/vjoy.png + + + Qt::LeftToRight + + + false + + + + + + Make sure rw for /dev/input/uinput! + + + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + OK + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Cancel + + + + + + + + + + + btnOK + btnCancel + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp new file mode 100644 index 00000000..6f34d20b --- /dev/null +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -0,0 +1,77 @@ +#include "ftnoir_protocol_libevdev.h" +#include "facetracknoir/global-settings.h" +//#include "ftnoir_tracker_base/ftnoir_tracker_types.h" + +#define CHECK_LIBEVDEV(expr) if ((expr) != 0) goto error; + +FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) +{ + int error; + + dev = libevdev_new(); + + if (!dev) + goto error; + + libevdev_set_name(dev, "opentrack headpose"); + + struct input_absinfo absinfo; + + absinfo.minimum = -ABS_MAX; + absinfo.maximum = ABS_MAX; + absinfo.resolution= 1; /* units per radian? let's go shopping */ + absinfo.value = 0; + absinfo.fuzz = 1; /* no filtering in evdev subsystem, we do our own */ + + CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_ABS)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_X, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Y, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Z, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RX, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RY, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)) + + CHECK_LIBEVDEV(error = libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev)) + + return; +error: + if (uidev) + libevdev_uinput_destroy(uidev); + if (dev) + libevdev_free(dev); + uidev = NULL; + dev = NULL; +} + +FTNoIR_Protocol::~FTNoIR_Protocol() +{ + if (uidev) + libevdev_uinput_destroy(uidev); + if (dev) + libevdev_free(dev); +} + +void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { + static const int axes[] = { + /* translation goes first */ + ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ + }; + static const int ranges[] = { + 2, + 2, + 2, + 2, /* | pitch | only goes to 90 */ + 1, + 2 + }; + + const int max_euler = 90; + + for (int i = 0; i < 6; i++) + (void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], ranges[i] * headpose[i] * max_euler / ABS_MAX); +} + +extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() +{ + return new FTNoIR_Protocol; +} diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h new file mode 100644 index 00000000..b71738f1 --- /dev/null +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -0,0 +1,72 @@ +/* Copyright (c) 2013 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. + */ +#pragma once +#include "ftnoir_protocol_base/ftnoir_protocol_base.h" +#include "ui_ftnoir_libevdev_controls.h" + +#include +#include +#include "facetracknoir/global-settings.h" + +#include +#include + +class FTNoIR_Protocol : public IProtocol +{ +public: + FTNoIR_Protocol(); + ~FTNoIR_Protocol(); + bool checkServerInstallationOK() { + return dev != NULL; + } + void sendHeadposeToGame( double *headpose, double *rawheadpose ); + QString getGameName() { + return "Virtual joystick for Linux"; + } +private: + struct libevdev* dev; + struct libevdev_uinput* uidev; +}; + +// Widget that has controls for FTNoIR protocol client-settings. +class LibevdevControls: public QWidget, public IProtocolDialog +{ + Q_OBJECT +public: + + explicit LibevdevControls(); + virtual ~LibevdevControls(); + void showEvent ( QShowEvent *) {} + + void Initialize(QWidget *); + void registerProtocol(IProtocol *l) {} + void unRegisterProtocol() {} + +private: + Ui::UICVJoyControls ui; + void save(); + +private slots: + void doOK(); + void doCancel(); +}; + +//******************************************************************************************************* +// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol +//******************************************************************************************************* +class FTNoIR_ProtocolDll : public Metadata +{ +public: + FTNoIR_ProtocolDll(); + ~FTNoIR_ProtocolDll(); + + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } + + void getIcon(QIcon *icon) { *icon = QIcon(":/images/linux.png"); } +}; diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp new file mode 100644 index 00000000..6665a3d2 --- /dev/null +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp @@ -0,0 +1,41 @@ +#include "ftnoir_protocol_libevdev.h" +#include "facetracknoir/global-settings.h" + +LibevdevControls::LibevdevControls() : QWidget() +{ + ui.setupUi( this ); + connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); + connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); +} + +LibevdevControls::~LibevdevControls() { +} + +// +// Initialize tracker-client-dialog +// +void LibevdevControls::Initialize(QWidget *parent) { + + QPoint offsetpos(100, 100); + if (parent) { + this->move(parent->pos() + offsetpos); + } + show(); +} + +void LibevdevControls::doOK() { + save(); + this->close(); +} + +void LibevdevControls::doCancel() { + this->close(); +} + +void LibevdevControls::save() { +} + +extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocolDialog* CALLING_CONVENTION GetDialog( ) +{ + return new LibevdevControls; +} diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp new file mode 100644 index 00000000..79a22d5e --- /dev/null +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp @@ -0,0 +1,16 @@ +#include "ftnoir_protocol_libevdev.h" +#include +#include "facetracknoir/global-settings.h" + +FTNoIR_ProtocolDll::FTNoIR_ProtocolDll() { +} + +FTNoIR_ProtocolDll::~FTNoIR_ProtocolDll() +{ + +} + +extern "C" FTNOIR_PROTOCOL_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() +{ + return new FTNoIR_ProtocolDll; +} diff --git a/ftnoir_protocol_libevdev/libevdev-protocol.qrc b/ftnoir_protocol_libevdev/libevdev-protocol.qrc new file mode 100644 index 00000000..70bb415f --- /dev/null +++ b/ftnoir_protocol_libevdev/libevdev-protocol.qrc @@ -0,0 +1,5 @@ + + + images/linux.png + + -- cgit v1.2.3 From 40f95d58324609d74b1e3a7ff81d4ef3b2388550 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 Sep 2013 23:54:16 +0200 Subject: proto-libevdev: first version. NEEDS UDEV RULE --- .../ftnoir_protocol_libevdev.cpp | 57 +++++++++++++++------- .../ftnoir_protocol_libevdev.h | 6 ++- 2 files changed, 43 insertions(+), 20 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 6f34d20b..74986299 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -1,37 +1,52 @@ #include "ftnoir_protocol_libevdev.h" #include "facetracknoir/global-settings.h" //#include "ftnoir_tracker_base/ftnoir_tracker_types.h" +#include +#include -#define CHECK_LIBEVDEV(expr) if ((expr) != 0) goto error; +#include +#include + +#define CHECK_LIBEVDEV(expr) if (error = (expr) != 0) goto error; + +static const int max_input = 8192; +static const int mid_input = 4096; +static const int min_input = 0; + +#define HT_PI 3.1415926535 FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) { - int error; + int error = 0; dev = libevdev_new(); if (!dev) goto error; + CHECK_LIBEVDEV(libevdev_enable_property(dev, INPUT_PROP_BUTTONPAD)); + libevdev_set_name(dev, "opentrack headpose"); struct input_absinfo absinfo; - absinfo.minimum = -ABS_MAX; - absinfo.maximum = ABS_MAX; - absinfo.resolution= 1; /* units per radian? let's go shopping */ - absinfo.value = 0; - absinfo.fuzz = 1; /* no filtering in evdev subsystem, we do our own */ + absinfo.minimum = min_input; + absinfo.maximum = max_input; + absinfo.resolution = 1; + absinfo.value = mid_input; + absinfo.flat = 8192 / 180; + absinfo.fuzz = 1; + + CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_ABS)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_X, &absinfo)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Y, &absinfo)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Z, &absinfo)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RX, &absinfo)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RY, &absinfo)); - CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_ABS)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_X, &absinfo)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Y, &absinfo)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Z, &absinfo)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RX, &absinfo)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RY, &absinfo)) - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)) + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)); - CHECK_LIBEVDEV(error = libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev)) + CHECK_LIBEVDEV(libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev)); return; error: @@ -39,6 +54,8 @@ error: libevdev_uinput_destroy(uidev); if (dev) libevdev_free(dev); + if (error) + fprintf(stderr, "libevdev error: %d\n", error); uidev = NULL; dev = NULL; } @@ -60,15 +77,19 @@ void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose 2, 2, 2, - 2, /* | pitch | only goes to 90 */ - 1, + 2, + 1, /* |pitch| only goes to 90 */ 2 }; const int max_euler = 90; for (int i = 0; i < 6; i++) - (void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], ranges[i] * headpose[i] * max_euler / ABS_MAX); + { + int value = headpose[i] * mid_input / (max_euler * ranges[i]) + mid_input; + int normalized = std::max(std::min(max_input, value), min_input); + (void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], normalized); + } } extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index b71738f1..42864a07 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -12,8 +12,10 @@ #include #include "facetracknoir/global-settings.h" -#include -#include +extern "C" { +# include +# include +} class FTNoIR_Protocol : public IProtocol { -- cgit v1.2.3 From 4fc7efa31f385baaaf8db16a3fc59c695dd5ee47 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 00:07:26 +0200 Subject: add missing evdev driver icon --- ftnoir_protocol_libevdev/images/linux.png | Bin 0 -> 668 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ftnoir_protocol_libevdev/images/linux.png (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/images/linux.png b/ftnoir_protocol_libevdev/images/linux.png new file mode 100644 index 00000000..8836c0e2 Binary files /dev/null and b/ftnoir_protocol_libevdev/images/linux.png differ -- cgit v1.2.3 From a1c5b014da305b43da45b57e76c2c273270ad4b4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 00:34:48 +0200 Subject: Pretend to be a joystick a bit harder for udev --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 74986299..dec4f847 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -46,6 +46,9 @@ FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)); + CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_KEY)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_KEY, BTN_JOYSTICK, NULL)); + CHECK_LIBEVDEV(libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev)); return; -- cgit v1.2.3 From 37fb6559536685df97f6b6b35614dff43cb901a1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 00:41:34 +0200 Subject: Rename UI class from copied boilerplate --- ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui | 4 ++-- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui index f9a55547..e85e001e 100644 --- a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui +++ b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui @@ -1,7 +1,7 @@ - UICVJoyControls - + UICLibevdevControls + Qt::ApplicationModal diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index 42864a07..e753269e 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -49,7 +49,7 @@ public: void unRegisterProtocol() {} private: - Ui::UICVJoyControls ui; + Ui::UICLibevdevControls ui; void save(); private slots: -- cgit v1.2.3 From 46029fe376e358a6a3ab021cfd8252945460d84a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 00:42:22 +0200 Subject: Add a note to future self --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index dec4f847..80b075d6 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -46,6 +46,7 @@ FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)); + /* do not remove next 2 lines or udev scripts won't assign 0664 permissions -sh */ CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_KEY)); CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_KEY, BTN_JOYSTICK, NULL)); -- cgit v1.2.3 From b2dcd14ef0a12803c82b7aaf374d3f88098ad4e8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 00:47:55 +0200 Subject: Take a peek on how uglyDwarf doesIt --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 80b075d6..60922967 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -46,9 +46,10 @@ FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)); - /* do not remove next 2 lines or udev scripts won't assign 0664 permissions -sh */ + /* do not remove next 3 lines or udev scripts won't assign 0664 permissions -sh */ CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_KEY)); CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_KEY, BTN_JOYSTICK, NULL)); + CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_KEY, BTN_TRIGGER, NULL)); CHECK_LIBEVDEV(libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev)); -- cgit v1.2.3 From 4109274cf3ae8ddd586a85196680084bee40f5b9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 01:57:42 +0200 Subject: Refactor for proper translation output range --- .../ftnoir_protocol_libevdev.cpp | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 60922967..a64f252e 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -9,8 +9,8 @@ #define CHECK_LIBEVDEV(expr) if (error = (expr) != 0) goto error; -static const int max_input = 8192; -static const int mid_input = 4096; +static const int max_input = 65535; +static const int mid_input = 32767; static const int min_input = 0; #define HT_PI 3.1415926535 @@ -34,8 +34,8 @@ FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) absinfo.maximum = max_input; absinfo.resolution = 1; absinfo.value = mid_input; - absinfo.flat = 8192 / 180; - absinfo.fuzz = 1; + absinfo.flat = 1; + absinfo.fuzz = 0; CHECK_LIBEVDEV(libevdev_enable_event_type(dev, EV_ABS)); CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_X, &absinfo)); @@ -78,20 +78,19 @@ void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose /* translation goes first */ ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ }; - static const int ranges[] = { - 2, - 2, - 2, - 2, - 1, /* |pitch| only goes to 90 */ - 2 - }; - const int max_euler = 90; + static const int max_value[] = { + 100, + 100, + 100, + 180, + 90, + 180 + }; for (int i = 0; i < 6; i++) { - int value = headpose[i] * mid_input / (max_euler * ranges[i]) + mid_input; + int value = headpose[i] * mid_input / max_value[i] + mid_input; int normalized = std::max(std::min(max_input, value), min_input); (void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], normalized); } -- cgit v1.2.3 From b3f2cfa87ba25a85e486f4e45ce419fc0e823ca2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 02:09:23 +0200 Subject: remove empty line --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index a64f252e..3f74f462 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -43,7 +43,6 @@ FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_Z, &absinfo)); CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RX, &absinfo)); CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RY, &absinfo)); - CHECK_LIBEVDEV(libevdev_enable_event_code(dev, EV_ABS, ABS_RZ, &absinfo)); /* do not remove next 3 lines or udev scripts won't assign 0664 permissions -sh */ -- cgit v1.2.3 From 169bd7eb0396cd8d9474e47b669f5db7bcaf38bf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 12:52:43 +0200 Subject: proto-libevdev: End bulk updates with EV_SYN --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 3f74f462..f0950d80 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -93,6 +93,8 @@ void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose int normalized = std::max(std::min(max_input, value), min_input); (void) libevdev_uinput_write_event(uidev, EV_ABS, axes[i], normalized); } + + (void) libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0); } extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() -- cgit v1.2.3 From 5bedf6f81342356c197604a9484281db0a726611 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Sep 2013 17:34:14 +0200 Subject: Appease GNU CC -Wall -Wno-reorder --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index f0950d80..60d9e90c 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -7,7 +7,7 @@ #include #include -#define CHECK_LIBEVDEV(expr) if (error = (expr) != 0) goto error; +#define CHECK_LIBEVDEV(expr) if ((error = (expr)) != 0) goto error; static const int max_input = 65535; static const int mid_input = 32767; -- cgit v1.2.3 From b37d9f82420d545f650f5f5eb39de513c9dbce80 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 18 Sep 2013 17:16:46 +0200 Subject: libevdev: since don't care about sensor resolution, cleanup unused macro --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 60d9e90c..fc01552e 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -13,8 +13,6 @@ static const int max_input = 65535; static const int mid_input = 32767; static const int min_input = 0; -#define HT_PI 3.1415926535 - FTNoIR_Protocol::FTNoIR_Protocol() : dev(NULL), uidev(NULL) { int error = 0; -- cgit v1.2.3 From da46cf18a2c7ad56c53e9c02014f75c818d39ea3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 16 Oct 2013 23:30:47 +0200 Subject: change protocol ABI: sprinkle const. ABI BREAKAGE! Signed-off-by: Stanislaw Halik --- facetracknoir/tracker.cpp | 2 +- ftnoir_protocol_base/ftnoir_protocol_base.h | 2 +- ftnoir_protocol_fg/ftnoir_protocol_fg.cpp | 6 +----- ftnoir_protocol_fg/ftnoir_protocol_fg.h | 2 +- ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp | 2 +- ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 2 +- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 6 +++--- ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 2 +- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 2 +- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 4 ++-- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 2 +- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 8 ++++---- 12 files changed, 18 insertions(+), 22 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 53b3ffd3..25b42ece 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -149,7 +149,7 @@ void Tracker::run() { // Send the headpose to the game if (Libraries->pProtocol) { gameoutput_camera = output_camera; - Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes, newpose ); // degrees & centimeters + Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes ); // degrees & centimeters } } } diff --git a/ftnoir_protocol_base/ftnoir_protocol_base.h b/ftnoir_protocol_base/ftnoir_protocol_base.h index 79f0800c..5db49f01 100644 --- a/ftnoir_protocol_base/ftnoir_protocol_base.h +++ b/ftnoir_protocol_base/ftnoir_protocol_base.h @@ -41,7 +41,7 @@ struct IProtocol { virtual ~IProtocol() {} virtual bool checkServerInstallationOK() = 0; - virtual void sendHeadposeToGame( double *headpose, double *rawheadpose ) = 0; + virtual void sendHeadposeToGame( const double* headpose ) = 0; virtual QString getGameName() = 0; }; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp index 5aa3487e..08e7370b 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp @@ -63,11 +63,7 @@ void FTNoIR_Protocol::loadSettings() { } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { - int no_bytes; - QHostAddress sender; - quint16 senderPort; - +void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { FlightData.x = headpose[TX] * 1e-2; FlightData.y = headpose[TY] * 1e-2; FlightData.z = headpose[TZ] * 1e-2; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index f399904b..43d1b05a 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -46,7 +46,7 @@ public: FTNoIR_Protocol(); ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "FlightGear"; } diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp index cefc9bf8..45123540 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp @@ -91,7 +91,7 @@ void FGControls::doOK() { } // override show event -void FGControls::showEvent ( QShowEvent * event ) { +void FGControls::showEvent ( QShowEvent * ) { loadSettings(); } diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp index 3d04dfd0..80cbfa0a 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp @@ -66,7 +66,7 @@ void FTNoIR_Protocol::loadSettings() { // // Update Headpose in Game. // -void FTNoIR_Protocol::sendHeadposeToGame(double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose) { int no_bytes; double test_data[6]; // diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 4c1c34cd..4e814ddf 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -45,7 +45,7 @@ public: FTNoIR_Protocol(); ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "UDP Tracker"; } @@ -65,9 +65,9 @@ public: explicit FTNControls(); virtual ~FTNControls(); - void showEvent ( QShowEvent * event ); + void showEvent (QShowEvent *); void Initialize(QWidget *parent); - void registerProtocol(IProtocol *protocol) {} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp index 0b61fd48..3b4e851c 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp @@ -84,7 +84,7 @@ void FTNControls::doOK() { } // override show event -void FTNControls::showEvent ( QShowEvent * event ) { +void FTNControls::showEvent ( QShowEvent * ) { loadSettings(); } diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index fc01552e..70fde395 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -70,7 +70,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() libevdev_free(dev); } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { static const int axes[] = { /* translation goes first */ ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index e753269e..3c6f591c 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -25,7 +25,7 @@ public: bool checkServerInstallationOK() { return dev != NULL; } - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "Virtual joystick for Linux"; } @@ -45,7 +45,7 @@ public: void showEvent ( QShowEvent *) {} void Initialize(QWidget *); - void registerProtocol(IProtocol *l) {} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index 698c2236..c5d0754f 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -25,7 +25,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() shm_unlink("/" WINE_SHM_NAME); } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { if (shm) { lck_shm.lock(); diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 300501ad..01bfc93d 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -51,7 +51,7 @@ public: ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame(double* headpose, double* rawheadpose ); + void sendHeadposeToGame(const double* headpose); QString getGameName() { QMutexLocker foo(&game_name_mutex); return connected_game; @@ -72,9 +72,9 @@ class FTControls: public QWidget, public IProtocolDialog public: FTControls(); - void showEvent ( QShowEvent * event ) {show();} - void Initialize(QWidget *parent) {show();} - void registerProtocol(IProtocol *protocol) {} + void showEvent ( QShowEvent * ) {show();} + void Initialize(QWidget *) {show();} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: -- cgit v1.2.3 From 79697936ef3ce7f0bbd1965931cdfb4b2c4c9f5b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 19 Oct 2013 17:06:23 +0200 Subject: Fix proto/filter dtor not being called Signed-off-by: Stanislaw Halik Reported-by: mm0zct --- ftnoir_filter_accela/ftnoir_filter_accela.h | 2 +- ftnoir_filter_base/ftnoir_filter_base.h | 4 +++- ftnoir_filter_ewma2/ftnoir_filter_ewma2.h | 2 +- ftnoir_protocol_base/ftnoir_protocol_base.h | 4 +++- ftnoir_protocol_fg/ftnoir_protocol_fg.h | 2 +- ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h | 2 +- ftnoir_protocol_ft/ftnoir_protocol_ft.cpp | 1 + ftnoir_protocol_ft/ftnoir_protocol_ft.h | 2 +- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 2 +- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 2 +- ftnoir_protocol_mouse/ftnoir_protocol_mouse.h | 2 +- ftnoir_protocol_sc/ftnoir_protocol_sc.h | 2 +- ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 2 +- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 2 +- 14 files changed, 18 insertions(+), 13 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h index 4afe127b..f1807fd0 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.h +++ b/ftnoir_filter_accela/ftnoir_filter_accela.h @@ -42,7 +42,7 @@ class FTNoIR_Filter : public IFilter { public: FTNoIR_Filter(); - ~FTNoIR_Filter(); + virtual ~FTNoIR_Filter(); void FilterHeadPoseData(const double* target_camera_position, double *new_camera_position, const double* last_post_filter_values); void Initialize() { first_run = true; diff --git a/ftnoir_filter_base/ftnoir_filter_base.h b/ftnoir_filter_base/ftnoir_filter_base.h index fe1ad19a..48a4a6b9 100644 --- a/ftnoir_filter_base/ftnoir_filter_base.h +++ b/ftnoir_filter_base/ftnoir_filter_base.h @@ -12,11 +12,13 @@ struct IFilter { - virtual ~IFilter() {} + virtual ~IFilter() = 0; virtual void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position, const double *last_post_filter) = 0; virtual void Initialize() = 0; }; +inline IFilter::~IFilter() { } + struct IFilterDialog { virtual ~IFilterDialog() {} diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h index 656b2895..7f2f21e6 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h @@ -41,7 +41,7 @@ class FTNoIR_Filter : public IFilter { public: FTNoIR_Filter(); - ~FTNoIR_Filter(); + virtual ~FTNoIR_Filter(); void Initialize() {} void FilterHeadPoseData(const double *target_camera_position, diff --git a/ftnoir_protocol_base/ftnoir_protocol_base.h b/ftnoir_protocol_base/ftnoir_protocol_base.h index 5db49f01..e4ca1977 100644 --- a/ftnoir_protocol_base/ftnoir_protocol_base.h +++ b/ftnoir_protocol_base/ftnoir_protocol_base.h @@ -39,12 +39,14 @@ struct IProtocol { - virtual ~IProtocol() {} + virtual ~IProtocol() = 0; virtual bool checkServerInstallationOK() = 0; virtual void sendHeadposeToGame( const double* headpose ) = 0; virtual QString getGameName() = 0; }; +inline IProtocol::~IProtocol() { } + struct IProtocolDialog { virtual ~IProtocolDialog() {} diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index 43d1b05a..9a4f304c 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -44,7 +44,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame(const double *headpose); QString getGameName() { diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h index 52b2cd98..87c6a3a4 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h @@ -59,7 +59,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); QString getGameName() { diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp index 27e88136..65d877a7 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp @@ -61,6 +61,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() FTIRViewsLib.unload(); } dummyTrackIR.kill(); + dummyTrackIR.waitForFinished(5); } // diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h index cd77bbe4..e13d260f 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h @@ -53,7 +53,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK( ); void sendHeadposeToGame( const double *headpose ); QString getGameName() { diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 4e814ddf..9aee73ac 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -43,7 +43,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame(const double *headpose); QString getGameName() { diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index 3c6f591c..aabd3e51 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -21,7 +21,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK() { return dev != NULL; } diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h index 1eb80b12..1ce72f69 100644 --- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h +++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h @@ -58,7 +58,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame( const double *headpose); QString getGameName() { diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index 9ac56b30..e17cabb5 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -81,7 +81,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); QString getGameName() { diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index 2fe53669..c4db29e4 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -42,7 +42,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK() { return true; } diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 01bfc93d..d7276b8e 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -48,7 +48,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - ~FTNoIR_Protocol(); + virtual ~FTNoIR_Protocol(); bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); -- cgit v1.2.3 From d1e0537f704ea67483ccbdf7461e636490aba0cf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 31 Dec 2013 08:41:16 +0100 Subject: meta: get rid of Initialize(), now RAII --- FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h | 4 - ftnoir_filter_accela/ftnoir_filter_accela.h | 4 +- .../ftnoir_filter_accela_dialog.cpp | 4 - ftnoir_filter_base/ftnoir_filter_base.h | 3 +- ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp | 4 - ftnoir_filter_ewma2/ftnoir_filter_ewma2.h | 5 +- ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp | 21 -- ftnoir_filter_kalman/ftnoir_filter_kalman.h | 9 +- ftnoir_filter_kalman/kalman.cpp | 4 +- ftnoir_protocol_base/ftnoir_protocol_base.h | 3 - ftnoir_protocol_fg/ftnoir_protocol_fg.h | 7 - ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp | 24 -- ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h | 3 - .../ftnoir_protocol_fsuipc_dialog.cpp | 29 -- ftnoir_protocol_ft/ftnoir_protocol_ft.h | 3 - ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp | 30 -- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 3 - ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 24 -- .../ftnoir_protocol_libevdev.h | 4 - .../ftnoir_protocol_libevdev_dialog.cpp | 15 - ftnoir_protocol_sc/ftnoir_protocol_sc.h | 3 - ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp | 30 -- ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 4 - .../ftnoir_protocol_vjoy_dialog.cpp | 15 - ftnoir_protocol_wine/ftnoir_protocol_wine.h | 3 - ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 309 +++++---------------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 55 ++-- ftnoir_tracker_base/ftnoir_tracker_base.h | 3 +- ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp | 34 --- ftnoir_tracker_hatire/ftnoir_tracker_hat.h | 7 - .../ftnoir_tracker_hat_dialog.cpp | 18 -- ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h | 4 +- ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 5 - ftnoir_tracker_ht/ftnoir_tracker_ht.h | 1 - ftnoir_tracker_hydra/ftnoir_tracker_hydra.h | 1 - .../ftnoir_tracker_hydra_dialog.cpp | 9 - ftnoir_tracker_joystick/ftnoir_tracker_joystick.h | 6 +- .../ftnoir_tracker_joystick_dialog.cpp | 18 -- ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | 2 - ftnoir_tracker_rift/ftnoir_tracker_rift.h | 1 - ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp | 9 - ftnoir_tracker_udp/ftnoir_tracker_udp.h | 3 - ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp | 23 -- 43 files changed, 118 insertions(+), 648 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h index 18283837..1d30e7e5 100644 --- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h @@ -20,10 +20,6 @@ class TrackerDll : public ITrackerDll #endif { - // ITrackerDll interface -#ifndef OPENTRACK_API - void Initialize() {} -#endif void getFullName(QString *strToBeFilled); void getShortName(QString *strToBeFilled); void getDescription(QString *strToBeFilled); diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h index 2b93f550..1aaa039f 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.h +++ b/ftnoir_filter_accela/ftnoir_filter_accela.h @@ -37,7 +37,7 @@ class FTNoIR_Filter : public IFilter public: FTNoIR_Filter(); void FilterHeadPoseData(const double* target_camera_position, double *new_camera_position); - void Initialize() { + void reset() { first_run = true; } void receiveSettings() { @@ -64,7 +64,7 @@ class FilterControls: public QWidget, public IFilterDialog Q_OBJECT public: FilterControls(); - void Initialize(QWidget *); + void reset(QWidget *); void registerFilter(IFilter* filter); void unregisterFilter(); private: diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp index cc759bcb..6d1ad384 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp @@ -20,10 +20,6 @@ FilterControls::FilterControls() : tie_setting(s.expt, ui.expt); } -void FilterControls::Initialize(QWidget *) { - show(); -} - void FilterControls::registerFilter(IFilter* filter) { accela_filter = (FTNoIR_Filter*) filter; diff --git a/ftnoir_filter_base/ftnoir_filter_base.h b/ftnoir_filter_base/ftnoir_filter_base.h index 800e5deb..fbb0441d 100644 --- a/ftnoir_filter_base/ftnoir_filter_base.h +++ b/ftnoir_filter_base/ftnoir_filter_base.h @@ -14,7 +14,7 @@ struct IFilter { virtual ~IFilter() = 0; virtual void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position) = 0; - virtual void Initialize() = 0; + virtual void reset() = 0; }; inline IFilter::~IFilter() { } @@ -22,7 +22,6 @@ inline IFilter::~IFilter() { } struct IFilterDialog { virtual ~IFilterDialog() {} - virtual void Initialize(QWidget *parent) = 0; virtual void registerFilter(IFilter* tracker) = 0; virtual void unregisterFilter() = 0; }; diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp index 5f66be96..77596b71 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp @@ -44,10 +44,6 @@ FTNoIR_Filter::FTNoIR_Filter() loadSettings(); // Load the Settings } -FTNoIR_Filter::~FTNoIR_Filter() -{ -} - void FTNoIR_Filter::receiveSettings(double smin, double smax, double sexpt) { QMutexLocker foo(&mutex); diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h index 86e4b65c..7c98b2cb 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h @@ -41,8 +41,7 @@ class FTNoIR_Filter : public IFilter { public: FTNoIR_Filter(); - virtual ~FTNoIR_Filter(); - void Initialize() {} + void reset() {} void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position); @@ -73,9 +72,7 @@ class FilterControls: public QWidget, public IFilterDialog Q_OBJECT public: explicit FilterControls(); - virtual ~FilterControls(); void showEvent (QShowEvent *); - void Initialize(QWidget *parent); void registerFilter(IFilter* flt); void unregisterFilter(); diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp index c304eb0a..eb414340 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp @@ -59,27 +59,6 @@ FilterControls::FilterControls() : loadSettings(); } -// -// Destructor for server-dialog -// -FilterControls::~FilterControls() { - qDebug() << "~FilterControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void FilterControls::Initialize(QWidget *parent) { - // - // - // - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void FilterControls::registerFilter(IFilter* flt) { pFilter = (FTNoIR_Filter*) flt; diff --git a/ftnoir_filter_kalman/ftnoir_filter_kalman.h b/ftnoir_filter_kalman/ftnoir_filter_kalman.h index da6df2b1..9e0d817d 100644 --- a/ftnoir_filter_kalman/ftnoir_filter_kalman.h +++ b/ftnoir_filter_kalman/ftnoir_filter_kalman.h @@ -28,7 +28,7 @@ public: FTNoIR_Filter(); ~FTNoIR_Filter() virt_override { } - void Initialize() virt_override; + void reset() virt_override; void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position) virt_override; cv::KalmanFilter kalman; @@ -68,16 +68,9 @@ public: connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); show(); } - ~FilterControls() {} void showEvent ( QShowEvent * ) virt_override { show(); } - - void Initialize(QWidget *) virt_override { - show(); - raise(); - } - bool settingsDirty; Ui::KalmanUICFilterControls ui; virtual void registerFilter(IFilter*) virt_override {} diff --git a/ftnoir_filter_kalman/kalman.cpp b/ftnoir_filter_kalman/kalman.cpp index 629cfcc8..743eb3d4 100644 --- a/ftnoir_filter_kalman/kalman.cpp +++ b/ftnoir_filter_kalman/kalman.cpp @@ -31,12 +31,12 @@ void kalman_save_settings(FilterControls&) { FTNoIR_Filter::FTNoIR_Filter() { kalman_load_settings(*this); - Initialize(); + reset(); } // the following was written by Donovan Baarda // https://sourceforge.net/p/facetracknoir/discussion/1150909/thread/418615e1/?limit=25#af75/084b -void FTNoIR_Filter::Initialize() { +void FTNoIR_Filter::reset() { const double accel_variance = 1e-3; const double noise_variance = 5e2; kalman.init(12, 6, 0, CV_64F); diff --git a/ftnoir_protocol_base/ftnoir_protocol_base.h b/ftnoir_protocol_base/ftnoir_protocol_base.h index e4ca1977..d2f85ec0 100644 --- a/ftnoir_protocol_base/ftnoir_protocol_base.h +++ b/ftnoir_protocol_base/ftnoir_protocol_base.h @@ -50,9 +50,6 @@ inline IProtocol::~IProtocol() { } struct IProtocolDialog { virtual ~IProtocolDialog() {} - virtual void Initialize(QWidget *parent) = 0; - virtual void showEvent ( QShowEvent * event ) = 0; - virtual void registerProtocol(IProtocol *protocol) = 0; virtual void unRegisterProtocol() = 0; }; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index 9a4f304c..0a255d84 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -35,11 +35,8 @@ #include #include #include -#include #include "facetracknoir/global-settings.h" -#define FT_PROGRAMID "FT_ProgramID" - class FTNoIR_Protocol : public IProtocol { public: @@ -65,10 +62,6 @@ class FGControls: public QWidget, public IProtocolDialog public: explicit FGControls(); - virtual ~FGControls(); - void showEvent ( QShowEvent * event ); - - void Initialize(QWidget *parent); void registerProtocol(IProtocol *protocol) { theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol } diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp index 45123540..cb11ace6 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp @@ -63,25 +63,6 @@ QWidget() loadSettings(); } -// -// Destructor for server-dialog -// -FGControls::~FGControls() { - qDebug() << "~FGControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void FGControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - // // OK clicked on server-dialog // @@ -90,11 +71,6 @@ void FGControls::doOK() { this->close(); } -// override show event -void FGControls::showEvent ( QShowEvent * ) { - loadSettings(); -} - // // Cancel clicked on server-dialog // diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h index 87c6a3a4..9f5e3b6f 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h @@ -83,9 +83,6 @@ class FSUIPCControls: public QWidget, public IProtocolDialog public: explicit FSUIPCControls(); - virtual ~FSUIPCControls(); - void showEvent ( QShowEvent * event ); - void Initialize(QWidget *parent); void registerProtocol(IProtocol *protocol) { theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol } diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp index 985915b4..b2f28ba1 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp @@ -48,41 +48,12 @@ QWidget() loadSettings(); } -// -// Destructor for server-dialog -// -FSUIPCControls::~FSUIPCControls() { - qDebug() << "~FSUIPCControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void FSUIPCControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - -// -// OK clicked on server-dialog -// void FSUIPCControls::doOK() { save(); this->close(); } -// override show event -void FSUIPCControls::showEvent ( QShowEvent * event ) { - loadSettings(); -} -// -// Cancel clicked on server-dialog -// void FSUIPCControls::doCancel() { // // Ask if changed Settings should be saved diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h index e13d260f..56316ec4 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h @@ -93,9 +93,6 @@ class FTControls: public QWidget, public IProtocolDialog public: explicit FTControls(); - virtual ~FTControls(); - void showEvent ( QShowEvent * event ); - void Initialize(QWidget *parent); void registerProtocol(IProtocol *protocol) { theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol } diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp index df13a6dc..0b29db6e 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp @@ -75,41 +75,11 @@ QWidget() } -// -// Destructor for server-dialog -// -FTControls::~FTControls() { - qDebug() << "~FTControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void FTControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - -// -// OK clicked on server-dialog -// void FTControls::doOK() { save(); this->close(); } -// override show event -void FTControls::showEvent ( QShowEvent * event ) { - loadSettings(); -} - -// -// Cancel clicked on server-dialog -// void FTControls::doCancel() { // // Ask if changed Settings should be saved diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 9aee73ac..acccc9e7 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -64,9 +64,6 @@ class FTNControls: public QWidget, public IProtocolDialog public: explicit FTNControls(); - virtual ~FTNControls(); - void showEvent (QShowEvent *); - void Initialize(QWidget *parent); void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp index 3b4e851c..72c30051 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp @@ -56,25 +56,6 @@ QWidget() loadSettings(); } -// -// Destructor for server-dialog -// -FTNControls::~FTNControls() { - qDebug() << "~FTNControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void FTNControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - // // OK clicked on server-dialog // @@ -83,11 +64,6 @@ void FTNControls::doOK() { this->close(); } -// override show event -void FTNControls::showEvent ( QShowEvent * ) { - loadSettings(); -} - // // Cancel clicked on server-dialog // diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index aabd3e51..5df59919 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -41,10 +41,6 @@ class LibevdevControls: public QWidget, public IProtocolDialog public: explicit LibevdevControls(); - virtual ~LibevdevControls(); - void showEvent ( QShowEvent *) {} - - void Initialize(QWidget *); void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp index 6665a3d2..bb54c354 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp @@ -8,21 +8,6 @@ LibevdevControls::LibevdevControls() : QWidget() connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); } -LibevdevControls::~LibevdevControls() { -} - -// -// Initialize tracker-client-dialog -// -void LibevdevControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void LibevdevControls::doOK() { save(); this->close(); diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index e17cabb5..7917c532 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -131,9 +131,6 @@ class SCControls: public QWidget, public IProtocolDialog public: explicit SCControls(); - virtual ~SCControls(); - void showEvent ( QShowEvent * event ); - void Initialize(QWidget *parent); void registerProtocol(IProtocol *protocol) { theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol } diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp index fb822145..eb15ca69 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp @@ -49,41 +49,11 @@ QWidget() loadSettings(); } -// -// Destructor for server-dialog -// -SCControls::~SCControls() { - qDebug() << "~SCControls() says: started"; -} - -// -// Initialize tracker-client-dialog -// -void SCControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - -// -// OK clicked on server-dialog -// void SCControls::doOK() { save(); this->close(); } -// override show event -void SCControls::showEvent ( QShowEvent * event ) { - loadSettings(); -} - -// -// Cancel clicked on server-dialog -// void SCControls::doCancel() { // // Ask if changed Settings should be saved diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index c4db29e4..873b4e3c 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -60,10 +60,6 @@ class VJoyControls: public QWidget, public IProtocolDialog public: explicit VJoyControls(); - virtual ~VJoyControls(); - void showEvent ( QShowEvent *) {} - - void Initialize(QWidget *); void registerProtocol(IProtocol *l) {} void unRegisterProtocol() {} diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp index 0009553b..febb7b18 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp @@ -8,21 +8,6 @@ VJoyControls::VJoyControls() : QWidget() connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); } -VJoyControls::~VJoyControls() { -} - -// -// Initialize tracker-client-dialog -// -void VJoyControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void VJoyControls::doOK() { save(); this->close(); diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index d7276b8e..e84dbd69 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -70,10 +70,7 @@ class FTControls: public QWidget, public IProtocolDialog { Q_OBJECT public: - FTControls(); - void showEvent ( QShowEvent * ) {show();} - void Initialize(QWidget *) {show();} void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 9408de02..a0a11ed2 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -99,47 +99,8 @@ static resolution_tuple resolution_choices[] = { { 0, 0 } }; -void Tracker::load_settings() +Tracker::Tracker() : stop(false), layout(nullptr), videoWidget(nullptr) { - QMutexLocker foo(&mtx); - QSettings settings("opentrack"); - QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); - QSettings iniFile( currentFile, QSettings::IniFormat ); - - iniFile.beginGroup( "aruco-Tracker" ); - fov = iniFile.value("fov", 56).toFloat(); - force_fps = iniFile.value("fps", 0).toInt(); - camera_index = iniFile.value("camera-index", -1).toInt(); - int res = iniFile.value("resolution", 0).toInt(); - if (res < 0 || res >= (int)(sizeof(resolution_choices) / sizeof(resolution_tuple))) - res = 0; - resolution_tuple r = resolution_choices[res]; - force_width = r.width; - force_height = r.height; - enableRX = iniFile.value("enable-rx", true).toBool(); - enableRY = iniFile.value("enable-ry", true).toBool(); - enableRZ = iniFile.value("enable-rz", true).toBool(); - enableTX = iniFile.value("enable-tx", true).toBool(); - enableTY = iniFile.value("enable-ty", true).toBool(); - enableTZ = iniFile.value("enable-tz", true).toBool(); - - for (int i = 0; i < 3; i++) - { - headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); - } - headpitch = iniFile.value("pitch", 0).toDouble(); - red_only = iniFile.value("red-only", true).toBool(); - - iniFile.endGroup(); -} - -Tracker::Tracker() -{ - layout = nullptr; - stop = false; - videoWidget = NULL; - enableRX = enableRY = enableRZ = enableTX = enableTY = enableTZ = true; - load_settings(); } Tracker::~Tracker() @@ -166,7 +127,6 @@ void Tracker::StartTracker(QFrame* videoframe) delete videoframe->layout(); videoframe->setLayout(layout); videoWidget->show(); - load_settings(); start(); for (int i = 0; i < 6; i++) pose[i] = 0; @@ -177,13 +137,35 @@ void Tracker::StartTracker(QFrame* videoframe) void Tracker::run() { - camera = cv::VideoCapture(camera_index); - if (force_width) - camera.set(CV_CAP_PROP_FRAME_WIDTH, force_width); - if (force_height) - camera.set(CV_CAP_PROP_FRAME_HEIGHT, force_height); - if (force_fps) - camera.set(CV_CAP_PROP_FPS, force_fps); + int res = s.resolution; + if (res < 0 || res >= (int)(sizeof(resolution_choices) / sizeof(resolution_tuple))) + res = 0; + resolution_tuple r = resolution_choices[res]; + int fps; + switch (static_cast(s.force_fps)) + { + default: + case 0: + fps = 0; + break; + case 30: + fps = 1; + break; + case 60: + fps = 2; + break; + case 120: + fps = 3; + break; + } + camera = cv::VideoCapture(s.camera_index); + if (r.width) + { + camera.set(CV_CAP_PROP_FRAME_WIDTH, r.width); + camera.set(CV_CAP_PROP_FRAME_HEIGHT, r.height); + } + if (fps) + camera.set(CV_CAP_PROP_FPS, fps); aruco::MarkerDetector detector; detector.setDesiredSpeed(3); @@ -206,7 +188,7 @@ void Tracker::run() auto freq = cv::getTickFrequency(); auto last_time = cv::getTickCount(); - int fps = 0; + int cur_fps = 0; int last_fps = 0; cv::Point2f last_centroid; @@ -216,7 +198,7 @@ void Tracker::run() continue; auto tm = cv::getTickCount(); color_.copyTo(color); - if (red_only) + if (s.red_only) { cv::Mat channel[3]; cv::split(color, channel); @@ -227,8 +209,8 @@ void Tracker::run() const int scale = frame.cols > 480 ? 2 : 1; detector.setThresholdParams(scale > 1 ? 11 : 7, 4); - const float focal_length_w = 0.5 * grayscale.cols / tan(0.5 * fov * HT_PI / 180); - const float focal_length_h = 0.5 * grayscale.rows / tan(0.5 * fov * grayscale.rows / grayscale.cols * HT_PI / 180.0); + const float focal_length_w = 0.5 * grayscale.cols / tan(0.5 * s.fov * HT_PI / 180); + const float focal_length_h = 0.5 * grayscale.rows / tan(0.5 * s.fov * grayscale.rows / grayscale.cols * HT_PI / 180.0); cv::Mat intrinsics = cv::Mat::eye(3, 3, CV_32FC1); intrinsics.at (0, 0) = focal_length_w; intrinsics.at (1, 1) = focal_length_h; @@ -275,12 +257,12 @@ void Tracker::run() if ((long) (time / freq) != (long) (last_time / freq)) { - last_fps = fps; - fps = 0; + last_fps = cur_fps; + cur_fps = 0; last_time = time; } - fps++; + cur_fps++; char buf[128]; @@ -296,18 +278,18 @@ void Tracker::run() const float size = 7; cv::Mat obj_points(4,3,CV_32FC1); - obj_points.at(1,0)=-size + headpos[0]; - obj_points.at(1,1)=-size + headpos[1]; - obj_points.at(1,2)=0 + headpos[2]; - obj_points.at(2,0)=size + headpos[0]; - obj_points.at(2,1)=-size + headpos[1]; - obj_points.at(2,2)=0 + headpos[2]; - obj_points.at(3,0)=size + headpos[0]; - obj_points.at(3,1)=size + headpos[1]; - obj_points.at(3,2)=0 + headpos[2]; - obj_points.at(0,0)=-size + headpos[0]; - obj_points.at(0,1)=size + headpos[1]; - obj_points.at(0,2)=0 + headpos[2]; + obj_points.at(1,0)=-size + s.headpos_x; + obj_points.at(1,1)=-size + s.headpos_y; + obj_points.at(1,2)=0 + s.headpos_z; + obj_points.at(2,0)=size + s.headpos_x; + obj_points.at(2,1)=-size + s.headpos_y; + obj_points.at(2,2)=0 + s.headpos_z; + obj_points.at(3,0)=size + s.headpos_x; + obj_points.at(3,1)=size + s.headpos_y; + obj_points.at(3,2)=0 + s.headpos_z; + obj_points.at(0,0)=-size + s.headpos_x; + obj_points.at(0,1)=size + s.headpos_y; + obj_points.at(0,2)=0 + s.headpos_z; last_roi = cv::Rect(65535, 65535, 0, 0); @@ -341,22 +323,12 @@ void Tracker::run() cv::Rodrigues(rvec, rotation_matrix); { - const double beta = headpitch * HT_PI / 180; - double pitch[] = { - 1, 0, 0, - 0, cos(beta), -sin(beta), - 0, sin(beta), cos(beta) - }; - cv::Mat rot(3, 3, CV_64F, pitch); - cv::Mat tvec2 = rot * tvec; - rotation_matrix = rot * rotation_matrix; - cv::Vec3d euler = cv::RQDecomp3x3(rotation_matrix, junk1, junk2); QMutexLocker lck(&mtx); for (int i = 0; i < 3; i++) - pose[i] = tvec2.at(i); + pose[i] = tvec.at(i); pose[Yaw] = euler[1]; pose[Pitch] = -euler[0]; @@ -389,17 +361,17 @@ void Tracker::GetHeadPoseData(double *data) { QMutexLocker lck(&mtx); - if (enableRX) + if (s.eyaw) data[Yaw] = pose[Yaw]; - if (enableRY) + if (s.epitch) data[Pitch] = pose[Pitch]; - if (enableRZ) + if (s.eroll) data[Roll] = pose[Roll]; - if (enableTX) + if (s.ex) data[TX] = pose[TX]; - if (enableTY) + if (s.ey) data[TY] = pose[TY]; - if (enableTZ) + if (s.ez) data[TZ] = pose[TZ]; } @@ -468,178 +440,49 @@ TrackerControls::TrackerControls() tracker = nullptr; ui.setupUi(this); setAttribute(Qt::WA_NativeWindow, true); - connect(ui.cameraName, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.cameraFPS, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.cameraFOV, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); - connect(ui.rx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.ry, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.rz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.tx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.ty, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); - connect(ui.cx, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); - connect(ui.cy, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); - connect(ui.cz, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); - //connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel())); - //connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK())); - //connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings())); + tie_setting(s.camera_index, ui.cameraName); + tie_setting(s.force_fps, ui.cameraFPS); + tie_setting(s.fov, ui.cameraFOV); + tie_setting(s.eyaw, ui.rx); + tie_setting(s.epitch, ui.ry); + tie_setting(s.eroll, ui.rz); + tie_setting(s.ex, ui.tx); + tie_setting(s.ey, ui.ty); + tie_setting(s.ez, ui.tz); + tie_setting(s.headpos_x, ui.cx); + tie_setting(s.headpos_y, ui.cy); + tie_setting(s.headpos_z, ui.cz); + tie_setting(s.red_only, ui.red_only); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - loadSettings(); - settingsDirty = false; -} - -TrackerControls::~TrackerControls() -{ -} - -void TrackerControls::showEvent(QShowEvent *) -{ -} - -void TrackerControls::Initialize(QWidget*) -{ - loadSettings(); - show(); -} - -void TrackerControls::loadSettings() -{ - ui.cameraName->clear(); - QList names = get_camera_names(); - names.prepend("Any available"); - ui.cameraName->addItems(names); - QSettings settings("opentrack"); - QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); - QSettings iniFile( currentFile, QSettings::IniFormat ); - iniFile.beginGroup( "aruco-Tracker" ); - ui.cameraName->setCurrentIndex(iniFile.value("camera-index", -1).toInt() + 1); - ui.cameraFOV->setValue(iniFile.value("fov", 56).toFloat()); - int fps; - switch (iniFile.value("fps", 0).toInt()) - { - default: - case 0: - fps = 0; - break; - case 30: - fps = 1; - break; - case 60: - fps = 2; - break; - case 120: - fps = 3; - break; - } - ui.cameraFPS->setCurrentIndex(fps); - ui.rx->setCheckState(iniFile.value("enable-rx", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.ry->setCheckState(iniFile.value("enable-ry", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.rz->setCheckState(iniFile.value("enable-rz", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.tx->setCheckState(iniFile.value("enable-tx", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.ty->setCheckState(iniFile.value("enable-ty", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.tz->setCheckState(iniFile.value("enable-tz", true).toBool() ? Qt::Checked : Qt::Unchecked); - ui.resolution->setCurrentIndex(iniFile.value("resolution", 0).toInt()); - - QDoubleSpinBox* headpos[] = { - ui.cx, - ui.cy, - ui.cz - }; - - for (int i = 0; i < 3; i++) - { - headpos[i]->setValue(iniFile.value(QString("headpos-%1").arg(i)).toDouble()); - } - - ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble()); - ui.red_only->setChecked(iniFile.value("red-only", true).toBool()); - iniFile.endGroup(); - settingsDirty = false; -} - -void TrackerControls::save() -{ - QSettings settings("opentrack"); - QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); - QSettings iniFile( currentFile, QSettings::IniFormat ); - - iniFile.beginGroup( "aruco-Tracker" ); - iniFile.setValue("fov", ui.cameraFOV->value()); - int fps; - switch (ui.cameraFPS->currentIndex()) - { - case 0: - default: - fps = 0; - break; - case 1: - fps = 30; - break; - case 2: - fps = 60; - break; - case 3: - fps = 120; - break; - } - iniFile.setValue("fps", fps); - iniFile.setValue("camera-index", ui.cameraName->currentIndex() - 1); - iniFile.setValue("enable-rx", ui.rx->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("enable-ry", ui.ry->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("enable-rz", ui.rz->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("enable-tx", ui.tx->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("enable-ty", ui.ty->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false); - iniFile.setValue("resolution", ui.resolution->currentIndex()); - iniFile.setValue("pitch", ui.pitch_deg->value()); - - QDoubleSpinBox* headpos[] = { - ui.cx, - ui.cy, - ui.cz - }; - - for (int i = 0; i < 3; i++) - { - iniFile.setValue(QString("headpos-%1").arg(i), headpos[i]->value()); - } - iniFile.setValue("red-only", ui.red_only->isChecked()); - iniFile.endGroup(); - settingsDirty = false; - if (tracker) - tracker->load_settings(); + ui.cameraName->addItems(get_camera_names()); } void TrackerControls::doOK() { - save(); + s.b->save(); this->close(); } void TrackerControls::doCancel() { - if (settingsDirty) { + if (s.b->modifiedp()) { int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", - QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, - QMessageBox::Discard ); + QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel ); switch (ret) { case QMessageBox::Save: - save(); + s.b->save(); this->close(); break; case QMessageBox::Discard: + s.b->revert(); this->close(); break; case QMessageBox::Cancel: - // Cancel was clicked - break; - default: - // should never be reached - break; + break; } } else { diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 545ad5d0..23598f4d 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -18,6 +18,33 @@ #include #include #include +#include "facetracknoir/options.hpp" +using namespace options; + +struct settings { + pbundle b; + value fov, headpos_x, headpos_y, headpos_z; + value camera_index, force_fps, resolution; + value red_only; + value eyaw, epitch, eroll, ex, ey, ez; + settings() : + b(bundle("aruco-tracker")), + fov(b, "field-of-view", 56), + headpos_x(b, "headpos-x", 0), + headpos_y(b, "headpos-y", 0), + headpos_z(b, "headpos-z", 0), + camera_index(b, "camera-index", 0), + force_fps(b, "force-fps", 0), + resolution(b, "force-resolution", 0), + red_only(b, "red-only", false), + eyaw(b, "enable-y", true), + epitch(b, "enable-p", true), + eroll(b, "enable-r", true), + ex(b, "enable-x", true), + ey(b, "enable-y", true), + ez(b, "enable-z", true) + {} +}; class Tracker : protected QThread, public ITracker { @@ -27,22 +54,16 @@ public: virtual ~Tracker(); void StartTracker(QFrame* frame); void GetHeadPoseData(double *data); - bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ; void run(); - void load_settings(); private: QMutex mtx; - ArucoVideoWidget* videoWidget; - QHBoxLayout* layout; volatile bool stop; - float fov; - int camera_index; - int force_fps, force_width, force_height; + QHBoxLayout* layout; + ArucoVideoWidget* videoWidget; + settings s; double pose[6]; cv::Mat frame; - double headpos[3], headpitch; cv::VideoCapture camera; - volatile bool red_only; }; // Widget that has controls for FTNoIR protocol client-settings. @@ -50,32 +71,20 @@ class TrackerControls : public QWidget, public ITrackerDialog { Q_OBJECT public: - - explicit TrackerControls(); - virtual ~TrackerControls(); - void showEvent (QShowEvent *); - - void Initialize(QWidget *); + TrackerControls(); void registerTracker(ITracker * x) { tracker = dynamic_cast(x); } void unRegisterTracker() { tracker = nullptr; } - private: Ui::Form ui; - void loadSettings(); - void save(); - bool settingsDirty; Tracker* tracker; - + settings s; private slots: void doOK(); void doCancel(); - void settingChanged() { settingsDirty = true; } - void settingChanged(int) { settingsDirty = true; } - void settingChanged(double) { settingsDirty = true; } }; #endif diff --git a/ftnoir_tracker_base/ftnoir_tracker_base.h b/ftnoir_tracker_base/ftnoir_tracker_base.h index 16f76cf3..b8e16e9d 100644 --- a/ftnoir_tracker_base/ftnoir_tracker_base.h +++ b/ftnoir_tracker_base/ftnoir_tracker_base.h @@ -58,8 +58,7 @@ inline ITracker::~ITracker() { } struct ITrackerDialog { virtual ~ITrackerDialog() {} - virtual void Initialize(QWidget *parent) = 0; - virtual void registerTracker(ITracker *tracker) = 0; + virtual void registerTracker(ITracker *tracker) = 0; virtual void unRegisterTracker() = 0; }; diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp index 3547dd6b..6fef2db0 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp @@ -403,7 +403,6 @@ void FTNoIR_Tracker::GetHeadPoseData(THeadPoseData *data) CptError=0; return; } -#ifdef OPENTRACK_API data[frame_cnt] = (long) HAT.Code; struct Fun { @@ -446,39 +445,6 @@ void FTNoIR_Tracker::GetHeadPoseData(THeadPoseData *data) if (settings.InvertZ) data[TZ] = HAT.Trans[Fun::clamp3(settings.ZAxe)]* -1.0f; else data[TZ] = HAT.Trans[Fun::clamp3(settings.ZAxe)]; } -#else - data->frame_number = (long) HAT.Code; - - if (bEnableYaw) { - if (bInvertYaw ) data->yaw = (double) HAT.Rot[iYawAxe] * -1.0f; - else data->yaw = (double) HAT.Rot[iYawAxe]; - } - - if (bEnablePitch) { - if (bInvertPitch)data->pitch = (double) HAT.Rot[iPitchAxe] * -1.0f; - else data->pitch = (double) HAT.Rot[iPitchAxe]; - } - - if (bEnableRoll) { - if (bInvertRoll) data->roll = (double) HAT.Rot[iRollAxe] * -1.0f; - else data->roll = (double) HAT.Rot[iRollAxe]; - } - - if (bEnableX) { - if (bInvertX) data->x = (double) HAT.Trans[iXAxe]* -1.0f; - else data->x = (double) HAT.Trans[iXAxe]; - } - - if (bEnableY) { - if (bInvertY) data->y = (double) HAT.Trans[iYAxe]* -1.0f; - else data->y = (double) HAT.Trans[iYAxe]; - } - - if (bEnableZ) { - if (bInvertZ) data->z = (double) HAT.Trans[iZAxe]* -1.0f; - else data->z = (double) HAT.Trans[iZAxe]; - } -#endif } void FTNoIR_Tracker::applysettings(const TrackerSettings& settings){ diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h index a4243c38..57ead58d 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h @@ -27,15 +27,8 @@ public: FTNoIR_Tracker(); ~FTNoIR_Tracker(); -#ifdef OPENTRACK_API virtual void StartTracker(QFrame*); virtual void GetHeadPoseData(double* data); -#else - void Initialize( QFrame *videoframe ); - virtual void StartTracker(HWND parent_window); - virtual void StopTracker(bool exit); - virtual bool GetHeadPoseData(THeadPoseData *data); -#endif void applysettings(const TrackerSettings& settings); void notifyCenter(); bool notifyZeroed(); diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp index 0ef723c9..2ef75b89 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp @@ -146,24 +146,6 @@ TrackerControls::TrackerControls() : theTracker(NULL), timer(this) connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info())); } -// -// Destructor for server-dialog -// -TrackerControls::~TrackerControls() { -} - -// -// Initialize tracker-client-dialog -// -void TrackerControls::Initialize(QWidget *parent) { - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - - // // Center asked to ARDUINO // diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h index 82c69e0d..fe16e5e8 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h @@ -21,8 +21,6 @@ class TrackerControls: public QWidget, public ITrackerDialog Q_OBJECT public: explicit TrackerControls(); - virtual ~TrackerControls(); - void Initialize(QWidget *parent) virt_override; void registerTracker(ITracker *tracker) virt_override; void unRegisterTracker() virt_override; private: @@ -30,7 +28,7 @@ private: FTNoIR_Tracker *theTracker; QTime last_time; -public slots: +public slots: void WriteMsgInfo(const QByteArray &MsgInfo); protected slots: diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index e154557e..1773b018 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -275,11 +275,6 @@ TrackerControls::TrackerControls() connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); } -void TrackerControls::Initialize(QWidget*) -{ - show(); -} - void TrackerControls::doOK() { s.b->save(); diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index f45e54f9..b3c89136 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -62,7 +62,6 @@ class TrackerControls : public QWidget, public ITrackerDialog Q_OBJECT public: explicit TrackerControls(); - void Initialize(QWidget *); void registerTracker(ITracker *) {} void unRegisterTracker() {} diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h index 16629c3a..8d91dfbb 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h @@ -45,7 +45,6 @@ class TrackerControls: public QWidget, public ITrackerDialog Q_OBJECT public: explicit TrackerControls(); - void Initialize(QWidget *parent); void registerTracker(ITracker *) {} void unRegisterTracker() {} private: diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp index e92180a3..4a2deb9f 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp @@ -18,15 +18,6 @@ QWidget() tie_setting(s.bEnableZ, ui.chkEnableZ); } -void TrackerControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void TrackerControls::doOK() { s.b->save(); this->close(); diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h index 9c856d85..67291e6f 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h @@ -62,11 +62,7 @@ class TrackerControls: public QWidget, public ITrackerDialog { Q_OBJECT public: - explicit TrackerControls(); - ~TrackerControls(); - void showEvent (QShowEvent *); - - void Initialize(QWidget *parent); + TrackerControls(); void registerTracker(ITracker *foo) { tracker = dynamic_cast(foo); } diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp index af3613d9..42ca8689 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp @@ -50,29 +50,11 @@ fin: loadSettings(); } -// -// Destructor for server-dialog -// -TrackerControls::~TrackerControls() { -} - -void TrackerControls::Initialize(QWidget *parent) { - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void TrackerControls::doOK() { save(); this->close(); } -void TrackerControls::showEvent ( QShowEvent * ) { - loadSettings(); -} - void TrackerControls::doCancel() { if (settingsDirty) { int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard ); diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp index e10db0bf..b548db71 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp @@ -26,8 +26,6 @@ Rift_Tracker::~Rift_Tracker() System::Destroy(); } - - void Rift_Tracker::StartTracker(QFrame*) { System::Init(Log::ConfigureDefaultLog(LogMask_All)); diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.h b/ftnoir_tracker_rift/ftnoir_tracker_rift.h index 80bf6ffa..b1f96bf2 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.h +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.h @@ -55,7 +55,6 @@ class TrackerControls: public QWidget, public ITrackerDialog public: explicit TrackerControls(); - void Initialize(QWidget *parent); void registerTracker(ITracker *) {} void unRegisterTracker() {} diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp index 5487da92..763ddd11 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp @@ -20,15 +20,6 @@ QWidget() tie_setting(s.useYawSpring, ui.yawSpring); } -void TrackerControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - void TrackerControls::doOK() { s.b->save(); this->close(); diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h index c7e9decf..7157f064 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h @@ -49,9 +49,6 @@ public: explicit TrackerControls(); ~TrackerControls(); - void showEvent (QShowEvent *); - - void Initialize(QWidget *parent); void registerTracker(ITracker *) {} void unRegisterTracker() {} diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp index e17d5c32..707abf37 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp @@ -60,34 +60,11 @@ TrackerControls::~TrackerControls() { qDebug() << "~TrackerControls() says: started"; } -// -// Initialize tracker-client-dialog -// -void TrackerControls::Initialize(QWidget *parent) { - - QPoint offsetpos(100, 100); - if (parent) { - this->move(parent->pos() + offsetpos); - } - show(); -} - -// -// OK clicked on server-dialog -// void TrackerControls::doOK() { save(); this->close(); } -// override show event -void TrackerControls::showEvent ( QShowEvent * ) { - loadSettings(); -} - -// -// Cancel clicked on server-dialog -// void TrackerControls::doCancel() { // // Ask if changed Settings should be saved -- cgit v1.2.3 From c2e56bd21ee40501dab53b3647c8bdd1f370dba3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Jan 2014 11:28:59 +0100 Subject: don't reference QSettings anymore --- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 1 - ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 1 - ftnoir_protocol_wine/ftnoir_protocol_wine.h | 1 - ftnoir_tracker_hatire/ftnoir_tracker_hat.h | 1 - ftnoir_tracker_ht/stdafx.h | 1 - ftnoir_tracker_hydra/ftnoir_tracker_hydra.h | 1 - ftnoir_tracker_rift/ftnoir_tracker_rift.h | 1 - ftnoir_tracker_udp/ftnoir_tracker_udp.h | 1 - 8 files changed, 8 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index d5dc2cfe..99e6c6a1 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "facetracknoir/global-settings.h" #include "facetracknoir/options.h" diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index 5df59919..f92bb7bb 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -9,7 +9,6 @@ #include "ui_ftnoir_libevdev_controls.h" #include -#include #include "facetracknoir/global-settings.h" extern "C" { diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index e84dbd69..50d2bc0c 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -33,7 +33,6 @@ #include "ftnoir_csv/csv.h" #include "ui_ftnoir_winecontrols.h" #include -#include #include #include #include diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h index 57ead58d..0dbc4c8c 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h @@ -16,7 +16,6 @@ #include #include #include -#include #define VER_FILEVERSION_STR "Version 2.0.7\0" diff --git a/ftnoir_tracker_ht/stdafx.h b/ftnoir_tracker_ht/stdafx.h index 0e532c9f..6f1539b7 100644 --- a/ftnoir_tracker_ht/stdafx.h +++ b/ftnoir_tracker_ht/stdafx.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h index e569efab..05a8b076 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h @@ -1,7 +1,6 @@ #include "ftnoir_tracker_base/ftnoir_tracker_base.h" #include "ui_ftnoir_hydra_clientcontrols.h" #include -#include #include #include #include "facetracknoir/global-settings.h" diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.h b/ftnoir_tracker_rift/ftnoir_tracker_rift.h index dd673308..7162b7ca 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.h +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.h @@ -2,7 +2,6 @@ #include "ftnoir_tracker_base/ftnoir_tracker_base.h" #include "ui_ftnoir_rift_clientcontrols.h" #include -#include #include #include #include "facetracknoir/global-settings.h" diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h index 140a935d..20d4f742 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 65facfc7c819a5fc14385aedbb2848eb68bac390 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 15 Jan 2014 19:17:51 +0100 Subject: make all tracker/protocol/filter dialogs non-modal --- FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui | 2 +- ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui | 2 +- ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui | 2 +- ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui | 2 +- ftnoir_protocol_fg/ftnoir_fgcontrols.ui | 2 +- ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui | 2 +- ftnoir_protocol_ft/ftnoir_ftcontrols.ui | 2 +- ftnoir_protocol_ftn/ftnoir_ftncontrols.ui | 2 +- ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui | 2 +- ftnoir_protocol_mouse/ftnoir_mousecontrols.ui | 2 +- ftnoir_protocol_sc/ftnoir_sccontrols.ui | 2 +- ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui | 2 +- ftnoir_protocol_wine/ftnoir_winecontrols.ui | 2 +- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 2 +- ftnoir_tracker_ht/ht-trackercontrols.ui | 2 +- ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui | 2 +- ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui | 2 +- ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui | 2 +- ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) (limited to 'ftnoir_protocol_libevdev') diff --git a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui index bdbed955..0bbec7e1 100644 --- a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui +++ b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui @@ -3,7 +3,7 @@ UICPTClientControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui index debd1250..c544263d 100644 --- a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui +++ b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui @@ -3,7 +3,7 @@ AccelaUICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui index a1083265..8ee633cc 100644 --- a/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui +++ b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui @@ -3,7 +3,7 @@ UICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui b/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui index a9fdec6e..e0c849c9 100644 --- a/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui +++ b/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui @@ -3,7 +3,7 @@ KalmanUICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui index e351647b..a4092c05 100644 --- a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui +++ b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui @@ -3,7 +3,7 @@ UICFGControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui b/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui index 1ce77862..6cb066bd 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui +++ b/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui @@ -3,7 +3,7 @@ UICFSUIPCControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_ft/ftnoir_ftcontrols.ui b/ftnoir_protocol_ft/ftnoir_ftcontrols.ui index bd5980b4..941aaff0 100644 --- a/ftnoir_protocol_ft/ftnoir_ftcontrols.ui +++ b/ftnoir_protocol_ft/ftnoir_ftcontrols.ui @@ -3,7 +3,7 @@ UICFTControls - Qt::ApplicationModal + Qt::NonModal true diff --git a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui b/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui index 429e7046..48679f3c 100644 --- a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui +++ b/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui @@ -3,7 +3,7 @@ UICFTNControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui index e85e001e..d2b86445 100644 --- a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui +++ b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui @@ -3,7 +3,7 @@ UICLibevdevControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui b/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui index 540e4f0d..2705fff7 100644 --- a/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui +++ b/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui @@ -3,7 +3,7 @@ UICMOUSEControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_sc/ftnoir_sccontrols.ui b/ftnoir_protocol_sc/ftnoir_sccontrols.ui index 430b3912..87dc8d86 100644 --- a/ftnoir_protocol_sc/ftnoir_sccontrols.ui +++ b/ftnoir_protocol_sc/ftnoir_sccontrols.ui @@ -3,7 +3,7 @@ UICSCControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui b/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui index 94b229fb..2214b887 100644 --- a/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui +++ b/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui @@ -3,7 +3,7 @@ UICVJoyControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_wine/ftnoir_winecontrols.ui b/ftnoir_protocol_wine/ftnoir_winecontrols.ui index 749feb0f..9356c448 100644 --- a/ftnoir_protocol_wine/ftnoir_winecontrols.ui +++ b/ftnoir_protocol_wine/ftnoir_winecontrols.ui @@ -3,7 +3,7 @@ UICFTControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index e0794eb9..1d5a4241 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -3,7 +3,7 @@ Form - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_ht/ht-trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui index 55501ef1..f57022c8 100644 --- a/ftnoir_tracker_ht/ht-trackercontrols.ui +++ b/ftnoir_tracker_ht/ht-trackercontrols.ui @@ -3,7 +3,7 @@ Form - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui index 1acbf93f..e5e41bec 100644 --- a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui +++ b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui @@ -3,7 +3,7 @@ UIHydraControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui index 7522cf31..5d349169 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui @@ -3,7 +3,7 @@ UIJoystickControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui index e868a9c3..a9168239 100644 --- a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui +++ b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui @@ -3,7 +3,7 @@ UIRiftControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui index fc614477..5c602792 100644 --- a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui +++ b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui @@ -3,7 +3,7 @@ UICFTNClientControls - Qt::ApplicationModal + Qt::NonModal -- cgit v1.2.3