DtLaserDesignatorConnector listens for Start/StopMonitoringDesignatorMessages and provides updates on designator position and removal for monitored laser codes. It tracks designators by their code and sends position updates when they change or are removed from the simulation.
#include <laserDesignatorConnector.h>
|
| using | CodeMonitorMap = std::map<int, std::pair<DtReflectedDesignator*, DtVector>> |
| |
◆ CodeMonitorMap
Type alias for the map of monitored designator codes.
Key is the designator code to monitor (integer). Value is a pair containing:
- Pointer to the reflected designator (nullptr if not yet discovered)
- Last sent position (used to detect changes)
◆ DtLaserDesignatorConnector()
| makVre::DtLaserDesignatorConnector::DtLaserDesignatorConnector |
( |
| ) |
|
◆ ~DtLaserDesignatorConnector()
| virtual makVre::DtLaserDesignatorConnector::~DtLaserDesignatorConnector |
( |
| ) |
|
|
overridevirtual |
◆ install()
| virtual void makVre::DtLaserDesignatorConnector::install |
( |
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * | connection, |
|
|
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkReflectedLaserDesignatorList * | laserDesignatorList ) |
|
virtual |
Installs the laser designator connector with shared infrastructure.
- Parameters
-
| connection | Non-owning pointer to the protocol-specific VR-Link connection. |
| laserDesignatorList | Non-owning pointer to the reflected laser designator list. |
Registers designator added/removed callbacks on the reflected list and registers handlers for Start/StopMonitoringDesignatorMessages
◆ tick()
| virtual void makVre::DtLaserDesignatorConnector::tick |
( |
double | dt | ) |
|
|
overridevirtual |
Performs periodic checks of monitored designator positions.
For each designator code being monitored (that exists), checks if its location has changed. If so, sends an update message with the new position.
- Parameters
-
| dt | The elapsed time in seconds since the last tick |
Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.
◆ shutdown()
| virtual void makVre::DtLaserDesignatorConnector::shutdown |
( |
| ) |
|
|
overridevirtual |
◆ handleDesignatorAdded()
| virtual void makVre::DtLaserDesignatorConnector::handleDesignatorAdded |
( |
DtReflectedDesignator * | des | ) |
|
|
virtual |
Handles the addition of a new designator.
- Parameters
-
| des | Pointer to the newly added designator |
Callback triggered when a new designator is discovered. If this code is being monitored, sends an initial update with the position.
◆ handleDesignatorRemoved()
| virtual void makVre::DtLaserDesignatorConnector::handleDesignatorRemoved |
( |
DtReflectedDesignator * | des | ) |
|
|
virtual |
Handles the removal of a designator.
- Parameters
-
| des | Pointer to the designator about to be removed |
Callback triggered when a designator is about to be destroyed. If this code is being monitored, sends a deletion notification.
◆ handleStartMonitoringDesignator()
Handles requests to start monitoring a laser designator.
- Parameters
-
| msg | Pointer to the monitoring request message |
- Returns
- Message result indicating the message was handled
Processes StartMonitoringDesignatorMessages by adding the requested code to myCodesToMonitor. If the designator already exists, sends an initial position update.
◆ handleStopMonitoringDesignator()
Handles requests to stop monitoring a laser designator.
- Parameters
-
| msg | Pointer to the message requesting monitoring to stop |
- Returns
- Message result indicating the message was handled
Processes StopMonitoringDesignatorMessages by removing the code from myCodesToMonitor.
◆ findDesignator()
| virtual DtReflectedDesignator * makVre::DtLaserDesignatorConnector::findDesignator |
( |
int | laserCode | ) |
|
|
protectedvirtual |
Searches the reflected laser designator list for a designator with the given code.
- Parameters
-
| laserCode | The laser designator code to search for |
- Returns
- Pointer to the matching DtReflectedDesignator, or nullptr if not found
Iterates myLaserDesignatorList to find a designator whose designator code matches laserCode. Returns nullptr if the list is empty or no match is found.
◆ sendDesignatorUpdate()
| virtual void makVre::DtLaserDesignatorConnector::sendDesignatorUpdate |
( |
DtReflectedDesignator * | des, |
|
|
bool | toBeDeleted = false ) |
|
protectedvirtual |
Sends a position update (or deletion notification) for the given designator.
- Parameters
-
| des | Pointer to the designator to report; if nullptr the message is skipped |
| toBeDeleted | When true, sends a deletion notification instead of a position update; defaults to false |
Builds and queues a LaserDesignatorUpdateMessage containing the current geocentric position and laser code of des. When toBeDeleted is true the message signals that the designator has been removed from the simulation.
◆ myCodesToMonitor
Map of laser codes being monitored.
Tracks which designator codes are being monitored, along with their current designator object and last reported position
◆ myLaserDesignatorList
| makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkReflectedLaserDesignatorList* makVre::DtLaserDesignatorConnector::myLaserDesignatorList |
|
protected |
Pointer to the reflected laser designator list (NON-OWNING)
Provided by DtConnectorAccessory via the laserDesignatorList parameter of install(). Used to iterate existing designators and register add/remove callbacks. Lifetime is managed by the VR-Link connection; guaranteed to outlive this connector while the connection is active.
The documentation for this class was generated from the following file: