VR-Engage  2.2
Loading...
Searching...
No Matches
rwRwrContactInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file rwRwrContactInfo.h
7//! \ingroup vreVrfMessages
8//! \brief Defines RWR (Radar Warning Receiver) contact information structure
9//!
10//! This file contains the DtRwRwrContactInfo class which represents detailed
11//! information about radar warning receiver contacts detected by aircraft
12//! electronic warfare systems. It includes positional data, signal characteristics,
13//! and emitter identification information.
14
15#pragma once
16
17#include "export.h"
18
19#include <readerWriter/readerWriter.h>
20#include <readerWriter/rwReal.h>
21#include <readerWriter/rwInt.h>
22#include <vrfutil/rwTemplatedList.h>
23
24// class DtReaderWriterRegistry;
25//! \brief Radar Warning Receiver (RWR) contact information class
26//!
27//! This class represents the data gathered by an RWR about a particular
28//! emitter (radar) detected in the environment. It provides information about
29//! the contact's position, signal characteristics, and emitter identification.
30//! This is a readable/writable class that can store and read itself from a file.
31//! Note that entity IDs are not persisted, as they change between scenario runs.
32
33class VRFMESSAGES_DLL DtRwRwrContactInfo : public DtReaderWriter
34{
35public:
36 //! \brief Default constructor
37 //!
38 //! Initializes an RWR contact info object with default values.
40
41 //! \brief Constructor with name
42 //! \param name The name of the RWR contact
43 //! \param parentRegistry Optional reader-writer registry for serialization
44 DtRwRwrContactInfo(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
45
46 //! \brief Constructor with symbol name
47 //! \param name The symbol name of the RWR contact
48 //! \param parentRegistry Optional reader-writer registry for serialization
49 DtRwRwrContactInfo(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
50
51 //! \brief Copy constructor
52 //! \param orig The RWR contact info to copy from
53 //! \param parentRegistry Optional reader-writer registry for serialization
54 DtRwRwrContactInfo(const DtRwRwrContactInfo& orig, DtReaderWriterRegistry* const parentRegistry = NULL);
55
56 //! \brief Virtual destructor
57 virtual ~DtRwRwrContactInfo() override;
58
59 //! \brief Assignment operator
60 //! \param orig The RWR contact info to copy from
61 //! \return Reference to this object after assignment
63
64 //! \brief Sets the contact's azimuth relative to the platform's heading
65 //! \param azimuth The azimuth angle in degrees
66 //!
67 //! Sets the azimuth angle (in degrees) of the contact relative to the platform's heading.
68 //! Negative azimuth values indicate the contact is towards the left.
69 virtual void setContactAzimuth(double azimuth);
70
71 //! \brief Gets the contact's azimuth
72 //! \return The azimuth angle in degrees relative to the platform's heading
73 virtual double contactAzimuth() const;
74
75 //! \brief Sets the contact's elevation angle
76 //! \param elevation The elevation angle in degrees
77 //!
78 //! Sets the elevation angle (in degrees) of the contact relative to the platform.
79 virtual void setContactElevation(double elevation);
80
81 //! \brief Gets the contact's elevation angle
82 //! \return The elevation angle in degrees
83 virtual double contactElevation() const;
84
85 //! \brief Sets the range to the contact
86 //! \param range The range in meters
87 //!
88 //! Sets the straight-line distance to the contact in meters.
89 virtual void setContactRange(double range);
90
91 //! \brief Gets the range to the contact
92 //! \return The range in meters
93 virtual double contactRange() const;
94
95 //! \brief Sets the radar mode of the contact
96 //! \param mode The radar mode identifier
97 //!
98 //! Sets the operational mode of the radar emitter that this contact represents.
99 virtual void setContactRadarMode(int mode);
100
101 //! \brief Gets the radar mode of the contact
102 //! \return The radar mode identifier
103 virtual int contactRadarMode() const;
104
105 //! \brief Sets the received signal power
106 //! \param power The signal power in Watts
107 //!
108 //! Sets the power of the signal received from this contact, measured in Watts.
109 virtual void setContactPower(double power);
110
111 //! \brief Gets the received signal power
112 //! \return The signal power in Watts
113 virtual double contactPower() const;
114
115 //! \brief Sets the emitter system identifier
116 //! \param id The emitter system identifier string
117 //!
118 //! Sets the identifier for the emitter system type of this contact.
119 virtual void setEmitterSystemId(const DtString& id);
120
121 //! \brief Gets the emitter system identifier
122 //! \return The emitter system identifier string
123 virtual DtString emitterSystemId() const;
124
125 //! \brief Gets the list of target UUIDs associated with this contact
126 //! \return Reference to the list of target UUIDs
127 //!
128 //! Returns a reference to the list of entity UUIDs targeted by this emitter.
129 DtRwTemplatedUUIDList& targets();
130
131 //! \brief Creates a deep copy of this object
132 //! \return Pointer to a newly created clone of this object
133 //!
134 //! Returns a dynamically allocated copy of this RWR contact info.
135 virtual DtRwRwrContactInfo* clone() const;
136
137 //! \brief Equality comparison operator
138 //! \param other The RWR contact info to compare with
139 //! \return True if the objects are equal, false otherwise
140 bool operator==(const DtRwRwrContactInfo& other) const;
141
142 //! \brief Inequality comparison operator
143 //! \param rhs The RWR contact info to compare with
144 //! \return True if the objects are not equal, false otherwise
145 bool operator!=(const DtRwRwrContactInfo& rhs) { return !(*this == rhs); };
146
147 //! \brief Encodes this object to a buffer
148 //! \param buffer The buffer to encode into
149 //! \return Pointer to the buffer after the encoded data
150 virtual char* encode(char* buffer) const;
151
152 //! \brief Decodes this object from a buffer
153 //! \param buffer The buffer to decode from
154 //! \return Pointer to the buffer after the decoded data
155 virtual const char* decode(const char* buffer);
156
157 //! \brief Gets the size of the encoded data in bytes
158 //! \return The size in bytes
159 virtual int getSize() const;
160
161protected:
162 //! \brief Azimuth angle to the contact relative to platform heading (degrees)
164
165 //! \brief Elevation angle to the contact relative to platform (degrees)
167
168 //! \brief Range to the contact (meters)
170
171 //! \brief Operational mode of the radar emitter
172 DtRwInt myRadarMode;
173
174 //! \brief Received signal power (Watts)
176
177 //! \brief Identifier for the emitter system type
179
180 //! \brief List of entity UUIDs targeted by this emitter
181 DtRwTemplatedUUIDList myTargets;
182};
183
184//! \brief List type for storing multiple RWR contact information entries
185using DtRwRwrContactInfoList = DtRwTemplatedListPtr<DtRwRwrContactInfo, true>;
186
187//! \brief Gets the number of bytes required to encode the RWR contact info
188//! \param info The RWR contact info to calculate size for
189//! \return The number of bytes required for encoding
190//!
191//! Calculates the number of bytes required to encode the specified RWR contact info.
192//! Note that passing in a null pointer is valid and will return a size of zero.
194
195//! \brief Serializes the RWR contact info into a buffer
196//! \param info The RWR contact info to encode
197//! \param buffer The buffer to serialize into
198//! \return Pointer to the buffer after the serialization
199//!
200//! Serializes the provided RWR contact info into the buffer.
201//! The buffer must have at least the number of bytes returned by getSize().
202VRFMESSAGES_DLL char* encode(const DtRwRwrContactInfo& info, char* buffer);
203
204//! \brief Deserializes the buffer into RWR contact info
205//! \param info The RWR contact info to populate
206//! \param buffer The buffer to deserialize from
207//! \return Pointer to the buffer after the deserialization
208//!
209//! Decodes data from the buffer into the provided RWR contact info object.
210VRFMESSAGES_DLL const char* decode(DtRwRwrContactInfo& info, const char* buffer);
Radar Warning Receiver (RWR) contact information class.
Definition rwRwrContactInfo.h:34
DtRwRwrContactInfo(const DtSymbolString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with symbol name.
DtRwReal myContactElevation
Elevation angle to the contact relative to platform (degrees)
Definition rwRwrContactInfo.h:166
virtual void setContactElevation(double elevation)
Sets the contact's elevation angle.
DtRwTemplatedUUIDList & targets()
Gets the list of target UUIDs associated with this contact.
virtual double contactElevation() const
Gets the contact's elevation angle.
DtRwRwrContactInfo(const DtRwRwrContactInfo &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
Copy constructor.
virtual double contactPower() const
Gets the received signal power.
DtRwTemplatedUUIDList myTargets
List of entity UUIDs targeted by this emitter.
Definition rwRwrContactInfo.h:181
virtual ~DtRwRwrContactInfo() override
Virtual destructor.
virtual void setContactAzimuth(double azimuth)
Sets the contact's azimuth relative to the platform's heading.
virtual DtString emitterSystemId() const
Gets the emitter system identifier.
DtRwRwrContactInfo()
Default constructor.
virtual int getSize() const
Gets the size of the encoded data in bytes.
DtRwRwrContactInfo & operator=(const DtRwRwrContactInfo &orig)
Assignment operator.
virtual void setContactRadarMode(int mode)
Sets the radar mode of the contact.
virtual const char * decode(const char *buffer)
Decodes this object from a buffer.
DtRwString myEmitterSystemId
Identifier for the emitter system type.
Definition rwRwrContactInfo.h:178
DtRwReal myContactRange
Range to the contact (meters)
Definition rwRwrContactInfo.h:169
virtual void setEmitterSystemId(const DtString &id)
Sets the emitter system identifier.
DtRwReal mySignalPower
Received signal power (Watts)
Definition rwRwrContactInfo.h:175
virtual void setContactRange(double range)
Sets the range to the contact.
bool operator==(const DtRwRwrContactInfo &other) const
Equality comparison operator.
virtual int contactRadarMode() const
Gets the radar mode of the contact.
virtual char * encode(char *buffer) const
Encodes this object to a buffer.
virtual double contactRange() const
Gets the range to the contact.
virtual void setContactPower(double power)
Sets the received signal power.
virtual DtRwRwrContactInfo * clone() const
Creates a deep copy of this object.
DtRwReal myContactAzimuth
Azimuth angle to the contact relative to platform heading (degrees)
Definition rwRwrContactInfo.h:163
bool operator!=(const DtRwRwrContactInfo &rhs)
Inequality comparison operator.
Definition rwRwrContactInfo.h:145
DtRwInt myRadarMode
Operational mode of the radar emitter.
Definition rwRwrContactInfo.h:172
DtRwRwrContactInfo(const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
Constructor with name.
virtual double contactAzimuth() const
Gets the contact's azimuth.
Export/import macros for the VRF Messages library.
#define VRFMESSAGES_DLL
Definition export.h:23
VRFMESSAGES_DLL char * encode(const DtRwRwrContactInfo &info, char *buffer)
Serializes the RWR contact info into a buffer.
DtRwTemplatedListPtr< DtRwRwrContactInfo, true > DtRwRwrContactInfoList
List type for storing multiple RWR contact information entries.
Definition rwRwrContactInfo.h:185
VRFMESSAGES_DLL const char * decode(DtRwRwrContactInfo &info, const char *buffer)
Deserializes the buffer into RWR contact info.
VRFMESSAGES_DLL int getSize(const DtRwRwrContactInfo &info)
Gets the number of bytes required to encode the RWR contact info.