mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 20:25:29 +08:00
refs #806, apply CInterpolationAndRenderingSetup
* removed no longer needed signatures * some renaming of CInterpolationAndRenderingSetup functions * adjusted UI element
This commit is contained in:
@@ -432,12 +432,12 @@ namespace BlackCore
|
||||
emit this->connectionStatusChanged(from, to);
|
||||
}
|
||||
|
||||
void CContextNetwork::ps_simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const CLength &maxRenderedDistance, const CLength &maxRenderedBoundary)
|
||||
void CContextNetwork::ps_simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const CLength &maxRenderedDistance)
|
||||
{
|
||||
// mainly passing changed restrictions from simulator to network
|
||||
if (!m_airspace) { return; }
|
||||
if (!m_airspace->analyzer()) { return; }
|
||||
m_airspace->analyzer()->setSimulatorRenderRestrictionsChanged(restricted, enabled, maxAircraft, maxRenderedDistance, maxRenderedBoundary);
|
||||
m_airspace->analyzer()->setSimulatorRenderRestrictionsChanged(restricted, enabled, maxAircraft, maxRenderedDistance);
|
||||
}
|
||||
|
||||
void CContextNetwork::ps_updateMetars(const BlackMisc::Weather::CMetarList &metars)
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace BlackCore
|
||||
|
||||
//! Render restrictions have been changed, used with analyzer
|
||||
//! \sa CAirspaceAnalyzer
|
||||
void ps_simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance, const BlackMisc::PhysicalQuantities::CLength &maxRenderedBoundary);
|
||||
void ps_simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackCore
|
||||
void simulatorPluginChanged(BlackMisc::Simulation::CSimulatorPluginInfo info);
|
||||
|
||||
//! Render restrictions have been changed
|
||||
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance, const BlackMisc::PhysicalQuantities::CLength &maxRenderedBoundary);
|
||||
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
||||
|
||||
//! Model set ready or changed
|
||||
void modelSetChanged();
|
||||
@@ -161,32 +161,8 @@ namespace BlackCore
|
||||
//! Is time synchronization on?
|
||||
virtual bool isTimeSynchronized() const = 0;
|
||||
|
||||
//! Max. number of remote aircraft rendered
|
||||
virtual int getMaxRenderedAircraft() const = 0;
|
||||
|
||||
//! Max. rendered distance
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const = 0;
|
||||
|
||||
//! Technical range until aircraft are visible
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getRenderedDistanceBoundary() const = 0;
|
||||
|
||||
//! Text describing the rendering restrictions
|
||||
virtual QString getRenderRestrictionText() const = 0;
|
||||
|
||||
//! Max. number of remote aircraft rendered and provide optional selection which aircraft those are
|
||||
virtual void setMaxRenderedAircraft(int number) = 0;
|
||||
|
||||
//! Max. distance until we render an aircraft
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) = 0;
|
||||
|
||||
//! Delete all restrictions (if any) -> unlimited number of aircraft
|
||||
virtual void deleteAllRenderingRestrictions() = 0;
|
||||
|
||||
//! Is number of aircraft restricted ormax distance set?
|
||||
virtual bool isRenderingRestricted() const = 0;
|
||||
|
||||
//! Rendering enabled at all
|
||||
virtual bool isRenderingEnabled() const = 0;
|
||||
//! Set interpolation and rendering
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const = 0;
|
||||
|
||||
//! Set interpolation and rendering
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) = 0;
|
||||
|
||||
@@ -133,25 +133,11 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getMaxRenderedAircraft
|
||||
virtual int getMaxRenderedAircraft() const override
|
||||
//! \copydoc ISimulator::getInterpolationAndRenderingSetup
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setMaxRenderedAircraft
|
||||
virtual void setMaxRenderedAircraft(int number) override
|
||||
{
|
||||
Q_UNUSED(number);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setMaxRenderedDistance
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) override
|
||||
{
|
||||
Q_UNUSED(distance);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return BlackMisc::CInterpolationAndRenderingSetup();
|
||||
}
|
||||
|
||||
//! \copydoc ISimulator::setInterpolationAndRenderingSetup
|
||||
@@ -161,47 +147,6 @@ namespace BlackCore
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setMaxRenderedDistance
|
||||
virtual void deleteAllRenderingRestrictions() override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::isRenderingRestricted
|
||||
virtual bool isRenderingRestricted() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::isRenderingEnabled
|
||||
virtual bool isRenderingEnabled() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getMaxRenderedDistance
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return BlackMisc::PhysicalQuantities::CLength();
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getRenderedDistanceBoundary
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getRenderedDistanceBoundary() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return BlackMisc::PhysicalQuantities::CLength();
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getRenderRestrictionText
|
||||
virtual QString getRenderRestrictionText() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return QString();
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getTimeSynchronizationOffset
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override
|
||||
{
|
||||
|
||||
@@ -212,29 +212,12 @@ namespace BlackCore
|
||||
return m_simulatorPlugin.second->isTimeSynchronized();
|
||||
}
|
||||
|
||||
int CContextSimulator::getMaxRenderedAircraft() const
|
||||
CInterpolationAndRenderingSetup CContextSimulator::getInterpolationAndRenderingSetup() const
|
||||
{
|
||||
if (m_debugEnabled) {CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return 0; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return CInterpolationAndRenderingSetup(); }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->getMaxRenderedAircraft();
|
||||
}
|
||||
|
||||
void CContextSimulator::setMaxRenderedAircraft(int number)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << number; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
m_simulatorPlugin.second->setMaxRenderedAircraft(number);
|
||||
|
||||
}
|
||||
|
||||
void CContextSimulator::setMaxRenderedDistance(const CLength &distance)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << distance; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
m_simulatorPlugin.second->setMaxRenderedDistance(distance);
|
||||
return m_simulatorPlugin.second->getInterpolationAndRenderingSetup();
|
||||
}
|
||||
|
||||
void CContextSimulator::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
@@ -245,71 +228,6 @@ namespace BlackCore
|
||||
m_simulatorPlugin.second->setInterpolationAndRenderingSetup(setup);
|
||||
}
|
||||
|
||||
QString CContextSimulator::getRenderRestrictionText() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return ""; }
|
||||
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
if (!m_simulatorPlugin.second->isRenderingRestricted()) { return "none"; }
|
||||
QString rt;
|
||||
if (m_simulatorPlugin.second->isMaxAircraftRestricted())
|
||||
{
|
||||
rt.append(QString::number(m_simulatorPlugin.second->getMaxRenderedAircraft())).append(" A/C");
|
||||
}
|
||||
if (m_simulatorPlugin.second->isMaxDistanceRestricted())
|
||||
{
|
||||
if (!rt.isEmpty()) { rt.append(" ");}
|
||||
rt.append(m_simulatorPlugin.second->getMaxRenderedDistance().valueRoundedWithUnit(CLengthUnit::NM(), 0));
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
CLength CContextSimulator::getMaxRenderedDistance() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return CLength(0, CLengthUnit::nullUnit()); }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->getMaxRenderedDistance();
|
||||
}
|
||||
|
||||
CLength CContextSimulator::getRenderedDistanceBoundary() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified())
|
||||
{
|
||||
return CLength(20.0, CLengthUnit::NM());
|
||||
}
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->getRenderedDistanceBoundary();
|
||||
}
|
||||
|
||||
void CContextSimulator::deleteAllRenderingRestrictions()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.first.isUnspecified())
|
||||
{
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
m_simulatorPlugin.second->deleteAllRenderingRestrictions();
|
||||
}
|
||||
}
|
||||
|
||||
bool CContextSimulator::isRenderingRestricted() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return false; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->isRenderingRestricted();
|
||||
}
|
||||
|
||||
bool CContextSimulator::isRenderingEnabled() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return false; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->isRenderingEnabled();
|
||||
}
|
||||
|
||||
CTime CContextSimulator::getTimeSynchronizationOffset() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
|
||||
@@ -87,19 +87,11 @@ namespace BlackCore
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override;
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) override;
|
||||
virtual bool isTimeSynchronized() const override;
|
||||
virtual int getMaxRenderedAircraft() const override;
|
||||
virtual void setMaxRenderedAircraft(int number) override;
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const override;
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) override;
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const 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;
|
||||
virtual bool isRenderingRestricted() const override;
|
||||
virtual bool isRenderingEnabled() const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override;
|
||||
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override;
|
||||
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;
|
||||
|
||||
@@ -129,14 +129,9 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isTimeSynchronized"));
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::setMaxRenderedAircraft(int number)
|
||||
CInterpolationAndRenderingSetup CContextSimulatorProxy::getInterpolationAndRenderingSetup() const
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("setMaxRenderedAircraft"), number);
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::setMaxRenderedDistance(const CLength &distance)
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("setMaxRenderedDistance"), distance);
|
||||
return m_dBusInterface->callDBusRet<CInterpolationAndRenderingSetup>(QLatin1Literal("getInterpolationAndRenderingSetup"));
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
@@ -144,41 +139,6 @@ namespace BlackCore
|
||||
m_dBusInterface->callDBus(QLatin1Literal("setInterpolationAndRenderingSetup"), setup);
|
||||
}
|
||||
|
||||
void CContextSimulatorProxy::deleteAllRenderingRestrictions()
|
||||
{
|
||||
m_dBusInterface->callDBus(QLatin1Literal("deleteAllRenderingRestrictions"));
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::isRenderingRestricted() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isRenderingRestricted"));
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::isRenderingEnabled() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isRenderingEnabled"));
|
||||
}
|
||||
|
||||
CLength CContextSimulatorProxy::getMaxRenderedDistance() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<CLength>(QLatin1Literal("getMaxRenderedDistance"));
|
||||
}
|
||||
|
||||
CLength CContextSimulatorProxy::getRenderedDistanceBoundary() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<CLength>(QLatin1Literal("getRenderedDistanceBoundary"));
|
||||
}
|
||||
|
||||
QString CContextSimulatorProxy::getRenderRestrictionText() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<QString>(QLatin1Literal("getRenderRestrictionText"));
|
||||
}
|
||||
|
||||
int CContextSimulatorProxy::getMaxRenderedAircraft() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<int>(QLatin1Literal("getMaxRenderedAircraft"));
|
||||
}
|
||||
|
||||
CTime CContextSimulatorProxy::getTimeSynchronizationOffset() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::PhysicalQuantities::CTime>(QLatin1Literal("getTimeSynchronizationOffset"));
|
||||
|
||||
@@ -67,16 +67,8 @@ namespace BlackCore
|
||||
virtual BlackMisc::Simulation::CSimulatorSetup getSimulatorSetup() const override;
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) override;
|
||||
virtual bool isTimeSynchronized() const override;
|
||||
virtual int getMaxRenderedAircraft() const override;
|
||||
virtual void setMaxRenderedAircraft(int number) override;
|
||||
virtual void setMaxRenderedDistance(const BlackMisc::PhysicalQuantities::CLength &distance) override;
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const override;
|
||||
virtual void setInterpolationAndRenderingSetup(const BlackMisc::CInterpolationAndRenderingSetup &setup) override;
|
||||
virtual void deleteAllRenderingRestrictions() override;
|
||||
virtual bool isRenderingRestricted() const override;
|
||||
virtual bool isRenderingEnabled() const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getMaxRenderedDistance() const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CLength getRenderedDistanceBoundary() const override;
|
||||
virtual QString getRenderRestrictionText() const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override;
|
||||
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override;
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
|
||||
Reference in New Issue
Block a user