swift
cockpitcomform.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_GUI_EDITORS_COCKPITCOMFORM_H
7 #define SWIFT_GUI_EDITORS_COCKPITCOMFORM_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 
12 #include "gui/editors/form.h"
13 #include "gui/swiftguiexport.h"
16 
17 namespace Ui
18 {
19  class CCockpitComForm;
20 }
21 namespace swift::gui::editors
22 {
27  {
28  Q_OBJECT
29 
30  public:
32  explicit CCockpitComForm(QWidget *parent = nullptr);
33 
35  virtual ~CCockpitComForm() override;
36 
38  void setFrequencies(const swift::misc::aviation::CComSystem &com1,
40 
42  void setTransponder(const swift::misc::aviation::CTransponder &transponder);
43 
45  void setTransponderModeStateIdent();
46 
48  void setValue(const swift::misc::simulation::CSimulatedAircraft &aircraft);
49 
51  swift::misc::aviation::CSelcal getSelcal() const;
52 
54  void setSelcal(const swift::misc::aviation::CSelcal &selcal);
55 
58  virtual void setReadOnly(bool readonly) override;
59  virtual void setSelectOnly() override;
60  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
62 
63  signals:
66 
69 
71  void testSelcal();
72 
75 
78 
84 
85  private:
86  bool m_integratedWithSim = false;
87 
89  void initLeds();
90 
92  swift::misc::simulation::CSimulatedAircraft cockpitValuesToAircraftObject();
93 
95  void onGuiChangedCockpitValues();
96 
98  void onSelcalChanged();
99 
101  void alignUiElementsHeight();
102 
104  void updateActiveCOMUnitLEDs(bool integratedWithSim, bool com1T, bool com1R, bool com2T, bool com2R);
105 
107  void updateIntegratedFlagFromSimulatorContext();
108 
110  static bool isFrequenceEqual(double f1, double f2);
111 
112  QScopedPointer<Ui::CCockpitComForm> ui;
113  };
114 } // namespace swift::gui::editors
115 #endif // SWIFT_GUI_EDITORS_COCKPITCOMFORM_H
void transponderStateIdentEnded()
Ident phase ended.
void requestCom2TextMessage()
Request COM text messages.
void requestCom1TextMessage()
Request COM text messages.
void transponderModeChanged(swift::misc::aviation::CTransponder::TransponderMode newMode)
Mode / state has been changed.
void changedCockpitValues(const swift::misc::simulation::CSimulatedAircraft &aircraft)
GUI values changed.
void testSelcal()
Request to test SELCAL.
void changedSelcal(const swift::misc::aviation::CSelcal &selcal)
SELCAL value changed.
Form base class.
Definition: form.h:27
Status messages, e.g. from Core -> GUI.
COM system (aka "radio")
Definition: comsystem.h:37
Value object for SELCAL.
Definition: selcal.h:31
Comprehensive information of an aircraft.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.