swift
Loading...
Searching...
No Matches
windlayer.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2015 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_WEATHER_WINDLAYER_H
7#define SWIFT_MISC_WEATHER_WINDLAYER_H
8
9#include <QMetaType>
10#include <QString>
11
13#include "misc/metaclass.h"
14#include "misc/pq/angle.h"
15#include "misc/pq/speed.h"
18#include "misc/valueobject.h"
19
20SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::weather, CWindLayer)
21
22namespace swift::misc::weather
23{
27 class SWIFT_MISC_EXPORT CWindLayer : public CValueObject<CWindLayer>
28 {
29 public:
32 {
33 IndexLevel = swift::misc::CPropertyIndexRef::GlobalIndexCWindLayer,
34 IndexDirection,
35 IndexDirectionVariable,
36 IndexSpeed,
37 IndexGustSpeed
38 };
39
41 CWindLayer() = default;
42
45 const physical_quantities::CSpeed &speed, const physical_quantities::CSpeed &gustSpeed);
46
48 void setLevel(const swift::misc::aviation::CAltitude &level) { m_level = level; }
49
51 swift::misc::aviation::CAltitude getLevel() const { return m_level; }
52
54 void setDirection(const physical_quantities::CAngle &main) { m_directionMain = main; }
55
59 {
60 m_directionFrom = from;
61 m_directionTo = to;
62 }
63
67 {
68 m_directionMain = main;
69 m_directionFrom = from;
70 m_directionTo = to;
71 }
72
74 physical_quantities::CAngle getDirection() const { return m_directionMain; }
75
77 physical_quantities::CAngle getDirectionFrom() const { return m_directionFrom; }
78
80 physical_quantities::CAngle getDirectionTo() const { return m_directionTo; }
81
83 void setDirectionVariable(bool variable = true) { m_directionVariable = variable; }
84
86 bool isDirectionVariable() const { return m_directionVariable; }
87
89 void setSpeed(const physical_quantities::CSpeed &speed) { m_speed = speed; }
90
92 physical_quantities::CSpeed getSpeed() const { return m_speed; }
93
95 void setGustSpeed(const physical_quantities::CSpeed &gustSpeed) { m_gustSpeed = gustSpeed; }
96
98 physical_quantities::CSpeed getGustSpeed() const { return m_gustSpeed; }
99
101 QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const;
102
104 void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant);
105
107 QString convertToQString(bool i18n = false) const;
108
109 private:
111 physical_quantities::CAngle m_directionMain;
112 physical_quantities::CAngle m_directionFrom;
113 physical_quantities::CAngle m_directionTo;
114 bool m_directionVariable = false;
116 physical_quantities::CSpeed m_gustSpeed;
117
120 SWIFT_METAMEMBER(level),
121 SWIFT_METAMEMBER(directionMain),
122 SWIFT_METAMEMBER(directionFrom),
123 SWIFT_METAMEMBER(directionTo),
124 SWIFT_METAMEMBER(directionVariable),
125 SWIFT_METAMEMBER(speed),
126 SWIFT_METAMEMBER(gustSpeed));
127 };
128
129} // namespace swift::misc::weather
130
131Q_DECLARE_METATYPE(swift::misc::weather::CWindLayer)
132
133#endif // SWIFT_MISC_WEATHER_WINDLAYER_H
Non-owning reference to a CPropertyIndex with a subset of its features.
Altitude as used in aviation, can be AGL or MSL altitude.
Definition altitude.h:52
Physical unit angle (radians, degrees).
Definition angle.h:23
Value object for a wind layer.
Definition windlayer.h:28
void setDirection(const physical_quantities::CAngle &main)
Set direction.
Definition windlayer.h:54
physical_quantities::CSpeed getGustSpeed() const
Get weather phenomenas.
Definition windlayer.h:98
CWindLayer()=default
Default constructor.
ColumnIndex
Properties by index.
Definition windlayer.h:32
physical_quantities::CAngle getDirectionTo() const
Get direction to.
Definition windlayer.h:80
void setGustSpeed(const physical_quantities::CSpeed &gustSpeed)
Set gust speed.
Definition windlayer.h:95
void setDirectionVariable(bool variable=true)
Set direction to variable.
Definition windlayer.h:83
swift::misc::aviation::CAltitude getLevel() const
Get level.
Definition windlayer.h:51
void setDirection(const physical_quantities::CAngle &from, const physical_quantities::CAngle &to)
Set direction Main direction will not be modified.
Definition windlayer.h:58
void setDirection(const physical_quantities::CAngle &main, const physical_quantities::CAngle &from, const physical_quantities::CAngle &to)
Set direction.
Definition windlayer.h:65
void setLevel(const swift::misc::aviation::CAltitude &level)
Set level.
Definition windlayer.h:48
physical_quantities::CSpeed getSpeed() const
Get descriptor.
Definition windlayer.h:92
void setSpeed(const physical_quantities::CSpeed &speed)
Set speed.
Definition windlayer.h:89
physical_quantities::CAngle getDirectionFrom() const
Get direction from.
Definition windlayer.h:77
physical_quantities::CAngle getDirection() const
Get direction.
Definition windlayer.h:74
bool isDirectionVariable() const
Is direction variable?
Definition windlayer.h:86
#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