DtVreCommunicationManager provides functionality for managing simulation model sets, parameter databases, and frame updates. It serves as a bridge between the player station and the underlying VR-Link connection, handling pre and post thread ticks for frame advancement.
#include <vreCommunicationManager.h>
◆ DtVreCommunicationManager()
| makVre::DtVreCommunicationManager::DtVreCommunicationManager |
( |
const DtSimulationAddress & | addr, |
|
|
makVrf::DtStateDataManager * | sm = 0, |
|
|
int | threadPoolSize = -1 ) |
Constructor for the communication manager.
- Parameters
-
| addr | The simulation address to be used |
| sm | Pointer to the state data manager (optional) |
| threadPoolSize | Size of the thread pool; -1 uses default size |
Referenced by instance(), and registerInstance().
◆ ~DtVreCommunicationManager()
| virtual makVre::DtVreCommunicationManager::~DtVreCommunicationManager |
( |
| ) |
|
|
overridevirtual |
◆ instance()
Gets or creates a singleton instance of DtVreCommunicationManager for the given connection.
- Parameters
-
| conn | Reference to the VR-Link connection to associate with the instance |
- Returns
- Reference to the singleton instance
If an instance doesn't exist, one will be created and registered with the connection
References DtVreCommunicationManager().
Referenced by registerInstance().
◆ registerInstance()
| static void makVre::DtVreCommunicationManager::registerInstance |
( |
makVrv::DtBaseConnection & | sim, |
|
|
DtVreCommunicationManager * | instance ) |
|
static |
Registers an instance with the connection and connects it for updates.
- Parameters
-
| sim | Reference to the VR-Link connection |
| instance | Pointer to the instance to register |
References DtVreCommunicationManager(), and instance().
◆ creator()
| static DtCommunicationManager * makVre::DtVreCommunicationManager::creator |
( |
const DtSimulationAddress & | addr, |
|
|
makVrf::DtStateDataManager * | sm = 0, |
|
|
int | threadPoolSize = -1 ) |
|
static |
Factory method to create a new communication manager.
- Parameters
-
| addr | The simulation address to use |
| sm | Pointer to the state data manager (optional) |
| threadPoolSize | Size of the thread pool; -1 uses default size |
- Returns
- Pointer to a newly created DtCommunicationManager
◆ connectForUpdate()
| virtual void makVre::DtVreCommunicationManager::connectForUpdate |
( |
makVrv::DtBaseConnection & | vrlConn | ) |
|
|
virtual |
Connects for pre/post tick to be able to advance frame.
- Parameters
-
| vrlConn | Reference to the VR-Link connection to connect to |
This function connects the manager to the pre and post tick signals of the VR-Link connection, allowing automatic frame advancement. Call disconnectForUpdate to disable this and handle the updates yourself.
◆ disconnectForUpdate()
| virtual void makVre::DtVreCommunicationManager::disconnectForUpdate |
( |
| ) |
|
|
virtual |
Disconnects from pre/post tick signals.
Disconnects the manager from the pre and post tick signals, disabling automatic frame advancement.
◆ setSimulationModelSets() [1/4]
| virtual bool makVre::DtVreCommunicationManager::setSimulationModelSets |
( |
const std::vector< DtFilename > & | smss | ) |
|
|
virtual |
Sets the simulation model sets from a vector of DtFilename objects.
- Parameters
-
| smss | Vector of DtFilename objects representing simulation model sets |
- Returns
- True if the model sets were changed, false otherwise
◆ setSimulationModelSets() [2/4]
| virtual bool makVre::DtVreCommunicationManager::setSimulationModelSets |
( |
const std::vector< std::string > & | smss | ) |
|
|
virtual |
Sets the simulation model sets from a vector of strings.
- Parameters
-
| smss | Vector of strings representing simulation model sets |
- Returns
- True if the model sets were changed, false otherwise
◆ setSimulationModelSets() [3/4]
| virtual bool makVre::DtVreCommunicationManager::setSimulationModelSets |
( |
const std::set< std::string > & | smss | ) |
|
|
virtual |
Sets the simulation model sets from a set of strings.
- Parameters
-
| smss | Set of strings representing simulation model sets |
- Returns
- True if the model sets were changed, false otherwise
◆ setSimulationModelSets() [4/4]
| virtual bool makVre::DtVreCommunicationManager::setSimulationModelSets |
( |
const std::vector< DtString > & | smss | ) |
|
|
virtual |
Sets the simulation model sets from a vector of DtString objects.
- Parameters
-
| smss | Vector of DtString objects representing simulation model sets |
- Returns
- True if the model sets were changed, false otherwise
◆ addSimulationModelSet()
| virtual void makVre::DtVreCommunicationManager::addSimulationModelSet |
( |
const std::string & | sms | ) |
|
|
virtual |
Adds a single simulation model set.
- Parameters
-
| sms | String representing the simulation model set to add |
◆ clearSimModelSets()
| virtual void makVre::DtVreCommunicationManager::clearSimModelSets |
( |
| ) |
|
|
virtual |
Clears all simulation model sets.
◆ simulationModelSets()
| virtual const std::vector< DtFilename > & makVre::DtVreCommunicationManager::simulationModelSets |
( |
| ) |
|
|
inlinevirtual |
Gets the current simulation model sets.
- Returns
- Constant reference to the vector of simulation model sets
References mySimulationModelSets.
◆ setParameterDatabase()
| virtual void makVre::DtVreCommunicationManager::setParameterDatabase |
( |
DtVrfParameterDb * | parameterDb | ) |
|
|
overridevirtual |
Sets the parameter database for the communication manager.
- Parameters
-
| parameterDb | Pointer to the parameter database to use |
- Note
- The parameter database is cast to DtMtlParameterDb internally
◆ slot_preThreadTick()
| virtual void makVre::DtVreCommunicationManager::slot_preThreadTick |
( |
| ) |
|
|
protectedvirtual |
Slot called before each thread tick.
Calls beginFrame to prepare for the next simulation frame
◆ slot_postThreadTick()
| virtual void makVre::DtVreCommunicationManager::slot_postThreadTick |
( |
| ) |
|
|
protectedvirtual |
Slot called after each thread tick.
Calls advanceFrame to complete the current simulation frame and handles parameter database updates if simulation model sets have changed
◆ setupParameterDatabase()
| virtual bool makVre::DtVreCommunicationManager::setupParameterDatabase |
( |
| ) |
|
|
protectedvirtual |
Sets up the parameter database with the current simulation model sets.
- Returns
- True if the parameter database was set up successfully, false otherwise
Creates a new parameter database if one doesn't exist, then loads all OPD files from the simulation model sets into the database
◆ parseOPDFiles()
| virtual void makVre::DtVreCommunicationManager::parseOPDFiles |
( |
const DtFilename & | smsToLoad, |
|
|
std::vector< DtFilename > & | opdFiles, |
|
|
std::vector< DtFilename > & | searchPaths ) |
|
protectedvirtual |
Parses OPD files from a simulation model set.
- Parameters
-
| smsToLoad | The simulation model set to load |
| opdFiles | Vector to store the found OPD files |
| searchPaths | Vector to store the search paths |
Recursively processes included simulation model sets and collects all OPD files and search paths
◆ myPreTickConnection
| boost::signals2::scoped_connection makVre::DtVreCommunicationManager::myPreTickConnection |
|
protected |
Connection to the pre-tick signal.
◆ myPostTickConnection
| boost::signals2::scoped_connection makVre::DtVreCommunicationManager::myPostTickConnection |
|
protected |
Connection to the post-tick signal.
◆ myParamDB
| DtMtlParameterDb* makVre::DtVreCommunicationManager::myParamDB |
|
protected |
Pointer to the parameter database.
◆ myLastSearchPaths
| std::vector<DtFilename> makVre::DtVreCommunicationManager::myLastSearchPaths |
|
protected |
Last used search paths for the parameter database.
◆ mySimulationModelSets
| std::vector<DtFilename> makVre::DtVreCommunicationManager::mySimulationModelSets |
|
protected |
◆ mySmsChanged
| bool makVre::DtVreCommunicationManager::mySmsChanged |
|
protected |
Flag indicating whether simulation model sets have changed.
◆ myParamDBTimerStart
| double makVre::DtVreCommunicationManager::myParamDBTimerStart |
|
protected |
Timer for parameter database updates.
The documentation for this class was generated from the following file: