mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +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;
|
||||
}
|
||||
|
||||
void CSimulatedAircraft::setCG(const CLength &cg)
|
||||
{
|
||||
m_models.setCG(cg);
|
||||
}
|
||||
|
||||
void CSimulatedAircraft::setModelString(const QString &modelString)
|
||||
{
|
||||
Q_ASSERT_X(m_models.size() == 2, Q_FUNC_INFO, "Wrong model size");
|
||||
|
||||
@@ -386,6 +386,9 @@ namespace BlackMisc
|
||||
//! Set network model
|
||||
void setNetworkModel(const CAircraftModel &model);
|
||||
|
||||
//! Set the center of gravity
|
||||
void setCG(const PhysicalQuantities::CLength &cg);
|
||||
|
||||
//! Set callsign
|
||||
void setCallsign(const Aviation::CCallsign &callsign);
|
||||
|
||||
|
||||
@@ -108,6 +108,19 @@ namespace BlackMisc
|
||||
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 c = 0;
|
||||
|
||||
@@ -78,6 +78,9 @@ namespace BlackMisc
|
||||
//! Mark given callsign as rendered
|
||||
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
|
||||
int setEnabled(const Aviation::CCallsign &callsign, bool enabled, bool onlyFirst);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user