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:
Klaus Basan
2015-01-27 03:27:01 +01:00
parent ea68170202
commit ce86c902b5
45 changed files with 1257 additions and 790 deletions

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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;