|
VR-Engage
2.2
|
DtVreRadarObjectSensorMonitor manages the communication of radar sensor contact information between a radar system and visualization clients. It extends the base ObjectSensorMonitor with VR-Engage specific functionality for handling multiple subscriptions from the same client address and providing enhanced radar contact information.
This class manages the sending of radar sensor contact information to the GUI from one particular sensor on an entity, handling subscription requests and maintaining a list of current subscribers.
#include <vreRadarObjectSensorMonitor.h>
Public Member Functions | |
| DtVreRadarObjectSensorMonitor (DtLocalObject *hostObject, const DtSensorContactInfoList *contactInfoList, const DtString &sensorName, int sensorType, DtObjectSensorPSR *psr) | |
| virtual | ~DtVreRadarObjectSensorMonitor () override |
| virtual void | createAndSendSensorDataMessage () override |
| virtual void | processSensorDataRequest (DtSimMessage *msg) override |
| virtual void | processSensorDataUnsubscribe (DtSimMessage *msg) override |
Protected Types | |
| using | DtSubscriberListCounter = std::map<DtSimulationAddress, int> |
Protected Member Functions | |
| virtual void | addToSubscriberList (const DtSimulationAddress &add) override |
| virtual void | removeFromSubscriberList (const DtSimulationAddress &add) override |
| virtual int | numberOfSubscribers () override |
Protected Attributes | |
| const DtRadarContactInfoList * | myRadarContactInfoList |
| DtSubscriberListCounter | mySubscriberListCounter |
Private Member Functions | |
| DtVreRadarObjectSensorMonitor () | |
| DtVreRadarObjectSensorMonitor (const DtVreRadarObjectSensorMonitor &orig) | |
| const DtVreRadarObjectSensorMonitor & | operator= (const DtVreRadarObjectSensorMonitor &orig) |
|
protected |
Type definition for the subscriber list with counter.
Defines the container type used to store simulation addresses of subscribers with a counter for each to track multiple subscriptions from the same client.
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
Referenced by DtVreRadarObjectSensorMonitor(), and operator=().
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreRadarObjectSensorMonitor().
| makVre::DtVreRadarObjectSensorMonitor::DtVreRadarObjectSensorMonitor | ( | DtLocalObject * | hostObject, |
| const DtSensorContactInfoList * | contactInfoList, | ||
| const DtString & | sensorName, | ||
| int | sensorType, | ||
| DtObjectSensorPSR * | psr ) |
Constructor.
| hostObject | The local object that owns the sensor this monitor is for |
| contactInfoList | Pointer to the list of sensor contacts maintained by the sensor |
| sensorName | The name of the sensor being monitored |
| sensorType | The type identifier for the sensor being monitored |
| psr | Pointer to the process state repository for the sensor |
Creates a new radar sensor monitor that will handle communication between the specified radar system and visualization clients.
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the radar object sensor monitor.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtVreRadarObjectSensorMonitor().
|
overridevirtual |
Creates and sends a sensor data message to subscribers.
Constructs a DtSensorData message based on the current state of the sensor's process state repository (PSR), and sends it to all current subscribers. This provides visualization clients with up-to-date radar contact information.
|
overridevirtual |
Processes a sensor data request message.
| msg | The simulation message containing the request |
Handles subscription requests for radar sensor data, adding the client to the subscriber list and sending initial data. Overrides the base class implementation to use the counter-based subscriber list for better handling of multiple subscriptions.
|
overridevirtual |
Processes a sensor data unsubscribe message.
| msg | The simulation message containing the unsubscribe request |
Handles unsubscription requests for radar sensor data, removing the client from the subscriber list. Overrides the base class implementation to use the counter-based subscriber list.
|
overrideprotectedvirtual |
Adds a client to the subscriber list.
| add | The simulation address of the client to add |
Overridden to use mySubscriberListCounter instead of the base member mySubscriberList to properly handle cases where more than one application uses the same SimulationAddress. Maintains a counter for each address to track multiple subscriptions from the same client.
|
overrideprotectedvirtual |
Removes a client from the subscriber list.
| add | The simulation address of the client to remove |
Overridden to use mySubscriberListCounter instead of the base member mySubscriberList to properly handle cases where more than one application uses the same SimulationAddress. Decrements the counter for the address and only completely removes the client when the counter reaches zero.
|
overrideprotectedvirtual |
Gets the number of current subscribers.
Returns the count of unique clients currently subscribed to receive radar sensor data updates. Overridden to use the counter-based subscriber list.
|
protected |
Pointer to the radar contact information list.
Contains the current list of radar contacts detected by the radar system. Cast from the base contact info list to the radar-specific type.
|
protected |
List of current subscribers with subscription counts.
Contains the simulation addresses of all clients currently subscribed to receive radar sensor data updates, with a count of subscriptions for each.