mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
@@ -3,11 +3,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "blackcore/coreruntime.h"
|
#include "blackcore/context_runtime.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
#include "blackcore/context_settings.h"
|
||||||
#include "tool.h"
|
#include "tool.h"
|
||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
|
||||||
|
#include <QMetaType>
|
||||||
|
#include <QMetaMethod>
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* DBus tests, tests marshalling / unmarshalling of many value classes.
|
* DBus tests, tests marshalling / unmarshalling of many value classes.
|
||||||
@@ -17,11 +21,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// metadata are registered in runtime
|
// metadata are registered in runtime
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
BlackCore::CCoreRuntime *core = new BlackCore::CCoreRuntime(true, &a);
|
BlackCore::CRuntime *core = new BlackCore::CRuntime(BlackCore::CRuntimeConfig::forCore(), &a);
|
||||||
|
|
||||||
QtConcurrent::run(BlackMiscTest::Tool::serverLoop, core); // QFuture<void> future
|
QtConcurrent::run(BlackMiscTest::Tool::serverLoop, core); // QFuture<void> future
|
||||||
qDebug() << "Server event loop, pid:" << BlackMiscTest::Tool::getPid();
|
qDebug() << "Server event loop, pid:" << BlackMiscTest::Tool::getPid();
|
||||||
|
|
||||||
// loop
|
// end
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#include "tool.h"
|
#include "tool.h"
|
||||||
#include "blackcore/coreruntime.h"
|
#include "blackcore/context_runtime.h"
|
||||||
#include "blackcore/context_network.h"
|
#include "blackcore/context_network.h"
|
||||||
#include "blackcore/context_audio.h"
|
#include "blackcore/context_audio.h"
|
||||||
|
#include "blackcore/context_settings.h"
|
||||||
#include "blackmisc/valuemap.h"
|
#include "blackmisc/valuemap.h"
|
||||||
#include "blackmisc/avallclasses.h"
|
#include "blackmisc/avallclasses.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pqallquantities.h"
|
||||||
@@ -42,23 +43,16 @@ namespace BlackMiscTest
|
|||||||
QString line;
|
QString line;
|
||||||
while (line != "x")
|
while (line != "x")
|
||||||
{
|
{
|
||||||
const BlackCore::IContextNetwork *networkContext = core->getIContextNetwork();
|
const BlackCore::IContextNetwork *networkContext = runtime->getIContextNetwork();
|
||||||
const BlackCore::IContextAudio *audioContext = core->getIContextAudio();
|
const BlackCore::IContextAudio *audioContext = runtime->getIContextAudio();
|
||||||
|
const BlackCore::IContextSettings *settingsContext = runtime->getIContextSettings();
|
||||||
|
|
||||||
// display current status
|
|
||||||
qDebug() << "-------------";
|
|
||||||
qDebug() << "ATC booked";
|
|
||||||
qDebug() << networkContext->getAtcStationsBooked().toQString();
|
|
||||||
qDebug() << "-------------";
|
|
||||||
qDebug() << "ATC online";
|
|
||||||
qDebug() << networkContext->getAtcStationsOnline().toQString();
|
|
||||||
|
|
||||||
// next round? Server
|
|
||||||
qDebug() << "-------------";
|
qDebug() << "-------------";
|
||||||
qDebug() << "Connected with network: " << networkContext->isConnected();
|
qDebug() << "Connected with network: " << networkContext->isConnected();
|
||||||
|
|
||||||
qDebug() << "-------------";
|
qDebug() << "-------------";
|
||||||
qDebug() << "Key x to exit";
|
qDebug() << "Key x to exit";
|
||||||
|
qDebug() << "0 .. settings";
|
||||||
qDebug() << "1 .. ATC booked";
|
qDebug() << "1 .. ATC booked";
|
||||||
qDebug() << "2 .. ATC online";
|
qDebug() << "2 .. ATC online";
|
||||||
qDebug() << "3 .. Aircrafts in range";
|
qDebug() << "3 .. Aircrafts in range";
|
||||||
@@ -67,7 +61,13 @@ namespace BlackMiscTest
|
|||||||
|
|
||||||
line = qtin.readLine();
|
line = qtin.readLine();
|
||||||
|
|
||||||
if (line.startsWith("1"))
|
if (line.startsWith("0"))
|
||||||
|
{
|
||||||
|
qDebug() << "-------------";
|
||||||
|
qDebug() << "Settings:" << settingsContext->getSettingsFileName();
|
||||||
|
qDebug() << settingsContext->getSettingsAsJsonString();
|
||||||
|
}
|
||||||
|
else if (line.startsWith("1"))
|
||||||
{
|
{
|
||||||
qDebug() << "-------------";
|
qDebug() << "-------------";
|
||||||
qDebug() << "ATC booked";
|
qDebug() << "ATC booked";
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ int main(int argc, char *argv[])
|
|||||||
BlackMisc::initResources();
|
BlackMisc::initResources();
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
CSamplesJson::samples();
|
CSamplesJson::samples();
|
||||||
// CSamplesChangeObject::samples();
|
CSamplesChangeObject::samples();
|
||||||
// CSamplesContainer::samples();
|
CSamplesContainer::samples();
|
||||||
// CSamplesMetadata::samples();
|
CSamplesMetadata::samples();
|
||||||
return a.exec();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user