mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +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
@@ -167,6 +167,11 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
bool CAircraftModel::isVtol() const
|
||||
{
|
||||
return this->getAircraftIcaoCode().isVtol();
|
||||
}
|
||||
|
||||
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
@@ -175,6 +175,9 @@ namespace BlackMisc
|
||||
//! Aircraft ICAO code designator
|
||||
const QString &getAircraftIcaoCodeDesignator() const { return this->m_aircraftIcao.getDesignator(); }
|
||||
|
||||
//! VTOL aircraft?
|
||||
bool isVtol() const;
|
||||
|
||||
//! Airline ICAO code
|
||||
const BlackMisc::Aviation::CAirlineIcaoCode &getAirlineIcaoCode() const { return this->m_livery.getAirlineIcaoCode(); }
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace BlackMisc
|
||||
|
||||
bool CSimulatedAircraft::isVtol() const
|
||||
{
|
||||
return getAircraftIcaoCode().isVtol();
|
||||
return getModel().isVtol();
|
||||
}
|
||||
|
||||
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
||||
|
||||
@@ -203,19 +203,19 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::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(); }
|
||||
|
||||
//! Elevation
|
||||
void setGroundElevation(const BlackMisc::Aviation::CAltitude &elevation) { return this->m_situation.setGroundElevation(elevation); }
|
||||
//! \copydoc BlackMisc::Aviation::CAircraftSituation::setGroundElevation
|
||||
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(); }
|
||||
|
||||
//! Get pitch
|
||||
//! \copydoc BlackMisc::Aviation::CAircraftSituation::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(); }
|
||||
|
||||
//! 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;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
@@ -104,11 +104,12 @@ namespace BlackMisc
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setRendered(rendered);
|
||||
c++;
|
||||
if (onlyFirst) break;
|
||||
}
|
||||
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;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
@@ -116,11 +117,12 @@ namespace BlackMisc
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setModel(model);
|
||||
c++;
|
||||
if (onlyFirst) break;
|
||||
}
|
||||
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;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
@@ -129,6 +131,20 @@ namespace BlackMisc
|
||||
aircraft.setParts(parts);
|
||||
aircraft.setPartsSynchronized(true);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -78,13 +78,16 @@ namespace BlackMisc
|
||||
void markAllAsNotRendered();
|
||||
|
||||
//! 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
|
||||
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
|
||||
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?
|
||||
bool isEnabled(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
Reference in New Issue
Block a user