Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
airportswidget.h
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // airportswidget.h
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 #ifndef AIRPORTSWIDGET_H
10 #define AIRPORTSWIDGET_H
11 
12 #include <QtCore/QDirIterator>
13 #include <QtCore/QStringList>
14 #include <QtCore/QHash>
15 
16 #include <QWidget>
17 #include <QButtonGroup>
18 #include <QRadioButton>
19 #include <QPushButton>
20 #include <QProgressBar>
21 #include <QStatusBar>
22 #include <QRadioButton>
23 #include <QToolButton>
24 #include <QTabWidget>
25 
26 
27 #include <QStandardItemModel>
28 #include <QSortFilterProxyModel>
29 #include <QTreeView>
30 #include <QTreeWidget>
31 
32 #include "xwidgets/xgroupboxes.h"
33 
34 #include "xobjects/mainobject.h"
35 class MainObject;
36 
37 #include "map/openlayerwidget.h"
38 class OpenLayerWidget;
39 
40 #include "airports/metarwidget.h"
41 class MetarWidget;
42 
43 #include "utilities/workThread.h" // class workThread
44 #include "utilities/loadAptDat.h" // class loadAptDat
45 
46 class AirportsWidget : public QWidget
47 {
48 Q_OBJECT
49 public:
50 
52  CA_CODE = 0,
53  CA_NAME = 1,
54  CA_DIR = 2
55  };
56 
58  CI_NODE = 0,
59  CI_LABEL = 1,
60  CI_TYPE = 2,
62  CI_WIDTH = 4,
63  CI_LENGTH = 5,
64  CI_LAT = 6,
65  CI_LON = 7,
68  //CI_HDG = 10
69  };
70 
75  };
76 
77  explicit AirportsWidget(MainObject *mOb, QWidget *parent = 0);
79 
81 
82 
83  QTabWidget *tabWidget;
86 
89 
90  QButtonGroup *buttonGroupFilter;
91  QLineEdit *txtAirportsFilter;
92 
95  QTreeView *treeAirports;
96 
97  QPushButton *buttonRefreshTree;
98  QStatusBar *statusBarAirports;
101 
102  QTreeWidget *treeAptInfo;
103  QStatusBar *statusBarAirportInfo;
104 
105 
106  void scan_airports_xml();
107  void show_progress(bool state);
108 
109  void load_airports_tree();
110 
111  void load_info_tree(QString airport_dir, QString airport_code);
112  void load_tower_node(QString airport_dir, QString airport_code);
113  int load_runways_node(QString airport_dir, QString airport_code);
114  int load_parking_node(QString airport_dir, QString airport_code);
115 
116 
117  QLineEdit *txtLat;
118  QLineEdit *txtLon;
119  QLineEdit *txtVOR;
120  QLineEdit *txtNDB;
121  QLineEdit *txtFIX;
122  QLineEdit *txtOffset;
123  QLineEdit *txtAltitude;
124  QLineEdit *txtHeading;
125 
126  QString validate();
127 
128  QString current_airport();
129 
130  workThread *apt_dat_loader;
131  PLOADITEM ploadItem;
132  loadAptDat *pAptDat;
133 
134 signals:
135 
136  void setx(QString option, bool enabled, QString value);
137  void set_ena(QString option, bool enabled);
138 
139 public slots:
140 
141  void on_map_double_clicked(QString lat, QString lon, QString heading);
142 
143  void initialize();
144 
146 
147  void on_airport_tree_selected(QModelIndex currentIdx, QModelIndex previousIdx);
149 
152  void on_show_metar();
153 
154  void on_reload_cache();
155 
156  //void on_tab_changed();
157 
158  void on_coordinates_changed();
159 
160  void on_upx( QString option, bool enabled, QString value);
161 
162  void on_loadaptdat_done(); // fired when the apt.dat[.gz] thread load completes
163 
164  void on_debug_mode();
165 
166  void on_view_airports_cache();
167 
168 };
169 
170 #endif // AIRPORTSWIDGET_H
QPushButton * buttonRefreshTree
void on_open_airports_folder()
A QGroupBox with a QVBoxLyout layout.
Definition: xgroupboxes.h:19
XGroupVBox * groupBoxUseCoordinates
int load_parking_node(QString airport_dir, QString airport_code)
int load_runways_node(QString airport_dir, QString airport_code)
QSortFilterProxyModel * proxyModel
void on_airport_info_double_clicked(QTreeWidgetItem *, int)
QLineEdit * txtVOR
MainObject * mainObject
QTreeWidget * treeAptInfo
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
QTreeView * treeAirports
QLineEdit * txtLat
void set_ena(QString option, bool enabled)
void on_update_airports_filter()
void on_view_airports_cache()
QString current_airport()
AirportsWidget(MainObject *mOb, QWidget *parent=0)
OpenLayerWidget * mapWidget
void setx(QString option, bool enabled, QString value)
workThread * apt_dat_loader
QLabel * labelAirportsFolder
QLineEdit * txtLon
QLineEdit * txtAltitude
QButtonGroup * buttonGroupFilter
void load_tower_node(QString airport_dir, QString airport_code)
QStatusBar * statusBarAirports
XGroupVBox * groupBoxAirport
void on_coordinates_changed()
void on_map_double_clicked(QString lat, QString lon, QString heading)
QLineEdit * txtFIX
void on_upx(QString option, bool enabled, QString value)
void scan_airports_xml()
QStandardItemModel * model
void on_airport_tree_selected(QModelIndex currentIdx, QModelIndex previousIdx)
QStatusBar * statusBarAirportInfo
void on_airport_info_selection_changed()
void load_info_tree(QString airport_dir, QString airport_code)
QTabWidget * tabWidget
loadAptDat * pAptDat
QLineEdit * txtOffset
QToolButton * buttonOpenAirportsFolder
void show_progress(bool state)
QLineEdit * txtNDB
PLOADITEM ploadItem
QLineEdit * txtAirportsFilter
MetarWidget * metarWidget
QLineEdit * txtHeading