VR-Engage  2.2
Loading...
Searching...
No Matches
radarFxConnectorDriver.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 MAK Technologies
3 * All rights reserved.
4 ******************************************************************************/
5
6//! \file radarFxConnectorDriver.h
7//! \brief Defines the driver for connecting to RadarFx external service
8//! \ingroup sarClient
9
10#pragma once
11
13
14#include <vrvCore/DtDriver.h>
15
17
18class DtThread;
19
20namespace makRadarFx
21{
22//! \brief Forward declaration of the RadarFx connector class
24
25//! \brief Forward declaration of the base message class for RadarFx
26class DtBaseMessage;
27} // namespace makRadarFx
28
29namespace makVre
30{
31//! \brief Forward declaration of the VRE message class
32class DtVreMessage;
33} // namespace makVre
34
35//! \brief Driver for managing the connection to the RadarFx service
36//!
37//! This driver is responsible for the DtRadarFxConnector object that connects to
38//! the external RadarFx service for Synthetic Aperture Radar (SAR) image generation.
39//! Because the connector blocks while attempting to connect, it runs in its own
40//! worker thread. Connection status updates and SAR responses are pushed back to
41//! the main thread for processing.
42class DT_DLL_sarClient DtRadarFxConnectorDriver : public makVrv::DtDriver
43{
44public:
45 //! \brief Constructor
46 //! \param am Reference to the agent manager
47 DtRadarFxConnectorDriver(makVrv::DtAgentManager& am);
48
49 //! \brief Virtual destructor
50 virtual ~DtRadarFxConnectorDriver() override;
51
52 //! \brief Gets the class name of this driver
53 //! \return Reference to the class name string
54 virtual const std::string& className() const override;
55
56 //! \brief Initializes the driver when it starts
57 //! \return True if initialization was successful, false otherwise
58 virtual bool onStart() override;
59
60 //! \brief Cleans up resources when the driver stops
61 //! \return True if cleanup was successful, false otherwise
62 virtual bool onStop() override;
63
64 //! \brief Performs per-frame updates
65 //! \return True if the update was successful, false otherwise
66 virtual bool onTick() override;
67
68 //! \brief Handles SAR request messages
69 //! \param msg Pointer to the message being processed
70 //! \return Message processing result
71 //!
72 //! Processes requests for Synthetic Aperture Radar images and forwards them to RadarFx
74
75 //! \brief Handles connection requests to RadarFx
76 //! \param msg Pointer to the message being processed
77 //! \return Message processing result
78 //!
79 //! Processes requests to establish a connection to the RadarFx service
81
82 //! \brief Handles connection status change messages
83 //! \param msg Pointer to the message being processed
84 //! \return Message processing result
85 //!
86 //! Processes notifications about changes in the connection status to RadarFx
88
89 //! \brief Handles SAR response messages from RadarFx
90 //! \param msg Pointer to the RadarFx message containing the response
91 //!
92 //! Function to be called by the delegate when a SAR response message is returned from RadarFx
94
95 //! \brief Worker thread function for the RadarFx connector
96 //! \param data Pointer to the driver instance
97 //! \param stop Pointer to a flag indicating when to stop the thread
98 //!
99 //! Static function that runs in a separate thread to handle RadarFx connection operations
100 static void driverWorkerFunction(void* data, volatile bool* stop);
101
102protected:
103 //! \brief Reference to the display element
104 makVrv::DtDe& myDe;
105
106 //! \brief Pointer to the RadarFx connector
108
109 //! \brief Pointer to the worker thread
110 DtThread* myWorkerThread;
111
112 //! \brief Flag indicating if the worker thread should exit
114
115 //! \brief Current connection status to RadarFx
117
118 //! \brief Connection status as reported by the worker thread
120};
makVrv::DtDe & myDe
Reference to the display element.
Definition radarFxConnectorDriver.h:104
makRadarFx::DtRadarFxConnector * myConnector
Pointer to the RadarFx connector.
Definition radarFxConnectorDriver.h:107
virtual makVre::DtVreMessageResult handleSarRequest(makVre::DtVreMessage *msg)
Handles SAR request messages.
virtual bool onStart() override
Initializes the driver when it starts.
bool myShouldQuit
Flag indicating if the worker thread should exit.
Definition radarFxConnectorDriver.h:113
void handleSarResponse(makRadarFx::DtBaseMessage *msg)
Handles SAR response messages from RadarFx.
virtual bool onTick() override
Performs per-frame updates.
virtual makVre::DtVreMessageResult handleConnectionStatusChanged(makVre::DtVreMessage *msg)
Handles connection status change messages.
static void driverWorkerFunction(void *data, volatile bool *stop)
Worker thread function for the RadarFx connector.
virtual bool onStop() override
Cleans up resources when the driver stops.
DtRadarFxConnectorDriver(makVrv::DtAgentManager &am)
Constructor.
bool myWorkerThreadConnStatus
Connection status as reported by the worker thread.
Definition radarFxConnectorDriver.h:119
virtual const std::string & className() const override
Gets the class name of this driver.
DtThread * myWorkerThread
Pointer to the worker thread.
Definition radarFxConnectorDriver.h:110
virtual makVre::DtVreMessageResult handleConnectToRadarFx(makVre::DtVreMessage *msg)
Handles connection requests to RadarFx.
virtual ~DtRadarFxConnectorDriver() override
Virtual destructor.
bool myConnectionStatus
Current connection status to RadarFx.
Definition radarFxConnectorDriver.h:116
Base class for all RadarFX messages.
Definition rfxMessage.h:35
Manages connection to a RadarFX server and handles message exchange.
Definition radarFxConnector.h:54
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Definition radarFxConnectorDriver.h:21
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines DLL export macros for the SAR client plugin.
#define DT_DLL_sarClient
Definition sarClientPlugin.h:19
Defines the base class for all VREngage messages.