swift
modelmatchercomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2016 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_COMPONENT_MODELMATCHERCOMPONENT_H
7 #define SWIFT_GUI_COMPONENT_MODELMATCHERCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QObject>
11 #include <QPointer>
12 #include <QScopedPointer>
13 
14 #include "core/aircraftmatcher.h"
15 #include "gui/swiftguiexport.h"
17 #include "misc/settingscache.h"
22 
23 namespace Ui
24 {
25  class CModelMatcherComponent;
26 }
27 namespace swift::gui
28 {
29  namespace views
30  {
31  class CAircraftModelView;
32  }
33  namespace components
34  {
35  class CSettingsMatchingDialog;
36 
41  {
42  Q_OBJECT
43 
44  public:
46  explicit CModelMatcherComponent(QWidget *parent = nullptr);
47 
49  virtual ~CModelMatcherComponent() override;
50 
52  void tabIndexChanged(int index);
53 
55  void setWorkbenchView(views::CAircraftModelView *workbenchView);
56 
57  private:
59  void onSimulatorChanged(const swift::misc::simulation::CSimulatorInfo &simulator);
60 
62  void onWorkbenchToggled(bool checked);
63 
65  void onCacheChanged(const swift::misc::simulation::CSimulatorInfo &simulator);
66 
68  void onWebDataRead(swift::misc::network::CEntityFlags::Entity entity,
69  swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url);
70 
72  void displaySettingsDialog();
73 
75  void testModelMatching();
76 
79  void reverseLookup();
80 
82  void redisplay();
83 
85  swift::misc::simulation::CAircraftModelList getModelSetModels() const;
86 
88  int getMatcherModelsCount() const;
89 
91  bool useWorkbench() const;
92 
94  swift::misc::simulation::CSimulatedAircraft createAircraft() const;
95 
97  swift::misc::simulation::CAircraftModel defaultModel() const;
98 
101  matchingScript(const swift::misc::simulation::CAircraftModel &inModel,
105 
106  QScopedPointer<Ui::CModelMatcherComponent> ui;
107  QPointer<views::CAircraftModelView> m_workbenchView;
108  CSettingsMatchingDialog *m_settingsDialog = nullptr;
109  swift::core::CAircraftMatcher m_matcher { this };
111  this
112  };
113  };
114  } // namespace components
115 } // namespace swift::gui
116 
117 #endif // SWIFT_GUI_COMPONENT_MODELMATCHERCOMPONENT_H
Matcher for all models.
Model matcher testing and configuration.
Status messages, e.g. from Core -> GUI.
Aircraft model (used by another pilot, my models on disk)
Definition: aircraftmodel.h:71
Value object encapsulating a list of aircraft models.
Comprehensive information of an aircraft.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.