mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-12 04:35:41 +08:00
Ref T365, samples for addon/fsx config files
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "samplesfscommon.h"
|
||||
#include "samplesfsx.h"
|
||||
#include "samplesp3d.h"
|
||||
#include "samplesmodelmapping.h"
|
||||
#include "samplesvpilotrules.h"
|
||||
#include "blackcore/application.h"
|
||||
@@ -43,6 +44,7 @@ int main(int argc, char *argv[])
|
||||
streamOut << "2 .. FSX" << endl;
|
||||
streamOut << "3 .. Mappings" << endl;
|
||||
streamOut << "4 .. vPilot rules" << endl;
|
||||
streamOut << "5 .. P3D cfg files" << endl;
|
||||
streamOut << "x .. exit" << endl;
|
||||
QString i = streamIn.readLine().toLower().trimmed();
|
||||
|
||||
@@ -64,6 +66,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
BlackSample::CSamplesVPilotRules::samples(streamOut, streamIn);
|
||||
}
|
||||
else if (i.startsWith("5"))
|
||||
{
|
||||
BlackSample::CSamplesP3D::samplesMisc(streamOut);
|
||||
}
|
||||
else if (i.startsWith("x"))
|
||||
{
|
||||
streamOut << "terminating" << endl;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QTemporaryFile>
|
||||
#include <QTextStream>
|
||||
#include <QTime>
|
||||
#include <QDir>
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -40,6 +41,13 @@ namespace BlackSample
|
||||
"C:/Flight Simulator 9/Aircraft"
|
||||
}, streamOut, streamIn);
|
||||
|
||||
const QDir dir(fsDir);
|
||||
if (!dir.exists())
|
||||
{
|
||||
streamOut << "Directory does not exist:" << dir.absolutePath();
|
||||
return;
|
||||
}
|
||||
|
||||
const CSimulatorInfo sim = fsDir.contains("simobjects", Qt::CaseInsensitive) ? CSimulatorInfo::FSX : CSimulatorInfo::FS9;
|
||||
CMultiSimulatorSettings multiSettings;
|
||||
const CSimulatorSettings originalSettings = multiSettings.getSettings(sim);
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
//! \ingroup sampleblackmiscsim
|
||||
|
||||
#include "samplesfsx.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
|
||||
33
samples/blackmiscsim/samplesp3d.cpp
Normal file
33
samples/blackmiscsim/samplesp3d.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
//! \ingroup sampleblackmiscsim
|
||||
|
||||
#include "samplesp3d.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
void CSamplesP3D::samplesMisc(QTextStream &streamOut)
|
||||
{
|
||||
const QSet<QString> configFiles = CFsCommonUtil::findP3dAddOnConfigFiles("v4");
|
||||
streamOut << BlackMisc::joinStringSet(configFiles, ", ") << endl;
|
||||
|
||||
const QSet<QString> addOnPaths = CFsCommonUtil::allP3dAddOnPaths(configFiles.toList(), false);
|
||||
streamOut << BlackMisc::joinStringSet(addOnPaths, ", ") << endl;
|
||||
|
||||
const QSet<QString> simObjectPaths = CFsCommonUtil::fsxSimObjectsPaths("B:/fsx.cfg", false);
|
||||
streamOut << BlackMisc::joinStringSet(simObjectPaths, ", ") << endl;
|
||||
}
|
||||
} // namespace
|
||||
29
samples/blackmiscsim/samplesp3d.h
Normal file
29
samples/blackmiscsim/samplesp3d.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
//! \ingroup sampleblackmiscsim
|
||||
|
||||
#ifndef BLACKSAMPLE_SAMPLESP3D_H
|
||||
#define BLACKSAMPLE_SAMPLESP3D_H
|
||||
|
||||
class QTextStream;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for P3D classes
|
||||
class CSamplesP3D
|
||||
{
|
||||
public:
|
||||
//! Run the misc. samples
|
||||
static void samplesMisc(QTextStream &streamOut);
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user