VR-Engage  2.2
Loading...
Searching...
No Matches
radioPage.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file radioPage.h
7//! \ingroup vrfMakRadioQt
8//! \brief Radio control page for the VREngage user interface
9//!
10//! This file defines the DtRadioPage class, which provides a control page
11//! for radio communications in the VREngage user interface. It manages radio
12//! widgets and handles radio events.
13
14#pragma once
15
18
19#include <vrvCore/DtElementData.h>
20
21#include <vrvCoreQt/DtPage.h>
22
23#include <QtWidgets/QWidget>
24
25#include <vlpi/entityIdentifier.h>
26
27class QTimer;
28class QStandardItemModel;
29class QSortFilterProxyModel;
30
31namespace makRadio
32{
33class DtRadioWidget;
34}
35
36namespace makVrv
37{
38class DtVrvRadioManager;
39class DtRadioEventProcessor;
40
41//! \brief Radio control page for the VREngage user interface
42//!
43//! This class provides a control page for radio communications in the VREngage
44//! user interface. It manages radio widgets, processes radio events, and allows
45//! users to interact with the radio simulation subsystem through a graphical interface.
46class VRVRADIOQT_DLL DtRadioPage : public DtPage
47{
48 Q_OBJECT
49
50public:
51 //! \brief Virtual destructor
52 //!
53 //! Cleans up resources used by the radio page, including event connections
54 //! and radio widgets.
55 virtual ~DtRadioPage();
56
57 //! \brief Gets the icon for this page
58 //! \return Icon to display for this page in the UI
59 //!
60 //! Returns the icon that represents this page in menus and tabs.
61 virtual QIcon icon();
62
63 //! \brief Gets the title for this page
64 //! \return Title to display for this page in the UI
65 //!
66 //! Returns the title that identifies this page in menus and tabs.
67 virtual QString title();
68
69 //! \brief Gets the class name of the page
70 //! \return Reference to the class name string
71 //!
72 //! Returns the unique class name that identifies this page type in the system.
73 virtual const std::string& pageClassName() const;
74
75 //! \brief Activates the page when it is displayed
76 //!
77 //! Called when the page is displayed to the user. Initializes radio connections
78 //! and starts processing radio events.
79 virtual void activate();
80
81 //! \brief Deactivates the page when it is hidden
82 //!
83 //! Called when the page is hidden from the user. Disconnects from radio events
84 //! to prevent unnecessary processing while not visible.
85 virtual void deactivate();
86
87 //! \brief Finds an entity identifier from its marking text
88 //! \param markingText The marking text to search for
89 //! \return Entity identifier for the matching entity, or invalid identifier if not found
90 //!
91 //! Searches for an entity with the specified marking text and returns its identifier.
92 //! This is used to associate radio communications with specific entities.
93 virtual DtEntityIdentifier findEntityIdFromMarkingText(const std::string& markingText);
94
95protected:
96 //! \brief Allows the page creator to create instances of this class
97 //!
98 //! This friendship declaration grants the creator class access to the
99 //! protected constructor of this class.
100 friend class DtRadioPageCreator;
101
102 //! \brief Handles activation-specific tasks
103 //!
104 //! Called by the activate() method to perform implementation-specific
105 //! activation tasks.
106 virtual void handleActivate();
107
108 //! \brief Handles deactivation-specific tasks
109 //!
110 //! Called by the deactivate() method to perform implementation-specific
111 //! deactivation tasks.
112 virtual void handleDeactivate();
113
114 //! \brief Constructor
115 //! \param de The document environment providing access to application resources
116 //! \param parent The parent widget (optional)
117 //! \param f Window flags (optional)
118 //!
119 //! Creates a new radio page with the specified document environment and parent.
120 //! This constructor is protected to enforce creation through the factory pattern.
121 DtRadioPage(DtDe& de, QWidget* parent = 0, Qt::WindowFlags f = 0);
122
123 //! \brief Finds and processes existing entities when the page is activated
124 //!
125 //! Searches for and processes all existing entities in the simulation
126 //! when the page is activated, to ensure all relevant entities are included
127 //! in the radio communications system.
128 virtual void findExistingEntites();
129
130 //! \brief Slot called when elements are ready to be processed
131 //! \param elements List of element identifiers that are ready for processing
132 //!
133 //! Processes elements that have been added or modified in the simulation.
134 //! Updates the radio system with information about these elements.
135 virtual void slot_elementsReadyToProcess(const DtElementData::ElementIdList& elements);
136
137 //! \brief Slot called when elements are removed from the simulation
138 //! \param elements List of element identifiers that have been removed
139 //!
140 //! Handles cleanup and updates the radio system when elements are removed
141 //! from the simulation.
142 virtual void slot_elementsRemoved(const DtElementData::ElementIdList& elements);
143
144 //! \brief Sets up the contents of the widget onto the supplied parent
145 //! \param p The parent widget to set up the UI on
146 //!
147 //! Initializes the UI components of the radio page and adds them to the
148 //! specified parent widget.
149 void setupUi(QWidget* p);
150
151 //! \brief The class name of this page
152 //!
153 //! Stores the class name string that uniquely identifies this page type.
154 std::string myClassName;
155
156 //! \brief The radio stack widget containing the radio controls
157 //!
158 //! Contains the actual radio UI components displayed on this page.
160
161 //! \brief The radio manager handling radio functionality
162 //!
163 //! Manages the underlying radio simulation functionality.
164 DtVrvRadioManager* myManager;
165
166 //! \brief The event processor for radio events
167 //!
168 //! Processes radio events from the simulation and updates the UI accordingly.
169 DtRadioEventProcessor* myEventHandler;
170};
171
172
173//! \brief Creator class for radio pages
174//!
175//! This class is responsible for creating instances of the DtRadioPage class.
176//! It implements the factory pattern to create and initialize radio pages.
177class VRVRADIOQT_DLL DtRadioPageCreator : public DtPageCreator
178{
179public:
180 //! \brief Constructor
181 //! \param de The document environment providing access to application resources
182 //!
183 //! Creates a new radio page creator with the specified document environment.
185
186 //! \brief Virtual destructor
187 //!
188 //! Cleans up resources used by the radio page creator.
190
191 //! \brief Gets the name of the page class this creator creates
192 //! \return The unique class name string for the created page type
193 //!
194 //! Returns the unique class name that identifies the type of page this creator
195 //! produces. This is NOT the title of the page. When replacing a page in the
196 //! application, the pageClassName should remain the same to ensure proper
197 //! page replacement behavior.
198 virtual std::string pageClassName() const;
199
200 //! \brief Creates a new radio page instance
201 //! \param parent The parent widget (optional)
202 //! \param f Window flags (optional)
203 //! \return Pointer to the newly created page
204 //!
205 //! Creates and initializes a new instance of DtRadioPage with the specified
206 //! parent widget and window flags.
207 virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0);
208};
209} // namespace makVrv
virtual std::string pageClassName() const
Gets the name of the page class this creator creates.
DtRadioPageCreator(DtDe &de)
Constructor.
virtual ~DtRadioPageCreator()
Virtual destructor.
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)
Creates a new radio page instance.
virtual ~DtRadioPage()
Virtual destructor.
virtual void slot_elementsReadyToProcess(const DtElementData::ElementIdList &elements)
Slot called when elements are ready to be processed.
DtRadioEventProcessor * myEventHandler
The event processor for radio events.
Definition radioPage.h:169
virtual void handleDeactivate()
Handles deactivation-specific tasks.
DtRadioPage(DtDe &de, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
virtual void findExistingEntites()
Finds and processes existing entities when the page is activated.
DtRadioStackWidget * myRadioStack
The radio stack widget containing the radio controls.
Definition radioPage.h:159
virtual QIcon icon()
Gets the icon for this page.
virtual void slot_elementsRemoved(const DtElementData::ElementIdList &elements)
Slot called when elements are removed from the simulation.
void setupUi(QWidget *p)
Sets up the contents of the widget onto the supplied parent.
virtual const std::string & pageClassName() const
Gets the class name of the page.
friend class DtRadioPageCreator
Allows the page creator to create instances of this class.
Definition radioPage.h:100
virtual void handleActivate()
Handles activation-specific tasks.
DtVrvRadioManager * myManager
The radio manager handling radio functionality.
Definition radioPage.h:164
virtual void deactivate()
Deactivates the page when it is hidden.
std::string myClassName
The class name of this page.
Definition radioPage.h:154
virtual QString title()
Gets the title for this page.
virtual void activate()
Activates the page when it is displayed.
virtual DtEntityIdentifier findEntityIdFromMarkingText(const std::string &markingText)
Finds an entity identifier from its marking text.
Radio stack widget for managing multiple radio interfaces.
Definition radioStackWidget.h:40
Main entry point for the MAK Radio Qt module.
#define VRVRADIOQT_DLL
Platform-specific DLL export/import declaration.
Definition makRadioQt.h:28
Definition makRadio.h:23
Definition appLauncherComponent.h:28
Radio stack widget for managing multiple radio interfaces.
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.