diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
commit | a8ffbb76f3e3bbca547fccf5135323e06cae9d2a (patch) | |
tree | cd77a5302cb4ead5995a2a86d5b5b6324ebf43ff /ftnoir_protocol_fg | |
parent | 0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff) |
update modules to refactored API
Diffstat (limited to 'ftnoir_protocol_fg')
-rw-r--r-- | ftnoir_protocol_fg/ftnoir_protocol_fg.cpp | 4 | ||||
-rw-r--r-- | ftnoir_protocol_fg/ftnoir_protocol_fg.h | 18 |
2 files changed, 10 insertions, 12 deletions
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp index b2d29118..8b5baaa8 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp @@ -35,7 +35,7 @@ void FTNoIR_Protocol::reloadSettings() s.b->reload(); } -void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { +void FTNoIR_Protocol::pose(const double* headpose) { FlightData.x = headpose[TX] * 1e-2; FlightData.y = headpose[TY] * 1e-2; FlightData.z = headpose[TZ] * 1e-2; @@ -52,7 +52,7 @@ void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(destPort)); } -bool FTNoIR_Protocol::checkServerInstallationOK() +bool FTNoIR_Protocol::correct() { return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); } diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index 4b25a3e1..44b79c06 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -52,9 +52,9 @@ struct settings { class FTNoIR_Protocol : public IProtocol { public: - bool checkServerInstallationOK(); - void sendHeadposeToGame(const double *headpose); - QString getGameName() { + bool correct(); + void pose(const double *headpose); + QString game_name() { return "FlightGear"; } void reloadSettings(); @@ -65,15 +65,15 @@ private: }; // Widget that has controls for FTNoIR protocol client-settings. -class FGControls: public QWidget, public IProtocolDialog +class FGControls: public IProtocolDialog { Q_OBJECT public: FGControls(); - void registerProtocol(IProtocol *protocol) { + void register_protocol(IProtocol *protocol) { theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol } - void unRegisterProtocol() { + void unregister_protocol() { theProtocol = NULL; // Reset the pointer } private: @@ -88,8 +88,6 @@ private slots: class FTNoIR_ProtocolDll : public Metadata { public: - void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); } - void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); } - void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear UDP protocol"); } - void getIcon(QIcon *icon) { *icon = QIcon(":/images/flightgear.png"); } + QString name() { return QString("FlightGear"); } + QIcon icon() { return QIcon(":/images/flightgear.png"); } }; |