VR-Engage  2.2
Loading...
Searching...
No Matches
rwRadarStateInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file rwRadarStateInfo.h
7//! \ingroup vreVrfMessages
8//! \brief Defines radar state information structure
9//!
10//! This file contains the DtRwRadarStateInfo class which represents the
11//! current operating state of a radar system in the simulation, including mode,
12//! antenna parameters, and scan pattern information.
13
14#pragma once
15
16#include "export.h"
17
18#include <readerWriter/readerWriter.h>
19#include <readerWriter/rwReal.h>
20#include <readerWriter/rwInt.h>
21#include <vrfUtil/rwTemplatedList.h>
22
23// class DtReaderWriterRegistry;
24//! \brief Radar state information class for radar system configurations
25//!
26//! This class represents the current operational state of a radar system,
27//! including its mode, scan patterns, and antenna parameters. It is a
28//! readable/writable class that can store itself and read itself from a file.
29//! This enables persistent storage of radar configuration between scenario runs.
30
31class VRFMESSAGES_DLL DtRwRadarStateInfo : public DtReaderWriter
32{
33public:
34 //! \brief Default constructor
35 //!
36 //! Initializes a radar state info object with default values.
38
39 //! \brief Constructor with name
40 //! \param name The name of the radar state
41 //! \param parentRegistry Optional reader-writer registry for serialization
42 DtRwRadarStateInfo(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
43
44 //! \brief Constructor with symbol name
45 //! \param name The symbol name of the radar state
46 //! \param parentRegistry Optional reader-writer registry for serialization
47 DtRwRadarStateInfo(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
48
49 //! \brief Copy constructor
50 //! \param orig The radar state info to copy from
51 //! \param parentRegistry Optional reader-writer registry for serialization
52 DtRwRadarStateInfo(const DtRwRadarStateInfo& orig, DtReaderWriterRegistry* const parentRegistry = NULL);
53
54 //! \brief Virtual destructor
55 virtual ~DtRwRadarStateInfo() override;
56
57 //! \brief Assignment operator
58 //! \param orig The radar state info to copy from
59 //! \return Reference to this object after assignment
61
62 //! \brief Sets the radar's operating mode
63 //! \param val The mode string to set (e.g., "Search", "Track", "Standby")
64 //!
65 //! Sets the primary operational mode of the radar system.
66 virtual void setMode(const DtString& val);
67
68 //! \brief Gets the radar's operating mode
69 //! \return The current radar mode
70 virtual DtString mode() const;
71
72 //! \brief Sets the radar's operating submode
73 //! \param val The submode string to set
74 //!
75 //! Sets the submode within the current operational mode.
76 virtual void setSubmode(const DtString& val);
77
78 //! \brief Gets the radar's operating submode
79 //! \return The current radar submode
80 virtual DtString submode() const;
81
82 //! \brief Sets the antenna center azimuth angle
83 //! \param val The center azimuth angle in degrees
84 //!
85 //! Sets the center of the radar's azimuth scan pattern.
86 virtual void setAntennaCenterAzimuth(double val);
87
88 //! \brief Gets the antenna center azimuth angle
89 //! \return The center azimuth angle in degrees
90 virtual double antennaCenterAzimuth() const;
91
92 //! \brief Sets the antenna center elevation angle
93 //! \param val The center elevation angle in degrees
94 //!
95 //! Sets the center of the radar's elevation scan pattern.
96 virtual void setAntennaCenterElevation(double val);
97
98 //! \brief Gets the antenna center elevation angle
99 //! \return The center elevation angle in degrees
100 virtual double antennaCenterElevation() const;
101
102 //! \brief Sets the antenna minimum elevation angle
103 //! \param val The minimum elevation angle in degrees
104 //!
105 //! Sets the lower limit of the radar's elevation scan pattern.
106 virtual void setAntennaMinElevation(double val);
107
108 //! \brief Gets the antenna minimum elevation angle
109 //! \return The minimum elevation angle in degrees
110 virtual double antennaMinElevation() const;
111
112 //! \brief Sets the antenna maximum elevation angle
113 //! \param val The maximum elevation angle in degrees
114 //!
115 //! Sets the upper limit of the radar's elevation scan pattern.
116 virtual void setAntennaMaxElevation(double val);
117
118 //! \brief Gets the antenna maximum elevation angle
119 //! \return The maximum elevation angle in degrees
120 virtual double antennaMaxElevation() const;
121
122 //! \brief Sets the antenna gate size
123 //! \param val The gate size in degrees
124 //!
125 //! Sets the angular size of the radar's detection gate.
126 virtual void setAntennaGateSize(double val);
127
128 //! \brief Gets the antenna gate size
129 //! \return The gate size in degrees
130 virtual double antennaGateSize() const;
131
132 //! \brief Sets the antenna current azimuth angle
133 //! \param val The current azimuth angle in degrees
134 //!
135 //! Sets the current instantaneous azimuth angle of the radar beam.
136 virtual void setAntennaCurrentAzimuth(double val);
137
138 //! \brief Gets the antenna current azimuth angle
139 //! \return The current azimuth angle in degrees
140 virtual double antennaCurrentAzimuth() const;
141
142 //! \brief Sets the antenna current elevation angle
143 //! \param val The current elevation angle in degrees
144 //!
145 //! Sets the current instantaneous elevation angle of the radar beam.
146 virtual void setAntennaCurrentElevation(double val);
147
148 //! \brief Gets the antenna current elevation angle
149 //! \return The current elevation angle in degrees
150 virtual double antennaCurrentElevation() const;
151
152 //! \brief Sets the antenna current azimuth scan rate
153 //! \param val The current azimuth scan rate in degrees per second
154 //!
155 //! Sets the rate at which the radar beam is currently sweeping in azimuth.
156 virtual void setAntennaCurrentAzimuthRate(double val);
157
158 //! \brief Gets the antenna current azimuth scan rate
159 //! \return The current azimuth scan rate in degrees per second
160 virtual double antennaCurrentAzimuthRate() const;
161
162 //! \brief Sets the number of scan bars
163 //! \param val The number of scan bars
164 //!
165 //! Sets the number of horizontal scan bars in the radar's scan pattern.
166 virtual void setBarCount(int val);
167
168 //! \brief Gets the number of scan bars
169 //! \return The number of scan bars
170 virtual int barCount() const;
171
172 //! \brief Creates a deep copy of this object
173 //! \return Pointer to a newly created clone of this class
174 //!
175 //! Returns a dynamically allocated copy of this radar state info.
176 virtual DtRwRadarStateInfo* clone() const;
177
178 //! \brief Equality comparison operator
179 //! \param other The radar state info to compare with
180 //! \return True if the objects are equal, false otherwise
181 bool operator==(const DtRwRadarStateInfo& other) const;
182
183 //! \brief Inequality comparison operator
184 //! \param rhs The radar state info to compare with
185 //! \return True if the objects are not equal, false otherwise
186 bool operator!=(const DtRwRadarStateInfo& rhs) { return !(*this == rhs); };
187
188 //! \brief Encodes this object to a buffer
189 //! \param buffer The buffer to encode into
190 //! \return Pointer to the buffer after the encoded data
191 virtual char* encode(char* buffer) const;
192
193 //! \brief Decodes this object from a buffer
194 //! \param buffer The buffer to decode from
195 //! \return Pointer to the buffer after the decoded data
196 virtual const char* decode(const char* buffer);
197
198 //! \brief Gets the size of the encoded data in bytes
199 //! \return The size in bytes
200 virtual int getSize() const;
201
202protected:
203 //! \brief Primary mode of radar operation (e.g., "Search", "Track")
204 DtRwString myMode;
205
206 //! \brief Submode of radar operation within the primary mode
207 DtRwString mySubmode;
208
209 //! \brief Center azimuth angle of the radar scan pattern (degrees)
211
212 //! \brief Center elevation angle of the radar scan pattern (degrees)
214
215 //! \brief Minimum elevation angle of the radar scan pattern (degrees)
217
218 //! \brief Maximum elevation angle of the radar scan pattern (degrees)
220
221 //! \brief Angular size of the radar detection gate (degrees)
223
224 //! \brief Current instantaneous azimuth angle of the radar beam (degrees)
226
227 //! \brief Current instantaneous elevation angle of the radar beam (degrees)
229
230 //! \brief Current rate of azimuth scanning (degrees/second)
232
233 //! \brief Number of horizontal scan bars in the radar scan pattern
234 DtRwInt myBarCount;
235};
236
237//! \brief List type for storing multiple radar state information entries
238using DtRwSensorStateInfoList = DtRwTemplatedListPtr<DtRwRadarStateInfo, true>;
239
240//! \brief Namespace containing serialization functions for buffer operations
241namespace DtBufferSerialize
242{
243//! \brief Gets the number of bytes required to encode the value
244//! \param info The radar state info to calculate size for
245//! \return The number of bytes required for encoding
247
248//! \brief Serializes the provided data into a buffer
249//! \param info The radar state info to encode
250//! \param buffer The buffer to serialize into
251//! \return Pointer to the buffer after the serialization
252//!
253//! Serializes the provided radar state info into the buffer.
254//! The buffer must have at least the number of bytes returned by getSize().
255VRFMESSAGES_DLL char* encode(const DtRwRadarStateInfo& info, char* buffer);
256
257//! \brief Deserializes data from a buffer into the provided object
258//! \param info The radar state info to populate
259//! \param buffer The buffer to deserialize from
260//! \return Pointer to the buffer after the deserialization
261VRFMESSAGES_DLL const char* decode(DtRwRadarStateInfo& info, const char* buffer);
262} // namespace DtBufferSerialize
Radar state information class for radar system configurations.
Definition rwRadarStateInfo.h:32
virtual void setBarCount(int val)
Sets the number of scan bars.
DtRwRadarStateInfo()
Default constructor.
virtual double antennaCurrentElevation() const
Gets the antenna current elevation angle.
virtual void setAntennaMaxElevation(double val)
Sets the antenna maximum elevation angle.
DtRwReal myAntennaCenterElevation
Center elevation angle of the radar scan pattern (degrees)
Definition rwRadarStateInfo.h:213
DtRwString mySubmode
Submode of radar operation within the primary mode.
Definition rwRadarStateInfo.h:207
virtual double antennaCurrentAzimuth() const
Gets the antenna current azimuth angle.
virtual double antennaMinElevation() const
Gets the antenna minimum elevation angle.
virtual DtString mode() const
Gets the radar's operating mode.
virtual void setSubmode(const DtString &val)
Sets the radar's operating submode.
virtual void setAntennaMinElevation(double val)
Sets the antenna minimum elevation angle.
virtual int getSize() const
Gets the size of the encoded data in bytes.
DtRwReal myAntennaMaxElevation
Maximum elevation angle of the radar scan pattern (degrees)
Definition rwRadarStateInfo.h:219
virtual DtRwRadarStateInfo * clone() const
Creates a deep copy of this object.
DtRwRadarStateInfo(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with name.
DtRwReal myAntennaCenterAzimuth
Center azimuth angle of the radar scan pattern (degrees)
Definition rwRadarStateInfo.h:210
DtRwReal myAntennaCurrentAzimuthRate
Current rate of azimuth scanning (degrees/second)
Definition rwRadarStateInfo.h:231
bool operator==(const DtRwRadarStateInfo &other) const
Equality comparison operator.
virtual double antennaCenterAzimuth() const
Gets the antenna center azimuth angle.
virtual void setAntennaCenterAzimuth(double val)
Sets the antenna center azimuth angle.
virtual double antennaGateSize() const
Gets the antenna gate size.
virtual ~DtRwRadarStateInfo() override
Virtual destructor.
virtual void setAntennaGateSize(double val)
Sets the antenna gate size.
virtual void setAntennaCenterElevation(double val)
Sets the antenna center elevation angle.
virtual double antennaCenterElevation() const
Gets the antenna center elevation angle.
virtual DtString submode() const
Gets the radar's operating submode.
virtual void setMode(const DtString &val)
Sets the radar's operating mode.
DtRwRadarStateInfo & operator=(const DtRwRadarStateInfo &orig)
Assignment operator.
DtRwInt myBarCount
Number of horizontal scan bars in the radar scan pattern.
Definition rwRadarStateInfo.h:234
virtual const char * decode(const char *buffer)
Decodes this object from a buffer.
bool operator!=(const DtRwRadarStateInfo &rhs)
Inequality comparison operator.
Definition rwRadarStateInfo.h:186
DtRwReal myAntennaGateSize
Angular size of the radar detection gate (degrees)
Definition rwRadarStateInfo.h:222
virtual void setAntennaCurrentAzimuthRate(double val)
Sets the antenna current azimuth scan rate.
virtual double antennaCurrentAzimuthRate() const
Gets the antenna current azimuth scan rate.
virtual void setAntennaCurrentElevation(double val)
Sets the antenna current elevation angle.
virtual double antennaMaxElevation() const
Gets the antenna maximum elevation angle.
DtRwReal myAntennaCurrentElevation
Current instantaneous elevation angle of the radar beam (degrees)
Definition rwRadarStateInfo.h:228
virtual char * encode(char *buffer) const
Encodes this object to a buffer.
DtRwRadarStateInfo(const DtRwRadarStateInfo &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Copy constructor.
DtRwString myMode
Primary mode of radar operation (e.g., "Search", "Track")
Definition rwRadarStateInfo.h:204
DtRwReal myAntennaCurrentAzimuth
Current instantaneous azimuth angle of the radar beam (degrees)
Definition rwRadarStateInfo.h:225
DtRwReal myAntennaMinElevation
Minimum elevation angle of the radar scan pattern (degrees)
Definition rwRadarStateInfo.h:216
virtual int barCount() const
Gets the number of scan bars.
DtRwRadarStateInfo(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with symbol name.
virtual void setAntennaCurrentAzimuth(double val)
Sets the antenna current azimuth angle.
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23
Namespace containing serialization functions for buffer operations.
Definition rwRadarContactInfo.h:251
VRFMESSAGES_DLL int getSize(const DtRwRadarContactInfo &data)
Gets the number of bytes required to encode the value.
VRFMESSAGES_DLL const char * decode(DtRwRadarContactInfo &data, const char *buffer)
Deserializes data from a buffer into the provided object.
VRFMESSAGES_DLL char * encode(const DtRwRadarContactInfo &data, char *buffer)
Serializes the provided data into a buffer.
DtRwTemplatedListPtr< DtRwRadarStateInfo, true > DtRwSensorStateInfoList
List type for storing multiple radar state information entries.
Definition rwRadarStateInfo.h:238