From 2240978b0115c3a3c19c0d587dca00e0755eedc9 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Mon, 22 Nov 2021 16:18:47 +0100 Subject: [PATCH] define the arrival waypoint --- include/aman/types/ArrivalWaypoint.h | 56 ++++++++++++++++++++++++++++ src/CMakeLists.txt | 2 + src/types/ArrivalWaypoint.cpp | 37 ++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 include/aman/types/ArrivalWaypoint.h create mode 100644 src/types/ArrivalWaypoint.cpp diff --git a/include/aman/types/ArrivalWaypoint.h b/include/aman/types/ArrivalWaypoint.h new file mode 100644 index 0000000..ad6a206 --- /dev/null +++ b/include/aman/types/ArrivalWaypoint.h @@ -0,0 +1,56 @@ +/* + * @brief Defines a waypoint of a route + * @file types/ArrivalWaypoint.h + * @author Sven Czarnian + * @copyright Copyright 2020-2021 Sven Czarnian + * @license This project is published under the GNU General Public License v3 (GPLv3) + */ + +#pragma once + +#include + +#include +#include + +namespace aman { + /** + * @brief Describes a waypoint of a route + * @ingroup types + */ + class ArrivalWaypoint { + private: + std::string m_name; + GeoCoordinate m_position; + Length m_altitude; + Velocity m_indicatedAirspeed; + UtcTime::Point m_plannedArrivalTime; + + public: + /** + * @brief Creates an empty waypoint + */ + ArrivalWaypoint() noexcept; + /** + * @brief Creates a waypoint + * @param[in] name The waypoint's name + * @param[in] position The waypoint's position + * @param[in] altitude The planned altitude + * @param[in] indicatedAirspeed The planned IAS + * @param[in] pta The planned time of arrival + */ + ArrivalWaypoint(const std::string& name, const GeoCoordinate& position, const Length& altitude, + const Velocity& indicatedAirspeed, const UtcTime::Point& pta); + + /** + * @brief Returns the waypoint's name + * @return The name + */ + const std::string& name() const noexcept; + /** + * @brief Returns the waypoint's position + * @return The position + */ + const GeoCoordinate& position() const noexcept; + }; +} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8c3ee0..665c5eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,6 +46,7 @@ SET(SOURCE_CONFIG_FILES ) SET(SOURCE_TYPES_FILES + types/ArrivalWaypoint.cpp types/GeoCoordinate.cpp ) @@ -73,6 +74,7 @@ SET(INCLUDE_HELPER_FILES SET(INCLUDE_TYPES_FILES ${CMAKE_SOURCE_DIR}/include/aman/types/AltitudeWindData.h + ${CMAKE_SOURCE_DIR}/include/aman/types/ArrivalWaypoint.h ${CMAKE_SOURCE_DIR}/include/aman/types/Communication.h ${CMAKE_SOURCE_DIR}/include/aman/types/GeoCoordinate.h ${CMAKE_SOURCE_DIR}/include/aman/types/Quantity.hpp diff --git a/src/types/ArrivalWaypoint.cpp b/src/types/ArrivalWaypoint.cpp new file mode 100644 index 0000000..1c1e1f8 --- /dev/null +++ b/src/types/ArrivalWaypoint.cpp @@ -0,0 +1,37 @@ +/* + * Author: + * Sven Czarnian + * Brief: + * Implements the waypoint + * Copyright: + * 2020-2021 Sven Czarnian + * License: + * GNU General Public License v3 (GPLv3) + */ + +#include + +using namespace aman; + +ArrivalWaypoint::ArrivalWaypoint() noexcept : + m_name(), + m_position(), + m_altitude(), + m_indicatedAirspeed(), + m_plannedArrivalTime() { } + +ArrivalWaypoint::ArrivalWaypoint(const std::string& name, const GeoCoordinate& position, const Length& altitude, + const Velocity& indicatedAirspeed, const UtcTime::Point& pta) : + m_name(name), + m_position(position), + m_altitude(altitude), + m_indicatedAirspeed(indicatedAirspeed), + m_plannedArrivalTime(pta) { } + +const std::string& ArrivalWaypoint::name() const noexcept { + return this->m_name; +} + +const GeoCoordinate& ArrivalWaypoint::position() const noexcept { + return this->m_position; +}