mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Upfront of refs #369
* consolidated ICoordinateGeodetic (e.g. fixed nested properties) * shifted common functionality for objects/containers with callsign into interface * shifted common functionality for objects/containers with geo position into interface * shifted common functionality for objects/containers with timestamp into interface * updated corresponding value objects / specialized lists * adjusted all places where renamed functions are used
This commit is contained in:
@@ -118,13 +118,13 @@ namespace BlackSimPlugin
|
||||
// We want the distance in Latitude direction. Longitude must be equal for old and new position.
|
||||
helperPosition.setLatitude(newPosition.latitude());
|
||||
helperPosition.setLongitude(oldPosition.longitude());
|
||||
CLength distanceLatitudeObj = greatCircleDistance(oldPosition, helperPosition);
|
||||
CLength distanceLatitudeObj = calculateGreatCircleDistance(oldPosition, helperPosition);
|
||||
|
||||
|
||||
// Now we want the Longitude distance. Latitude must be equal for old and new position.
|
||||
helperPosition.setLatitude(oldPosition.latitude());
|
||||
helperPosition.setLongitude(newSituation.longitude());
|
||||
CLength distanceLongitudeObj = greatCircleDistance(oldPosition, helperPosition);
|
||||
CLength distanceLongitudeObj = calculateGreatCircleDistance(oldPosition, helperPosition);
|
||||
|
||||
// Latitude and Longitude velocity
|
||||
positionVelocity.lat_velocity = distanceLatitudeObj.value(CLengthUnit::ft()) * 65536.0 / updateInterval;
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BlackSimPlugin
|
||||
if (!CAirportIcao::isValidIcaoDesignator(icao)) continue; // tiny airfields in SIM
|
||||
CCoordinateGeodetic pos(pFacilityAirport->Latitude, pFacilityAirport->Longitude, pFacilityAirport->Altitude);
|
||||
CAirport airport(CAirportIcao(icao), pos);
|
||||
CLength d = airport.calculcateDistanceAndBearingToPlane(posAircraft);
|
||||
CLength d = airport.calculcateDistanceAndBearingToOwnAircraft(posAircraft);
|
||||
if (d > maxDistance) continue;
|
||||
simulatorFsx->m_airportsInRange.replaceOrAddByIcao(airport);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "xbus_service_proxy.h"
|
||||
#include "xbus_traffic_proxy.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/coordinategeodetic.h"
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -15,6 +16,7 @@ using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Geo;
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
@@ -254,7 +256,8 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Aviation::CAirportList CSimulatorXPlane::getAirportsInRange() const
|
||||
{
|
||||
auto copy = m_airports;
|
||||
copy.sortByRange({ m_xplaneData.latitude, m_xplaneData.longitude, 0 }, true);
|
||||
//! \todo Check if units match, xPlaneData has now hints what the values are
|
||||
copy.sortByRange(CCoordinateGeodetic(m_xplaneData.latitude, m_xplaneData.longitude, 0), true);
|
||||
copy.truncate(20);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Aviation::CAirportList m_airports;
|
||||
BlackMisc::Simulation::CSimulatedAircraftList m_remoteAircraft;
|
||||
|
||||
//! \todo Add units to members? pitchDeg?, altitudeFt?
|
||||
struct // data is written by DBus async method callbacks
|
||||
{
|
||||
QString aircraftModelPath;
|
||||
|
||||
Reference in New Issue
Block a user