swift
Loading...
Searching...
No Matches
aircraftvelocity.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2021 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_AVIATION_AIRCRAFTVELOCITY_H
7#define SWIFT_MISC_AVIATION_AIRCRAFTVELOCITY_H
8
9#include "misc/metaclass.h"
10#include "misc/pq/angle.h"
11#include "misc/pq/speed.h"
12#include "misc/pq/time.h"
15#include "misc/valueobject.h"
16
17SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::aviation, CAircraftVelocity)
18
19namespace swift::misc::aviation
20{
22 class SWIFT_MISC_EXPORT CAircraftVelocity : public CValueObject<CAircraftVelocity>
23 {
24 public:
27 {
28 IndexVelocityX = CPropertyIndexRef::GlobalIndexCAircraftVelocity,
29 IndexVelocityY,
30 IndexVelocityZ,
31 IndexPitchVelocity,
32 IndexRollVelocity,
33 IndexHeadingVelocity
34 };
35
37 CAircraftVelocity() = default;
38
40 CAircraftVelocity(double x, double y, double z, physical_quantities::CSpeedUnit xyzUnit, double pitch,
41 double roll, double heading, physical_quantities::CAngleUnit pbhAngleUnit,
43
46 void setLinearVelocity(double x, double y, double z, physical_quantities::CSpeedUnit xyzUnit);
47 void setAngularVelocity(double pitch, double roll, double heading, physical_quantities::CAngleUnit pbhAngleUnit,
50
57 physical_quantities::CTimeUnit timeUnit) const;
59 physical_quantities::CTimeUnit timeUnit) const;
61 physical_quantities::CTimeUnit timeUnit) const;
63
65 QString convertToQString(bool i18n = false) const;
66
69
71 void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
72
74 int comparePropertyByIndex(CPropertyIndexRef index, const CAircraftVelocity &compareValue) const;
75
81 c_pbhAngleUnit; // TODO Create a dedicated PQ class for angular velocity
84
85 private:
86 double m_x = 0;
87 double m_y = 0;
88 double m_z = 0;
89 double m_pitch = 0;
90 double m_roll = 0;
91 double m_heading = 0;
92
98 SWIFT_METAMEMBER(pitch),
99 SWIFT_METAMEMBER(roll),
100 SWIFT_METAMEMBER(heading));
101 };
102} // namespace swift::misc::aviation
103
105
106#endif // SWIFT_MISC_AVIATION_AIRCRAFTVELOCITY_H
Non-owning reference to a CPropertyIndex with a subset of its features.
Velocity and angular velocity for 6DOF bodies.
void setAngularVelocity(double pitch, double roll, double heading, physical_quantities::CAngleUnit pbhAngleUnit, physical_quantities::CTimeUnit pbhTimeUnit)
Setter.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
double getHeadingVelocity(physical_quantities::CAngleUnit angleUnit, physical_quantities::CTimeUnit timeUnit) const
Getter.
double getRollVelocity(physical_quantities::CAngleUnit angleUnit, physical_quantities::CTimeUnit timeUnit) const
Getter.
static const physical_quantities::CLengthUnit c_xyzLengthUnit
Unit constants.
int comparePropertyByIndex(CPropertyIndexRef index, const CAircraftVelocity &compareValue) const
Compare for index.
double getPitchVelocity(physical_quantities::CAngleUnit angleUnit, physical_quantities::CTimeUnit timeUnit) const
Getter.
double getVelocityZ(physical_quantities::CSpeedUnit unit) const
Getter.
CAircraftVelocity()=default
Default constructor.
void setLinearVelocity(double x, double y, double z, physical_quantities::CSpeedUnit xyzUnit)
Setter.
static const physical_quantities::CSpeedUnit c_xyzSpeedUnit
Unit constants.
double getVelocityX(physical_quantities::CSpeedUnit unit) const
Getter.
static const physical_quantities::CAngleUnit c_pbhAngleUnit
Unit constants.
QString convertToQString(bool i18n=false) const
Cast as QString.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
double getVelocityY(physical_quantities::CSpeedUnit unit) const
Getter.
static const physical_quantities::CTimeUnit c_timeUnit
Unit constants.
Specialized class for angles (degrees, radian).
Definition units.h:231
Specialized class for distance units (meter, foot, nautical miles).
Definition units.h:95
Specialized class for speed units (m/s, ft/s, NM/h).
Definition units.h:764
Specialized class for time units (ms, hour, min).
Definition units.h:893
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition metaclass.h:72
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition metaclass.h:52
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...
Definition valueobject.h:65