NDEVR
API Documentation
DeploymentWidgets.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/OrientationSensor.h>
4#include <NDEVR/QCustomComboBox.h>
5#include <NDEVR/ResizeVisibleAnimation.h>
6namespace NDEVR
7{
9 class WindowManager;
10 class QTModelManager;
11 class AlignmentWidget;
12 class Button;
13 class CustomUnit;
18 class HARDWARE_WIDGETS_API DeploymentUnit
19 {
20 public:
34 static constexpr StringView DeploymentLengthUnitName() { return "DeploymentLengthUnit"; }
35 };
36
39 class HARDWARE_WIDGETS_API DeploymentModeCombobox : public QCustomComboBox
40 {
41 Q_OBJECT
42 public:
47 explicit DeploymentModeCombobox(QWidget* parent = nullptr);
58 signals:
60 protected slots:
61 void updatedSlot();
63 protected:
68 void fixedHeadingChosen(bool has_calculated_yaw);
73 void roddedModeChosen(bool has_calculated_yaw);
79 void gyroModeChosen(bool use_compass, bool is_free_hanging = false);
80 protected:
91 };
92
95 class HARDWARE_WIDGETS_API DeploymentLengthCombobox : public QCustomComboBox
96 {
97 Q_OBJECT
98 public:
105 static TranslatedString DistanceValueString(fltp08 value, bool show_only_native);
106 public:
111 DeploymentLengthCombobox(QWidget* parent = nullptr);
116 void setLengths(const Buffer<fltp08>& lengths);
126 void setCustomDeploymentSettings(const String& settings);
127 signals:
129 protected:
134 protected:
136 };
137
140 class HARDWARE_WIDGETS_API DeploymentWidget : public QWidget
141 {
142 Q_OBJECT
143 public:
148 explicit DeploymentWidget(QWidget* parent = nullptr);
163 void setupMainButton(Button* button);
168 void setupGyroButton(Button* button);
183 void setIgnoreSounds(bool ignore_sounds);
188 void setDeploymentWidgetEnabled(bool enabled);
203 void setAllowModeSwitch(bool allow);
208 QPalette mainButtonPalette() const;
209#if NDEVR_CALIBRATION
214 Button* calibrationButton();
219 void setAllowEditAlignment(bool allow);
224 void setAllowVerifyAlignment(bool allow);
229 void setAllowNewAlignment(bool allow);
234 void showCalibrationOptionsPopup(PopupInfo info);
235#endif
236 signals:
238 protected slots:
239 void updatedSlot();
241 protected:
247 AlignmentWidget* m_alignment_widget;
249 bool m_is_enabled = true;
250 };
251
252}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A program-defined unit that can be used for some specific task different from a program-wide unit.
void customDeploymentSettingsChangedSignal()
Emitted when custom deployment settings change.
void updateDistanceDropdown()
Updates the distance dropdown to reflect current settings and unit preferences.
void setLengths(const Buffer< fltp08 > &lengths)
Sets the available deployment segment lengths.
String m_custom_deployment_settings
Stores custom deployment configuration settings.
const String & customDeploymentSettings() const
Returns the custom deployment settings string.
static TranslatedString DistanceValueString(fltp08 value, bool show_only_native)
Formats a distance value as a translated string for display.
DeploymentLengthCombobox(QWidget *parent=nullptr)
Constructs a DeploymentLengthCombobox.
void setCustomDeploymentSettings(const String &settings)
Sets the custom deployment settings string.
Provides a list of options for the user to select how to perform a particular Deployment.
uint04 m_compass_mode_index
Index of the compass-only mode in the combobox.
void fixedHeadingChosen(bool has_calculated_yaw)
Configures the sensor for fixed heading deployment mode.
uint04 m_compass_and_gyro_mode_index
Index of the compass and gyro combined mode.
DeploymentModeCombobox(QWidget *parent=nullptr)
Constructs a DeploymentModeCombobox.
uint04 m_gyro_mode_index
Index of the gyro-only mode in the combobox.
void updatedSlot()
Slot called when the sensor state is updated.
uint04 m_free_hanging_index
Index of the free-hanging mode in the combobox.
void roddedModeChosen(bool has_calculated_yaw)
Configures the sensor for rodded deployment mode.
GyroState m_last_gyro_state
The last known gyroscope state from the sensor.
OrientationSensor * m_sensor
The orientation sensor being configured.
uint04 m_mode_count
Total number of available deployment modes.
void optionsChangedSignal()
Emitted when the available deployment mode options change.
bool m_is_showing_calibrate
Whether the calibration option is currently shown.
uint04 m_rodded_mode_index
Index of the rodded mode in the combobox.
void setSensor(OrientationSensor *sensor)
Sets the orientation sensor whose deployment modes will be displayed.
void gyroModeChosen(bool use_compass, bool is_free_hanging=false)
Configures the sensor for gyroscope-based deployment mode.
uint04 m_fixed_mode_index
Index of the fixed heading mode in the combobox.
uint04 modeCount() const
Returns the number of available deployment modes.
void deploymentModeChoosenSlot()
Slot called when the user selects a deployment mode.
A CustomUnit that is used to define the length of a Deployment.
static constexpr StringView DeploymentLengthUnitName()
Returns the name identifier for the deployment length unit.
static DynamicPointer< CustomUnit > DeploymentLengthUnit()
Returns the CustomUnit used for deployment length measurements.
static void SetupDeploymentLengthUnit()
Registers the deployment length unit with the unit system.
QPalette mainButtonPalette() const
Returns the palette currently used by the main deployment button.
void destroyedSlot()
Slot called when the sensor is destroyed.
DeploymentWidget(QWidget *parent=nullptr)
Constructs a DeploymentWidget.
void showMagnetometerOptionsPopup(PopupInfo info)
Displays a popup with magnetometer options.
AlignmentWidget * m_alignment_widget
Widget for alignment configuration.
void setIgnoreSounds(bool ignore_sounds)
Sets whether to suppress deployment-related audio cues.
void setModelManager(QTModelManager *manager)
Sets the model manager used for design object lookups.
void setupMainButton(Button *button)
Registers a button as the main deployment action button.
DeploymentModeCombobox * m_mode_combo
Combobox for deployment mode selection.
Buffer< QPointer< Button > > m_gyro_buttons
Collection of registered gyroscope buttons.
Buffer< QPointer< Button > > m_bubble_level_buttons
Collection of registered bubble level buttons.
Buffer< QPointer< Button > > m_magnetometer_buttons
Collection of registered magnetometer buttons.
void setupBubbleLevelButton(Button *button)
Registers a button for bubble level status and control.
OrientationSensor * m_sensor
The orientation sensor being managed.
void setupMagnetometerButton(Button *button)
Registers a button for magnetometer status and control.
void setSensor(OrientationSensor *sensor)
Sets the orientation sensor to configure for deployment.
void setDeploymentWidgetEnabled(bool enabled)
Enables or disables the deployment widget and its child controls.
void showBubbleLevelPopup(PopupInfo info)
Displays a popup with bubble level options.
void setupGyroButton(Button *button)
Registers a button for gyroscope status and control.
void requestMagnetometerCalibrationSignal()
Emitted when magnetometer calibration is requested.
Buffer< QPointer< Button > > m_main_buttons
Collection of registered main deployment buttons.
void updatedSlot()
Slot called when the sensor state is updated.
void setAllowModeSwitch(bool allow)
Sets whether the user is allowed to switch deployment modes.
bool m_is_enabled
Whether the deployment widget is currently enabled.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Forward declaration for design object lookup service.
QCustomComboBox(QWidget *parent=nullptr)
Constructs a QCustomComboBox with the given parent widget.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Manages all windows and logic surrounding dialogs and views for displaying and managing any environme...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
GyroState
Used by OrientationSensor to display the current state of any available gyro.
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16