mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
DBus enabling of base classes plus sample for testing / show how to use them. Also qdbuscpp2xml plugin for blackmisc classes.
This commit is contained in:
56
samples/blackmiscquantities_dbus/testservice.cpp
Normal file
56
samples/blackmiscquantities_dbus/testservice.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / authors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "testservice.h"
|
||||
|
||||
namespace BlackMiscTest
|
||||
{
|
||||
|
||||
const QString Testservice::ServiceName = QString(BLACKMISCKTEST_SERVICENAME);
|
||||
const QString Testservice::ServicePath = QString(BLACKMISCKTEST_SERVICEPATH);
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
Testservice::Testservice(QObject *parent) : QObject(parent)
|
||||
{
|
||||
// void
|
||||
}
|
||||
|
||||
/*
|
||||
* Slot to receive messages
|
||||
*/
|
||||
void Testservice::receiveStringMessage(const QString &message)
|
||||
{
|
||||
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received message:" << message;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive variant
|
||||
*/
|
||||
void Testservice::receiveVariant(const QDBusVariant &variant)
|
||||
{
|
||||
QVariant qv = variant.variant();
|
||||
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received variant:" << qv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive speed
|
||||
*/
|
||||
void Testservice::receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed)
|
||||
{
|
||||
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received speed:" << speed;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive COM unit
|
||||
*/
|
||||
void Testservice::receiveComUnit(const BlackMisc::Aviation::CComSystem &comUnit)
|
||||
{
|
||||
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received COM:" << comUnit;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user