VR-Engage  2.2
Loading...
Searching...
No Matches
radarWarningReceiver.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file radarWarningReceiver.h
7//! \ingroup vreVrfmodel
8//! \brief Radar Warning Receiver component
9//!
10//! This file defines the DtRadarWarningReceiver class which provides common functionality
11//! for Radar Warning Receiver systems. It detects and tracks radar signals targeting the
12//! entity, and communicates this information to visualization systems through a monitor.
13
14#pragma once
15
16#include "vreVrfmodel/export.h"
17#include <vrfobjcore/simComponent.h>
19
20namespace makVre
21{
22class DtRwrMonitor;
23
24//! \brief Type identifier for the VRE radar warning receiver component
25const char DtVreRadarWarningReceiverType[] = "vre-radar-warning-receiver";
26
29
30//! \brief Component for detecting and tracking radar signals targeting the entity
31//!
32//! DtRadarWarningReceiver provides the functionality needed to detect and track
33//! radar signals that are targeting the entity. It maintains a list of detected
34//! radar emitters, their signal characteristics, and threat levels. The component
35//! communicates with visualization systems through a monitor to provide up-to-date
36//! threat information to the user interface.
37//!
38//! Uses Descriptor Type: DtRadarWarningReceiverDescriptor
39class VREVRFMODEL_DLL DtRadarWarningReceiver : public DtSimComponent
40{
41private:
42 //! \brief Default constructor (not implemented)
43 //!
44 //! Default constructor is private and not implemented to prevent
45 //! creation of instances without proper initialization.
47
48 //! \brief Copy constructor (not implemented)
49 //!
50 //! Copy constructor is private and not implemented to prevent
51 //! copy construction.
53
54 //! \brief Assignment operator (not implemented)
55 //! \return Reference to this object
56 //!
57 //! Assignment operator is private and not implemented to prevent assignment.
59
60public:
61 using DtSimComponent::tick;
62
63 //! \brief Constructor
64 //! \param name The name of this component
65 //! \param owner The local object that owns this component
66 //! \param simManager The simulation services manager
67 //! \param desc Component descriptor with configuration parameters
68 //! \param parentRegistry Optional parent registry for reader/writer functionality
69 //!
70 //! Creates a new radar warning receiver component with the specified parameters.
71 DtRadarWarningReceiver(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
72 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
73
74 //! \brief Virtual destructor
75 //!
76 //! Cleans up resources used by the radar warning receiver component,
77 //! including the monitor and process state repository.
78 virtual ~DtRadarWarningReceiver() override;
79
80 //! \brief Initializes the radar warning receiver component
81 //! \return True if initialization is successful, false otherwise
82 //!
83 //! Performs component initialization, including creating the process
84 //! state repository (PSR) by calling createPSR().
85 virtual bool init() override;
86
87 //! \brief Gets the type identifier for this component
88 //! \return String identifying the component type (DtVreRadarWarningReceiverType)
89 //!
90 //! Implements the DtSimComponent::type() method to return the
91 //! type identifier for this component.
92 virtual const char* type() const override;
93
94 //! \brief Performs initialization before the first simulation tick
95 //!
96 //! Performs one-time setup tasks that must be completed before the first
97 //! simulation tick, such as initializing the RWR monitor.
98 virtual void preFirstTickInit() override;
99
100 //! \brief Updates the component state each simulation frame
101 //!
102 //! Processes radar signal detection logic each simulation frame,
103 //! updating the list of detected emitters and their threat levels.
104 //! Also handles communication with the monitor for visualization.
105 virtual void tick() override;
106
107 //! \brief Handles messages to enable or disable the RWR
108 //! \param msg The message containing enable/disable request
109 //! \return Message processing result indicating success or failure
110 //!
111 //! Processes messages that request changing the enabled state of
112 //! the radar warning receiver.
114
115 //! \brief Determines if this component should tick while the entity is destroyed
116 //! \return Always returns true for RWR components
117 //!
118 //! The radar warning receiver continues to tick even when the entity is destroyed
119 //! so that it can notify any subscribed GUIs that it is no longer detecting
120 //! objects. This ensures proper cleanup of visualization displays.
121 virtual bool tickWhileDestroyed() const override;
122
123 //! \brief Factory method to create a new instance of this component
124 //! \param name The name for the new component
125 //! \param owner The local object that will own this component
126 //! \param simManager The simulation services manager
127 //! \param desc Optional component descriptor
128 //! \param parentRegistry Optional parent registry for reader/writer functionality
129 //! \return Pointer to the newly created component
130 //!
131 //! Static factory method used by the component creation system to instantiate
132 //! new instances of this component type.
133 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
134 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
135
136protected:
137 //! \brief Creates input and output port groups for the component
138 //! \return True if port groups were created successfully, false otherwise
139 //!
140 //! Creates and initializes the port groups used by this component
141 //! for receiving and transmitting data related to radar warnings.
142 virtual bool createPortGroups() override;
143
144 //! \brief Creates input and output ports for the component
145 //! \return True if ports were created successfully, false otherwise
146 //!
147 //! Creates the target list port and any other ports needed by the
148 //! radar warning receiver to communicate with other components.
149 virtual bool createPorts() override;
150
151 //! \brief Creates the process state repository for the component
152 //! \return Pointer to the created process state repository
153 //!
154 //! Creates the myProcessState data member and adds it to the process state
155 //! repository manager. Uses the name and type specified in the component
156 //! descriptor (if they exist) or appropriate defaults if not specified.
157 //! The PSR maintains the state of detected radar emitters and their properties.
159
160 //! \brief Gets the default process state repository type
161 //! \return String identifying the default PSR type (DtVrfRwrProcessStateRepositoryType)
162 //!
163 //! Returns the default process state repository type for this component.
164 //! Derived classes may override this to return their own default PSR type
165 //! if a different PSR type is desired.
166 virtual const char* defaultPSRType() const;
167
168 //! \brief Creates and initializes the RWR monitor
169 //! \return True if monitor creation and initialization succeeds, false otherwise
170 //!
171 //! Creates a DtRwrMonitor instance and initializes it, establishing the
172 //! connection between the radar warning receiver and the front-end
173 //! visualization system for displaying radar warning information.
175
176protected:
177 //! \brief Pointer to the radar warning receiver process state repository
178 //!
179 //! Maintains state information about detected radar emitters, their
180 //! properties, and threat levels. This state persists across simulation
181 //! ticks and can be saved with scenarios.
183
184 //! \brief Pointer to the component descriptor
185 //!
186 //! Contains configuration parameters for the radar warning receiver,
187 //! such as detection ranges, frequency bands, and visualization settings.
189
190 //! \brief Pointer to the RWR monitor
191 //!
192 //! Handles communication with visualization clients, sending RWR contact
193 //! information to the GUI or other applications that have requested the
194 //! information. Maintains subscription lists and message handling.
196};
197
198} // namespace makVre
Radar Warning Receiver (RWR) descriptor for VREngage.
Definition radarWarningReceiverDescriptor.h:32
const DtRadarWarningReceiverDescriptor * myRwrDescriptor
Pointer to the component descriptor.
Definition radarWarningReceiver.h:188
virtual const char * defaultPSRType() const
Gets the default process state repository type.
virtual bool createPortGroups() override
Creates input and output port groups for the component.
virtual bool createAndInitRwrMonitor()
Creates and initializes the RWR monitor.
virtual void tick() override
Updates the component state each simulation frame.
DtRadarWarningReceiver(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual bool init() override
Initializes the radar warning receiver component.
DtRadarWarningReceiver(const DtRadarWarningReceiver &orig)
Copy constructor (not implemented)
virtual bool tickWhileDestroyed() const override
Determines if this component should tick while the entity is destroyed.
DtRadarWarningReceiver()
Default constructor (not implemented)
virtual DtRadarWarningReceiverPSR * createPSR()
Creates the process state repository for the component.
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
virtual const char * type() const override
Gets the type identifier for this component.
virtual bool createPorts() override
Creates input and output ports for the component.
virtual DtVreMessageResult handleRwrSetEnabledMessage(DtVreMessage *msg)
Handles messages to enable or disable the RWR.
DtRadarWarningReceiverPSR * myProcessState
Pointer to the radar warning receiver process state repository.
Definition radarWarningReceiver.h:182
virtual ~DtRadarWarningReceiver() override
Virtual destructor.
const DtRadarWarningReceiver & operator=(const DtRadarWarningReceiver &orig)
Assignment operator (not implemented)
virtual void preFirstTickInit() override
Performs initialization before the first simulation tick.
DtRwrMonitor * myMonitor
Pointer to the RWR monitor.
Definition radarWarningReceiver.h:195
Process state repository for radar warning receiver components.
Definition radarWarningReceiverPSR.h:44
Monitor for managing radar warning receiver (RWR) contact information.
Definition rwrMonitor.h:32
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtVreRadarWarningReceiverType[]
Type identifier for the VRE radar warning receiver component.
Definition radarWarningReceiver.h:25
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the central message manager for the VREngage messaging system.