mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #485, adjusted samples
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3829aaeae8
commit
7a38afe8c3
@@ -7,13 +7,13 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include "sampleschangeobject.h"
|
||||
#include "samplesmetadata.h"
|
||||
#include "samplescontainer.h"
|
||||
#include "samplesjson.h"
|
||||
#include "samplesperformance.h"
|
||||
#include "samplesalgorithm.h"
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
#include "blackmisc/pq/pq.h"
|
||||
|
||||
@@ -22,21 +22,19 @@
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackSample;
|
||||
using namespace BlackCore;
|
||||
|
||||
//! main
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// I use QGuiApplication and not core application
|
||||
// I use CGuiApplication and not core application
|
||||
// otherwise no QPixmap metadata (metadata sample)
|
||||
QGuiApplication a(argc, argv);
|
||||
Q_UNUSED(a);
|
||||
QCoreApplication qa(argc, argv);
|
||||
CApplication a;
|
||||
|
||||
QTextStream qtout(stdout);
|
||||
QTextStream qtin(stdin);
|
||||
|
||||
BlackMisc::initResources();
|
||||
BlackMisc::registerMetadata();
|
||||
|
||||
do
|
||||
{
|
||||
qtout << "1 .. JSON" << endl;
|
||||
|
||||
@@ -7,7 +7,7 @@ TEMPLATE = app
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += blackmisc
|
||||
CONFIG += blackmisc blackcore blackgui
|
||||
|
||||
DEPENDPATH += . $$SourceRoot/src/blackmisc
|
||||
INCLUDEPATH += . $$SourceRoot/src
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
* Samples
|
||||
*/
|
||||
int CSamplesAlgorithm::samples()
|
||||
{
|
||||
BlackMisc::CSequence<int> seq;
|
||||
|
||||
@@ -29,10 +29,6 @@ using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
* Samples
|
||||
*/
|
||||
int CSamplesChangeObject::samples()
|
||||
{
|
||||
// ATC station
|
||||
|
||||
@@ -24,10 +24,6 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
* Samples
|
||||
*/
|
||||
int CSamplesPerformance::samplesMisc(QTextStream &out)
|
||||
{
|
||||
QTime timer;
|
||||
|
||||
@@ -13,34 +13,23 @@
|
||||
#include "samplesphysicalquantities.h"
|
||||
#include "samplesaviation.h"
|
||||
#include "samplesgeo.h"
|
||||
#include "blackcore/application.h"
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackSample;
|
||||
using namespace BlackCore;
|
||||
|
||||
//! main
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication(argc, argv);
|
||||
CApplication a;
|
||||
Q_UNUSED(a);
|
||||
|
||||
QTextStream out(stdout, QIODevice::WriteOnly);
|
||||
|
||||
BlackMisc::initResources();
|
||||
QFile file(":blackmisc/translations/blackmisc_i18n_de.qm");
|
||||
out << (file.exists() ? "Found translations in resources" : "No translations in resources") << endl;
|
||||
QTranslator translator;
|
||||
bool t = translator.load("blackmisc_i18n_de", ":blackmisc/translations/");
|
||||
out << (t ? "Translator loaded" : "Translator not loaded") << endl;
|
||||
|
||||
QCoreApplication a(argc, argv);
|
||||
out << "Use I18N version, y? n?";
|
||||
out.flush();
|
||||
int yn = getchar();
|
||||
t = (yn == 'y' || yn == 'Y');
|
||||
t = t ? a.installTranslator(&translator) : false;
|
||||
out << (t ? "Installed translator" : "No translator ");
|
||||
|
||||
CSamplesPhysicalQuantities::samples(out);
|
||||
CSamplesAviation::samples(out);
|
||||
CSamplesGeo::samples(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ TEMPLATE = app
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += blackmisc
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += blackmisc blackcore
|
||||
|
||||
DEPENDPATH += . $$SourceRoot/src/blackmisc
|
||||
INCLUDEPATH += . $$SourceRoot/src
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "samplesmodelmapping.h"
|
||||
#include "samplesvpilotrules.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
#include <QTime>
|
||||
|
||||
@@ -28,10 +28,6 @@ using namespace BlackMisc::Simulation::FsCommon;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
* Samples
|
||||
*/
|
||||
void CSamplesFsCommon::samples(QTextStream &streamOut, QTextStream &streamIn)
|
||||
{
|
||||
QString fsxDir = CSampleUtils::selectDirectory({"C:/Program Files (x86)/Microsoft Games/Microsoft Flight Simulator X/SimObjects",
|
||||
@@ -71,5 +67,4 @@ namespace BlackSample
|
||||
streamOut << "read entries from disk: " << entriesList.size() << " in " << time.restart() << "ms" << endl;
|
||||
tempFile.close();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user