VR-Engage  2.2
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
16
17namespace makVrv
18{
19//! \brief Forward declaration of intersectors container class
20class DtIntersectorsContainer;
21} // namespace makVrv
22
23namespace makVre
24{
25//! \brief Forward declaration of the pilot simulation logic class
26class DtPilotSimLogic;
27
28//! \brief Input logic for aircraft instrument controls
29//!
30//! DtPilotInstrumentsInputLogic handles aircraft instrument inputs including
31//! radar controls, sensors, display management controls, and other avionics
32//! systems. This class translates user input into appropriate actions for
33//! aircraft instrumentation systems.
35{
36public:
37 //! \brief Constructor
38 //! \param simLogic Reference to the pilot simulation logic component
39 //! \param configFile Path to the input configuration file
40 DtPilotInstrumentsInputLogic(DtPilotSimLogic& simLogic, const std::string& configFile);
41
42 //! \brief Virtual destructor
44
45 //! \brief Initializes the instruments input logic component
46 //! \return True if initialization was successful
47 virtual void initialize() override;
48
49 //! \brief Adds an action handler for instrument controls
50 //! \param action Name of the action to handle
51 //! \param handler Function to handle the specified action
52 virtual void addInstrumentsActionHandler(const std::string& action, DtActionDelegate handler);
53
54 //! \brief Toggles radar warning receiver sounds
55 //! \param val Input value, defaults to 1.0 for activation
56 virtual void toggleRwrSounds(float val = 1);
57
58 //! \brief Sends a tactical command to the system
59 //! \param command Type of tactical command to send
60 //! \param value Value associated with the command
61 virtual void sendTacCommand(TacCommandMessage::Command command, float value);
62
63 //! \brief Moves the radar cursor upward
64 //! \param val Input value, typically 1.0 for activation
65 virtual void radarCursorUp(float val);
66
67 //! \brief Moves the radar cursor to the right
68 //! \param val Input value, typically 1.0 for activation
69 virtual void radarCursorRight(float val);
70
71 //! \brief Moves the radar cursor downward
72 //! \param val Input value, typically 1.0 for activation
73 virtual void radarCursorDown(float val);
74
75 //! \brief Moves the radar cursor to the left
76 //! \param val Input value, typically 1.0 for activation
77 virtual void radarCursorLeft(float val);
78
79 //! \brief Controls radar cursor horizontal position
80 //! \param val Input value in range [-1.0, 1.0]
81 virtual void radarCursorX(float val);
82
83 //! \brief Controls radar cursor vertical position
84 //! \param val Input value in range [-1.0, 1.0]
85 virtual void radarCursorY(float val);
86
87 //! \brief Selects the target under the radar cursor
88 //! \param val Input value, typically 1.0 for activation
89 virtual void radarCursorSelect(float val);
90
91 //! \brief Deselects the currently selected radar target
92 //! \param val Input value, typically 1.0 for activation
93 virtual void radarCursorDeselect(float val);
94
95 //! \brief Cycles forward through available targets
96 //! \param val Input value, typically 1.0 for activation
97 virtual void cycleTargetsForward(float val);
98
99 //! \brief Cycles backward through available targets
100 //! \param val Input value, typically 1.0 for activation
101 virtual void cycleTargetsBackward(float val);
102
103 //! \brief Clears all selected targets
104 //! \param val Input value, typically 1.0 for activation
105 virtual void clearTargets(float val);
106
107 //! \brief Controls co-pilot's cursor horizontal position
108 //! \param val Input value in range [-1.0, 1.0]
109 virtual void copCursorX(float val);
110
111 //! \brief Controls co-pilot's cursor vertical position
112 //! \param val Input value in range [-1.0, 1.0]
113 virtual void copCursorY(float val);
114
115 //! \brief Controls the Display Management Switch (DMS)
116 //! \param direction Direction to push the switch ("up", "down", "left", "right")
117 //! \param val Input value, typically 1.0 for activation
118 virtual void dms(std::string direction, double val);
119
120 //! \brief Activates the Display Management Switch in down direction
121 //! \param val Input value, typically 1.0 for activation
122 virtual void dmsDown(double val);
123
124 //! \brief Activates the Display Management Switch in left direction
125 //! \param val Input value, typically 1.0 for activation
126 virtual void dmsLeft(double val);
127
128 //! \brief Activates the Display Management Switch in right direction
129 //! \param val Input value, typically 1.0 for activation
130 virtual void dmsRight(double val);
131
132 //! \brief Activates the Display Management Switch in up direction
133 //! \param val Input value, typically 1.0 for activation
134 virtual void dmsUp(double val);
135
136 //! \brief Controls sensor azimuth position
137 //! \param val Input value in range [-1.0, 1.0]
138 virtual void sensorAzimuth(double val);
139
140 //! \brief Controls sensor elevation
141 //! \param val Input value in range [-1.0, 1.0]
142 virtual void sensorElevation(double val);
143
144 //! \brief Resets sensor to default position
145 //! \param val Input value, typically 1.0 for activation
146 virtual void sensorReset(double val);
147
148 //! \brief Commands sensor to track a location
149 //! \param val Input value, typically 1.0 for activation
150 virtual void sensorTrackLocation(double val);
151
152 //! \brief Commands sensor to track an object
153 //! \param val Input value, typically 1.0 for activation
154 virtual void sensorTrackObject(double val);
155
156 //! \brief Controls sensor zoom level
157 //! \param val Input value in range [0.0, 1.0]
158 virtual void sensorZoom(double val);
159
160 //! \brief Cycles through available sensor modes
161 //! \param val Input value, typically 1.0 for activation
162 virtual void sensorCycle(double val);
163
164 //! \brief Initiates a Synthetic Aperture Radar (SAR) request
165 //! \param val Input value, typically 1.0 for activation
166 virtual void sarRequest(double val);
167
168 //! \brief Handles player controls state messages
169 //! \param msg Pointer to the message being processed
170 //! \return Message processing result
171 //!
172 //! Handles player controls state messages to cancel SAR requests if disabled.
174
175protected:
176 //! \brief Reference to the pilot simulation logic component
178
179 //! \brief Path to the input configuration file
180 std::string myConfigFile;
181
182 //! \brief Flag indicating if a SAR request is active
184
185 //! \brief Pointer to the intersectors container
186 makVrv::DtIntersectorsContainer* myIntersectors;
187};
188} // namespace makVre
DtInputLogic()
Constructor.
makVrv::DtIntersectorsContainer * myIntersectors
Pointer to the intersectors container.
Definition instrumentsInputLogic.h:186
virtual void sensorTrackObject(double val)
Commands sensor to track an object.
DtPilotSimLogic & mySimLogic
Reference to the pilot simulation logic component.
Definition instrumentsInputLogic.h:177
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 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.
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.
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:183
std::string myConfigFile
Path to the input configuration file.
Definition instrumentsInputLogic.h:180
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:89
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Command
Definition tacCommand.h:30
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.
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
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