swift
simulatorcomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2014 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_SIMULATORCOMPONENT_H
7 #define SWIFT_GUI_SIMULATORCOMPONENT_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 #include <QString>
12 #include <QTabWidget>
13 #include <QTimer>
14 #include <QtGlobal>
15 
17 #include "gui/swiftguiexport.h"
18 #include "misc/icons.h"
19 #include "misc/logcategories.h"
21 
22 namespace Ui
23 {
24  class CSimulatorComponent;
25 }
26 namespace swift::misc
27 {
28  class CIcon;
29  class CStatusMessageList;
30  namespace simulation
31  {
32  class CSimulatedAircraft;
33  }
34 } // namespace swift::misc
35 namespace swift::gui::components
36 {
39  {
40  Q_OBJECT
41 
42  public:
44  static const QStringList &getLogCategories();
45 
47  explicit CSimulatorComponent(QWidget *parent = nullptr);
48 
50  virtual ~CSimulatorComponent();
51 
53  int rowCount() const;
54 
56  void clear(bool addInternalsAfterwards = false);
57 
59  void update();
60 
61  private:
63  void onSimulatorStatusChanged(int status);
64 
66  void onAddingRemoteModelFailed(const swift::misc::simulation::CSimulatedAircraft &aircraft, bool disabled,
67  bool failover, const swift::misc::CStatusMessage &message);
68 
70  void onSimulatorMessages(const swift::misc::CStatusMessageList &messages);
71 
73  void refreshInternals();
74 
76  int getUpdateIntervalMs() const;
77 
79  void addOrUpdateLiveDataByName(const QString &name, const QString &value, const swift::misc::CIcon &icon);
80 
82  void addOrUpdateLiveDataByName(const QString &name, const QString &value,
84 
86  void removeLiveDataByName(const QString &name);
87 
88  QScopedPointer<Ui::CSimulatorComponent> ui;
89  QTimer m_updateTimer;
91  };
92 } // namespace swift::gui::components
93 
94 #endif // SWIFT_GUI_SIMULATORCOMPONENT_H
Helper class: If a component is residing in an dockable widget. This class provides access to its inf...
Value object for icons. An icon is stored in the global icon repository and identified by its index....
Definition: icon.h:39
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Definition: icons.h:32
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Comprehensive information of an aircraft.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
High level reusable GUI components.
Definition: aboutdialog.cpp:13
Free functions in swift::misc.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.