mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
refs #267, samples for model matching
This commit is contained in:
@@ -4,8 +4,11 @@
|
|||||||
* 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 "blacksim/blacksimfreefunctions.h"
|
#include "blacksim/blacksimfreefunctions.h"
|
||||||
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "samplesfscommon.h"
|
#include "samplesfscommon.h"
|
||||||
#include "samplesfsx.h"
|
#include "samplesfsx.h"
|
||||||
|
#include "samplesmodelmapping.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -16,11 +19,16 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QTextStream streamIn(stdin);
|
QTextStream streamIn(stdin);
|
||||||
|
BlackMisc::registerMetadata();
|
||||||
BlackSim::registerMetadata();
|
BlackSim::registerMetadata();
|
||||||
|
|
||||||
qDebug() << "Run samples:";
|
qDebug() << "Run samples:";
|
||||||
qDebug() << "1 .. FS common";
|
qDebug() << "1 .. FS common";
|
||||||
qDebug() << "2 .. FSX";
|
qDebug() << "2 .. FSX";
|
||||||
|
qDebug() << "3 .. Mappings";
|
||||||
|
qDebug() << "x .. exit";
|
||||||
QString i = streamIn.readLine().toLower().trimmed();
|
QString i = streamIn.readLine().toLower().trimmed();
|
||||||
|
|
||||||
if (i.startsWith("1"))
|
if (i.startsWith("1"))
|
||||||
{
|
{
|
||||||
BlackSimTest::CSamplesFsCommon::samples();
|
BlackSimTest::CSamplesFsCommon::samples();
|
||||||
@@ -29,6 +37,15 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
BlackSimTest::CSamplesFsx::samples();
|
BlackSimTest::CSamplesFsx::samples();
|
||||||
}
|
}
|
||||||
|
else if (i.startsWith("3"))
|
||||||
|
{
|
||||||
|
BlackSimTest::CSamplesModelMapping::samples();
|
||||||
|
}
|
||||||
|
else if (i.startsWith("x"))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
37
samples/blacksim/samplesmodelmapping.cpp
Normal file
37
samples/blacksim/samplesmodelmapping.cpp
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/* Copyright (C) 2013 VATSIM Community / contributors
|
||||||
|
* 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 "samplesmodelmapping.h"
|
||||||
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
#include "blacksim/blacksimfreefunctions.h"
|
||||||
|
#include "blacksim/vpilotmodelmappings.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
using namespace BlackSim;
|
||||||
|
|
||||||
|
namespace BlackSimTest
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Samples
|
||||||
|
*/
|
||||||
|
int CSamplesModelMapping::samples()
|
||||||
|
{
|
||||||
|
BlackMisc::registerMetadata();
|
||||||
|
BlackSim::registerMetadata();
|
||||||
|
|
||||||
|
CVPilotModelMappings cvm;
|
||||||
|
cvm.addDirectory(CVPilotModelMappings::standardMappingsDirectory());
|
||||||
|
bool s = cvm.load();
|
||||||
|
qDebug() << "loaded:" << s << "size:" << cvm.size();
|
||||||
|
|
||||||
|
BlackMisc::Aviation::CAircraftIcao icao("C172");
|
||||||
|
qDebug() << cvm.findByIcao(icao);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
24
samples/blacksim/samplesmodelmapping.h
Normal file
24
samples/blacksim/samplesmodelmapping.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* Copyright (C) 2013 VATSIM Community / contributors
|
||||||
|
* 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/. */
|
||||||
|
|
||||||
|
#ifndef BLACKSIMTEST_SAMPLESMODELMAPPING_H
|
||||||
|
#define BLACKSIMTEST_SAMPLESMODELMAPPING_H
|
||||||
|
|
||||||
|
namespace BlackSimTest
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
* \brief Samples for model mapping classes
|
||||||
|
*/
|
||||||
|
class CSamplesModelMapping
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*!
|
||||||
|
* \brief Run the samples
|
||||||
|
*/
|
||||||
|
static int samples();
|
||||||
|
};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user