swift
Loading...
Searching...
No Matches
simulatedaircraftlist.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_SIMULATION_SIMULATEDNAIRCRAFTLIST_H
7#define SWIFT_MISC_SIMULATION_SIMULATEDNAIRCRAFTLIST_H
8
9#include <QMetaType>
10
13#include "misc/collection.h"
16#include "misc/sequence.h"
19
20SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::simulation, CSimulatedAircraft, CSimulatedAircraftList)
21
22namespace swift::misc
23{
24 namespace aviation
25 {
26 class CAircraftParts;
27 class CCallsign;
28 } // namespace aviation
29 namespace simulation
30 {
31 class CAircraftModel;
33 } // namespace simulation
34 namespace simulation
35 {
38 public CSequence<CSimulatedAircraft>,
39 public aviation::ICallsignObjectList<CSimulatedAircraft, CSimulatedAircraftList>,
40 public geo::IGeoObjectWithRelativePositionList<CSimulatedAircraft, CSimulatedAircraftList>,
41 public mixin::MetaType<CSimulatedAircraftList>
42 {
43 public:
46
49
52
55
58
60 Q_REQUIRED_RESULT CSimulatedAircraftList findByEnabled(bool enabled) const;
61
63 Q_REQUIRED_RESULT CSimulatedAircraftList findByRendered(bool rendered) const;
64
66 CSimulatedAircraftList findByVtol(bool vtol) const;
67
70
73 bool updateWithVatsimDataFileData(CSimulatedAircraft &aircraftToBeUpdated) const;
74
77
79 int setRendered(const aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
80
82 int setCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg,
83 bool onlyFirst = true);
84
86 int setEnabled(const aviation::CCallsign &callsign, bool enabled, bool onlyFirst);
87
89 int setFastPositionUpdates(const aviation::CCallsign &callsign, bool fastPositions, bool onlyFirst = true);
90
92 int setAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model,
93 bool onlyFirst = true);
94
97 bool onlyFirst = true);
98
100 int setAircraftSituation(const aviation::CCallsign &callsign, const aviation::CAircraftSituation &situation,
101 bool onlyFirst = true);
102
104 int setGroundElevationChecked(const aviation::CCallsign &callsign, const geo::CElevationPlane &elevation,
105 aviation::CAircraftSituation::GndElevationInfo info, bool onlyFirst = true);
106
108 bool isEnabled(const aviation::CCallsign &callsign) const;
109
111 bool isRendered(const aviation::CCallsign &callsign) const;
112
114 bool replaceOrAddByCallsign(const CSimulatedAircraft &aircraft);
115
117 int countEnabled() const;
118
120 int countRendered() const;
121
124
127 };
128
131
132 } // namespace simulation
133} // namespace swift::misc
134
138
139#endif // SWIFT_MISC_SIMULATION_SIMULATEDNAIRCRAFTLIST_H
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?
Value object encapsulating information of a callsign.
Definition callsign.h:30
Value object for a set of callsigns.
Definition callsignset.h:26
Plane of same elevation, can be a single point or larger area (e.g. airport).
List of objects with geo coordinates.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Value object encapsulating a list of voice rooms.
Definition userlist.h:26
Physical unit length (length).
Definition length.h:18
Aircraft model (used by another pilot, my models on disk).
Value object encapsulating a list of aircraft models.
Comprehensive information of an aircraft.
Value object encapsulating a list of aircraft.
int countRendered() const
Number of rendered aircraft.
bool updateWithVatsimDataFileData(CSimulatedAircraft &aircraftToBeUpdated) const
Update aircraft with data from VATSIM data file.
int setAircraftSituation(const aviation::CCallsign &callsign, const aviation::CAircraftSituation &situation, bool onlyFirst=true)
Set aircraft situation.
network::CUserList getPilots() const
All pilots (with valid data).
CSequence()=default
Default constructor.
int setCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg, bool onlyFirst=true)
Set center of gravity.
CSimulatedAircraftList()=default
Default constructor.
Q_REQUIRED_RESULT CSimulatedAircraftList findByRendered(bool rendered) const
Rendered / not rendered aircraft.
int setAircraftPartsSynchronized(const aviation::CCallsign &callsign, const aviation::CAircraftParts &parts, bool onlyFirst=true)
Set aircraft parts and mark as synchronized.
int countEnabled() const
Number of enabled aircraft.
aviation::CCallsignSet getCallsignsWithSynchronizedParts() const
Callsigns of aircraft with synchronized parts.
Q_REQUIRED_RESULT CSimulatedAircraftList findByEnabled(bool enabled) const
Enabled / disabled aircraft.
bool replaceOrAddByCallsign(const CSimulatedAircraft &aircraft)
Replace or add by callsign.
int setEnabled(const aviation::CCallsign &callsign, bool enabled, bool onlyFirst)
Mark given callsign as enabled.
bool isRendered(const aviation::CCallsign &callsign) const
Rendered?
CAircraftModelList getModels() const
Get all models.
bool isEnabled(const aviation::CCallsign &callsign) const
Enabled?
void sortByDistanceToReferencePositionRenderedCallsign()
Same as sortByDistanceToReferencePosition, but consider callsign and rendered as secondary criteria.
int setAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model, bool onlyFirst=true)
Set model.
CSimulatedAircraftList findByVtol(bool vtol) const
VTOL / non VTOL aircraft.
int countAircraftPartsSynchronized() const
Number of aircraft with parts.
int setFastPositionUpdates(const aviation::CCallsign &callsign, bool fastPositions, bool onlyFirst=true)
Mark as fast position enabled.
int setGroundElevationChecked(const aviation::CCallsign &callsign, const geo::CElevationPlane &elevation, aviation::CAircraftSituation::GndElevationInfo info, bool onlyFirst=true)
Set ground elevation.
void markAllAsNotRendered()
Mark all aircraft as unrendered.
int setRendered(const aviation::CCallsign &callsign, bool rendered, bool onlyFirst=true)
Mark given callsign as rendered.
#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
QHash< aviation::CCallsign, CSimulatedAircraft > CSimulatedAircraftPerCallsign
Aircraft per callsign.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.