mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T238, comments and formatting
This commit is contained in:
@@ -47,9 +47,9 @@ using namespace BlackCore::Db;
|
||||
namespace BlackCore
|
||||
{
|
||||
CSimulatorCommon::CSimulatorCommon(const CSimulatorPluginInfo &info,
|
||||
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
IWeatherGridProvider *weatherGridProvider,
|
||||
IOwnAircraftProvider *ownAircraftProvider,
|
||||
IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
IWeatherGridProvider *weatherGridProvider,
|
||||
QObject *parent)
|
||||
: ISimulator(parent),
|
||||
COwnAircraftAware(ownAircraftProvider),
|
||||
@@ -245,7 +245,7 @@ namespace BlackCore
|
||||
{
|
||||
if (CDatabaseUtils::hasDbAircraftData())
|
||||
{
|
||||
const CAircraftModel newModel = reverseLookupModel(model);
|
||||
const CAircraftModel newModel = this->reverseLookupModel(model);
|
||||
const bool updated = this->updateOwnModel(newModel); // update in provider (normally the context)
|
||||
if (updated)
|
||||
{
|
||||
@@ -350,7 +350,7 @@ namespace BlackCore
|
||||
const bool r = setup.isRenderingRestricted();
|
||||
const bool e = setup.isRenderingEnabled();
|
||||
|
||||
emit renderRestrictionsChanged(r, e, setup.getMaxRenderedAircraft(), setup.getMaxRenderedDistance());
|
||||
emit this->renderRestrictionsChanged(r, e, setup.getMaxRenderedAircraft(), setup.getMaxRenderedDistance());
|
||||
}
|
||||
|
||||
CInterpolationAndRenderingSetup CSimulatorCommon::getInterpolationAndRenderingSetup() const
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexInterpolatorDebugMessages = BlackMisc::CPropertyIndex::GlobalIndexCInterpolatioRenderingSetup,
|
||||
IndexInterpolatorDebugMessages = CPropertyIndex::GlobalIndexCInterpolatioRenderingSetup,
|
||||
IndexSimulatorDebugMessages,
|
||||
IndexForceFullInterpolation,
|
||||
IndexMaxRenderedAircraft,
|
||||
@@ -66,7 +66,7 @@ namespace BlackMisc
|
||||
bool setMaxRenderedAircraft(int maxRenderedAircraft);
|
||||
|
||||
//! Max. distance for rendering
|
||||
bool setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance);
|
||||
bool setMaxRenderedDistance(const PhysicalQuantities::CLength &distance);
|
||||
|
||||
//! Set enabled aircraft parts
|
||||
bool setEnabledAircraftParts(bool enabled);
|
||||
@@ -84,7 +84,7 @@ namespace BlackMisc
|
||||
bool isAircraftPartsEnabled() const;
|
||||
|
||||
//! Max.distance for rendering
|
||||
BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const { return m_maxRenderedDistance; }
|
||||
PhysicalQuantities::CLength getMaxRenderedDistance() const { return m_maxRenderedDistance; }
|
||||
|
||||
//! Restricted by distance?
|
||||
bool isMaxDistanceRestricted() const;
|
||||
@@ -102,10 +102,10 @@ namespace BlackMisc
|
||||
QString getRenderRestrictionText() const;
|
||||
|
||||
//! Add a callsign which will be logged
|
||||
void addCallsignToLog(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void addCallsignToLog(const Aviation::CCallsign &callsign);
|
||||
|
||||
//! Remove a callsign from logging
|
||||
void removeCallsignFromLog(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void removeCallsignFromLog(const Aviation::CCallsign &callsign);
|
||||
|
||||
//! Clear all interpolator log callsigns
|
||||
void clearInterpolatorLogCallsigns();
|
||||
@@ -114,16 +114,16 @@ namespace BlackMisc
|
||||
BlackMisc::Aviation::CCallsignSet getLogCallsigns() const;
|
||||
|
||||
//! Log the given callsign?
|
||||
bool logCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
bool logCallsign(const Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
private:
|
||||
bool m_interpolatorDebugMessage = false; //! Debug messages in interpolator
|
||||
@@ -131,8 +131,8 @@ namespace BlackMisc
|
||||
bool m_forceFullInterpolation = false; //! always do a full interpolation, even if aircraft is not moving
|
||||
bool m_enabledAircraftParts = true; //! Update aircraft parts
|
||||
int m_maxRenderedAircraft = InfiniteAircraft(); //!< max.rendered aircraft
|
||||
BlackMisc::PhysicalQuantities::CLength m_maxRenderedDistance { 0, nullptr }; //!< max.distance for rendering
|
||||
BlackMisc::Aviation::CCallsignSet m_callsignsToLog;
|
||||
PhysicalQuantities::CLength m_maxRenderedDistance { 0, nullptr }; //!< max.distance for rendering
|
||||
Aviation::CCallsignSet m_callsignsToLog;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CInterpolationAndRenderingSetup,
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace BlackMisc
|
||||
//! only in a dev.environment, otherwise replaced by low footprint dummy driver
|
||||
CInterpolatorLinear m_linear;
|
||||
#else
|
||||
//! Low footprint dummy interpolator in non-debug compile
|
||||
CInterpolatorDummy m_linear;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -90,7 +90,8 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
CInterpolatorSpline::Interpolant CInterpolatorSpline::getInterpolant(qint64 currentTimeMsSinceEpoc,
|
||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status, CInterpolationLogger::SituationLog &log)
|
||||
const CInterpolationAndRenderingSetup &setup, const CInterpolationHints &hints, CInterpolationStatus &status,
|
||||
CInterpolationLogger::SituationLog &log)
|
||||
{
|
||||
Q_UNUSED(hints);
|
||||
Q_UNUSED(setup);
|
||||
@@ -114,10 +115,13 @@ namespace BlackMisc
|
||||
|
||||
std::array<CAircraftSituation, 3> s {{ *(situationsOlder.begin() + 1), *situationsOlder.begin(), *(situationsNewer.end() - 1) }};
|
||||
|
||||
// altitude unit must be the same for all three, but does not matter
|
||||
// ground elevantion here normally is not available
|
||||
// 100km/h => 1sec 27,7m => 5 secs 136m
|
||||
// only use elevation plane here, do not call provider
|
||||
// - altitude unit must be the same for all three, but the unit itself does not matter
|
||||
// - ground elevantion here normally is not available
|
||||
// - only use elevation plane here, do not call provider
|
||||
// - some info how has a plane moves: 100km/h => 1sec 27,7m => 5 secs 136m
|
||||
// - on an airport the plane does not move very fast, or not at all
|
||||
// - and the elevation remains (almost) constant for a wider area
|
||||
// - flying the ground elevation not really matters
|
||||
if (!hints.getElevationPlane().isNull())
|
||||
{
|
||||
const CAltitude groundElevation = hints.getElevationPlane().getAltitude();
|
||||
|
||||
@@ -214,7 +214,6 @@ namespace BlackSimPlugin
|
||||
if (physicallyRemoveRemoteAircraft(cs)) { r++; }
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
CCallsignSet CSimulatorFs9::physicallyRenderedAircraft() const
|
||||
|
||||
Reference in New Issue
Block a user