VR-Engage  2.3
Loading...
Searching...
No Matches
instrumentsInputLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file instrumentsInputLogic.h
7//! \brief Defines DtPilotInstrumentsInputLogic for handling aircraft instrument inputs
8//! \ingroup vrePilotFrontend
9
10#pragma once
11
14#include <vreUtil/attribute.h>
15
17
18namespace makVrv
19{
20//! \brief Forward declaration of intersectors container class
21class DtIntersectorsContainer;
22} // namespace makVrv
23
24namespace makVre
25{
26//! \brief Forward declaration of the pilot simulation logic class
27class DtPilotSimLogic;
28
29//! \brief Input logic for aircraft instrument controls
30//!
31//! DtPilotInstrumentsInputLogic handles aircraft instrument inputs including
32//! radar controls, sensors, display management controls, and other avionics
33//! systems. This class translates user input into appropriate actions for
34//! aircraft instrumentation systems.
36{
37public:
38 //! \brief Constructor
39 //! \param simLogic Reference to the pilot simulation logic component
40 //! \param configFile Path to the input configuration file
41 DtPilotInstrumentsInputLogic(DtPilotSimLogic& simLogic, const std::string& configFile);
42
43 //! \brief Virtual destructor
45
46 //! \brief Initializes the instruments input logic component
47 //! \return True if initialization was successful
48 virtual void initialize() override;
49
50 //! \brief Adds an action handler for instrument controls
51 //! \param action Name of the action to handle
52 //! \param handler Function to handle the specified action
53 virtual void addInstrumentsActionHandler(const std::string& action, DtActionDelegate handler);
54
55 //! \brief Toggles radar warning receiver sounds
56 //! \param val Input value, defaults to 1.0 for activation
57 virtual void toggleRwrSounds(float val = 1);
58
59 //! \brief Sends a tactical command to the system
60 //! \param command Type of tactical command to send
61 //! \param value Value associated with the command
62 virtual void sendTacCommand(TacCommandMessage::Command command, float value);
63
64 //! \brief Moves the radar cursor upward
65 //! \param val Input value, typically 1.0 for activation
66 virtual void radarCursorUp(float val);
67
68 //! \brief Moves the radar cursor to the right
69 //! \param val Input value, typically 1.0 for activation
70 virtual void radarCursorRight(float val);
71
72 //! \brief Moves the radar cursor downward
73 //! \param val Input value, typically 1.0 for activation
74 virtual void radarCursorDown(float val);
75
76 //! \brief Moves the radar cursor to the left
77 //! \param val Input value, typically 1.0 for activation
78 virtual void radarCursorLeft(float val);
79
80 //! \brief Controls radar cursor horizontal position
81 //! \param val Input value in range [-1.0, 1.0]
82 virtual void radarCursorX(float val);
83
84 //! \brief Controls radar cursor vertical position
85 //! \param val Input value in range [-1.0, 1.0]
86 virtual void radarCursorY(float val);
87
88 //! \brief Selects the target under the radar cursor
89 //! \param val Input value, typically 1.0 for activation
90 virtual void radarCursorSelect(float val);
91
92 //! \brief Deselects the currently selected radar target
93 //! \param val Input value, typically 1.0 for activation
94 virtual void radarCursorDeselect(float val);
95
96 //! \brief Cycles forward through available targets
97 //! \param val Input value, typically 1.0 for activation
98 virtual void cycleTargetsForward(float val);
99
100 //! \brief Cycles backward through available targets
101 //! \param val Input value, typically 1.0 for activation
102 virtual void cycleTargetsBackward(float val);
103
104 //! \brief Clears all selected targets
105 //! \param val Input value, typically 1.0 for activation
106 virtual void clearTargets(float val);
107
108 //! \brief Controls co-pilot's cursor horizontal position
109 //! \param val Input value in range [-1.0, 1.0]
110 virtual void copCursorX(float val);
111
112 //! \brief Controls co-pilot's cursor vertical position
113 //! \param val Input value in range [-1.0, 1.0]
114 virtual void copCursorY(float val);
115
116 //! \brief Controls the Display Management Switch (DMS)
117 //! \param direction Direction to push the switch ("up", "down", "left", "right")
118 //! \param val Input value, typically 1.0 for activation
119 virtual void dms(std::string direction, double val);
120
121 //! \brief Activates the Display Management Switch in down direction
122 //! \param val Input value, typically 1.0 for activation
123 virtual void dmsDown(double val);
124
125 //! \brief Activates the Display Management Switch in left direction
126 //! \param val Input value, typically 1.0 for activation
127 virtual void dmsLeft(double val);
128
129 //! \brief Activates the Display Management Switch in right direction
130 //! \param val Input value, typically 1.0 for activation
131 virtual void dmsRight(double val);
132
133 //! \brief Activates the Display Management Switch in up direction
134 //! \param val Input value, typically 1.0 for activation
135 virtual void dmsUp(double val);
136
137 //! \brief Controls sensor azimuth position
138 //! \param val Input value in range [-1.0, 1.0]
139 virtual void sensorAzimuth(double val);
140
141 //! \brief Controls sensor elevation
142 //! \param val Input value in range [-1.0, 1.0]
143 virtual void sensorElevation(double val);
144
145 //! \brief Sets sensor elevation to an absolute position
146 //! \param val Input value in range [-1.0, 1.0]
147 virtual void sensorElevationAbsolute(double val);
148
149 //! \brief Resets sensor to default position
150 //! \param val Input value, typically 1.0 for activation
151 virtual void sensorReset(double val);
152
153 //! \brief Commands sensor to track a location
154 //! \param val Input value, typically 1.0 for activation
155 virtual void sensorTrackLocation(double val);
156
157 //! \brief Commands sensor to track an object
158 //! \param val Input value, typically 1.0 for activation
159 virtual void sensorTrackObject(double val);
160
161 //! \brief Controls sensor zoom level
162 //! \param val Input value in range [0.0, 1.0]
163 virtual void sensorZoom(double val);
164
165 //! \brief Sets sensor zoom to an absolute percentage of its zoom range
166 //! \param val Input value in range [-1.0, 1.0]
167 virtual void sensorZoomPercent(double val);
168
169 //! \brief Cycles through available sensor modes
170 //! \param val Input value, typically 1.0 for activation
171 virtual void sensorCycle(double val);
172
173 //! \brief Initiates a Synthetic Aperture Radar (SAR) request
174 //! \param val Input value, typically 1.0 for activation
175 virtual void sarRequest(double val);
176
177 //! \brief Handles player controls state messages
178 //! \param msg Pointer to the message being processed
179 //! \return Message processing result
180 //!
181 //! Handles player controls state messages to cancel SAR requests if disabled.
183
184protected:
185 //! \brief Reference to the pilot simulation logic component
187
188 //! \brief Path to the input configuration file
189 std::string myConfigFile;
190
191 //! \brief Flag indicating if a SAR request is active
193
194 //! \brief Pointer to the intersectors container
195 makVrv::DtIntersectorsContainer* myIntersectors;
196
197 //! \brief Attribute handle indicating whether radar warning receiver sounds are enabled.
198 //! \vreAttrKey{rwrSoundsEnabled}
200
201 //! \brief Attribute handle storing the ownship's relative velocity vector.
202 //! \vreAttrKey{ownship.relativeVelocity}
204};
205} // namespace makVre
Provides attribute handling system for hierarchical data storage and manipulation.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
DtInputLogic()
Constructor.
makVrv::DtIntersectorsContainer * myIntersectors
Pointer to the intersectors container.
Definition instrumentsInputLogic.h:195
virtual void sensorTrackObject(double val)
Commands sensor to track an object.
DtPilotSimLogic & mySimLogic
Reference to the pilot simulation logic component.
Definition instrumentsInputLogic.h:186
virtual void clearTargets(float val)
Clears all selected targets.
virtual void sensorAzimuth(double val)
Controls sensor azimuth position.
virtual void radarCursorRight(float val)
Moves the radar cursor to the right.
virtual void copCursorY(float val)
Controls co-pilot's cursor vertical position.
virtual void sensorZoomPercent(double val)
Sets sensor zoom to an absolute percentage of its zoom range.
virtual void radarCursorUp(float val)
Moves the radar cursor upward.
virtual void radarCursorDown(float val)
Moves the radar cursor downward.
virtual void toggleRwrSounds(float val=1)
Toggles radar warning receiver sounds.
virtual void dmsLeft(double val)
Activates the Display Management Switch in left direction.
DtAttributeHandleType< bool > myRwrSoundsEnabledAttr
Attribute handle indicating whether radar warning receiver sounds are enabled.
Definition instrumentsInputLogic.h:199
virtual void sensorElevationAbsolute(double val)
Sets sensor elevation to an absolute position.
virtual void cycleTargetsForward(float val)
Cycles forward through available targets.
virtual void sensorElevation(double val)
Controls sensor elevation.
virtual void cycleTargetsBackward(float val)
Cycles backward through available targets.
DtAttributeHandleType< DtVector32 > myRelativeVelocityAttr
Attribute handle storing the ownship's relative velocity vector.
Definition instrumentsInputLogic.h:203
virtual void addInstrumentsActionHandler(const std::string &action, DtActionDelegate handler)
Adds an action handler for instrument controls.
virtual ~DtPilotInstrumentsInputLogic() override
Virtual destructor.
virtual void dmsUp(double val)
Activates the Display Management Switch in up direction.
virtual void radarCursorX(float val)
Controls radar cursor horizontal position.
DtPilotInstrumentsInputLogic(DtPilotSimLogic &simLogic, const std::string &configFile)
Constructor.
virtual void sensorTrackLocation(double val)
Commands sensor to track a location.
virtual void radarCursorLeft(float val)
Moves the radar cursor to the left.
virtual void dmsDown(double val)
Activates the Display Management Switch in down direction.
virtual void sendTacCommand(TacCommandMessage::Command command, float value)
Sends a tactical command to the system.
bool mySarRequestActive
Flag indicating if a SAR request is active.
Definition instrumentsInputLogic.h:192
std::string myConfigFile
Path to the input configuration file.
Definition instrumentsInputLogic.h:189
virtual void sarRequest(double val)
Initiates a Synthetic Aperture Radar (SAR) request.
virtual DtVreMessageResult handlePlayerControlsState(DtVreMessage *msg)
Handles player controls state messages.
virtual void initialize() override
Initializes the instruments input logic component.
virtual void dmsRight(double val)
Activates the Display Management Switch in right direction.
virtual void radarCursorDeselect(float val)
Deselects the currently selected radar target.
virtual void copCursorX(float val)
Controls co-pilot's cursor horizontal position.
virtual void sensorReset(double val)
Resets sensor to default position.
virtual void radarCursorSelect(float val)
Selects the target under the radar cursor.
virtual void dms(std::string direction, double val)
Controls the Display Management Switch (DMS)
virtual void sensorZoom(double val)
Controls sensor zoom level.
virtual void sensorCycle(double val)
Cycles through available sensor modes.
virtual void radarCursorY(float val)
Controls radar cursor vertical position.
Simulation logic component for the pilot role.
Definition pilotSimLogic.h:93
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Command
Command enumeration.
Definition tacCommand.h:36
Defines export/import macros for the Pilot Frontend library.
#define PILOT_DLL
Definition export.h:19
Defines the DtInputLogic class for handling input in VR-Engage.
!
Definition glsVreMessageUtil.h:50
DtDelegate< void, float > DtActionDelegate
Delegate type for handling action events.
Definition vreInputManager.h:66
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28