define the inbound and predict the flight path

This commit is contained in:
Sven Czarnian
2021-11-25 22:27:03 +01:00
parent 1594be8dc1
commit 8390cd5309
5 changed files with 447 additions and 25 deletions

View File

@@ -0,0 +1,26 @@
/*
* @brief Defines the performance data
* @file aman/types/AircraftPerformanceData.h
* @author Sven Czarnian <devel@svcz.de>
* @copyright Copyright 2021 Sven Czarnian
* @license This project is published under the GNU General Public License v3 (GPLv3)
*/
#pragma once
#include <aman/types/Quantity.hpp>
namespace aman {
struct AircraftPerformanceData {
Velocity speedAboveFL240;
Velocity speedAboveFL100;
Velocity speedBelowFL100;
Velocity speedApproach;
AircraftPerformanceData() :
speedAboveFL240(310_kn),
speedAboveFL100(280_kn),
speedBelowFL100(250_kn),
speedApproach(140_kn) { }
};
}

View File

@@ -1,24 +0,0 @@
/*
* @brief Defines the wind data
* @file aman/types/WindData.h
* @author Sven Czarnian <devel@svcz.de>
* @copyright Copyright 2021 Sven Czarnian
* @license This project is published under the GNU General Public License v3 (GPLv3)
*/
#pragma once
#include <aman/types/Quantity.hpp>
namespace aman {
struct AltitudeWindData {
Length altitude;
Angle direction;
Velocity speed;
AltitudeWindData() :
altitude(),
direction(),
speed() { }
};
}

View File

@@ -0,0 +1,55 @@
/*
* @brief Defines the inbound
* @file aman/types/Inbound.h
* @author Sven Czarnian <devel@svcz.de>
* @copyright Copyright 2021 Sven Czarnian
* @license This project is published under the GNU General Public License v3 (GPLv3)
*/
#pragma once
#include <list>
#pragma warning(push, 0)
#include <EuroScopePlugIn.h>
#pragma warning(pop)
#pragma warning(disable: 4127)
#pragma warning(disable: 5054)
#include <protobuf/Communication.pb.h>
#pragma warning(default: 5054)
#pragma warning(default: 4127)
#include <aman/types/AircraftPerformanceData.h>
#include <aman/types/ArrivalWaypoint.h>
namespace aman {
class Inbound {
private:
std::vector<float> m_windLevels;
std::vector<float> m_windDirections;
std::vector<float> m_windSpeeds;
AircraftPerformanceData m_performanceData;
bool m_fixedPlan;
std::string m_star;
std::string m_runway;
std::size_t m_nextStarWaypoint;
std::vector<ArrivalWaypoint> m_arrivalRoute;
Time m_timeToLose;
void updatePrediction(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, bool forceUpdate);
Velocity indicatedAirspeed(const Length& altitude) const noexcept;
Velocity groundSpeed(const Length& altitude, const Velocity& ias, const Angle& heading);
void createWindTables(const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
static int findIndexInPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions, const GeoCoordinate& position);
public:
Inbound(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
void update(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound,
const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
void update(EuroScopePlugIn::CRadarTarget& target);
void update(EuroScopePlugIn::CFlightPlan& plan);
bool fixedPlan() const noexcept;
const Time& timeToLose() const noexcept;
};
}