mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #840, updated value classes
* VTOL flag * doxygen * allow to stop after an object has been found * support for hints/elevation
This commit is contained in:
committed by
Mathew Sutcliffe
parent
e1b472490f
commit
de72a678a2
@@ -54,16 +54,10 @@ namespace BlackMisc
|
|||||||
CVariant CAircraftSituation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
CVariant CAircraftSituation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { return CVariant::from(*this); }
|
if (index.isMyself()) { return CVariant::from(*this); }
|
||||||
if (ITimestampBased::canHandleIndex(index))
|
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); }
|
||||||
{
|
if (ICoordinateGeodetic::canHandleIndex(index)) { return ICoordinateGeodetic::propertyByIndex(index); }
|
||||||
return ITimestampBased::propertyByIndex(index);
|
|
||||||
}
|
|
||||||
if (ICoordinateGeodetic::canHandleIndex(index))
|
|
||||||
{
|
|
||||||
return ICoordinateGeodetic::propertyByIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
@@ -82,6 +76,8 @@ namespace BlackMisc
|
|||||||
return this->m_bank.propertyByIndex(index.copyFrontRemoved());
|
return this->m_bank.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexGroundSpeed:
|
case IndexGroundSpeed:
|
||||||
return this->m_groundSpeed.propertyByIndex(index.copyFrontRemoved());
|
return this->m_groundSpeed.propertyByIndex(index.copyFrontRemoved());
|
||||||
|
case IndexGroundElevation:
|
||||||
|
return this->m_groundElevation.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
return this->m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved());
|
return this->m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved());
|
||||||
default:
|
default:
|
||||||
@@ -98,7 +94,7 @@ namespace BlackMisc
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
@@ -113,6 +109,9 @@ namespace BlackMisc
|
|||||||
case IndexGroundSpeed:
|
case IndexGroundSpeed:
|
||||||
this->m_groundSpeed.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
this->m_groundSpeed.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
|
case IndexGroundElevation:
|
||||||
|
this->m_groundElevation.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
|
break;
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
this->m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
this->m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
@@ -124,15 +123,9 @@ namespace BlackMisc
|
|||||||
|
|
||||||
int CAircraftSituation::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftSituation &compareValue) const
|
int CAircraftSituation::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftSituation &compareValue) const
|
||||||
{
|
{
|
||||||
if (ITimestampBased::canHandleIndex(index))
|
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); }
|
||||||
{
|
if (ICoordinateGeodetic::canHandleIndex(index)) { return ICoordinateGeodetic::comparePropertyByIndex(index, compareValue); }
|
||||||
return ITimestampBased::comparePropertyByIndex(index, compareValue);
|
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
}
|
|
||||||
if (ICoordinateGeodetic::canHandleIndex(index))
|
|
||||||
{
|
|
||||||
return ICoordinateGeodetic::comparePropertyByIndex(index, compareValue);
|
|
||||||
}
|
|
||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
@@ -150,6 +143,9 @@ namespace BlackMisc
|
|||||||
case IndexGroundSpeed:
|
case IndexGroundSpeed:
|
||||||
return this->m_groundSpeed.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getGroundSpeed());
|
return this->m_groundSpeed.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getGroundSpeed());
|
||||||
break;
|
break;
|
||||||
|
case IndexGroundElevation:
|
||||||
|
return this->m_groundElevation.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getGroundElevation());
|
||||||
|
break;
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
return this->m_correspondingCallsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
return this->m_correspondingCallsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
||||||
break;
|
break;
|
||||||
@@ -161,19 +157,26 @@ namespace BlackMisc
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAircraftSituation::isOnGroundGuessed() const
|
bool CAircraftSituation::isOnGroundGuessed(const CLength &cgAboveGround) const
|
||||||
{
|
{
|
||||||
const CLength heightAboveGround(this->getHeightAboveGround());
|
const CLength heightAboveGround(this->getHeightAboveGround());
|
||||||
if (!heightAboveGround.isNull())
|
if (!heightAboveGround.isNull())
|
||||||
{
|
{
|
||||||
return heightAboveGround.value(CLengthUnit::m()) < 1.0;
|
if (cgAboveGround.isNull())
|
||||||
|
{
|
||||||
|
return heightAboveGround.value(CLengthUnit::m()) < 1.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return heightAboveGround <= cgAboveGround;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we guess on pitch an bank
|
// we guess on pitch and bank
|
||||||
if (qAbs(this->getPitch().value(CAngleUnit::deg())) > 10) { return false; }
|
if (qAbs(this->getPitch().value(CAngleUnit::deg())) > 10) { return false; }
|
||||||
if (qAbs(this->getBank().value(CAngleUnit::deg())) > 10) { return false; }
|
if (qAbs(this->getBank().value(CAngleUnit::deg())) > 10) { return false; }
|
||||||
|
|
||||||
if (this->getGroundSpeed().value(CSpeedUnit::km_h()) > 75) { return false; }
|
if (this->getGroundSpeed().value(CSpeedUnit::km_h()) > 50) { return false; }
|
||||||
|
|
||||||
// not sure, but this is a guess
|
// not sure, but this is a guess
|
||||||
return true;
|
return true;
|
||||||
@@ -188,22 +191,30 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (this->getAltitude().getReferenceDatum() == CAltitude::AboveGround)
|
if (this->getAltitude().getReferenceDatum() == CAltitude::AboveGround)
|
||||||
{
|
{
|
||||||
// we have a sure value
|
// we have a sure value explicitly set
|
||||||
return this->getAltitude();
|
return this->getAltitude();
|
||||||
}
|
}
|
||||||
const CLength gh(getGroundElevation());
|
const CLength gh(this->getGroundElevation());
|
||||||
if (!gh.isNull() && !getAltitude().isNull())
|
if (!gh.isNull() && !getAltitude().isNull())
|
||||||
{
|
{
|
||||||
return getAltitude() - gh;
|
return this->getAltitude() - gh;
|
||||||
}
|
}
|
||||||
return { 0, nullptr };
|
return { 0, nullptr };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAltitude CAircraftSituation::getCorrectedAltitude(const CLength &cgAboveGround) const
|
||||||
|
{
|
||||||
|
if (!this->hasGroundElevation()) { return this->getAltitude(); }
|
||||||
|
const CAltitude groundElevation(cgAboveGround.isNull() ?
|
||||||
|
this->getGroundElevation() :
|
||||||
|
CAltitude(this->getGroundElevation() + cgAboveGround, CAltitude::MeanSeaLevel));
|
||||||
|
return (groundElevation <= this->getAltitude()) ? this->getAltitude() : groundElevation;
|
||||||
|
}
|
||||||
|
|
||||||
void CAircraftSituation::setCallsign(const CCallsign &callsign)
|
void CAircraftSituation::setCallsign(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
this->m_correspondingCallsign = callsign;
|
this->m_correspondingCallsign = callsign;
|
||||||
this->m_correspondingCallsign.setTypeHint(CCallsign::Aircraft);
|
this->m_correspondingCallsign.setTypeHint(CCallsign::Aircraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace BlackMisc
|
|||||||
IndexBank,
|
IndexBank,
|
||||||
IndexPitch,
|
IndexPitch,
|
||||||
IndexGroundSpeed,
|
IndexGroundSpeed,
|
||||||
|
IndexGroundElevation,
|
||||||
IndexCallsign
|
IndexCallsign
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ namespace BlackMisc
|
|||||||
virtual BlackMisc::Geo::CLongitude longitude() const override { return this->m_position.longitude(); }
|
virtual BlackMisc::Geo::CLongitude longitude() const override { return this->m_position.longitude(); }
|
||||||
|
|
||||||
//! Guess if aircraft is "on ground"
|
//! Guess if aircraft is "on ground"
|
||||||
bool isOnGroundGuessed() const;
|
bool isOnGroundGuessed(const BlackMisc::PhysicalQuantities::CLength &cgAboveGround = { 0, nullptr }) const;
|
||||||
|
|
||||||
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
||||||
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override { return this->m_position.geodeticHeight(); }
|
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override { return this->m_position.geodeticHeight(); }
|
||||||
@@ -128,9 +129,12 @@ namespace BlackMisc
|
|||||||
//! Set heading
|
//! Set heading
|
||||||
void setHeading(const BlackMisc::Aviation::CHeading &heading) { this->m_heading = heading; }
|
void setHeading(const BlackMisc::Aviation::CHeading &heading) { this->m_heading = heading; }
|
||||||
|
|
||||||
//! Get altitude (true)
|
//! Get altitude
|
||||||
const BlackMisc::Aviation::CAltitude &getAltitude() const { return this->m_position.geodeticHeight(); }
|
const BlackMisc::Aviation::CAltitude &getAltitude() const { return this->m_position.geodeticHeight(); }
|
||||||
|
|
||||||
|
//! Get altitude under consideration of ground elevation and CG (if available)
|
||||||
|
BlackMisc::Aviation::CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength &cgAboveGround = { 0, nullptr }) const;
|
||||||
|
|
||||||
//! Set altitude
|
//! Set altitude
|
||||||
void setAltitude(const BlackMisc::Aviation::CAltitude &altitude) { this->m_position.setGeodeticHeight(altitude); }
|
void setAltitude(const BlackMisc::Aviation::CAltitude &altitude) { this->m_position.setGeodeticHeight(altitude); }
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace Aviation
|
namespace Aviation
|
||||||
{
|
{
|
||||||
class CAircraftSituation;
|
class CAircraftSituation;
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ namespace BlackMisc
|
|||||||
void CCoordinateGeodetic::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
void CCoordinateGeodetic::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { (*this) = variant.to<CCoordinateGeodetic>(); return; }
|
if (index.isMyself()) { (*this) = variant.to<CCoordinateGeodetic>(); return; }
|
||||||
ICoordinateGeodetic::ColumnIndex i = index.frontCasted<ICoordinateGeodetic::ColumnIndex>();
|
const ICoordinateGeodetic::ColumnIndex i = index.frontCasted<ICoordinateGeodetic::ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexGeodeticHeight:
|
case IndexGeodeticHeight:
|
||||||
@@ -190,7 +190,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CCoordinateGeodetic::CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, CAltitude geodeticHeight) :
|
CCoordinateGeodetic::CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const CAltitude &geodeticHeight) :
|
||||||
m_x(latitude.cos() * longitude.cos()),
|
m_x(latitude.cos() * longitude.cos()),
|
||||||
m_y(latitude.cos() * longitude.sin()),
|
m_y(latitude.cos() * longitude.sin()),
|
||||||
m_z(latitude.sin()),
|
m_z(latitude.sin()),
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_COORDINATEGEODETIC_H
|
#ifndef BLACKMISC_GEO_COORDINATEGEODETIC_H
|
||||||
#define BLACKMISC_COORDINATEGEODETIC_H
|
#define BLACKMISC_GEO_COORDINATEGEODETIC_H
|
||||||
|
|
||||||
#include "blackmisc/blackmiscexport.h"
|
#include "blackmisc/blackmiscexport.h"
|
||||||
#include "blackmisc/aviation/altitude.h"
|
#include "blackmisc/aviation/altitude.h"
|
||||||
@@ -188,7 +188,7 @@ namespace BlackMisc
|
|||||||
CCoordinateGeodetic(const QVector3D &normal) : m_x(normal.x()), m_y(normal.y()), m_z(normal.z()) {}
|
CCoordinateGeodetic(const QVector3D &normal) : m_x(normal.x()), m_y(normal.y()), m_z(normal.z()) {}
|
||||||
|
|
||||||
//! Constructor by values
|
//! Constructor by values
|
||||||
CCoordinateGeodetic(CLatitude latitude, CLongitude longitude, BlackMisc::Aviation::CAltitude geodeticHeight);
|
CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const BlackMisc::Aviation::CAltitude &geodeticHeight);
|
||||||
|
|
||||||
//! Constructor by double values, but no geodetic height
|
//! Constructor by double values, but no geodetic height
|
||||||
CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees);
|
CCoordinateGeodetic(double latitudeDegrees, double longitudeDegrees);
|
||||||
|
|||||||
@@ -167,6 +167,11 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CAircraftModel::isVtol() const
|
||||||
|
{
|
||||||
|
return this->getAircraftIcaoCode().isVtol();
|
||||||
|
}
|
||||||
|
|
||||||
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { return CVariant::from(*this); }
|
if (index.isMyself()) { return CVariant::from(*this); }
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ namespace BlackMisc
|
|||||||
//! Aircraft ICAO code designator
|
//! Aircraft ICAO code designator
|
||||||
const QString &getAircraftIcaoCodeDesignator() const { return this->m_aircraftIcao.getDesignator(); }
|
const QString &getAircraftIcaoCodeDesignator() const { return this->m_aircraftIcao.getDesignator(); }
|
||||||
|
|
||||||
|
//! VTOL aircraft?
|
||||||
|
bool isVtol() const;
|
||||||
|
|
||||||
//! Airline ICAO code
|
//! Airline ICAO code
|
||||||
const BlackMisc::Aviation::CAirlineIcaoCode &getAirlineIcaoCode() const { return this->m_livery.getAirlineIcaoCode(); }
|
const BlackMisc::Aviation::CAirlineIcaoCode &getAirlineIcaoCode() const { return this->m_livery.getAirlineIcaoCode(); }
|
||||||
|
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
bool CSimulatedAircraft::isVtol() const
|
bool CSimulatedAircraft::isVtol() const
|
||||||
{
|
{
|
||||||
return getAircraftIcaoCode().isVtol();
|
return getModel().isVtol();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
||||||
|
|||||||
@@ -203,19 +203,19 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::normalVectorDouble
|
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::normalVectorDouble
|
||||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_situation.normalVectorDouble(); }
|
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_situation.normalVectorDouble(); }
|
||||||
|
|
||||||
//! Elevation
|
//! \copydoc BlackMisc::Aviation::CAircraftSituation::getGroundElevation
|
||||||
const BlackMisc::Aviation::CAltitude &getGroundElevation() const { return this->m_situation.getGroundElevation(); }
|
const BlackMisc::Aviation::CAltitude &getGroundElevation() const { return this->m_situation.getGroundElevation(); }
|
||||||
|
|
||||||
//! Elevation
|
//! \copydoc BlackMisc::Aviation::CAircraftSituation::setGroundElevation
|
||||||
void setGroundElevation(const BlackMisc::Aviation::CAltitude &elevation) { return this->m_situation.setGroundElevation(elevation); }
|
void setGroundElevation(const BlackMisc::Aviation::CAltitude &elevation) { this->m_situation.setGroundElevation(elevation); }
|
||||||
|
|
||||||
//! Get heading
|
//! \copydoc BlackMisc::Aviation::CAircraftSituation::getHeading
|
||||||
const BlackMisc::Aviation::CHeading &getHeading() const { return this->m_situation.getHeading(); }
|
const BlackMisc::Aviation::CHeading &getHeading() const { return this->m_situation.getHeading(); }
|
||||||
|
|
||||||
//! Get pitch
|
//! \copydoc BlackMisc::Aviation::CAircraftSituation::getPitch
|
||||||
const BlackMisc::PhysicalQuantities::CAngle &getPitch() const { return this->m_situation.getPitch(); }
|
const BlackMisc::PhysicalQuantities::CAngle &getPitch() const { return this->m_situation.getPitch(); }
|
||||||
|
|
||||||
//! Get bank
|
//! \copydoc BlackMisc::Aviation::CAircraftSituation::getBank
|
||||||
const BlackMisc::PhysicalQuantities::CAngle &getBank() const { return this->m_situation.getBank(); }
|
const BlackMisc::PhysicalQuantities::CAngle &getBank() const { return this->m_situation.getBank(); }
|
||||||
|
|
||||||
//! Get COM1 system
|
//! Get COM1 system
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSimulatedAircraftList::setRendered(const CCallsign &callsign, bool rendered)
|
int CSimulatedAircraftList::setRendered(const CCallsign &callsign, bool rendered, bool onlyFirst)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (CSimulatedAircraft &aircraft : (*this))
|
for (CSimulatedAircraft &aircraft : (*this))
|
||||||
@@ -104,11 +104,12 @@ namespace BlackMisc
|
|||||||
if (aircraft.getCallsign() != callsign) { continue; }
|
if (aircraft.getCallsign() != callsign) { continue; }
|
||||||
aircraft.setRendered(rendered);
|
aircraft.setRendered(rendered);
|
||||||
c++;
|
c++;
|
||||||
|
if (onlyFirst) break;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSimulatedAircraftList::setAircraftModel(const CCallsign &callsign, const CAircraftModel &model)
|
int CSimulatedAircraftList::setAircraftModel(const CCallsign &callsign, const CAircraftModel &model, bool onlyFirst)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (CSimulatedAircraft &aircraft : (*this))
|
for (CSimulatedAircraft &aircraft : (*this))
|
||||||
@@ -116,11 +117,12 @@ namespace BlackMisc
|
|||||||
if (aircraft.getCallsign() != callsign) { continue; }
|
if (aircraft.getCallsign() != callsign) { continue; }
|
||||||
aircraft.setModel(model);
|
aircraft.setModel(model);
|
||||||
c++;
|
c++;
|
||||||
|
if (onlyFirst) break;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSimulatedAircraftList::setAircraftParts(const CCallsign &callsign, const CAircraftParts &parts)
|
int CSimulatedAircraftList::setAircraftParts(const CCallsign &callsign, const CAircraftParts &parts, bool onlyFirst)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (CSimulatedAircraft &aircraft : (*this))
|
for (CSimulatedAircraft &aircraft : (*this))
|
||||||
@@ -129,6 +131,20 @@ namespace BlackMisc
|
|||||||
aircraft.setParts(parts);
|
aircraft.setParts(parts);
|
||||||
aircraft.setPartsSynchronized(true);
|
aircraft.setPartsSynchronized(true);
|
||||||
c++;
|
c++;
|
||||||
|
if (onlyFirst) break;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CSimulatedAircraftList::setGroundElevation(const CCallsign &callsign, const CAltitude &elevation, bool onlyFirst)
|
||||||
|
{
|
||||||
|
int c = 0;
|
||||||
|
for (CSimulatedAircraft &aircraft : (*this))
|
||||||
|
{
|
||||||
|
if (aircraft.getCallsign() != callsign) { continue; }
|
||||||
|
aircraft.setGroundElevation(elevation);
|
||||||
|
c++;
|
||||||
|
if (onlyFirst) break;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,13 +78,16 @@ namespace BlackMisc
|
|||||||
void markAllAsNotRendered();
|
void markAllAsNotRendered();
|
||||||
|
|
||||||
//! Mark given callsign as rendered
|
//! Mark given callsign as rendered
|
||||||
int setRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered);
|
int setRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
|
||||||
|
|
||||||
//! Set model
|
//! Set model
|
||||||
int setAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const CAircraftModel &model);
|
int setAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const CAircraftModel &model, bool onlyFirst = true);
|
||||||
|
|
||||||
//! Set aircraft parts
|
//! Set aircraft parts
|
||||||
int setAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts);
|
int setAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts, bool onlyFirst = true);
|
||||||
|
|
||||||
|
//! Set ground elevation
|
||||||
|
int setGroundElevation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAltitude &elevation, bool onlyFirst = true);
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
bool isEnabled(const BlackMisc::Aviation::CCallsign &callsign) const;
|
bool isEnabled(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user