FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
radar_obj.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2006-2008 Marc Brooker and Michael Inggs
4// Copyright (c) 2008-present FERS Contributors (see AUTHORS.md).
5//
6// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
7
8/**
9 * @file radar_obj.h
10 * @brief Defines the Radar class and associated functionality.
11 */
12
13#pragma once
14
15#include "object.h"
16
17namespace timing
18{
19 class Timing;
20}
21
22namespace antenna
23{
24 class Antenna;
25}
26
27namespace radar
28{
29 class Platform;
30
31 /**
32 * @enum OperationMode
33 * @brief Defines the operational mode of a radar component.
34 */
35 enum class OperationMode
36 {
37 PULSED_MODE, ///< The component operates in a pulsed mode.
38 CW_MODE ///< The component operates in a continuous-wave mode.
39 };
40
41 /**
42 * @class Radar
43 * @brief Represents a radar system on a platform.
44 */
45 class Radar : public Object
46 {
47 public:
48 /**
49 * @brief Constructs a Radar object.
50 *
51 * @param platform Pointer to the platform on which the radar is mounted.
52 * @param name Name of the radar object.
53 */
54 Radar(Platform* platform, std::string name) noexcept : Object(platform, std::move(name)) {}
55
56 ~Radar() override = default;
57
58 Radar(const Radar&) = delete;
59
60 Radar& operator=(const Radar&) = delete;
61
62 Radar(Radar&&) = delete;
63
64 Radar& operator=(Radar&&) = delete;
65
66 /**
67 * @brief Retrieves the attached radar object.
68 *
69 * @return Pointer to the attached radar object.
70 */
71 [[nodiscard]] const Radar* getAttached() const noexcept { return _attached; }
72
73 /**
74 * @brief Gets the antenna associated with this radar.
75 *
76 * @return Pointer to the associated antenna.
77 */
78 [[nodiscard]] const antenna::Antenna* getAntenna() const noexcept { return _antenna; }
79
80 /**
81 * @brief Calculates the radar gain based on input angles and wavelength.
82 *
83 * @param angle The radar's pointing angle.
84 * @param refangle The reference angle for comparison.
85 * @param wavelength The wavelength of the radar signal.
86 * @return The calculated radar gain.
87 */
88 [[nodiscard]] RealType getGain(const math::SVec3& angle, const math::SVec3& refangle,
89 RealType wavelength) const;
90
91 /**
92 * @brief Gets the noise temperature of the radar.
93 *
94 * @param angle The angle at which the noise temperature is calculated.
95 * @return The calculated noise temperature.
96 */
97 [[nodiscard]] virtual RealType getNoiseTemperature(const math::SVec3& angle) const noexcept;
98
99 /**
100 * @brief Retrieves the timing source for the radar.
101 *
102 * @return Shared pointer to the timing source.
103 */
104 [[nodiscard]] std::shared_ptr<timing::Timing> getTiming() const;
105
106 /**
107 * @brief Sets the timing source for the radar.
108 *
109 * @param tim Shared pointer to the timing source to set.
110 */
111 void setTiming(const std::shared_ptr<timing::Timing>& tim);
112
113 /**
114 * @brief Sets the antenna for the radar.
115 *
116 * @param ant Pointer to the antenna to set.
117 */
118 void setAntenna(const antenna::Antenna* ant);
119
120 /**
121 * @brief Attaches another radar object to this radar.
122 *
123 * @param obj Pointer to the radar object to attach.
124 * @throws std::runtime_error If another object is already attached.
125 */
126 void setAttached(const Radar* obj);
127
128 protected:
129 std::shared_ptr<timing::Timing> _timing; ///< Timing source for the radar.
130
131 private:
132 const antenna::Antenna* _antenna{nullptr}; ///< Antenna object associated with the radar.
133 const Radar* _attached{nullptr}; ///< Attached radar object.
134 };
135}
Abstract base class representing an antenna.
A class representing a vector in spherical coordinates.
Represents a physical object in the radar system.
Definition object.h:24
Represents a simulation platform with motion and rotation paths.
Definition platform.h:31
Represents a radar system on a platform.
Definition radar_obj.h:46
std::shared_ptr< timing::Timing > _timing
Timing source for the radar.
Definition radar_obj.h:129
const Radar * getAttached() const noexcept
Retrieves the attached radar object.
Definition radar_obj.h:71
Radar(Platform *platform, std::string name) noexcept
Constructs a Radar object.
Definition radar_obj.h:54
~Radar() override=default
void setAntenna(const antenna::Antenna *ant)
Sets the antenna for the radar.
Definition radar_obj.cpp:46
const antenna::Antenna * getAntenna() const noexcept
Gets the antenna associated with this radar.
Definition radar_obj.h:78
std::shared_ptr< timing::Timing > getTiming() const
Retrieves the timing source for the radar.
Definition radar_obj.cpp:66
Radar(const Radar &)=delete
void setAttached(const Radar *obj)
Attaches another radar object to this radar.
Definition radar_obj.cpp:56
Radar & operator=(const Radar &)=delete
Radar & operator=(Radar &&)=delete
Radar(Radar &&)=delete
RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const
Calculates the radar gain based on input angles and wavelength.
Definition radar_obj.cpp:26
virtual RealType getNoiseTemperature(const math::SVec3 &angle) const noexcept
Gets the noise temperature of the radar.
Definition radar_obj.cpp:31
void setTiming(const std::shared_ptr< timing::Timing > &tim)
Sets the timing source for the radar.
Definition radar_obj.cpp:36
Represents a timing source for simulation.
Definition timing.h:34
double RealType
Type for real numbers.
Definition config.h:27
OperationMode
Defines the operational mode of a radar component.
Definition radar_obj.h:36
@ PULSED_MODE
The component operates in a pulsed mode.
@ CW_MODE
The component operates in a continuous-wave mode.
Base class for all physical objects in the radar system.