mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
clang-format samples
This commit is contained in:
@@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
using namespace BlackCore::Afv::Clients;
|
using namespace BlackCore::Afv::Clients;
|
||||||
|
|
||||||
CAfvClientBridge::CAfvClientBridge(CAfvClient *afvClient, QObject *parent) :
|
CAfvClientBridge::CAfvClientBridge(CAfvClient *afvClient, QObject *parent) : QObject(parent),
|
||||||
QObject(parent),
|
|
||||||
m_afvClient(afvClient)
|
m_afvClient(afvClient)
|
||||||
{
|
{
|
||||||
connect(afvClient, &CAfvClient::receivingCallsignsChanged, this, &CAfvClientBridge::receivingCallsignsChanged);
|
connect(afvClient, &CAfvClient::receivingCallsignsChanged, this, &CAfvClientBridge::receivingCallsignsChanged);
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ int main(int argc, char *argv[])
|
|||||||
voiceClient->start(QThread::TimeCriticalPriority); // background thread
|
voiceClient->start(QThread::TimeCriticalPriority); // background thread
|
||||||
CAfvClientBridge *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa);
|
CAfvClientBridge *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa);
|
||||||
|
|
||||||
QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]()
|
QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]() {
|
||||||
{
|
|
||||||
voiceClient->quitAndWait();
|
voiceClient->quitAndWait();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -163,22 +163,34 @@ namespace BlackSample
|
|||||||
QString containsStr("aaa");
|
QString containsStr("aaa");
|
||||||
number = 0;
|
number = 0;
|
||||||
timer.start();
|
timer.start();
|
||||||
for (const auto &str : std::as_const(strList1)) { if (newRegex.match(str).hasMatch()) number++; }
|
for (const auto &str : std::as_const(strList1))
|
||||||
|
{
|
||||||
|
if (newRegex.match(str).hasMatch()) number++;
|
||||||
|
}
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "new regex matched " << number << " of" << strList1.size() << " strings in " << ms << "ms" << Qt::endl;
|
out << "new regex matched " << number << " of" << strList1.size() << " strings in " << ms << "ms" << Qt::endl;
|
||||||
number = 0;
|
number = 0;
|
||||||
timer.start();
|
timer.start();
|
||||||
for (const auto &str : std::as_const(strList2)) { if (fullRegex.exactMatch(str)) number++; }
|
for (const auto &str : std::as_const(strList2))
|
||||||
|
{
|
||||||
|
if (fullRegex.exactMatch(str)) number++;
|
||||||
|
}
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "full regex matched " << number << " of" << strList2.size() << " strings in " << ms << "ms" << Qt::endl;
|
out << "full regex matched " << number << " of" << strList2.size() << " strings in " << ms << "ms" << Qt::endl;
|
||||||
number = 0;
|
number = 0;
|
||||||
timer.start();
|
timer.start();
|
||||||
for (const auto &str : std::as_const(strList3)) { if (wildcardRegex.exactMatch(str)) number++; }
|
for (const auto &str : std::as_const(strList3))
|
||||||
|
{
|
||||||
|
if (wildcardRegex.exactMatch(str)) number++;
|
||||||
|
}
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "wildcard matched " << number << " of " << strList3.size() << " strings in " << ms << "ms" << Qt::endl;
|
out << "wildcard matched " << number << " of " << strList3.size() << " strings in " << ms << "ms" << Qt::endl;
|
||||||
number = 0;
|
number = 0;
|
||||||
timer.start();
|
timer.start();
|
||||||
for (const auto &str : std::as_const(strList4)) { if (str.contains(containsStr)) number++; }
|
for (const auto &str : std::as_const(strList4))
|
||||||
|
{
|
||||||
|
if (str.contains(containsStr)) number++;
|
||||||
|
}
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "contains matched " << number << " of " << strList4.size() << " strings in " << ms << "ms" << Qt::endl;
|
out << "contains matched " << number << " of " << strList4.size() << " strings in " << ms << "ms" << Qt::endl;
|
||||||
|
|
||||||
@@ -256,7 +268,8 @@ namespace BlackSample
|
|||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
situations.convertFromJson(json);
|
situations.convertFromJson(json);
|
||||||
out << "Convert 100,000 aircraft situations from JSON: " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Convert 100,000 aircraft situations from JSON: " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
json = models.toJson();
|
json = models.toJson();
|
||||||
@@ -264,7 +277,8 @@ namespace BlackSample
|
|||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
models.convertFromJson(json);
|
models.convertFromJson(json);
|
||||||
out << "Convert 10,000 aircraft models from JSON (naive): " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Convert 10,000 aircraft models from JSON (naive): " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
json = models.toMemoizedJson();
|
json = models.toMemoizedJson();
|
||||||
@@ -272,7 +286,8 @@ namespace BlackSample
|
|||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
models.convertFromMemoizedJson(json);
|
models.convertFromMemoizedJson(json);
|
||||||
out << "Convert 10,000 aircraft models from JSON (memoize): " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Convert 10,000 aircraft models from JSON (memoize): " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -349,8 +364,7 @@ namespace BlackSample
|
|||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
static const QString chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~_-=+!\"@#$%^&*()[]{} \t;:\\/?,.<>";
|
static const QString chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~_-=+!\"@#$%^&*()[]{} \t;:\\/?,.<>";
|
||||||
QStringList strings;
|
QStringList strings;
|
||||||
std::generate_n(std::back_inserter(strings), 100000, []
|
std::generate_n(std::back_inserter(strings), 100000, [] {
|
||||||
{
|
|
||||||
QString s;
|
QString s;
|
||||||
std::generate_n(std::back_inserter(s), 10, [] { return chars[CMathUtils::randomInteger(0, chars.size() - 1)]; });
|
std::generate_n(std::back_inserter(s), 10, [] { return chars[CMathUtils::randomInteger(0, chars.size() - 1)]; });
|
||||||
return s;
|
return s;
|
||||||
@@ -374,7 +388,8 @@ namespace BlackSample
|
|||||||
auto c = s.contains(upperRegex);
|
auto c = s.contains(upperRegex);
|
||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
out << "Check 100,000 strings for containing uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Check 100,000 strings for containing uppercase letter: (regex) " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
for (const QString &s : std::as_const(strings))
|
for (const QString &s : std::as_const(strings))
|
||||||
@@ -390,7 +405,8 @@ namespace BlackSample
|
|||||||
auto i = s.indexOf(upperRegex);
|
auto i = s.indexOf(upperRegex);
|
||||||
Q_UNUSED(i);
|
Q_UNUSED(i);
|
||||||
}
|
}
|
||||||
out << "Check 100,000 strings for index of first uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Check 100,000 strings for index of first uppercase letter: (regex) " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
auto temp = strings;
|
auto temp = strings;
|
||||||
timer.start();
|
timer.start();
|
||||||
@@ -406,7 +422,8 @@ namespace BlackSample
|
|||||||
{
|
{
|
||||||
s.remove(upperRegex);
|
s.remove(upperRegex);
|
||||||
}
|
}
|
||||||
out << "Remove from 100,000 strings all uppercase letters: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl;
|
out << "Remove from 100,000 strings all uppercase letters: (regex) " << timer.elapsed() << "ms" << endl
|
||||||
|
<< Qt::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
{
|
{
|
||||||
@@ -714,16 +731,13 @@ namespace BlackSample
|
|||||||
if (n < 1) { return; }
|
if (n < 1) { return; }
|
||||||
CAtcStation atc = CTesting::createStation(1);
|
CAtcStation atc = CTesting::createStation(1);
|
||||||
const QList<CCoordinateGeodetic> pos(
|
const QList<CCoordinateGeodetic> pos(
|
||||||
{
|
{ CCoordinateGeodetic(10.0, 10.0, 10.0),
|
||||||
CCoordinateGeodetic(10.0, 10.0, 10.0),
|
|
||||||
CCoordinateGeodetic(20.0, 20.0, 20.0),
|
CCoordinateGeodetic(20.0, 20.0, 20.0),
|
||||||
CCoordinateGeodetic(30.0, 30.0, 30.0),
|
CCoordinateGeodetic(30.0, 30.0, 30.0),
|
||||||
CCoordinateGeodetic(40.0, 40.0, 40.0),
|
CCoordinateGeodetic(40.0, 40.0, 40.0),
|
||||||
CCoordinateGeodetic(50.0, 50.0, 50.0),
|
CCoordinateGeodetic(50.0, 50.0, 50.0),
|
||||||
CCoordinateGeodetic(60.0, 60.0, 60.0),
|
CCoordinateGeodetic(60.0, 60.0, 60.0),
|
||||||
CCoordinateGeodetic(70.0, 70.0, 70.0)
|
CCoordinateGeodetic(70.0, 70.0, 70.0) });
|
||||||
}
|
|
||||||
);
|
|
||||||
const int s = pos.size();
|
const int s = pos.size();
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
@@ -745,13 +759,11 @@ namespace BlackSample
|
|||||||
void CSamplesPerformance::parseWgs(int times)
|
void CSamplesPerformance::parseWgs(int times)
|
||||||
{
|
{
|
||||||
static QStringList wgsLatLng(
|
static QStringList wgsLatLng(
|
||||||
{
|
{ "12° 11′ 10″ N", "11° 22′ 33″ W",
|
||||||
"12° 11′ 10″ N", "11° 22′ 33″ W",
|
|
||||||
"48° 21′ 13″ N", "11° 47′ 09″ E",
|
"48° 21′ 13″ N", "11° 47′ 09″ E",
|
||||||
" 8° 21′ 13″ N", "11° 47′ 09″ W",
|
" 8° 21′ 13″ N", "11° 47′ 09″ W",
|
||||||
"18° 21′ 13″ S", "11° 47′ 09″ E",
|
"18° 21′ 13″ S", "11° 47′ 09″ E",
|
||||||
"09° 12′ 13″ S", "11° 47′ 09″ W"
|
"09° 12′ 13″ S", "11° 47′ 09″ W" });
|
||||||
});
|
|
||||||
|
|
||||||
CCoordinateGeodetic c;
|
CCoordinateGeodetic c;
|
||||||
const CAltitude a(333, CLengthUnit::m());
|
const CAltitude a(333, CLengthUnit::m());
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ class QDBusConnection;
|
|||||||
class QObject;
|
class QObject;
|
||||||
class QProcess;
|
class QProcess;
|
||||||
|
|
||||||
namespace BlackMisc { class CDBusServer; }
|
namespace BlackMisc
|
||||||
|
{
|
||||||
|
class CDBusServer;
|
||||||
|
}
|
||||||
namespace BlackSample
|
namespace BlackSample
|
||||||
{
|
{
|
||||||
class Testservice; // forward declaration
|
class Testservice; // forward declaration
|
||||||
|
|||||||
@@ -46,19 +46,13 @@ namespace BlackSample
|
|||||||
CLongitude deltaLng = geo.longitude() - lng;
|
CLongitude deltaLng = geo.longitude() - lng;
|
||||||
|
|
||||||
out << latStr << " " << lngStr << Qt::endl;
|
out << latStr << " " << lngStr << Qt::endl;
|
||||||
out <<
|
out << lat.value(CAngleUnit::deg()) << " " << lat.value(CAngleUnit::sexagesimalDeg()) << " " << lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||||
lat.value(CAngleUnit::deg()) << " " << lat.value(CAngleUnit::sexagesimalDeg()) << " " <<
|
out << geo.latitude().value(CAngleUnit::deg()) << " " << geo.latitude().value(CAngleUnit::sexagesimalDeg()) << " " << geo.longitude().value(CAngleUnit::deg()) << " " << geo.longitude().value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||||
lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
|
||||||
out <<
|
|
||||||
geo.latitude().value(CAngleUnit::deg()) << " " << geo.latitude().value(CAngleUnit::sexagesimalDeg()) << " " <<
|
|
||||||
geo.longitude().value(CAngleUnit::deg()) << " " << geo.longitude().value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
|
||||||
|
|
||||||
out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << Qt::endl;
|
out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << Qt::endl;
|
||||||
|
|
||||||
// equal test
|
// equal test
|
||||||
out << "Equal? " <<
|
out << "Equal? " << BlackMisc::boolToYesNo(lat == geo.latitude()) << " " << BlackMisc::boolToYesNo(lng == geo.longitude()) << Qt::endl;
|
||||||
BlackMisc::boolToYesNo(lat == geo.latitude()) << " " <<
|
|
||||||
BlackMisc::boolToYesNo(lng == geo.longitude()) << Qt::endl;
|
|
||||||
|
|
||||||
// check if conversions to xyz have messed something up
|
// check if conversions to xyz have messed something up
|
||||||
QVector3D geoVector = geo.normalVector();
|
QVector3D geoVector = geo.normalVector();
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ namespace BlackSample
|
|||||||
CTemperature t2(20, CTemperatureUnit::C());
|
CTemperature t2(20, CTemperatureUnit::C());
|
||||||
CTemperature t3(1, CTemperatureUnit::F());
|
CTemperature t3(1, CTemperatureUnit::F());
|
||||||
out << t1 << " " << t2 << " " << t2.valueRoundedWithUnit(CTemperatureUnit::defaultUnit(), -1, true);
|
out << t1 << " " << t2 << " " << t2.valueRoundedWithUnit(CTemperatureUnit::defaultUnit(), -1, true);
|
||||||
out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " " << t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " " << "I18N/UTF" << Qt::endl;
|
out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " " << t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " "
|
||||||
|
<< "I18N/UTF" << Qt::endl;
|
||||||
|
|
||||||
(t1 - t2).switchUnit(CTemperatureUnit::F()); // was not working since wrong return type const
|
(t1 - t2).switchUnit(CTemperatureUnit::F()); // was not working since wrong return type const
|
||||||
// CLengthUnit duA(CSpeedUnit::ft_min()); // no longer possible
|
// CLengthUnit duA(CSpeedUnit::ft_min()); // no longer possible
|
||||||
@@ -125,7 +126,8 @@ namespace BlackSample
|
|||||||
out << ti6 << " " << ti7 << " " << ti8 << Qt::endl;
|
out << ti6 << " " << ti7 << " " << ti8 << Qt::endl;
|
||||||
|
|
||||||
CAcceleration ac1(10, CAccelerationUnit::m_s2());
|
CAcceleration ac1(10, CAccelerationUnit::m_s2());
|
||||||
out << ac1 << " " << ac1.toQString(true) << " " << ac1.valueRoundedWithUnit(-1, true) << " " << "I18N/UTF" << Qt::endl;
|
out << ac1 << " " << ac1.toQString(true) << " " << ac1.valueRoundedWithUnit(-1, true) << " "
|
||||||
|
<< "I18N/UTF" << Qt::endl;
|
||||||
|
|
||||||
// bye
|
// bye
|
||||||
out << "-----------------------------------------------" << Qt::endl;
|
out << "-----------------------------------------------" << Qt::endl;
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ int main(int argc, char *argv[])
|
|||||||
else if (i.startsWith("4")) { CSamplesVPilotRules::samples(streamOut, streamIn); }
|
else if (i.startsWith("4")) { CSamplesVPilotRules::samples(streamOut, streamIn); }
|
||||||
else if (i.startsWith("5")) { CSamplesP3D::samplesMisc(streamOut); }
|
else if (i.startsWith("5")) { CSamplesP3D::samplesMisc(streamOut); }
|
||||||
else if (i.startsWith("6")) { CSamplesFsuipc::samplesFsuipc(streamOut); }
|
else if (i.startsWith("6")) { CSamplesFsuipc::samplesFsuipc(streamOut); }
|
||||||
else if (i.startsWith("x")) { run = false; streamOut << "terminating" << Qt::endl; }
|
else if (i.startsWith("x"))
|
||||||
|
{
|
||||||
|
run = false;
|
||||||
|
streamOut << "terminating" << Qt::endl;
|
||||||
|
}
|
||||||
|
|
||||||
streamOut << Qt::endl;
|
streamOut << Qt::endl;
|
||||||
streamOut << Qt::endl;
|
streamOut << Qt::endl;
|
||||||
|
|||||||
@@ -35,10 +35,9 @@ namespace BlackSample
|
|||||||
void CSamplesFsCommon::samples(QTextStream &streamOut, QTextStream &streamIn)
|
void CSamplesFsCommon::samples(QTextStream &streamOut, QTextStream &streamIn)
|
||||||
{
|
{
|
||||||
const QString fsDir = CSampleUtils::selectDirectory(
|
const QString fsDir = CSampleUtils::selectDirectory(
|
||||||
{
|
{ "C:/Program Files (x86)/Microsoft Games/Microsoft Flight Simulator X/SimObjects",
|
||||||
"C:/Program Files (x86)/Microsoft Games/Microsoft Flight Simulator X/SimObjects",
|
"C:/Flight Simulator 9/Aircraft" },
|
||||||
"C:/Flight Simulator 9/Aircraft"
|
streamOut, streamIn);
|
||||||
}, streamOut, streamIn);
|
|
||||||
|
|
||||||
const QDir dir(fsDir);
|
const QDir dir(fsDir);
|
||||||
if (!dir.exists())
|
if (!dir.exists())
|
||||||
|
|||||||
@@ -46,11 +46,10 @@ namespace BlackSample
|
|||||||
|
|
||||||
// mapper with rule set, handing over ownership
|
// mapper with rule set, handing over ownership
|
||||||
const QString fsDir = CSampleUtils::selectDirectory(
|
const QString fsDir = CSampleUtils::selectDirectory(
|
||||||
{
|
{ QStringLiteral("P:/FlightSimulatorX (MSI)/SimObjects"),
|
||||||
QStringLiteral("P:/FlightSimulatorX (MSI)/SimObjects"),
|
|
||||||
QStringLiteral("P:/Temp/SimObjects"),
|
QStringLiteral("P:/Temp/SimObjects"),
|
||||||
QStringLiteral("C:/Flight Simulator 9/Aircraft")
|
QStringLiteral("C:/Flight Simulator 9/Aircraft") },
|
||||||
}, streamOut, streamIn);
|
streamOut, streamIn);
|
||||||
|
|
||||||
const CSimulatorInfo sim = fsDir.contains("simobjects", Qt::CaseInsensitive) ? CSimulatorInfo::FSX : CSimulatorInfo::FS9;
|
const CSimulatorInfo sim = fsDir.contains("simobjects", Qt::CaseInsensitive) ? CSimulatorInfo::FSX : CSimulatorInfo::FS9;
|
||||||
CMultiSimulatorSettings multiSettings;
|
CMultiSimulatorSettings multiSettings;
|
||||||
|
|||||||
@@ -275,8 +275,7 @@ namespace BlackSample
|
|||||||
int cruiseTrueAirspeed;
|
int cruiseTrueAirspeed;
|
||||||
QString flightRulesString;
|
QString flightRulesString;
|
||||||
QString route;
|
QString route;
|
||||||
args >> equipmentIcao >> originAirportIcao >> destinationAirportIcao >> alternateAirportIcao >> takeoffTimePlanned >> takeoffTimeActual
|
args >> equipmentIcao >> originAirportIcao >> destinationAirportIcao >> alternateAirportIcao >> takeoffTimePlanned >> takeoffTimeActual >> enrouteTime >> fuelTime >> cruiseAltitude >> cruiseTrueAirspeed >> flightRulesString >> route;
|
||||||
>> enrouteTime >> fuelTime >> cruiseAltitude >> cruiseTrueAirspeed >> flightRulesString >> route;
|
|
||||||
|
|
||||||
const CFlightPlan::FlightRules flightRules = CFlightPlan::stringToFlightRules(flightRulesString);
|
const CFlightPlan::FlightRules flightRules = CFlightPlan::stringToFlightRules(flightRulesString);
|
||||||
const CCallsign callsign("DAMBZ");
|
const CCallsign callsign("DAMBZ");
|
||||||
@@ -353,13 +352,7 @@ namespace BlackSample
|
|||||||
int xpdrCode;
|
int xpdrCode;
|
||||||
QString xpdrMode;
|
QString xpdrMode;
|
||||||
args >> lat >> lon >> alt >> hdg >> pitch >> bank >> gs >> com1 >> com2 >> xpdrCode >> xpdrMode;
|
args >> lat >> lon >> alt >> hdg >> pitch >> bank >> gs >> com1 >> com2 >> xpdrCode >> xpdrMode;
|
||||||
BlackMisc::Simulation::CSimulatedAircraft aircraft("", BlackMisc::Network::CUser(), BlackMisc::Aviation::CAircraftSituation(
|
BlackMisc::Simulation::CSimulatedAircraft aircraft("", BlackMisc::Network::CUser(), BlackMisc::Aviation::CAircraftSituation(BlackMisc::Geo::CCoordinateGeodetic(lat, lon, alt), BlackMisc::Aviation::CHeading(hdg, BlackMisc::Aviation::CHeading::True, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), BlackMisc::PhysicalQuantities::CAngle(pitch, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), BlackMisc::PhysicalQuantities::CAngle(bank, BlackMisc::PhysicalQuantities::CAngleUnit::deg()), BlackMisc::PhysicalQuantities::CSpeed(gs, BlackMisc::PhysicalQuantities::CSpeedUnit::kts())));
|
||||||
BlackMisc::Geo::CCoordinateGeodetic(lat, lon, alt),
|
|
||||||
BlackMisc::Aviation::CHeading(hdg, BlackMisc::Aviation::CHeading::True, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
|
||||||
BlackMisc::PhysicalQuantities::CAngle(pitch, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
|
||||||
BlackMisc::PhysicalQuantities::CAngle(bank, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
|
||||||
BlackMisc::PhysicalQuantities::CSpeed(gs, BlackMisc::PhysicalQuantities::CSpeedUnit::kts())
|
|
||||||
));
|
|
||||||
updateCockpit(
|
updateCockpit(
|
||||||
BlackMisc::Aviation::CComSystem("COM1", BlackMisc::PhysicalQuantities::CFrequency(com1, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
BlackMisc::Aviation::CComSystem("COM1", BlackMisc::PhysicalQuantities::CFrequency(com1, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
||||||
BlackMisc::Aviation::CComSystem("COM2", BlackMisc::PhysicalQuantities::CFrequency(com2, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
BlackMisc::Aviation::CComSystem("COM2", BlackMisc::PhysicalQuantities::CFrequency(com2, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
||||||
@@ -395,8 +388,7 @@ namespace BlackSample
|
|||||||
BlackMisc::Aviation::CHeading(hdg, BlackMisc::Aviation::CHeading::True, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
BlackMisc::Aviation::CHeading(hdg, BlackMisc::Aviation::CHeading::True, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
||||||
BlackMisc::PhysicalQuantities::CAngle(pitch, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
BlackMisc::PhysicalQuantities::CAngle(pitch, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
||||||
BlackMisc::PhysicalQuantities::CAngle(bank, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
BlackMisc::PhysicalQuantities::CAngle(bank, BlackMisc::PhysicalQuantities::CAngleUnit::deg()),
|
||||||
BlackMisc::PhysicalQuantities::CSpeed(gs, BlackMisc::PhysicalQuantities::CSpeedUnit::kts())
|
BlackMisc::PhysicalQuantities::CSpeed(gs, BlackMisc::PhysicalQuantities::CSpeedUnit::kts())));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::setOwnAircraftCockpitCmd(QTextStream &args)
|
void Client::setOwnAircraftCockpitCmd(QTextStream &args)
|
||||||
@@ -410,8 +402,7 @@ namespace BlackSample
|
|||||||
BlackMisc::Aviation::CComSystem("COM1", BlackMisc::PhysicalQuantities::CFrequency(com1, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
BlackMisc::Aviation::CComSystem("COM1", BlackMisc::PhysicalQuantities::CFrequency(com1, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
||||||
BlackMisc::Aviation::CComSystem("COM2", BlackMisc::PhysicalQuantities::CFrequency(com2, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
BlackMisc::Aviation::CComSystem("COM2", BlackMisc::PhysicalQuantities::CFrequency(com2, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz())),
|
||||||
BlackMisc::Aviation::CTransponder(xpdrCode, xpdrMode),
|
BlackMisc::Aviation::CTransponder(xpdrCode, xpdrMode),
|
||||||
"testclient"
|
"testclient");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::sendPingCmd(QTextStream &args)
|
void Client::sendPingCmd(QTextStream &args)
|
||||||
|
|||||||
@@ -40,10 +40,17 @@ namespace BlackMisc
|
|||||||
class CInformationMessage;
|
class CInformationMessage;
|
||||||
class CTransponder;
|
class CTransponder;
|
||||||
}
|
}
|
||||||
namespace Network { class CServer; }
|
namespace Network
|
||||||
namespace Simulation { class CSimulatedAircraft; }
|
{
|
||||||
|
class CServer;
|
||||||
}
|
}
|
||||||
template <class T> class QVector;
|
namespace Simulation
|
||||||
|
{
|
||||||
|
class CSimulatedAircraft;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template <class T>
|
||||||
|
class QVector;
|
||||||
|
|
||||||
namespace BlackSample
|
namespace BlackSample
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ using namespace BlackMisc::Geo;
|
|||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
|
|
||||||
|
|
||||||
CWeatherDataPrinter::CWeatherDataPrinter(QObject *parent) : QObject(parent)
|
CWeatherDataPrinter::CWeatherDataPrinter(QObject *parent) : QObject(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user