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