mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
refs #796, allow to toggle full interpolation
* add setup class, metadata registration, property index ... * removed enableDebugMessages, added setInterpolatorSetup * adjusted contexts * used in interolator
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/interpolationsetup.h"
|
||||
#include "blackmisc/pixmap.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
@@ -187,6 +188,9 @@ namespace BlackCore
|
||||
//! Rendering enabled at all
|
||||
virtual bool isRenderingEnabled() const = 0;
|
||||
|
||||
//! Set interpolation and rendering
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) = 0;
|
||||
|
||||
//! Time synchronization offset
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const = 0;
|
||||
|
||||
@@ -199,9 +203,6 @@ namespace BlackCore
|
||||
//! Icon representing the model
|
||||
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const = 0;
|
||||
|
||||
//! Enable debugging
|
||||
virtual void enableDebugMessages(bool driver, bool interpolator) = 0;
|
||||
|
||||
//! Get mapping messages
|
||||
virtual BlackMisc::CStatusMessageList getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
|
||||
|
||||
|
||||
@@ -154,6 +154,13 @@ namespace BlackCore
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc ISimulator::setInterpolationAndRenderingSetup
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) override
|
||||
{
|
||||
Q_UNUSED(setup);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setMaxRenderedDistance
|
||||
virtual void deleteAllRenderingRestrictions() override
|
||||
{
|
||||
@@ -234,14 +241,6 @@ namespace BlackCore
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc ISimulator::enableDebugMessages
|
||||
virtual void enableDebugMessages(bool driver, bool interpolator) override
|
||||
{
|
||||
Q_UNUSED(driver);
|
||||
Q_UNUSED(interpolator);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getMatchingMessages
|
||||
virtual BlackMisc::CStatusMessageList getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const override
|
||||
{
|
||||
|
||||
@@ -236,6 +236,14 @@ namespace BlackCore
|
||||
m_simulatorPlugin.second->setMaxRenderedDistance(distance);
|
||||
}
|
||||
|
||||
void CContextSimulator::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << setup; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
m_simulatorPlugin.second->setInterpolationAndRenderingSetup(setup);
|
||||
}
|
||||
|
||||
QString CContextSimulator::getRenderRestrictionText() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
@@ -620,13 +628,6 @@ namespace BlackCore
|
||||
return pm;
|
||||
}
|
||||
|
||||
void CContextSimulator::enableDebugMessages(bool driver, bool interpolator)
|
||||
{
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
Q_ASSERT_X(m_simulatorPlugin.second, Q_FUNC_INFO, "Missing simulator");
|
||||
return m_simulatorPlugin.second->enableDebugMessages(driver, interpolator);
|
||||
}
|
||||
|
||||
CStatusMessageList CContextSimulator::getMatchingMessages(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign; }
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace BlackCore
|
||||
void gracefulShutdown();
|
||||
|
||||
public slots:
|
||||
//! \name Interface overrides
|
||||
//! \name Interface implementations
|
||||
//! @{
|
||||
virtual BlackMisc::Simulation::CSimulatorPluginInfo getSimulatorPluginInfo() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const override;
|
||||
@@ -91,6 +91,7 @@ namespace BlackCore
|
||||
virtual void setMaxRenderedAircraft(int number) override;
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const override;
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) override;
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) override;
|
||||
virtual QString getRenderRestrictionText() const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getRenderedDistanceBoundary() const override;
|
||||
virtual void deleteAllRenderingRestrictions() override;
|
||||
@@ -101,7 +102,6 @@ namespace BlackCore
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
virtual bool resetToModelMatchingAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) override;
|
||||
virtual void enableDebugMessages(bool driver, bool interpolator) override;
|
||||
virtual BlackMisc::CStatusMessageList getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
virtual bool isMatchingMessagesEnabled() const override;
|
||||
virtual void enableMatchingMessages(bool enabled) override;
|
||||
|
||||
@@ -139,6 +139,11 @@ namespace BlackCore
|
||||
m_dBusInterface->callDBus(QLatin1Literal("setMaxRenderedDistance"), distance);
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("setInterpolationAndRenderingSetup"), setup);
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::deleteAllRenderingRestrictions()
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("deleteAllRenderingRestrictions"));
|
||||
@@ -209,11 +214,6 @@ namespace BlackCore
|
||||
m_dBusInterface->callDBus(QLatin1Literal("requestWeatherGrid"), weatherGrid, identifier);
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::enableDebugMessages(bool driver, bool interpolator)
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("enableDebugMessages"), driver, interpolator);
|
||||
}
|
||||
|
||||
CStatusMessageList CContextSimulatorProxy::getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::CStatusMessageList>(QLatin1Literal("getMatchingMessages"), callsign);
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace BlackCore
|
||||
virtual int getMaxRenderedAircraft() const override;
|
||||
virtual void setMaxRenderedAircraft(int number) override;
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) override;
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) override;
|
||||
virtual void deleteAllRenderingRestrictions() override;
|
||||
virtual bool isRenderingRestricted() const override;
|
||||
virtual bool isRenderingEnabled() const override;
|
||||
@@ -81,7 +82,6 @@ namespace BlackCore
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
virtual bool resetToModelMatchingAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) override;
|
||||
virtual void enableDebugMessages(bool driver, bool interpolator) override;
|
||||
virtual BlackMisc::CStatusMessageList getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
virtual bool isMatchingMessagesEnabled() const override;
|
||||
virtual void enableMatchingMessages(bool enabled) override;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/pixmap.h"
|
||||
#include "blackmisc/interpolationsetup.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/time.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
@@ -153,8 +154,8 @@ namespace BlackCore
|
||||
//! Delete all restrictions (if any) -> unlimited number of aircraft
|
||||
virtual void deleteAllRenderingRestrictions() = 0;
|
||||
|
||||
//! Enable debugging messages
|
||||
virtual void enableDebugMessages(bool driver, bool interpolator) = 0;
|
||||
//! Enable debugging messages etc.
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) = 0;
|
||||
|
||||
//! Is the aircraft rendered (displayed in simulator)?
|
||||
//! This shall only return true if the aircraft is really visible in the simulator
|
||||
|
||||
@@ -314,10 +314,10 @@ namespace BlackCore
|
||||
return !m_maxRenderedDistance.isNull();
|
||||
}
|
||||
|
||||
void CSimulatorCommon::enableDebugMessages(bool driverMessages, bool interpolatorMessages)
|
||||
void CSimulatorCommon::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
{
|
||||
this->m_debugMessages = driverMessages;
|
||||
Q_UNUSED(interpolatorMessages);
|
||||
this->m_interpolationRenderingSetup = setup;
|
||||
this->m_interpolator->setInterpolatorSetup(setup);
|
||||
}
|
||||
|
||||
void CSimulatorCommon::highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "blackcore/aircraftmatcher.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/interpolationsetup.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/connectionguard.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
@@ -75,7 +76,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getRenderedDistanceBoundary() const override;
|
||||
virtual bool isMaxAircraftRestricted() const override;
|
||||
virtual bool isMaxDistanceRestricted() const override;
|
||||
virtual void enableDebugMessages(bool driverMessages, bool interpolatorMessages) override;
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) override;
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
virtual bool isRenderingEnabled() const override;
|
||||
virtual bool isRenderingRestricted() const override;
|
||||
@@ -148,7 +149,6 @@ namespace BlackCore
|
||||
void ps_allSwiftDataRead();
|
||||
|
||||
private:
|
||||
bool m_debugMessages = false; //!< Display debug messages
|
||||
bool m_blinkCycle = false; //!< use for highlighting
|
||||
qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting
|
||||
int m_timerCounter = 0; //!< allows to calculate n seconds
|
||||
@@ -159,6 +159,7 @@ namespace BlackCore
|
||||
BlackMisc::Aviation::CCallsignSet m_callsignsToBeRendered; //!< callsigns which will be rendered
|
||||
BlackMisc::PhysicalQuantities::CLength m_maxRenderedDistance { 0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit()}; //!< max.distance for rendering
|
||||
BlackMisc::CConnectionGuard m_remoteAircraftProviderConnections; //!< connected signal/slots
|
||||
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user