swift
simulatoremulatedmonitordialog.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_SIMPLUGIN_EMULATED_SIMULATOREMULATEDMONITORDIALOG_H
7 #define SWIFT_SIMPLUGIN_EMULATED_SIMULATOREMULATEDMONITORDIALOG_H
8 
9 #include <QDialog>
10 #include <QScopedPointer>
11 #include <QTimer>
12 
13 #include "misc/identifiable.h"
14 #include "misc/logcategories.h"
17 #include "misc/statusmessagelist.h"
18 
19 namespace Ui
20 {
21  class CSimulatorEmulatedMonitorDialog;
22 }
23 namespace swift::simplugin::emulated
24 {
25  class CSimulatorEmulated;
26 
31  {
32  Q_OBJECT
33 
34  public:
36  static const QStringList &getLogCategories();
37 
39  explicit CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent = nullptr);
40 
42  virtual ~CSimulatorEmulatedMonitorDialog() override;
43 
45  void appendStatusMessageToList(const swift::misc::CStatusMessage &statusMessage);
46 
49 
51  void appendReceivingCall(const QString &function, const QString &p1 = {}, const QString &p2 = {},
52  const QString &p3 = {});
53 
55  void appendSendingCall(const QString &function, const QString &p1 = {}, const QString &p2 = {},
56  const QString &p3 = {});
57 
60 
63 
66 
67  private:
68  static int constexpr MaxLogMessages = 500;
69 
71  void appendFunctionCall(const QString &function, const QString &p1 = {}, const QString &p2 = {},
72  const QString &p3 = {});
73 
75  void onSimulatorValuesChanged();
76 
78  void onSavedComTransmissionValues(swift::misc::aviation::CComSystem::ComUnit unit);
79 
81  void changeComFromUi(const swift::misc::simulation::CSimulatedAircraft &aircraft);
82 
84  void changeSelcalFromUi(const swift::misc::aviation::CSelcal &selcal);
85 
87  void changeSituationFromUi();
88 
90  void changePartsFromUi();
91 
93  void setSimulatorUiValues();
94 
96  void setInternalAircraftUiValues();
97 
99  void timerBasedUiUpdates();
100 
102  void resetStatistics();
103 
105  void interpolatorLogButton();
106 
108  void enableInterpolationLogButtons(bool enable);
109 
111  void emitSignal();
112 
114  void addAutoPublishTestData();
115 
117  bool canUseSimulator() const;
118 
119  QScopedPointer<Ui::CSimulatorEmulatedMonitorDialog> ui;
120  CSimulatorEmulated *m_simulator = nullptr;
121  QTimer m_uiUpdateTimer;
122  };
123 } // namespace swift::simplugin::emulated
124 
125 #endif // SWIFT_SIMPLUGIN_EMULATED_SIMULATOREMULATEDMONITORDIALOG_H
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
Definition: identifiable.h:24
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Value object for SELCAL.
Definition: selcal.h:31
Value object encapsulating information of a text message.
Definition: textmessage.h:31
Comprehensive information of an aircraft.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
CSimulatorEmulatedMonitorDialog(CSimulatorEmulated *simulator, QWidget *parent=nullptr)
Ctor.
void appendStatusMessageToList(const swift::misc::CStatusMessage &statusMessage)
Append status message.
void appendReceivingCall(const QString &function, const QString &p1={}, const QString &p2={}, const QString &p3={})
Receiving call to be written in log widget.
void displayStatusMessage(const swift::misc::CStatusMessage &message)
Display status message.
void updateWindowTitleAndUiValues(const swift::misc::simulation::CSimulatorInfo &info)
The title.
void appendStatusMessagesToList(const swift::misc::CStatusMessageList &statusMessages)
Append status messages.
void appendSendingCall(const QString &function, const QString &p1={}, const QString &p2={}, const QString &p3={})
Sending call to be written in log widget.
void displayTextMessage(const swift::misc::network::CTextMessage &message)
Display text message.