mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Minor Tweaks
* renamed methods in aircraft class, new helper method * renamed method in aircraft list * renamed method in datafile reader
This commit is contained in:
@@ -49,7 +49,7 @@ namespace BlackMisc
|
||||
/*
|
||||
* Distance to plane
|
||||
*/
|
||||
const PhysicalQuantities::CLength &CAircraft::calculcateDistanceToPlane(const Geo::CCoordinateGeodetic &position)
|
||||
const PhysicalQuantities::CLength &CAircraft::setCalculcatedDistanceToPosition(const Geo::CCoordinateGeodetic &position)
|
||||
{
|
||||
this->m_distanceToPlane = Geo::greatCircleDistance(position, this->m_situation.getPosition());
|
||||
return this->m_distanceToPlane;
|
||||
@@ -83,6 +83,17 @@ namespace BlackMisc
|
||||
{
|
||||
return this->getCom1System() != com1 || this->getCom2System() != com2 || this->getTransponder() != transponder;
|
||||
}
|
||||
|
||||
/*
|
||||
* Distance to plane
|
||||
*/
|
||||
PhysicalQuantities::CLength CAircraft::calculcateDistanceToPosition(const Geo::CCoordinateGeodetic &position) const
|
||||
{
|
||||
return Geo::greatCircleDistance(position, this->m_situation.getPosition());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Same COM system data
|
||||
*/
|
||||
bool CAircraft::hasSameComData(const CComSystem &com1, const CComSystem &com2, const CTransponder &transponder)
|
||||
|
||||
@@ -90,11 +90,14 @@ namespace BlackMisc
|
||||
//! Valid designators?
|
||||
bool hasValidAircraftAndAirlineDesignator() const { return this->m_icao.hasAircraftAndAirlineDesignator(); }
|
||||
|
||||
//! Distance to aircraft
|
||||
PhysicalQuantities::CLength calculcateDistanceToPosition(const Geo::CCoordinateGeodetic &position) const;
|
||||
|
||||
/*!
|
||||
* Calculcate distance to plane, set it, and also return it
|
||||
* \param position calculated from this postion to my own aircraft
|
||||
*/
|
||||
const BlackMisc::PhysicalQuantities::CLength &calculcateDistanceToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position);
|
||||
const BlackMisc::PhysicalQuantities::CLength &setCalculcatedDistanceToPosition(const BlackMisc::Geo::CCoordinateGeodetic &position);
|
||||
|
||||
//! Get position
|
||||
BlackMisc::Geo::CCoordinateGeodetic getPosition() const { return this->m_situation.getPosition(); }
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackMisc
|
||||
/*
|
||||
* Merge with aircraft
|
||||
*/
|
||||
bool CAircraftList::updateFromVatsimDataFileAircraft(CAircraft &aircraftToBeUpdated) const
|
||||
bool CAircraftList::updateWithVatsimDataFileData(CAircraft &aircraftToBeUpdated) const
|
||||
{
|
||||
if (this->isEmpty()) return false;
|
||||
if (aircraftToBeUpdated.hasValidRealName() && aircraftToBeUpdated.hasValidId() && aircraftToBeUpdated.hasValidAircraftAndAirlineDesignator()) return false;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace BlackMisc
|
||||
|
||||
//! \brief Update aircraft with data from VATSIM data file
|
||||
//! \remarks The list used needs to contain the VATSIM data file objects
|
||||
bool updateFromVatsimDataFileAircraft(CAircraft &aircraftToBeUpdated) const;
|
||||
bool updateWithVatsimDataFileData(CAircraft &aircraftToBeUpdated) const;
|
||||
};
|
||||
|
||||
} //namespace
|
||||
|
||||
Reference in New Issue
Block a user