refs #321 Add parts synchronized flag to CSimulatedAircraft

This commit is contained in:
Roland Winklmeier
2015-02-08 12:36:22 +01:00
committed by Klaus Basan
parent afea320a2e
commit d5731cf8d9
2 changed files with 16 additions and 2 deletions

View File

@@ -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;

View File

@@ -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)