swift
atcstationcomponent.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_GUI_COMPONENTS_ATCSTATIONCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_ATCSTATIONCOMPONENT_H
8 
9 #include <QDateTime>
10 #include <QFrame>
11 #include <QList>
12 #include <QModelIndex>
13 #include <QObject>
14 #include <QScopedPointer>
15 #include <QString>
16 #include <QTabWidget>
17 #include <QTimer>
18 #include <QVBoxLayout>
19 #include <QtGlobal>
20 
23 #include "gui/swiftguiexport.h"
26 #include "misc/identifiable.h"
28 #include "misc/pq/frequency.h"
29 
30 namespace Ui
31 {
32  class CAtcStationComponent;
33 }
34 namespace swift::misc::aviation
35 {
36  class CCallsign;
37 }
38 namespace swift::gui
39 {
40  class CDockWidgetInfoArea;
41 
42  namespace components
43  {
48  {
49  Q_OBJECT
50 
51  public:
54  enum AtcTab
55  {
56  TabAtcOnline = 0,
57  TabAtcOnlineTree,
58  };
59 
61  explicit CAtcStationComponent(QWidget *parent = nullptr);
62 
64  virtual ~CAtcStationComponent() override;
65 
67  void setTab(AtcTab tab);
68 
70  int countOnlineStations() const;
71 
73  void update();
74 
76  void getMetar(const QString &airportIcaoCode);
77 
79  virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override;
80 
81  signals:
84 
85  private:
87  void atcStationDisconnected(const swift::misc::aviation::CAtcStation &station);
88 
90  void getMetarAsEntered();
91 
93  void requestAtisUpdates();
94 
96  void onOnlineAtcStationSelected(const swift::misc::aviation::CAtcStation &station);
97 
99  void onOnlineAtcStationVariantSelected(const swift::misc::CVariant &object);
100 
102  void triggerOnlineAtcStationSelected(const swift::misc::aviation::CAtcStation &station);
103 
105  void changedAtcStationsOnline();
106 
108  void connectionStatusChanged(const swift::misc::network::CConnectionStatus &from,
110 
112  void testCreateDummyOnlineAtcStations(int number);
113 
115  void requestOnlineStationsUpdate();
116 
118  void infoAreaTabBarChanged(int index);
119 
121  void setOnlineTabs(int count, int filtered);
122 
124  void setComFrequency(const swift::misc::physical_quantities::CFrequency &frequency,
126 
128  void airportsRead();
129 
131  void updateTreeView();
132 
134  void initCompleters();
135 
137  void settingsChanged();
138 
140  bool canAccessContext() const;
141 
143  void clearOnlineViews();
144 
146  void showOverlayInlineTextMessage();
147 
149  void onDetailsToggled(bool checked);
150 
152  QVBoxLayout *vLayout() const;
153 
154  QScopedPointer<Ui::CAtcStationComponent> ui;
155  QTimer m_updateTimer;
156  QList<int> m_splitterSizes;
157  swift::misc::aviation::CCallsign m_selectedCallsign;
158  QDateTime m_timestampLastReadOnlineStations;
159  QDateTime m_timestampOnlineStationsChanged;
161  this, &CAtcStationComponent::settingsChanged
162  };
163  };
164  } // namespace components
165 } // namespace swift::gui
166 #endif // SWIFT_GUI_COMPONENTS_ATCSTATIONCOMPONENT_H
Specialized class for dock widgets serving as info area.
Using this class provides a QFrame with the overlay and dock widget functionality already integrated.
void requestAudioWidget()
Request audio widget.
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
Definition: identifiable.h:24
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Value object encapsulating information about an ATC station.
Definition: atcstation.h:38
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object encapsulating information about a connection status.
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.