mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 22:29:13 +08:00
Ref T261, simulated aircraft get/set CG
This commit is contained in:
committed by
Roland Winklmeier
parent
3f7b229e66
commit
f330e91350
@@ -461,6 +461,11 @@ namespace BlackMisc
|
|||||||
m_models[NetworkModel] = model;
|
m_models[NetworkModel] = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatedAircraft::setCG(const CLength &cg)
|
||||||
|
{
|
||||||
|
m_models.setCG(cg);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatedAircraft::setModelString(const QString &modelString)
|
void CSimulatedAircraft::setModelString(const QString &modelString)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_models.size() == 2, Q_FUNC_INFO, "Wrong model size");
|
Q_ASSERT_X(m_models.size() == 2, Q_FUNC_INFO, "Wrong model size");
|
||||||
|
|||||||
@@ -386,6 +386,9 @@ namespace BlackMisc
|
|||||||
//! Set network model
|
//! Set network model
|
||||||
void setNetworkModel(const CAircraftModel &model);
|
void setNetworkModel(const CAircraftModel &model);
|
||||||
|
|
||||||
|
//! Set the center of gravity
|
||||||
|
void setCG(const PhysicalQuantities::CLength &cg);
|
||||||
|
|
||||||
//! Set callsign
|
//! Set callsign
|
||||||
void setCallsign(const Aviation::CCallsign &callsign);
|
void setCallsign(const Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,19 @@ namespace BlackMisc
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CSimulatedAircraftList::setCG(const CCallsign &callsign, const CLength &cg, bool onlyFirst)
|
||||||
|
{
|
||||||
|
int c = 0;
|
||||||
|
for (CSimulatedAircraft &aircraft : (*this))
|
||||||
|
{
|
||||||
|
if (aircraft.getCallsign() != callsign) { continue; }
|
||||||
|
aircraft.setCG(cg);
|
||||||
|
c++;
|
||||||
|
if (onlyFirst) break;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
int CSimulatedAircraftList::setFastPositionUpdates(const CCallsign &callsign, bool fastPositions, bool onlyFirst)
|
int CSimulatedAircraftList::setFastPositionUpdates(const CCallsign &callsign, bool fastPositions, bool onlyFirst)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ namespace BlackMisc
|
|||||||
//! Mark given callsign as rendered
|
//! Mark given callsign as rendered
|
||||||
int setRendered(const Aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
|
int setRendered(const Aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
|
||||||
|
|
||||||
|
//! Set center of gravity
|
||||||
|
int setCG(const Aviation::CCallsign &callsign, const PhysicalQuantities::CLength &cg, bool onlyFirst = true);
|
||||||
|
|
||||||
//! Mark given callsign as enabled
|
//! Mark given callsign as enabled
|
||||||
int setEnabled(const Aviation::CCallsign &callsign, bool enabled, bool onlyFirst);
|
int setEnabled(const Aviation::CCallsign &callsign, bool enabled, bool onlyFirst);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user