swift
cockpittranspondermodeledscomponent.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_COCKPITTRANSPONDERMODELEDSCOMPONENT_H
7 #define SWIFT_MISC_COCKPITTRANSPONDERMODELEDSCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QObject>
11 #include <QScopedPointer>
12 
13 #include "gui/led.h"
14 #include "gui/swiftguiexport.h"
16 #include "misc/identifiable.h"
17 #include "misc/identifier.h"
19 
20 namespace swift::gui::components
21 {
24  {
25  Q_OBJECT
26 
27  public:
29  explicit CCockpitTransponderModeLedsComponent(QWidget *parent = nullptr);
30 
32  void setMode(swift::misc::aviation::CTransponder::TransponderMode mode, bool force = false);
33 
34  private:
35  static constexpr int LedWidth = 14;
36 
38  void onAircraftCockpitChanged(const swift::misc::simulation::CSimulatedAircraft &aircraft,
39  const swift::misc::CIdentifier &originator);
40 
42  void onLedClicked();
43 
45  void init(bool horizontal);
46 
48  swift::misc::aviation::CTransponder getOwnTransponder() const;
49 
51  swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const;
52 
54  QScopedPointer<swift::gui::CLedWidget> m_ledStandby;
55  QScopedPointer<swift::gui::CLedWidget> m_ledModes;
56  QScopedPointer<swift::gui::CLedWidget> m_ledIdent;
57  };
58 } // namespace swift::gui::components
59 
60 #endif // SWIFT_MISC_COCKPITTRANSPONDERMODELEDSCOMPONENT_H
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
Definition: identifiable.h:24
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition: identifier.h:29
@ StateStandby
not a real mode, more a state
Definition: transponder.h:33
Comprehensive information of an aircraft.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.