|
VR-Engage
2.2
|
DtRadioLogic provides management of radio communication systems in the simulation, handling radio channel selection, push-to-talk functionality, crypto settings, and various radio modulation parameters. It supports both standard radios and vehicle intercom systems, automatically managing radio state when embarking or disembarking from vehicles. The component provides menu-driven controls for switching between radios, channels, and communication settings.
#include <radioLogic.h>
Public Types | |
| enum | PttState { PTT_ON , PTT_OFF } |
Public Member Functions | |
| DtRadioLogic () | |
| virtual | ~DtRadioLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | ptt (PttState state) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Attributes | |
| int | myCurrentRadio |
| DtInputLogic | myInputLogic |
| std::map< std::string, boost::function< void(DtRadioLogic *, MenuActionMessage *)> > | myMenuActionMessageFnMap |
| boost::signals2::connection | myRadioManagerTickConnection |
| DtEntityIdentifier | myPreviouslyEmbarkedOn |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtRadioLogic::DtRadioLogic | ( | ) |
Constructor for DtRadioLogic.
Initializes the component with the name "DtRadioLogic" and sets up handlers for various radio menu actions
|
overridevirtual |
Virtual destructor for DtRadioLogic.
|
overridevirtual |
Initializes the radio logic component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing radio settings |
Sets up the radio manager, registers message handlers, and configures input handling for push-to-talk functionality. Also initializes the current radio based on saved state or configuration.
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization after all components are initialized.
Currently just returns true as no special post-initialization is needed
Reimplemented from makVre::DtPlayerComponent.
|
inlineoverridevirtual |
Called every frame to update the component state.
| dt | Delta time since the last frame in seconds |
Current implementation is empty as updates occur through message handlers and attribute change callbacks
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the radio logic component.
Saves the current radio state to attributes for persistence, removes message handlers and callbacks, and shuts down the radio manager
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
virtual |
Sets the push-to-talk state for the current radio.
| state | The desired PTT state (on or off) |
Activates or deactivates transmission on the current radio based on the specified PTT state. Does nothing if no radio is selected.
|
overrideprotectedvirtual |
Initializes state attributes for radio communication.
Current implementation is empty as attributes are initialized elsewhere
Reimplemented from makVre::DtPlayerComponent.
|
protected |
Handles menu messages related to radio operations.
| msg | The menu message to process |
Routes menu action messages to the appropriate handler based on the action type
|
protected |
Handles changes to the player's embarked state.
| val | Entity identifier of the vehicle being embarked on, or null if disembarking |
Manages vehicle intercom system when embarking on or disembarking from vehicles
|
protected |
Updates the radio manager based on current radio state.
Ensures only the current radio is powered on, manages audio capture settings, and configures push-to-talk functionality based on radio state
|
protected |
Updates state attributes with current radio settings.
Stores all current radio parameters (current radio, channel, crypto settings, etc.) to the player attribute store for UI display and persistence
|
protected |
Handles push-to-talk input events.
| val | Input value (1.0 for pressed, 0.0 for released) |
Translates input values to PTT states and calls the ptt() function
|
protected |
Sets the current radio to a specific index.
| msg | Menu message containing the radio index as a parameter |
|
protected |
Cycles to the next available radio or turns off if at the last radio.
| msg | Menu message triggering the action |
|
protected |
Cycles to the next channel on the current radio.
| msg | Menu message triggering the action |
|
protected |
Cycles through available duplex modes (FULL/HALF)
| msg | Menu message triggering the action |
|
protected |
Cycles through available cryptographic systems.
| msg | Menu message triggering the action |
|
protected |
Sets the crypto key based on input from a menu.
| msg | Menu message containing the crypto key as a parameter |
|
protected |
Cycles through available cryptographic modes.
| msg | Menu message triggering the action |
|
protected |
Cycles through available modulation system types.
| msg | Menu message triggering the action |
|
protected |
Cycles through available major modulation types.
| msg | Menu message triggering the action |
|
protected |
Cycles through available modulation detail types.
| msg | Menu message triggering the action |
|
protected |
Toggles frequency hopping on/off.
| msg | Menu message triggering the action |
|
protected |
Toggles time hopping on/off.
| msg | Menu message triggering the action |
|
protected |
Toggles pseudo-noise on/off.
| msg | Menu message triggering the action |
|
protected |
Gets the name of the current radio.
|
protected |
Gets the channel name of the current radio.
|
protected |
Gets the duplex mode of the current radio.
|
protected |
Gets the cryptographic system of the current radio.
|
protected |
Gets the cryptographic key of the current radio.
|
protected |
Gets the cryptographic mode of the current radio.
|
protected |
Gets the modulation system of the current radio.
|
protected |
Gets the major modulation type of the current radio.
|
protected |
Gets the modulation detail type of the current radio.
|
protected |
Gets the frequency hopping state of the current radio.
|
protected |
Gets the time hopping state of the current radio.
|
protected |
Gets the pseudo-noise state of the current radio.
|
protected |
Sets the cryptographic key for the current radio.
| cryptoKey | The crypto key value to set |
Updates the crypto key of the current radio if one is selected
|
protected |
Index of the currently selected radio (-1 if no radio selected)
|
protected |
Input logic for handling push-to-talk and other input actions.
|
protected |
Map of menu action names to handler functions.
Used to dispatch menu action messages to the appropriate handler methods
|
protected |
Connection made to de post tick to tick the radio manager.
|
protected |