mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +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:
@@ -74,6 +74,9 @@ namespace BlackCore
|
|||||||
//! ICAO info for callsign
|
//! ICAO info for callsign
|
||||||
BlackMisc::Aviation::CAircraftIcao getIcaoInfo(const BlackMisc::Aviation::CCallsign &callsign);
|
BlackMisc::Aviation::CAircraftIcao getIcaoInfo(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
|
//! Update with VATSIM aircraft data from data file
|
||||||
|
void updateWithVatsimDataFileData(BlackMisc::Aviation::CAircraft &aircraftToBeUdpated) const { this->m_aircrafts.updateWithVatsimDataFileData(aircraftToBeUdpated); }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Data have been read
|
//! Data have been read
|
||||||
void loadFinished(QNetworkReply *nwReply);
|
void loadFinished(QNetworkReply *nwReply);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace BlackMisc
|
|||||||
/*
|
/*
|
||||||
* Distance to plane
|
* 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());
|
this->m_distanceToPlane = Geo::greatCircleDistance(position, this->m_situation.getPosition());
|
||||||
return this->m_distanceToPlane;
|
return this->m_distanceToPlane;
|
||||||
@@ -83,6 +83,17 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
return this->getCom1System() != com1 || this->getCom2System() != com2 || this->getTransponder() != transponder;
|
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
|
* Same COM system data
|
||||||
*/
|
*/
|
||||||
bool CAircraft::hasSameComData(const CComSystem &com1, const CComSystem &com2, const CTransponder &transponder)
|
bool CAircraft::hasSameComData(const CComSystem &com1, const CComSystem &com2, const CTransponder &transponder)
|
||||||
|
|||||||
@@ -90,11 +90,14 @@ namespace BlackMisc
|
|||||||
//! Valid designators?
|
//! Valid designators?
|
||||||
bool hasValidAircraftAndAirlineDesignator() const { return this->m_icao.hasAircraftAndAirlineDesignator(); }
|
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
|
* Calculcate distance to plane, set it, and also return it
|
||||||
* \param position calculated from this postion to my own aircraft
|
* \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
|
//! Get position
|
||||||
BlackMisc::Geo::CCoordinateGeodetic getPosition() const { return this->m_situation.getPosition(); }
|
BlackMisc::Geo::CCoordinateGeodetic getPosition() const { return this->m_situation.getPosition(); }
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace BlackMisc
|
|||||||
/*
|
/*
|
||||||
* Merge with aircraft
|
* Merge with aircraft
|
||||||
*/
|
*/
|
||||||
bool CAircraftList::updateFromVatsimDataFileAircraft(CAircraft &aircraftToBeUpdated) const
|
bool CAircraftList::updateWithVatsimDataFileData(CAircraft &aircraftToBeUpdated) const
|
||||||
{
|
{
|
||||||
if (this->isEmpty()) return false;
|
if (this->isEmpty()) return false;
|
||||||
if (aircraftToBeUpdated.hasValidRealName() && aircraftToBeUpdated.hasValidId() && aircraftToBeUpdated.hasValidAircraftAndAirlineDesignator()) 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
|
//! \brief Update aircraft with data from VATSIM data file
|
||||||
//! \remarks The list used needs to contain the VATSIM data file objects
|
//! \remarks The list used needs to contain the VATSIM data file objects
|
||||||
bool updateFromVatsimDataFileAircraft(CAircraft &aircraftToBeUpdated) const;
|
bool updateWithVatsimDataFileData(CAircraft &aircraftToBeUpdated) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user