VR-Engage  2.2
Loading...
Searching...
No Matches
radioStackWidget.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file radioStackWidget.h
7//! \ingroup vrfMakRadioQt
8//! \brief Radio stack widget for managing multiple radio interfaces
9//!
10//! This file defines the DtRadioStackWidget class, which provides a container
11//! for managing multiple radio interfaces in the VREngage environment. It allows
12//! users to control multiple radio channels through a consistent interface.
13
14#pragma once
15
16#include <vrvUtil/signalslib.h>
17
18#include "radioStackWidget.hpp"
19
20#include <QtWidgets/QWidget>
21
22#include <vlpi/entityIdentifier.h>
23
24class QTimer;
25class QStandardItemModel;
26class QSortFilterProxyModel;
27
28namespace makVrv
29{
30class DtVrvRadioManager;
31class DtRadioWidget;
32
33//! \brief Radio stack widget for managing multiple radio interfaces
34//!
35//! This widget provides a container for managing multiple radio interfaces
36//! in the VREngage environment. It allows users to control and monitor multiple
37//! radio channels through a single consistent interface, including volume control,
38//! push-to-talk functionality, and voice activation detection (VOX).
39class DtRadioStackWidget : public QWidget
40{
41 Q_OBJECT
42
43public:
44 //! \brief Constructor
45 //! \param mgr The radio manager providing access to radio functionality
46 //! \param parent The parent widget (optional)
47 //! \param f Window flags (optional)
48 //!
49 //! Creates a new radio stack widget with the specified radio manager and parent.
50 DtRadioStackWidget(DtVrvRadioManager* mgr, QWidget* parent = 0, Qt::WindowFlags f = 0);
51
52 //! \brief Virtual destructor
53 //!
54 //! Cleans up resources used by the radio stack widget.
56
57 //! \brief Adds an entity to the radio system
58 //! \param markingText The marking text identifying the entity to add
59 //!
60 //! Adds an entity with the specified marking text to the radio system,
61 //! making it available for radio communications.
62 virtual void addEntity(std::string markingText);
63
64 //! \brief Removes an entity from the radio system
65 //! \param markingText The marking text identifying the entity to remove
66 //!
67 //! Removes an entity with the specified marking text from the radio system,
68 //! disconnecting it from radio communications.
69 virtual void removeEntity(std::string markingText);
70
71 //! \brief Gets the radio manager
72 //! \return Reference to the radio manager
73 //!
74 //! Returns a reference to the radio manager used by this stack widget.
75 virtual DtVrvRadioManager& radioManager();
76
77public slots:
78 //! \brief Slot called when the selected entity changes
79 //! \param idx The index of the newly selected entity
80 //!
81 //! Updates the radio display to show the radios for the newly selected entity.
82 virtual void entityChanged(int idx);
83
84 //! \brief Slot called when the master volume changes
85 //! \param value The new volume value
86 //!
87 //! Updates the volume for all radio channels.
88 virtual void masterVolumeChanged(int value);
89
90 //! \brief Slot called when the master VOX setting changes
91 //! \param value The new VOX threshold value
92 //!
93 //! Updates the voice activation detection threshold for all radio channels.
94 virtual void masterVoxChanged(int value);
95
96 //! \brief Slot called when the master push-to-talk button is pressed
97 //!
98 //! Activates transmission on all active radio channels.
99 virtual void masterPttPressed();
100
101 //! \brief Slot called when the master push-to-talk button is released
102 //!
103 //! Deactivates transmission on all active radio channels.
104 virtual void masterPttReleased();
105
106 //! \brief Updates the radio display
107 //!
108 //! Refreshes the display of all radio controls to reflect current state.
109 virtual void updateRadios();
110
111 //! \brief Updates signal level indicators
112 //!
113 //! Updates the signal level indicators for all active radio channels.
114 virtual void updateLevels();
115
116protected:
117 //! \brief Creates radio widgets for the current entity
118 //!
119 //! Creates and initializes the radio widgets for the currently selected entity.
120 virtual void createRadios();
121
122 //! \brief Filters events for radio widgets
123 //! \param watched The object being watched
124 //! \param event The event that occurred
125 //! \return True if the event was handled, false otherwise
126 //!
127 //! Handles events for radio widgets, particularly keyboard shortcuts for PTT.
128 virtual bool eventFilter(QObject* watched, QEvent* event);
129
130 //! \brief Sets up the contents of the widget onto the supplied parent
131 //! \param p The parent widget to set up the UI on
132 //!
133 //! Initializes the UI components of the radio stack widget and adds them to the
134 //! specified parent widget.
135 void setupUi(QWidget* p);
136
137 //! \brief The UI components for this widget
138 //!
139 //! Contains the actual UI components defined in the UI file.
140 Ui::DtRadioStackWidgetUI myUI;
141
142 //! \brief Data model for the entity list
143 //!
144 //! Stores entity data for display in the entity selection list.
145 QStandardItemModel* myModel;
146
147 //! \brief Proxy model for filtering the entity list
148 //!
149 //! Provides filtering and sorting capabilities for the entity list.
150 QSortFilterProxyModel* myProxy;
151
152 //! \brief The radio manager handling radio functionality
153 //!
154 //! Manages the underlying radio simulation functionality.
155 DtVrvRadioManager* myManager;
156
157 //! \brief Timer for updating signal levels
158 //!
159 //! Periodically triggers updates to the signal level indicators.
161};
162} // namespace makVrv
void setupUi(QWidget *p)
Sets up the contents of the widget onto the supplied parent.
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events for radio widgets.
QSortFilterProxyModel * myProxy
Proxy model for filtering the entity list.
Definition radioStackWidget.h:150
virtual void removeEntity(std::string markingText)
Removes an entity from the radio system.
virtual void entityChanged(int idx)
Slot called when the selected entity changes.
virtual void updateLevels()
Updates signal level indicators.
QStandardItemModel * myModel
Data model for the entity list.
Definition radioStackWidget.h:145
virtual void masterVoxChanged(int value)
Slot called when the master VOX setting changes.
virtual void updateRadios()
Updates the radio display.
DtRadioStackWidget(DtVrvRadioManager *mgr, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
virtual DtVrvRadioManager & radioManager()
Gets the radio manager.
virtual void masterPttPressed()
Slot called when the master push-to-talk button is pressed.
virtual void createRadios()
Creates radio widgets for the current entity.
virtual void masterVolumeChanged(int value)
Slot called when the master volume changes.
QTimer * myLevelsTimer
Timer for updating signal levels.
Definition radioStackWidget.h:160
virtual ~DtRadioStackWidget()
Virtual destructor.
Ui::DtRadioStackWidgetUI myUI
The UI components for this widget.
Definition radioStackWidget.h:140
virtual void masterPttReleased()
Slot called when the master push-to-talk button is released.
DtVrvRadioManager * myManager
The radio manager handling radio functionality.
Definition radioStackWidget.h:155
virtual void addEntity(std::string markingText)
Adds an entity to the radio system.
Individual radio control widget for VREngage.
Definition radioWidget.h:41
Definition appLauncherComponent.h:28