swift
contextownaircraftproxy.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_CORE_CONTEXT_OWNAIRCRAFT_PROXY_H
7 #define SWIFT_CORE_CONTEXT_OWNAIRCRAFT_PROXY_H
8 
9 #include <QString>
10 
12 #include "core/corefacadeconfig.h"
13 #include "core/swiftcoreexport.h"
16 #include "misc/aviation/selcal.h"
18 #include "misc/identifier.h"
19 #include "misc/network/user.h"
20 #include "misc/pq/frequency.h"
22 
23 // clazy:excludeall=const-signal-or-slot
24 
25 class QDBusConnection;
26 
27 namespace swift::misc
28 {
29  class CGenericDBusInterface;
30  namespace aviation
31  {
32  class CAircraftIcaoCode;
33  class CAltitude;
34  class CCallsign;
35  class CTransponder;
36  } // namespace aviation
37 } // namespace swift::misc
38 namespace swift::core
39 {
40  class CCoreFacade;
41  namespace context
42  {
46  {
47  Q_OBJECT
48  friend class IContextOwnAircraft;
49 
50  public:
52  ~CContextOwnAircraftProxy() override = default;
53 
56  static void unitTestRelaySignals();
57 
58  public slots:
60  swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const override;
61 
64  getOwnComSystem(swift::misc::aviation::CComSystem::ComUnit unit) const override;
65 
67  swift::misc::aviation::CTransponder getOwnTransponder() const override;
68 
70  swift::misc::aviation::CAircraftSituation getOwnAircraftSituation() const override;
71 
73  bool updateOwnPosition(const swift::misc::geo::CCoordinateGeodetic &position,
74  const swift::misc::aviation::CAltitude &altitude,
75  const swift::misc::aviation::CAltitude &pressureAltitude) override;
76 
78  bool updateCockpit(const swift::misc::aviation::CComSystem &com1,
80  const swift::misc::aviation::CTransponder &transponder,
81  const swift::misc::CIdentifier &originator) override;
82 
84  bool updateTransponderMode(const swift::misc::aviation::CTransponder::TransponderMode &transponderMode,
85  const swift::misc::CIdentifier &originator) override;
86 
88  bool updateActiveComFrequency(const swift::misc::physical_quantities::CFrequency &frequency,
90  const swift::misc::CIdentifier &originator) override;
91 
93  bool updateOwnAircraftPilot(const swift::misc::network::CUser &pilot) override;
94 
96  bool updateSelcal(const swift::misc::aviation::CSelcal &selcal,
97  const swift::misc::CIdentifier &originator) override;
98 
100  bool updateOwnCallsign(const swift::misc::aviation::CCallsign &callsign) override;
101 
103  bool updateOwnIcaoCodes(const swift::misc::aviation::CAircraftIcaoCode &aircraftIcaoCode,
104  const swift::misc::aviation::CAirlineIcaoCode &airlineIcaoCode) override;
105 
107  void toggleTransponderMode() override;
108 
110  bool setTransponderMode(swift::misc::aviation::CTransponder::TransponderMode mode) override;
111 
113  bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator) override;
114 
115  protected:
118  : IContextOwnAircraft(mode, runtime), m_dBusInterface(nullptr)
119  {}
120 
122  CContextOwnAircraftProxy(const QString &serviceName, QDBusConnection &connection,
124 
125  private:
126  swift::misc::CGenericDBusInterface *m_dBusInterface;
127 
129  void relaySignals(const QString &serviceName, QDBusConnection &connection);
130  };
131  } // namespace context
132 } // namespace swift::core
133 #endif // SWIFT_CORE_CONTEXT_OWNAIRCRAFT_PROXY_H
ContextMode
How to handle a given context.
The class providing facades (the contexts) for all DBus relevant operations.
Definition: corefacade.h:57
CContextOwnAircraftProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
Constructor.
Used for hand written interface based on virtual methods.
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition: identifier.h:29
Value object for ICAO classification.
Value object encapsulating information of an aircraft's situation.
Value object for ICAO classification.
Altitude as used in aviation, can be AGL or MSL altitude.
Definition: altitude.h:52
Value object encapsulating information of a callsign.
Definition: callsign.h:30
COM system (aka "radio")
Definition: comsystem.h:37
Value object for SELCAL.
Definition: selcal.h:31
Value object encapsulating information of a user.
Definition: user.h:28
Comprehensive information of an aircraft.
Backend services of the swift project, like dealing with the network or the simulators.
Definition: actionbind.cpp:7
Free functions in swift::misc.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.