Inbound.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. Velocity m_groundSpeed;
  31. std::size_t m_nextStarWaypoint;
  32. std::vector<ArrivalWaypoint> m_arrivalRoute;
  33. Time m_timeToLose;
  34. UtcTime::Point m_waypointEstimatedTimeOfArrival;
  35. bool m_resetFilter;
  36. void updatePrediction(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound);
  37. Velocity indicatedAirspeed(const Length& altitude) const noexcept;
  38. Velocity groundSpeed(const Length& altitude, const Velocity& ias, const Angle& heading);
  39. void createWindTables(const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  40. void predictETA(const EuroScopePlugIn::CRadarTarget& target, const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions);
  41. public:
  42. Inbound(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  43. void update(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound,
  44. const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  45. void update(EuroScopePlugIn::CRadarTarget& target);
  46. void directTo(EuroScopePlugIn::CRadarTarget& radarTarget, const std::string& waypoint);
  47. bool fixedPlan() const noexcept;
  48. UtcTime::Point eta() const;
  49. UtcTime::Point pta() const;
  50. const Time& timeToLose() const noexcept;
  51. const std::string& nextWaypoint() const noexcept;
  52. const std::vector<ArrivalWaypoint>& arrivalRoute() const noexcept;
  53. static int matchToPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions, const GeoCoordinate& position,
  54. const Velocity& groundspeed, Length& trackmiles);
  55. };
  56. }