diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:36:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:36:10 +0200 |
commit | 0bc78d53028f5ac68b9ab454347b8ad453988c08 (patch) | |
tree | 913abe48caeaf01e08707dfa4d0ef6aac3903b24 /proto-fg | |
parent | bf5954132b776b19b20586b0a4b2b622ab0642ea (diff) |
rename several protocols from abbreviated names
Diffstat (limited to 'proto-fg')
-rw-r--r-- | proto-fg/CMakeLists.txt | 1 | ||||
-rw-r--r-- | proto-fg/fg-protocol.qrc | 5 | ||||
-rw-r--r-- | proto-fg/ftnoir_fgcontrols.ui | 208 | ||||
-rw-r--r-- | proto-fg/ftnoir_protocol_fg.cpp | 33 | ||||
-rw-r--r-- | proto-fg/ftnoir_protocol_fg.h | 76 | ||||
-rw-r--r-- | proto-fg/ftnoir_protocol_fg_dialog.cpp | 58 | ||||
-rw-r--r-- | proto-fg/images/flightgear.png | bin | 979 -> 0 bytes | |||
-rw-r--r-- | proto-fg/lang/nl_NL.ts | 38 | ||||
-rw-r--r-- | proto-fg/lang/ru_RU.ts | 38 | ||||
-rw-r--r-- | proto-fg/lang/stub.ts | 38 |
10 files changed, 0 insertions, 495 deletions
diff --git a/proto-fg/CMakeLists.txt b/proto-fg/CMakeLists.txt deleted file mode 100644 index cdfe18a6..00000000 --- a/proto-fg/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -otr_module(proto-fgfs) diff --git a/proto-fg/fg-protocol.qrc b/proto-fg/fg-protocol.qrc deleted file mode 100644 index 1c685437..00000000 --- a/proto-fg/fg-protocol.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>images/flightgear.png</file> - </qresource> -</RCC> diff --git a/proto-fg/ftnoir_fgcontrols.ui b/proto-fg/ftnoir_fgcontrols.ui deleted file mode 100644 index 4c0a8314..00000000 --- a/proto-fg/ftnoir_fgcontrols.ui +++ /dev/null @@ -1,208 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>UICFGControls</class> - <widget class="QWidget" name="UICFGControls"> - <property name="windowModality"> - <enum>Qt::NonModal</enum> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>342</width> - <height>100</height> - </rect> - </property> - <property name="windowTitle"> - <string>FlightGear protocol settings</string> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="topMargin"> - <number>2</number> - </property> - <item> - <widget class="QFrame" name="frame"> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>IP address</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinIPFirstNibble"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - <property name="maximum"> - <number>255</number> - </property> - <property name="singleStep"> - <number>1</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinIPSecondNibble"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - <property name="maximum"> - <number>255</number> - </property> - <property name="singleStep"> - <number>1</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinIPThirdNibble"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - <property name="maximum"> - <number>255</number> - </property> - <property name="singleStep"> - <number>1</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinIPFourthNibble"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - <property name="maximum"> - <number>255</number> - </property> - <property name="singleStep"> - <number>1</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_2"> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="topMargin"> - <number>4</number> - </property> - <item> - <widget class="QLabel" name="label_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Port</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinPortNumber"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>1000</number> - </property> - <property name="maximum"> - <number>10000</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> - <slots> - <slot>startEngineClicked()</slot> - <slot>stopEngineClicked()</slot> - <slot>cameraSettingsClicked()</slot> - </slots> -</ui> diff --git a/proto-fg/ftnoir_protocol_fg.cpp b/proto-fg/ftnoir_protocol_fg.cpp deleted file mode 100644 index 3e0f955c..00000000 --- a/proto-fg/ftnoir_protocol_fg.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_fg.h" -#include "api/plugin-api.hpp" - -// For Todd and Arda Kutlu - -void flightgear::pose(const double* headpose) { - FlightData.x = -headpose[TX] * 1e-2; - FlightData.y = headpose[TY] * 1e-2; - FlightData.z = headpose[TZ] * 1e-2; - FlightData.p = headpose[Pitch]; - FlightData.h = -headpose[Yaw]; - FlightData.r = -headpose[Roll]; - FlightData.status = 1; - QHostAddress destIP(quint32(s.ip1 << 24 | s.ip2 << 16 | s.ip3 << 8 | s.ip4)); - (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(s.port)); -} - -bool flightgear::correct() -{ - return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); -} - -OPENTRACK_DECLARE_PROTOCOL(flightgear, FGControls, flightgearDll) diff --git a/proto-fg/ftnoir_protocol_fg.h b/proto-fg/ftnoir_protocol_fg.h deleted file mode 100644 index 48e5f1c1..00000000 --- a/proto-fg/ftnoir_protocol_fg.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#pragma once -#include "ui_ftnoir_fgcontrols.h" -#include <QThread> -#include <QUdpSocket> -#include <QMessageBox> -#include "api/plugin-api.hpp" -#include "options/options.hpp" -using namespace options; - -// x,y,z position in meters, heading, pitch and roll in degrees -#pragma pack(push, 1) -struct flightgear_datagram { - double x, y, z, h, p, r; - int status; -}; -#pragma pack(pop) - -struct settings : opts { - value<int> ip1, ip2, ip3, ip4; - value<int> port; - settings() : - opts("flightgear-proto"), - ip1(b, "ip1", 127), - ip2(b, "ip2", 0), - ip3(b, "ip3", 0), - ip4(b, "ip4", 1), - port(b, "port", 5542) - {} -}; - -class flightgear : public IProtocol -{ -public: - bool correct(); - void pose(const double *headpose); - QString game_name() { - return QCoreApplication::translate("flightgear", "FlightGear"); - } -private: - settings s; - flightgear_datagram FlightData; - QUdpSocket outSocket; -}; - -// Widget that has controls for FTNoIR protocol client-settings. -class FGControls: public IProtocolDialog -{ - Q_OBJECT -public: - FGControls(); - void register_protocol(IProtocol *) {} - void unregister_protocol() {} -private: - Ui::UICFGControls ui; - settings s; -private slots: - void doOK(); - void doCancel(); -}; - -class flightgearDll : public Metadata -{ -public: - QString name() { return QString(QCoreApplication::translate("flightgearDll", "FlightGear")); } - QIcon icon() { return QIcon(":/images/flightgear.png"); } -}; diff --git a/proto-fg/ftnoir_protocol_fg_dialog.cpp b/proto-fg/ftnoir_protocol_fg_dialog.cpp deleted file mode 100644 index 43a702f6..00000000 --- a/proto-fg/ftnoir_protocol_fg_dialog.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_fg.h" -#include "api/plugin-api.hpp" -#include "opentrack-library-path.h" - -#include <QString> -#include <QUrl> -#include <QDir> -#include <QDesktopServices> - -//******************************************************************************************************* -// FaceTrackNoIR Client Settings-dialog. -//******************************************************************************************************* - -// -// Constructor for server-settings-dialog -// -FGControls::FGControls() -{ - ui.setupUi( this ); - - tie_setting(s.ip1, ui.spinIPFirstNibble); - tie_setting(s.ip2, ui.spinIPSecondNibble); - tie_setting(s.ip3, ui.spinIPThirdNibble); - tie_setting(s.ip4, ui.spinIPFourthNibble); - tie_setting(s.port, ui.spinPortNumber); - - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); - connect(ui.buttonBox, &QDialogButtonBox::helpRequested, - ui.buttonBox, []() - { - static const QString contrib_dir = "file:///" + QDir::toNativeSeparators(QStringLiteral("%1/%2/%3"). - arg(OPENTRACK_BASE_PATH, OPENTRACK_CONTRIB_PATH, "FlightGear")); - QDesktopServices::openUrl(contrib_dir); - }); -} - -void FGControls::doOK() -{ - s.b->save(); - close(); -} - -void FGControls::doCancel() -{ - close(); -} - diff --git a/proto-fg/images/flightgear.png b/proto-fg/images/flightgear.png Binary files differdeleted file mode 100644 index 2a546642..00000000 --- a/proto-fg/images/flightgear.png +++ /dev/null diff --git a/proto-fg/lang/nl_NL.ts b/proto-fg/lang/nl_NL.ts deleted file mode 100644 index 35ab5431..00000000 --- a/proto-fg/lang/nl_NL.ts +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="nl_NL"> -<context> - <name>UICFGControls</name> - <message> - <location filename="../ftnoir_fgcontrols.ui" line="+17"/> - <source>FlightGear protocol settings</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+12"/> - <source>IP-address remote PC</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+71"/> - <source>Port-number</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgear</name> - <message> - <location filename="../ftnoir_protocol_fg.h" line="+40"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgearDll</name> - <message> - <location line="+27"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/proto-fg/lang/ru_RU.ts b/proto-fg/lang/ru_RU.ts deleted file mode 100644 index 916f5e2d..00000000 --- a/proto-fg/lang/ru_RU.ts +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ru_RU"> -<context> - <name>UICFGControls</name> - <message> - <location filename="../ftnoir_fgcontrols.ui" line="+17"/> - <source>FlightGear protocol settings</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+12"/> - <source>IP-address remote PC</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+71"/> - <source>Port-number</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgear</name> - <message> - <location filename="../ftnoir_protocol_fg.h" line="+40"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgearDll</name> - <message> - <location line="+27"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> diff --git a/proto-fg/lang/stub.ts b/proto-fg/lang/stub.ts deleted file mode 100644 index e94d44f2..00000000 --- a/proto-fg/lang/stub.ts +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1"> -<context> - <name>UICFGControls</name> - <message> - <location filename="../ftnoir_fgcontrols.ui" line="+17"/> - <source>FlightGear protocol settings</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+12"/> - <source>IP-address remote PC</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+71"/> - <source>Port-number</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgear</name> - <message> - <location filename="../ftnoir_protocol_fg.h" line="+40"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>flightgearDll</name> - <message> - <location line="+27"/> - <source>FlightGear</source> - <translation type="unfinished"></translation> - </message> -</context> -</TS> |