swift
Loading...
Searching...
No Matches
aircraftsituationlist.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 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_AIRCRAFTSITUATIONLIST_H
7#define SWIFT_MISC_AVIATION_AIRCRAFTSITUATIONLIST_H
8
9#include <QHash>
10#include <QList>
11#include <QMetaType>
12#include <QPair>
13
16#include "misc/collection.h"
19#include "misc/sequence.h"
22
23SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::aviation, CAircraftSituation, CAircraftSituationList)
24
25namespace swift::misc
26{
27 namespace geo
28 {
29 class CElevationPlane;
30 }
31 namespace aviation
32 {
33 class CAircraftParts;
34
37 public CSequence<CAircraftSituation>,
38 public geo::IGeoObjectList<CAircraftSituation, CAircraftSituationList>,
39 public ITimestampWithOffsetObjectList<CAircraftSituation, CAircraftSituationList>,
40 public ICallsignObjectList<CAircraftSituation, CAircraftSituationList>,
41 public mixin::MetaType<CAircraftSituationList>
42 {
43 public:
46
49
52
55
58
60 CAircraftSituation indexOrNull(int index) const;
61
63 int setGroundElevationChecked(const geo::CElevationPlane &elevationPlane,
64 CAircraftSituation::GndElevationInfo info, qint64 newerThanAdjustedMs = -1);
65
67 int adjustGroundFlag(const CAircraftParts &parts, double timeDeviationFactor = 0.1);
68
71
74 bool containsPushBack() const;
75
78
80 bool isConstOnGround() const;
81
83 bool isConstNotOnGround() const;
84
86 bool isConstDescending(bool alreadySortedLatestFirst = false) const;
87
89 bool isConstAscending(bool alreadySortedLatestFirst = false) const;
90
92 bool isConstAccelerating(bool alreadySortedLatestFirst = false) const;
93
95 bool isConstDecelarating(bool alreadySortedLatestFirst = false) const;
96
98 QPair<bool, COnGroundInfo::IsOnGround> isGndFlagStableChanging(bool alreadySortedLatestFirst = false) const;
99
101 bool isJustTakingOff(bool alreadySortedLatestFirst = false) const;
102
104 bool isJustTouchingDown(bool alreadySortedLatestFirst = false) const;
105
107 bool isRotatingUp(bool alreadySortedLatestFirst = false) const;
108
111
114 const geo::ICoordinateGeodetic &coordinate,
116
118 void setOnGroundInfo(const COnGroundInfo &info);
119
122
125
128
132
135
138
141
144
147
150
155
158 const physical_quantities::CLength &range,
159 int minValues = 1,
160 int sufficientValues = 2) const;
161 };
162
165
168
169 } // namespace aviation
170} // namespace swift::misc
171
176
177#endif // SWIFT_MISC_AVIATION_AIRCRAFTSITUATIONLIST_H
QHash< CCallsign, CAircraftSituation > CAircraftSituationPerCallsign
Situation per callsign.
QHash< CCallsign, CAircraftSituationList > CAircraftSituationListPerCallsign
Situations (list) per callsign.
QPair< CAngle, CAngle > CAnglePair
Pair of angle.
Definition angle.h:115
Generic ordered container with value semantics.
Definition collection.h:113
CSequence()=default
Default constructor.
Value object encapsulating information of aircraft's parts.
Value object encapsulating information of an aircraft's situation.
GndElevationInfo
Where did we get elevation from?
bool isJustTouchingDown(bool alreadySortedLatestFirst=false) const
Is just touching down?
CAircraftSituation findClosestElevationWithinRange(const geo::ICoordinateGeodetic &coordinate, const physical_quantities::CLength &range=geo::CElevationPlane::singlePointRadius()) const
CLosest elevation within given range.
CAircraftSituationList withoutFrontSituation() const
Remove the first situation.
bool isConstAccelerating(bool alreadySortedLatestFirst=false) const
Constantly accelerating?
CAircraftSituationList()=default
Default constructor.
bool isConstNotOnGround() const
Are all situations not on ground?
physical_quantities::CAnglePair pitchStandardDeviationAndMean() const
Pitch angles standard deviation and mean.
QPair< bool, COnGroundInfo::IsOnGround > isGndFlagStableChanging(bool alreadySortedLatestFirst=false) const
Is the ground flag changing for the situations.
int countOnGround(COnGroundInfo::IsOnGround og) const
Count the number of situations with COnGroundInfo::IsOnGround.
CSequence()=default
Default constructor.
QList< double > elevationValues(const physical_quantities::CLengthUnit &unit) const
All elevation values.
QList< double > groundSpeedValues(const physical_quantities::CSpeedUnit &unit) const
All ground speed values.
QList< double > pitchValues(const physical_quantities::CAngleUnit &unit) const
All pitch values.
int setGroundElevationChecked(const geo::CElevationPlane &elevationPlane, CAircraftSituation::GndElevationInfo info, qint64 newerThanAdjustedMs=-1)
Set ground elevation from elevation plane.
geo::CElevationPlane averageElevationOfTaxiingOnGroundAircraft(const CAircraftSituation &reference, const physical_quantities::CLength &range, int minValues=1, int sufficientValues=2) const
Average elevation for "nearby" aircraft "not/slowly moving" and having an elevation.
bool isConstDecelarating(bool alreadySortedLatestFirst=false) const
Constantly decelarating?
CAircraftSituation indexOrNull(int index) const
Index or NULL.
bool isConstDescending(bool alreadySortedLatestFirst=false) const
Constantly descending?
int adjustGroundFlag(const CAircraftParts &parts, double timeDeviationFactor=0.1)
Adjust flag from parts by using CAircraftSituation::adjustGroundFlag.
bool isConstOnGround() const
Are all situations on ground?
int addAltitudeOffset(const physical_quantities::CLength &offset)
Add an offset to each altitude.
bool isRotatingUp(bool alreadySortedLatestFirst=false) const
Is rotating up?
bool isJustTakingOff(bool alreadySortedLatestFirst=false) const
Is just taking off?
int transferElevationForward(const physical_quantities::CLength &radius=geo::CElevationPlane::singlePointRadius())
Transfer elevations forward from older to newer.
void setOnGroundInfo(const COnGroundInfo &info)
Set on ground.
void setOnGroundDetails(COnGroundInfo::OnGroundDetails details)
Set on ground details for all situations.
bool areAllOnGroundDetailsSame(COnGroundInfo::OnGroundDetails details) const
Are all on ground details the same?
bool containsOnGroundDetails(COnGroundInfo::OnGroundDetails details) const
Contains on ground details?
QList< double > altitudeValues(const physical_quantities::CLengthUnit &unit) const
All altitude values.
bool isSortedAdjustedLatestFirstWithoutNullPositions() const
Latest first and no null positions?
bool isConstAscending(bool alreadySortedLatestFirst=false) const
Constantly ascending?
CAircraftSituation backOrNull() const
Back or NULL.
CAircraftSituation frontOrNull() const
Front or NULL.
bool containsPushBack() const
Contains any push back?
physical_quantities::CSpeedPair groundSpeedStandardDeviationAndMean() const
Ground speed standard deviation and mean.
Information about the ground status.
OnGroundDetails
Reliability of on ground information.
Plane of same elevation, can be a single point or larger area (e.g. airport).
static const physical_quantities::CLength & singlePointRadius()
Radius for single point.
Geodetic coordinate, a position in 3D space relative to the reference geoid.
List of objects with geo coordinates.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Specialized class for angles (degrees, radian).
Definition units.h:231
Physical unit length (length).
Definition length.h:18
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
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
Free functions in swift::misc.
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition sequence.h:62
QPair< CSpeed, CSpeed > CSpeedPair
Pair of speeds.
Definition speed.h:32
#define SWIFT_MISC_EXPORT
Export a class or function from the library.