|
VR-Engage
2.2
|
This class provides storage and management for radar warning receiver (RWR) state data. An RWR is a passive sensor that detects radar emissions and provides information about potential threats to the entity. This PSR tracks detected radar contacts, their properties, and the operational parameters of the RWR system.
#include <radarWarningReceiverPSR.h>
Public Member Functions | |
| DtRadarWarningReceiverPSR (DtLocalObject *vrfObject, const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) | |
| DtRadarWarningReceiverPSR (const DtRadarWarningReceiverPSR &orig, const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtRadarWarningReceiverPSR () override |
| DtRadarWarningReceiverPSR & | operator= (const DtRadarWarningReceiverPSR &orig) |
| virtual DtVrfProcessStateRepository * | clone (const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const override |
| virtual DtString | type () const override |
| virtual bool | init () override |
| virtual DtRwrContactInfoList * | contactInfoList () |
| virtual const DtRwrContactInfoList * | contactInfoList () const |
| virtual DtRwRwrContactInfo * | lookupContactById (const DtUUID &id) const |
| virtual void | clearContactInfoList () |
| virtual DtRwRwrContactInfo * | createRwrContactInfo () const |
| virtual const DtRwEntityTypeList & | typesToDetectForTask () const |
| virtual void | setTypesToDetectForTask (const DtRwEntityTypeList &objectTypes) |
| virtual void | clearTypesToDetectForTask () |
| virtual void | setNextDetectAttempt (DtTime time) |
| virtual DtTime | nextDetectAttempt () const |
| virtual void | setRwrEnabled (bool enabled) |
| virtual bool | rwrEnabled () const |
| virtual void | putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtReaderWriter::appPath()) override |
| virtual void | getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override |
Static Public Member Functions | |
| static DtVrfProcessStateRepository * | creator (const DtString &rwName, DtLocalObject *vrfObject, DtReaderWriterRegistry *parentRegistry) |
Protected Member Functions | |
| virtual DtRwrContactInfoList * | createRwrContactInfoList (const DtString &name) |
Protected Attributes | |
| DtRwrContactInfoList * | myContactInfoList |
| bool | myMutableMapContactNamesToContactIds |
| DtRwEntityTypeList | myTaskDetectionTypes |
| DtRwReal | myNextDetectAttempt |
| DtRwBoolean | myRwrEnabled |
| makVre::DtRadarWarningReceiverPSR::DtRadarWarningReceiverPSR | ( | DtLocalObject * | vrfObject, |
| const DtString & | rwName = DtString::nullString(), | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor with VRF object and optional name.
| vrfObject | Pointer to the local object this PSR is associated with |
| rwName | Optional reader/writer name |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new radar warning receiver PSR for the specified VRF object.
Referenced by DtRadarWarningReceiverPSR(), and operator=().
| makVre::DtRadarWarningReceiverPSR::DtRadarWarningReceiverPSR | ( | const DtRadarWarningReceiverPSR & | orig, |
| const DtString & | rwName = DtString::nullString(), | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Copy constructor.
| orig | The source PSR to copy from |
| rwName | Optional reader/writer name |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new radar warning receiver PSR as a copy of the provided original.
References DtRadarWarningReceiverPSR().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the PSR.
| DtRadarWarningReceiverPSR & makVre::DtRadarWarningReceiverPSR::operator= | ( | const DtRadarWarningReceiverPSR & | orig | ) |
Assignment operator (not implemented)
| orig | The source PSR to copy from |
Assignment operator is declared but not implemented to prevent assignment.
References DtRadarWarningReceiverPSR().
|
overridevirtual |
Creates a clone of this PSR.
| rwName | Optional reader/writer name for the clone |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new radar warning receiver PSR as a deep copy of this one.
|
overridevirtual |
Gets the type identifier for this PSR.
Returns a unique type identifier string for this PSR type. Will return DtVreRadarWarningReceiverPSRType.
|
overridevirtual |
Initializes the PSR after creation.
Called after creation to initialize the PSR. This method sets up myContactInfoList using createRwrContactInfoList().
|
virtual |
Gets the list of radar contact information objects (non-const version)
Returns the list of DtRwRwrContactInfo (or derivative) objects representing detected radar emitters. Will call mapContactNamesToIds() if the flag is set. For this reason, avoid holding a pointer to this list outside of this class.
|
virtual |
Gets the list of radar contact information objects (const version)
Returns the const list of DtRwRwrContactInfo (or derivative) objects representing detected radar emitters. Will call mapContactNamesToIds() if the flag is set (casting away constness to do so). For this reason, avoid holding a pointer to this list outside of this class.
|
virtual |
Looks up contact information by entity ID.
| id | The UUID of the entity to find contact information for |
Returns the contact information for the radar contact with the specified entity ID, or nullptr if not found in the contact list.
|
virtual |
Clears all radar contacts.
Empties the contact information list, removing all currently tracked radar contacts.
|
virtual |
Creates a new radar contact information object.
Returns a new DtRwRwrContactInfo (or derivative) object by calling myContactInfoList->createRwrContactInfo(). This returns the type being used in the contactInfoList. All items added to the contactInfoList should be created by calling this method. Returns nullptr if myContactInfoList is not set.
|
virtual |
Gets the task-specific entity types to detect.
Returns the list of entity types to detect that were set specifically for a task. This type list is used along with the list in the descriptor and the list on the types-to-detect input port to make a combined list for processing detections. This task list is expected to be changed dynamically during a scenario by tasks.
|
virtual |
Sets the task-specific entity types to detect.
| objectTypes | The list of entity types to detect |
Sets the task-specific list of entity types that the RWR should detect. This allows tasks to dynamically change detection parameters during a scenario.
|
virtual |
Clears the task-specific entity types to detect.
Clears the task-specific list of entity types that the RWR should detect, returning to using only the default types from the descriptor.
|
virtual |
Sets the simulation time for the next detection attempt.
| time | The simulation time (in seconds) for the next detection |
Sets the simulation time at which the RWR should make its next detection attempt. This is used to control the detection update rate of the RWR.
|
virtual |
Gets the simulation time for the next detection attempt.
Returns the simulation time at which the RWR will make its next detection attempt.
|
virtual |
Sets whether the RWR is enabled.
| enabled | True to enable the RWR, false to disable it |
Enables or disables the radar warning receiver. When disabled, the RWR will not detect any new radar emissions.
|
virtual |
Checks if the RWR is enabled.
Returns whether the radar warning receiver is currently enabled.
|
overridevirtual |
Writes this PSR to a file.
| fp | The file path string to write to |
| indentLevel | The indentation level to use |
| writeUnspecified | Whether to write unspecified values |
| path | The base path for resolving relative paths |
Overrides the base class method to perform additional processing before writing the PSR to a file. Maps target IDs to target names before calling the base class version to ensure that previously detected targets are preserved in checkpoint saves.
|
overridevirtual |
Reads this PSR from a stream.
| args | The input stream to read from |
| searchPaths | Search paths for resolving references |
| variableBindings | Variable bindings for resolving references |
Overrides the base class method to perform additional processing after reading the PSR from a stream. Sets a flag indicating that target names should be mapped to target identifiers the next time lookupPreviousTarget() is called.
|
protectedvirtual |
Creates a new contact information list.
| name | The name to assign to the new list |
Factory method that returns a new DtRwrContactInfoList. If you are adding custom data to the RWR contact info, create a new derivative of DtRwrContactInfoList and override this method to create your new subclass here.
|
static |
Factory function to create a new instance of this PSR.
| rwName | The reader/writer name for the new instance |
| vrfObject | Pointer to the local object this PSR will be associated with |
| parentRegistry | Parent registry for reader/writer functionality |
Static factory function used by the PSR creation system to instantiate new instances of this PSR type.
|
protected |
Maps contact IDs to contact names.
Looks up each object in myContactInfoList by the entity ID in the contact information and sets the name of the contact in the contact info to the name of the object found. Objects that are not found are left as they were.
Maps contact names to contact IDs
Looks up each object in myContactInfoList by name, and sets the entity ID in the contact information to the one found in the vrf object.
List of radar contact information
The list of radar contacts detected by the RWR. This is created by the init() method using the createRwrContactInfoList() factory method.
|
mutableprotected |
Flag for contact name to ID mapping.
Flag used to indicate that we should initialize contact names to entity identifiers. This is used during deserialization to ensure contact information is properly restored.
|
protected |
Task-specific entity types to detect.
Types of objects to detect for a particular task. This can be set with a function call or an setAttribute call in Lua. Default value is empty.
|
protected |
Next detection time.
Simulation time of the next detection attempt (in seconds).
|
protected |
RWR enabled state.
Whether the radar warning receiver is enabled or disabled.