mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #321 Add parts synchronized flag to CSimulatedAircraft
This commit is contained in:
committed by
Klaus Basan
parent
afea320a2e
commit
d5731cf8d9
@@ -53,6 +53,8 @@ namespace BlackMisc
|
||||
return CVariant::fromValue(this->isEnabled());
|
||||
case IndexRendered:
|
||||
return CVariant::fromValue(this->isRendered());
|
||||
case IndexPartsSynchronized:
|
||||
return CVariant::fromValue(this->isPartsSynchronized());
|
||||
default:
|
||||
return CAircraft::propertyByIndex(index);
|
||||
}
|
||||
@@ -80,6 +82,9 @@ namespace BlackMisc
|
||||
case IndexRendered:
|
||||
this->m_rendered = variant.toBool();
|
||||
break;
|
||||
case IndexPartsSynchronized:
|
||||
this->m_partsSynchronized = variant.toBool();
|
||||
break;
|
||||
default:
|
||||
CAircraft::setPropertyByIndex(variant, index);
|
||||
break;
|
||||
|
||||
@@ -31,7 +31,8 @@ namespace BlackMisc
|
||||
IndexModel = BlackMisc::CPropertyIndex::GlobalIndexCSimulatedAircraft,
|
||||
IndexClient,
|
||||
IndexEnabled,
|
||||
IndexRendered
|
||||
IndexRendered,
|
||||
IndexPartsSynchronized
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
@@ -90,6 +91,12 @@ namespace BlackMisc
|
||||
//! Update from aviation aircraft
|
||||
void setAircraft(const BlackMisc::Aviation::CAircraft &aircraft);
|
||||
|
||||
//! Have parts been synchronized with a remote client?
|
||||
bool isPartsSynchronized() const { return m_partsSynchronized; }
|
||||
|
||||
//! Set the synchronisation flag
|
||||
void setPartsSynchronized(bool synchronized) { m_partsSynchronized = synchronized; }
|
||||
|
||||
protected:
|
||||
//! \copydoc CValueObject::convertToQString()
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
@@ -100,6 +107,7 @@ namespace BlackMisc
|
||||
BlackMisc::Network::CClient m_client;
|
||||
bool m_enabled = true; // to be displayed in sim
|
||||
bool m_rendered = false; // really shown in sim
|
||||
bool m_partsSynchronized = false;
|
||||
void init();
|
||||
|
||||
};
|
||||
@@ -110,7 +118,8 @@ BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatedAircraft, (
|
||||
attr(o.m_model),
|
||||
attr(o.m_client),
|
||||
attr(o.m_enabled),
|
||||
attr(o.m_rendered)
|
||||
attr(o.m_rendered),
|
||||
attr(o.m_partsSynchronized)
|
||||
))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraft)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user