mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Ref T261, detect gnd.flag (from network) suppport, display gnd.flag info in UI
* add flag info in simulated aircraft * allow to display info in UI * unified naming to "contains" in situation list * updated client provider
This commit is contained in:
@@ -97,6 +97,7 @@ namespace BlackMisc
|
||||
{
|
||||
m_situation = situation;
|
||||
m_situation.setCallsign(this->getCallsign());
|
||||
this->setSupportingGndFlag(situation.hasInboundGroundDetails());
|
||||
}
|
||||
|
||||
const CAircraftIcaoCode &CSimulatedAircraft::getAircraftIcaoCode() const
|
||||
@@ -311,6 +312,7 @@ namespace BlackMisc
|
||||
case IndexRendered: return CVariant::fromValue(this->isRendered());
|
||||
case IndexPartsSynchronized: return CVariant::fromValue(this->isPartsSynchronized());
|
||||
case IndexFastPositionUpdates: return CVariant::fromValue(this->fastPositionUpdates());
|
||||
case IndexSupportsGndFlag: return CVariant::fromValue(this->isSupportingGndFlag());
|
||||
case IndexCallsign: return m_callsign.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexPilot: return m_pilot.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexRelativeDistance: return m_relativeDistance.propertyByIndex(index.copyFrontRemoved());
|
||||
@@ -350,6 +352,7 @@ namespace BlackMisc
|
||||
case IndexRendered: m_rendered = variant.toBool(); break;
|
||||
case IndexPartsSynchronized: m_partsSynchronized = variant.toBool(); break;
|
||||
case IndexFastPositionUpdates: m_fastPositionUpdates = variant.toBool(); break;
|
||||
case IndexSupportsGndFlag: m_supportsGndFlag = variant.toBool(); break;
|
||||
case IndexLivery: Q_ASSERT_X(false, Q_FUNC_INFO, "Unsupported"); break;
|
||||
case IndexModel:
|
||||
m_models[CurrentModel].setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
@@ -391,6 +394,7 @@ namespace BlackMisc
|
||||
case IndexRendered: return Compare::compare(m_rendered, compareValue.isRendered());
|
||||
case IndexPartsSynchronized: return Compare::compare(m_partsSynchronized, compareValue.isPartsSynchronized());
|
||||
case IndexFastPositionUpdates: return Compare::compare(m_fastPositionUpdates, compareValue.fastPositionUpdates());
|
||||
case IndexSupportsGndFlag: return Compare::compare(m_supportsGndFlag, compareValue.isSupportingGndFlag());
|
||||
case IndexCombinedIcaoLiveryString: return this->getCombinedIcaoLiveryString(false).compare(compareValue.getCombinedIcaoLiveryString(false));
|
||||
case IndexCombinedIcaoLiveryStringNetworkModel: return this->getCombinedIcaoLiveryString(true).compare(compareValue.getCombinedIcaoLiveryString(true));
|
||||
default:
|
||||
|
||||
@@ -88,7 +88,8 @@ namespace BlackMisc
|
||||
IndexEnabled,
|
||||
IndexRendered,
|
||||
IndexPartsSynchronized,
|
||||
IndexFastPositionUpdates
|
||||
IndexFastPositionUpdates,
|
||||
IndexSupportsGndFlag
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
@@ -419,6 +420,13 @@ namespace BlackMisc
|
||||
//! Set the synchronisation flag
|
||||
void setPartsSynchronized(bool synchronized) { m_partsSynchronized = synchronized; }
|
||||
|
||||
//! Is supporting gnd.flag?
|
||||
bool isSupportingGndFlag() const { return m_supportsGndFlag; }
|
||||
|
||||
//! Indicate gnd.flag is supported
|
||||
//! \remark normally automatically set from BlackMisc::Aviation::CAircraftSituation::hasInboundGroundDetails
|
||||
void setSupportingGndFlag(bool supports) { m_supportsGndFlag = supports; }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
@@ -442,11 +450,12 @@ namespace BlackMisc
|
||||
Aviation::CTransponder m_transponder;
|
||||
Aviation::CAircraftParts m_parts;
|
||||
Aviation::CSelcal m_selcal;
|
||||
CAircraftModelList m_models = { { CAircraftModel(), CAircraftModel() } }; //!< Shorter DBus signature: current model, and model received from network
|
||||
CAircraftModelList m_models = {{ CAircraftModel(), CAircraftModel() }}; //!< Shorter DBus signature: current model, and model received from network
|
||||
bool m_enabled = true; //!< to be displayed in simulator
|
||||
bool m_rendered = false; //!< really shown in simulator
|
||||
bool m_partsSynchronized = false; //!< synchronize parts
|
||||
bool m_fastPositionUpdates = false; //!< use fast position updates
|
||||
bool m_supportsGndFlag = false; //!< supports gnd. flag
|
||||
|
||||
//! Init, which synchronizes some denormalized values
|
||||
void init();
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace BlackMisc
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setSituation(situation);
|
||||
aircraft.setSituation(situation); // also sets setSupportingGndFlag
|
||||
if (onlyFirst) break;
|
||||
}
|
||||
return c;
|
||||
|
||||
Reference in New Issue
Block a user