mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-04 16:22:52 +08:00
refs #840, style and const-correctness
This commit is contained in:
committed by
Mathew Sutcliffe
parent
de72a678a2
commit
534b9fb09e
@@ -14,11 +14,12 @@
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/interpolator.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/pq/physicalquantity.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/airspaceaircraftsnapshot.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/pq/physicalquantity.h"
|
||||
#include "blackmisc/simplecommandparser.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/threadutils.h"
|
||||
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/interpolationrenderingsetup.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/connectionguard.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/simulation/aircraftmodelsetloader.h"
|
||||
#include "blackmisc/simulation/ownaircraftprovider.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
@@ -33,6 +29,10 @@
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/weather/weathergridprovider.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/connectionguard.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackCore;
|
||||
|
||||
namespace BlackGui
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BlackGui
|
||||
explicit CInternalsComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CInternalsComponent();
|
||||
virtual ~CInternalsComponent();
|
||||
|
||||
protected:
|
||||
//! \copydoc QWidget::showEvent
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/interpolationrenderingsetup.h"
|
||||
#include "interpolationrenderingsetup.h"
|
||||
#include "stringutils.h"
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/interpolator.h"
|
||||
#include "interpolator.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -15,7 +15,6 @@ using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
IInterpolator::IInterpolator(IRemoteAircraftProvider *provider, const QString &objectName, QObject *parent) :
|
||||
QObject(parent),
|
||||
CRemoteAircraftAware(provider)
|
||||
@@ -24,7 +23,7 @@ namespace BlackMisc
|
||||
this->setObjectName(objectName);
|
||||
}
|
||||
|
||||
BlackMisc::Aviation::CAircraftSituation IInterpolator::getInterpolatedSituation(const BlackMisc::Aviation::CCallsign &callsign, qint64 currentTimeSinceEpoc,
|
||||
BlackMisc::Aviation::CAircraftSituation IInterpolator::getInterpolatedSituation(const CCallsign &callsign, qint64 currentTimeSinceEpoc,
|
||||
bool isVtolAircraft, InterpolationStatus &status) const
|
||||
{
|
||||
// has to be thread safe
|
||||
@@ -37,7 +36,7 @@ namespace BlackMisc
|
||||
return currentSituation;
|
||||
}
|
||||
|
||||
CAircraftPartsList IInterpolator::getPartsBeforeTime(const CAircraftPartsList &parts, qint64 cutoffTime, BlackMisc::IInterpolator::PartsStatus &partsStatus) const
|
||||
CAircraftPartsList IInterpolator::getPartsBeforeTime(const CAircraftPartsList &parts, qint64 cutoffTime, IInterpolator::PartsStatus &partsStatus) const
|
||||
{
|
||||
partsStatus.reset();
|
||||
partsStatus.setSupportsParts(true);
|
||||
@@ -46,7 +45,7 @@ namespace BlackMisc
|
||||
return parts.findBefore(cutoffTime);
|
||||
}
|
||||
|
||||
CAircraftPartsList IInterpolator::getPartsBeforeTime(const CCallsign &callsign, qint64 cutoffTime, BlackMisc::IInterpolator::PartsStatus &partsStatus) const
|
||||
CAircraftPartsList IInterpolator::getPartsBeforeTime(const CCallsign &callsign, qint64 cutoffTime, IInterpolator::PartsStatus &partsStatus) const
|
||||
{
|
||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
partsStatus.reset();
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#ifndef BLACKMISC_INTERPOLATOR_H
|
||||
#define BLACKMISC_INTERPOLATOR_H
|
||||
|
||||
#include "interpolationrenderingsetup.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/interpolationrenderingsetup.h"
|
||||
#include "blackmisc/aviation/aircraftpartslist.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
@@ -41,12 +41,8 @@ namespace BlackMisc
|
||||
static QString getLogCategory() { return "swift.interpolator"; }
|
||||
|
||||
//! Status of interpolation
|
||||
struct BLACKMISC_EXPORT InterpolationStatus
|
||||
struct BLACKMISC_EXPORT InterpolationStatus // does not link without export/allTrue, reset
|
||||
{
|
||||
private:
|
||||
bool m_changedPosition = false; //!< position was changed
|
||||
bool m_interpolationSucceeded = false; //!< interpolation succeeded (means enough values, etc.)
|
||||
|
||||
public:
|
||||
//! Did interpolation succeed?
|
||||
bool didInterpolationSucceed() const { return m_interpolationSucceeded; }
|
||||
@@ -65,14 +61,15 @@ namespace BlackMisc
|
||||
|
||||
//! Reset to default values
|
||||
void reset();
|
||||
|
||||
private:
|
||||
bool m_changedPosition = false; //!< position was changed
|
||||
bool m_interpolationSucceeded = false; //!< interpolation succeeded (means enough values, etc.)
|
||||
};
|
||||
|
||||
//! Status regarding parts
|
||||
struct BLACKMISC_EXPORT PartsStatus
|
||||
struct BLACKMISC_EXPORT PartsStatus // does not link without export/allTrue, resetx
|
||||
{
|
||||
private:
|
||||
bool m_supportsParts = false; //!< supports parts for given callsign
|
||||
|
||||
public:
|
||||
//! all OK
|
||||
bool allTrue() const;
|
||||
@@ -85,6 +82,9 @@ namespace BlackMisc
|
||||
|
||||
//! Reset to default values
|
||||
void reset();
|
||||
|
||||
private:
|
||||
bool m_supportsParts = false; //!< supports parts for given callsign
|
||||
};
|
||||
|
||||
//! Current interpolated situation
|
||||
@@ -114,7 +114,7 @@ namespace BlackMisc
|
||||
|
||||
//! Enable debug messages etc.
|
||||
//! \threadsafe
|
||||
void setInterpolatorSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup);
|
||||
void setInterpolatorSetup(const CInterpolationAndRenderingSetup &setup);
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
@@ -122,11 +122,10 @@ namespace BlackMisc
|
||||
|
||||
//! Enable debug messages etc.
|
||||
//! \threadsafe
|
||||
BlackMisc::CInterpolationAndRenderingSetup getInterpolatorSetup() const;
|
||||
CInterpolationAndRenderingSetup getInterpolatorSetup() const;
|
||||
|
||||
BlackMisc::CInterpolationAndRenderingSetup m_setup; //!< allows to disable debug messages
|
||||
CInterpolationAndRenderingSetup m_setup; //!< allows to disable debug messages
|
||||
mutable QReadWriteLock m_lock; //!< lock interpolator
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/interpolatorlinear.h"
|
||||
#include "interpolatorlinear.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/aviation/heading.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/physicalquantity.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackmisc/range.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
@@ -29,10 +29,11 @@
|
||||
#include <QList>
|
||||
#include <array>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Math;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -49,11 +50,11 @@ namespace BlackMisc
|
||||
if (currentTimeMsSinceEpoc < 0) { currentTimeMsSinceEpoc = QDateTime::currentMSecsSinceEpoch(); }
|
||||
|
||||
// find the first situation not in the correct order, keep only the situations before that one
|
||||
auto end = std::is_sorted_until(situations.begin(), situations.end(), [](auto &&a, auto &&b) { return b.getAdjustedMSecsSinceEpoch() < a.getAdjustedMSecsSinceEpoch(); });
|
||||
auto end = std::is_sorted_until(situations.begin(), situations.end(), [](auto && a, auto && b) { return b.getAdjustedMSecsSinceEpoch() < a.getAdjustedMSecsSinceEpoch(); });
|
||||
auto validSituations = makeRange(situations.begin(), end);
|
||||
|
||||
// find the first situation earlier than the current time
|
||||
auto pivot = std::partition_point(validSituations.begin(), validSituations.end(), [ = ](auto &&s) { return s.getAdjustedMSecsSinceEpoch() > currentTimeMsSinceEpoc; });
|
||||
auto pivot = std::partition_point(validSituations.begin(), validSituations.end(), [ = ](auto && s) { return s.getAdjustedMSecsSinceEpoch() > currentTimeMsSinceEpoc; });
|
||||
auto situationsNewer = makeRange(validSituations.begin(), pivot);
|
||||
auto situationsOlder = makeRange(pivot, validSituations.end());
|
||||
|
||||
@@ -103,8 +104,8 @@ namespace BlackMisc
|
||||
// < 0 should not happen due to the split, > 1 can happen if new values are delayed beyond split time
|
||||
// 1) values > 1 mean extrapolation
|
||||
// 2) values > 2 mean no new situations coming in
|
||||
double distanceToSplitTime = newSituation.getAdjustedMSecsSinceEpoch() - currentTimeMsSinceEpoc;
|
||||
double simulationTimeFraction = 1.0 - (distanceToSplitTime / deltaTime);
|
||||
const double distanceToSplitTime = newSituation.getAdjustedMSecsSinceEpoch() - currentTimeMsSinceEpoc;
|
||||
const double simulationTimeFraction = 1.0 - (distanceToSplitTime / deltaTime);
|
||||
if (simulationTimeFraction > 2.0)
|
||||
{
|
||||
if (setup.showInterpolatorDebugMessages())
|
||||
@@ -128,9 +129,9 @@ namespace BlackMisc
|
||||
const CAltitude newAlt(newSituation.getAltitude());
|
||||
Q_ASSERT_X(oldAlt.getReferenceDatum() == newAlt.getReferenceDatum(), Q_FUNC_INFO, "mismatch in reference"); // otherwise no calculation is possible
|
||||
currentSituation.setAltitude(CAltitude((newAlt - oldAlt)
|
||||
* simulationTimeFraction
|
||||
+ oldAlt,
|
||||
oldAlt.getReferenceDatum()));
|
||||
* simulationTimeFraction
|
||||
+ oldAlt,
|
||||
oldAlt.getReferenceDatum()));
|
||||
|
||||
if (!setup.isForcingFullInterpolation() && !vtolAiracraft && newVec == oldVec && oldAlt == newAlt)
|
||||
{
|
||||
@@ -139,7 +140,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
// Interpolate heading: HDG = (HdgB - HdgA) * t + HdgA
|
||||
CHeading headingBegin = oldSituation.getHeading();
|
||||
const CHeading headingBegin = oldSituation.getHeading();
|
||||
CHeading headingEnd = newSituation.getHeading();
|
||||
|
||||
if ((headingEnd - headingBegin).value(CAngleUnit::deg()) < -180)
|
||||
@@ -153,14 +154,14 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
currentSituation.setHeading(CHeading((headingEnd - headingBegin)
|
||||
* simulationTimeFraction
|
||||
+ headingBegin,
|
||||
headingBegin.getReferenceNorth()));
|
||||
* simulationTimeFraction
|
||||
+ headingBegin,
|
||||
headingBegin.getReferenceNorth()));
|
||||
|
||||
// Interpolate Pitch: Pitch = (PitchB - PitchA) * t + PitchA
|
||||
CAngle pitchBegin = oldSituation.getPitch();
|
||||
CAngle pitchEnd = newSituation.getPitch();
|
||||
CAngle pitch = (pitchEnd - pitchBegin) * simulationTimeFraction + pitchBegin;
|
||||
const CAngle pitchBegin = oldSituation.getPitch();
|
||||
const CAngle pitchEnd = newSituation.getPitch();
|
||||
const CAngle pitch = (pitchEnd - pitchBegin) * simulationTimeFraction + pitchBegin;
|
||||
currentSituation.setPitch(pitch);
|
||||
|
||||
// Interpolate bank: Bank = (BankB - BankA) * t + BankA
|
||||
@@ -174,5 +175,4 @@ namespace BlackMisc
|
||||
+ oldSituation.getGroundSpeed());
|
||||
return currentSituation;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -12,10 +12,9 @@
|
||||
#ifndef BLACKMISC_INTERPOLATOR_LINEAR_H
|
||||
#define BLACKMISC_INTERPOLATOR_LINEAR_H
|
||||
|
||||
#include "interpolator.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/interpolator.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -43,9 +42,7 @@ namespace BlackMisc
|
||||
|
||||
//! Log category
|
||||
static QString getLogCategory() { return "swift.interpolatorlinear"; }
|
||||
};
|
||||
|
||||
} // guard
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
|
||||
@@ -16,17 +16,20 @@
|
||||
*/
|
||||
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/airspaceaircraftsnapshot.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackmisc/simulation/distributorlistpreferences.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/simulation/interpolationhints.h"
|
||||
#include "blackmisc/simulation/modelsettings.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorinfolist.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/simulatorsettings.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
#include "blackmisc/simulation/fscommon/vpilotmodelruleset.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -34,17 +34,17 @@ namespace BlackSimPlugin
|
||||
MPPositionVelocity positionVelocity;
|
||||
|
||||
// Latitude - integer and decimal places
|
||||
double latitude = newSituation.getPosition().latitude().value(CAngleUnit::deg()) * 10001750.0 / 90.0;
|
||||
const double latitude = newSituation.getPosition().latitude().value(CAngleUnit::deg()) * 10001750.0 / 90.0;
|
||||
positionVelocity.lat_i = static_cast<qint32>(latitude);
|
||||
positionVelocity.lat_f = qAbs((latitude - positionVelocity.lat_i) * 65536);
|
||||
|
||||
// Longitude - integer and decimal places
|
||||
double longitude = newSituation.getPosition().longitude().value(CAngleUnit::deg()) * (65536.0 * 65536.0) / 360.0;
|
||||
const double longitude = newSituation.getPosition().longitude().value(CAngleUnit::deg()) * (65536.0 * 65536.0) / 360.0;
|
||||
positionVelocity.lon_hi = static_cast<qint32>(longitude);
|
||||
positionVelocity.lon_lo = qAbs((longitude - positionVelocity.lon_hi) * 65536);
|
||||
|
||||
// Altitude - integer and decimal places
|
||||
double altitude = newSituation.getAltitude().value(CLengthUnit::m());
|
||||
const double altitude = newSituation.getAltitude().value(CLengthUnit::m());
|
||||
positionVelocity.alt_i = static_cast<qint32>(altitude);
|
||||
positionVelocity.alt_f = (altitude - positionVelocity.alt_i) * 65536;
|
||||
|
||||
@@ -71,7 +71,6 @@ namespace BlackSimPlugin
|
||||
helperPosition.setLongitude(oldPosition.longitude());
|
||||
CLength distanceLatitudeObj = calculateGreatCircleDistance(oldPosition, helperPosition);
|
||||
|
||||
|
||||
// Now we want the Longitude distance. Latitude must be equal for old and new position.
|
||||
helperPosition.setLatitude(oldPosition.latitude());
|
||||
helperPosition.setLongitude(newSituation.longitude());
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -81,7 +80,7 @@ namespace BlackSimPlugin
|
||||
|
||||
situation.setPosition(position);
|
||||
situation.setAltitude(CAltitude(dHigh + dLow, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
double groundSpeed = positionVelocity.ground_velocity / 65536.0;
|
||||
const double groundSpeed = positionVelocity.ground_velocity / 65536.0;
|
||||
situation.setGroundSpeed(CSpeed(groundSpeed, CSpeedUnit::m_s()));
|
||||
|
||||
FS_PBH pbhstrct;
|
||||
@@ -113,7 +112,7 @@ namespace BlackSimPlugin
|
||||
m_lobbyClient(lobbyClient)
|
||||
{
|
||||
connect(lobbyClient.data(), &CLobbyClient::disconnected, this, std::bind(&CSimulatorFs9::simulatorStatusChanged, this, 0));
|
||||
this->m_interpolator = new BlackMisc::CInterpolatorLinear(remoteAircraftProvider, this);
|
||||
m_interpolator = new CInterpolatorLinear(remoteAircraftProvider, this);
|
||||
m_defaultModel =
|
||||
{
|
||||
"Boeing 737-400",
|
||||
@@ -205,7 +204,7 @@ namespace BlackSimPlugin
|
||||
|
||||
int CSimulatorFs9::physicallyRemoveAllRemoteAircraft()
|
||||
{
|
||||
if (this->m_hashFs9Clients.isEmpty()) { return 0; }
|
||||
if (m_hashFs9Clients.isEmpty()) { return 0; }
|
||||
QList<CCallsign> callsigns(this->m_hashFs9Clients.keys());
|
||||
int r = 0;
|
||||
for (const CCallsign &cs : callsigns)
|
||||
@@ -218,7 +217,7 @@ namespace BlackSimPlugin
|
||||
|
||||
CCallsignSet CSimulatorFs9::physicallyRenderedAircraft() const
|
||||
{
|
||||
return CCollection<CCallsign>(this->m_hashFs9Clients.keys());
|
||||
return CCollection<CCallsign>(m_hashFs9Clients.keys());
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CSimulatedAircraft &ownAircraft, const CIdentifier &originator)
|
||||
@@ -227,9 +226,9 @@ namespace BlackSimPlugin
|
||||
if (!this->isSimulating()) { return false; }
|
||||
|
||||
// actually those data should be the same as ownAircraft
|
||||
CComSystem newCom1 = ownAircraft.getCom1System();
|
||||
CComSystem newCom2 = ownAircraft.getCom2System();
|
||||
CTransponder newTransponder = ownAircraft.getTransponder();
|
||||
const CComSystem newCom1 = ownAircraft.getCom1System();
|
||||
const CComSystem newCom2 = ownAircraft.getCom2System();
|
||||
const CTransponder newTransponder = ownAircraft.getTransponder();
|
||||
|
||||
bool changed = false;
|
||||
if (newCom1.getFrequencyActive() != this->m_simCom1.getFrequencyActive())
|
||||
@@ -274,7 +273,9 @@ namespace BlackSimPlugin
|
||||
{
|
||||
/* Avoid errors from CDirectPlayPeer as it may end in infinite loop */
|
||||
if (message.getSeverity() == BlackMisc::CStatusMessage::SeverityError && message.isFromClass<CDirectPlayPeer>())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.getSeverity() != BlackMisc::CStatusMessage::SeverityDebug)
|
||||
{
|
||||
@@ -303,7 +304,7 @@ namespace BlackSimPlugin
|
||||
if (m_useFsuipc && m_fsuipc)
|
||||
{
|
||||
CSimulatedAircraft fsuipcAircraft(getOwnAircraft());
|
||||
bool ok = m_fsuipc->read(fsuipcAircraft, true, true, true);
|
||||
const bool ok = m_fsuipc->read(fsuipcAircraft, true, true, true);
|
||||
if (ok)
|
||||
{
|
||||
updateOwnAircraftFromSimulator(fsuipcAircraft);
|
||||
@@ -375,7 +376,8 @@ namespace BlackSimPlugin
|
||||
void CSimulatorFs9::disconnectAllClients()
|
||||
{
|
||||
// Stop all FS9 client tasks
|
||||
for (auto fs9Client : m_hashFs9Clients.keys())
|
||||
const QList<CCallsign> callsigns(m_hashFs9Clients.keys());
|
||||
for (auto fs9Client : callsigns)
|
||||
{
|
||||
physicallyRemoveRemoteAircraft(fs9Client);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace XBus
|
||||
CTraffic(QObject *parent);
|
||||
|
||||
//! Destructor
|
||||
~CTraffic();
|
||||
virtual ~CTraffic();
|
||||
|
||||
//! DBus interface name
|
||||
static const QString &InterfaceName()
|
||||
|
||||
Reference in New Issue
Block a user