NDEVR
API Documentation
OrientationOperationsWidget.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: StationSetupEditor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Editor.h>
34#include <NDEVR/OrientationOperations.h>
35namespace Ui
36{
37 class OrientationOperationsUI;
38}
39namespace NDEVR
40{
41 class Button;
43 class QCustomLineEdit;
49 class NDEVR_API OrientationOperationsWidget : public Editor
50 {
51 Q_OBJECT
52 public:
57 {
58 public:
66 virtual QWidget* createGNSSWidget(UUID gps_name, QCustomLineEdit* orientation_edit, uint01 axis) = 0;
67 };
68
74 OrientationOperationsWidget(uint01 dimension, const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr);
81 OrientationOperationsWidget(uint01 dimension, DesignObjectLookup* lookup, QWidget* parent = nullptr);
84 void init();
85 void updateValues() override;
86 QSize sizeHint() const override;
93 void setIsGeoReference(bool is_geo_reference);
101 void setIsMagneticReference(bool is_magnetic_reference, DesignObjectLookup* lookup);
106 static void SetGNSSCallback(GNSSCallback* callback);
111 static void SetGridMagnetCallback(const std::function<void(Button*)>& function);
128 void setAngle(const Angle<fltp08>& angle);
129 EditorShowMode showMode() const override;
130 virtual bool event(QEvent* event) override;
135 void invert(bool invert_orientation);
136 public slots:
145 signals:
148 protected:
155 bool isPrismModel() const;
168 protected:
169 Ui::OrientationOperationsUI* ui;
171 bool m_is_geo_reference = false;
173 bool m_has_offset = false;
174 bool m_use_model_icon = false;
175 bool m_invert_orientation = false;
176 QWidget* m_orientation_gnss_widget = nullptr;
178 public:
180 static std::function<void(Button*)> s_magnetic_callback;
181 //QTimer* m_prism_timer;
182 };
183}
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Definition Angle.h:83
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Editor(QWidget *parent=nullptr)
Constructs an Editor with no design object target.
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Abstract callback interface for creating GNSS orientation widgets.
virtual QWidget * createGNSSWidget(UUID gps_name, QCustomLineEdit *orientation_edit, uint01 axis)=0
Creates a widget for reading GNSS orientation data.
void onSpecifiedAngleUpdatedSlot()
Slot called when the user manually updates the specified angle.
void updateTitles(OrientationOperations::AzimuthType type)
Updates the UI titles based on the azimuth type.
bool m_is_magnet_reference
Whether editing a magnetic reference orientation.
DesignObjectLookup * m_lookup
The design object lookup for resolving references.
void setAngle(const Angle< fltp08 > &angle)
Sets the orientation angle directly.
void updateOrientationCalcOptionsSlot()
Slot called when the orientation calculation options change.
bool isPrismModel() const
Checks whether the current model is a prism type.
bool m_is_geo_reference
Whether editing a geographic reference orientation.
const uint01 m_dimension
The axis dimension this widget edits.
void updateDialImages()
Updates the dial images to reflect the current orientation angle.
void updateMagneticReferenceSignal(const Angle< fltp08 > &angle)
Emitted when the magnetic reference angle is updated.
void init()
Initializes the UI elements and connects signals.
static void SetGridMagnetCallback(const std::function< void(Button *)> &function)
Sets the global callback for configuring grid/magnetic reference buttons.
OrientationOperationsWidget(uint01 dimension, const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs the orientation operations widget for a specific design object.
DesignObjectLookup * lookup()
Gets the design object lookup used by this widget.
void updateValues() override
Updates the displayed values to reflect the current state of the target object.
static void SetGNSSCallback(GNSSCallback *callback)
Sets the global GNSS callback for creating GNSS orientation widgets.
void setIsGeoReference(bool is_geo_reference)
Sets whether this widget is editing a geographic reference orientation.
OrientationOperationsWidget(uint01 dimension, DesignObjectLookup *lookup, QWidget *parent=nullptr)
Constructs the orientation operations widget using a design object lookup.
bool m_invert_orientation
Whether to display the inverted orientation.
void invert(bool invert_orientation)
Sets whether the displayed orientation should be inverted.
void setIsMagneticReference(bool is_magnetic_reference, DesignObjectLookup *lookup)
Sets whether this widget is editing a magnetic reference orientation.
static std::function< void(Button *)> s_magnetic_callback
Global callback for magnetic reference button setup.
void updateVisibleWidgets()
Updates which sub-widgets are visible based on the current orientation type.
Ui::OrientationOperationsUI * ui
The auto-generated UI form.
bool m_has_offset
Whether an angular offset is applied.
static GNSSCallback * s_gnss_reading_callback
Global callback for creating GNSS widgets.
EditorShowMode showMode() const override
Returns the preferred display mode for this editor.
bool m_use_model_icon
Whether to use the model icon on the dial.
void onCalculatedUpdatedSlot()
Slot called when a calculated orientation value is updated.
void updateComputedPosition()
Recomputes the orientation position from the current inputs.
OrientationOperations operations() const
Gets the current orientation operations configuration.
QWidget * m_orientation_gnss_widget
The GNSS input widget, if applicable.
void updateOrientation(const Matrix< fltp08 > &matrix)
Applies an orientation matrix to the current object.
void onCopyFromExistingSlot()
Slot called when the user copies orientation from an existing object.
void updateRelativeCombos()
Updates the relative reference combo box options.
void setDialToModelIcon()
Sets the dial icon to match the current model icon.
Allows for easy manipulation of a Models orientation.
AzimuthType
Describes the method used to determine the azimuth (or roll/pitch) angle.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
EditorShowMode
Describes how an Editor should be displayed within the application UI.
Definition Editor.h:48
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...