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()); return CVariant::fromValue(this->isEnabled());
case IndexRendered: case IndexRendered:
return CVariant::fromValue(this->isRendered()); return CVariant::fromValue(this->isRendered());
case IndexPartsSynchronized:
return CVariant::fromValue(this->isPartsSynchronized());
default: default:
return CAircraft::propertyByIndex(index); return CAircraft::propertyByIndex(index);
} }
@@ -80,6 +82,9 @@ namespace BlackMisc
case IndexRendered: case IndexRendered:
this->m_rendered = variant.toBool(); this->m_rendered = variant.toBool();
break; break;
case IndexPartsSynchronized:
this->m_partsSynchronized = variant.toBool();
break;
default: default:
CAircraft::setPropertyByIndex(variant, index); CAircraft::setPropertyByIndex(variant, index);
break; break;

View File

@@ -31,7 +31,8 @@ namespace BlackMisc
IndexModel = BlackMisc::CPropertyIndex::GlobalIndexCSimulatedAircraft, IndexModel = BlackMisc::CPropertyIndex::GlobalIndexCSimulatedAircraft,
IndexClient, IndexClient,
IndexEnabled, IndexEnabled,
IndexRendered IndexRendered,
IndexPartsSynchronized
}; };
//! Default constructor. //! Default constructor.
@@ -90,6 +91,12 @@ namespace BlackMisc
//! Update from aviation aircraft //! Update from aviation aircraft
void setAircraft(const BlackMisc::Aviation::CAircraft &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: protected:
//! \copydoc CValueObject::convertToQString() //! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override; virtual QString convertToQString(bool i18n = false) const override;
@@ -100,6 +107,7 @@ namespace BlackMisc
BlackMisc::Network::CClient m_client; BlackMisc::Network::CClient m_client;
bool m_enabled = true; // to be displayed in sim bool m_enabled = true; // to be displayed in sim
bool m_rendered = false; // really shown in sim bool m_rendered = false; // really shown in sim
bool m_partsSynchronized = false;
void init(); void init();
}; };
@@ -110,7 +118,8 @@ BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatedAircraft, (
attr(o.m_model), attr(o.m_model),
attr(o.m_client), attr(o.m_client),
attr(o.m_enabled), attr(o.m_enabled),
attr(o.m_rendered) attr(o.m_rendered),
attr(o.m_partsSynchronized)
)) ))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraft) Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatedAircraft)