Inbound.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * @brief Defines the inbound
  3. * @file aman/types/Inbound.h
  4. * @author Sven Czarnian <devel@svcz.de>
  5. * @copyright Copyright 2021 Sven Czarnian
  6. * @license This project is published under the GNU General Public License v3 (GPLv3)
  7. */
  8. #pragma once
  9. #include <list>
  10. #pragma warning(push, 0)
  11. #include <EuroScopePlugIn.h>
  12. #pragma warning(pop)
  13. #pragma warning(disable: 4127)
  14. #pragma warning(disable: 5054)
  15. #include <protobuf/Communication.pb.h>
  16. #pragma warning(default: 5054)
  17. #pragma warning(default: 4127)
  18. #include <aman/types/AircraftPerformanceData.h>
  19. #include <aman/types/ArrivalWaypoint.h>
  20. namespace aman {
  21. class Inbound {
  22. private:
  23. std::vector<float> m_windLevels;
  24. std::vector<float> m_windDirections;
  25. std::vector<float> m_windSpeeds;
  26. AircraftPerformanceData m_performanceData;
  27. bool m_fixedPlan;
  28. std::string m_star;
  29. std::string m_runway;
  30. std::size_t m_nextStarWaypoint;
  31. std::vector<ArrivalWaypoint> m_arrivalRoute;
  32. Time m_timeToLose;
  33. void updatePrediction(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, bool forceUpdate);
  34. Velocity indicatedAirspeed(const Length& altitude) const noexcept;
  35. Velocity groundSpeed(const Length& altitude, const Velocity& ias, const Angle& heading);
  36. void createWindTables(const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  37. static int matchToPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions, const GeoCoordinate& position,
  38. Length& trackmiles);
  39. void predictETA(const EuroScopePlugIn::CRadarTarget& target, const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions, bool resetTTL);
  40. public:
  41. Inbound(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  42. void update(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound,
  43. const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  44. void update(EuroScopePlugIn::CRadarTarget& target);
  45. void update(EuroScopePlugIn::CFlightPlan& plan);
  46. bool fixedPlan() const noexcept;
  47. const Time& timeToLose() const noexcept;
  48. };
  49. }