Inbound.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. UtcTime::Point m_waypointEstimatedTimeOfArrival;
  34. Length m_trackmiles;
  35. Time m_flighttime;
  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. static int matchToPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions, const GeoCoordinate& position,
  41. const Velocity& groundspeed, Length& trackmiles);
  42. void predictETA(const EuroScopePlugIn::CRadarTarget& target, const EuroScopePlugIn::CFlightPlanPositionPredictions& predictions);
  43. public:
  44. Inbound(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound, const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  45. void update(EuroScopePlugIn::CRadarTarget& target, const aman::AircraftSchedule& inbound,
  46. const google::protobuf::RepeatedPtrField<aman::WindData>& wind);
  47. void update(EuroScopePlugIn::CRadarTarget& target);
  48. void update(EuroScopePlugIn::CFlightPlan& plan);
  49. bool fixedPlan() const noexcept;
  50. UtcTime::Point eta() const;
  51. UtcTime::Point pta() const;
  52. const Time& timeToLose() const noexcept;
  53. const Length& trackmiles() const noexcept;
  54. const Time& flighttime() const noexcept;
  55. };
  56. }