Enroute Flight Navigation
A navigation app for VFR pilots
DemoRunner.h
1/***************************************************************************
2 * Copyright (C) 2021-2025 by Stefan Kebekus *
3 * stefan.kebekus@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21#pragma once
22
23#include <QQmlApplicationEngine>
24#include <QQmlEngine>
25#include <QQuickWindow>
26
27#include "GlobalObject.h"
28#include "weather/Observer.h"
29
30
37
38class DemoRunner : public QObject {
39 Q_OBJECT
40 QML_ELEMENT
41 QML_SINGLETON
42
43public:
50 explicit DemoRunner(QObject *parent = nullptr);
51
52 // No default constructor, important for QML singleton
53 explicit DemoRunner() = delete;
54
55 // Standard destructor
56 ~DemoRunner() override = default;
57
58 // factory function for QML singleton
59 static DemoRunner* create(QQmlEngine* /*unused*/, QJSEngine* /*unused*/)
60 {
62 }
63
70 void setEngine(QQmlApplicationEngine* engine)
71 {
72 m_engine = engine;
73 }
74
75public slots:
76 // Begin to remote-control the app
77 void generateGooglePlayScreenshots();
78
79 // Begin to remote-control the app
80 void generateIosScreenshots();
81
82 // Begin to remote-control the app
83 void generateMacosScreenshots();
84
85 // Begin to remote-control the app
86 void generateManualScreenshots();
87
88signals:
91
94
96 void requestFollowGPS(bool val);
97
99 void requestMapBearing(double bearing);
100
105 void requestMapBearingPolicy(int bearing);
106
109
112
115
118
121
124
127
132 void requestShowSideView(bool show);
133
138 void requestVAC(QString vacName);
139
141 void requestZoomLevel(double newZoom);
142
143private:
144 Q_DISABLE_COPY_MOVE(DemoRunner)
145
146 QPointer<QQmlApplicationEngine> m_engine;
147
148 void generateScreenshotsForDevices(const QStringList &, bool);
149
150 static void saveScreenshot(bool, QQuickWindow *, const QString&);
151};
void requestClosePages()
Emitted to indicate that the GUI return to the main page.
void requestOpenAircraftPage()
Emitted to indicate that the GUI should open the "Aircraft" page.
void requestOpenWeatherPage()
Emitted to indicate that the GUI should open the "Weather" page.
void requestOpenNearbyPage()
Emitted to indicate that the GUI should open the "Nearby" page.
void requestMapBearing(double bearing)
Emitted to set bearing of the moving map.
DemoRunner(QObject *parent=nullptr)
Creates a new DemoRunner.
void requestMapBearingPolicy(int bearing)
Emitted to indicate that the GUI should set a map bearing.
void requestFollowGPS(bool val)
Emitted to set followGPS mode in the moving map.
void requestOpenRoutePage()
Emitted to indicate that the GUI should open the "Route & Wind" page.
void requestZoomLevel(double newZoom)
Emitted to set a zoom level in the moving map.
void setEngine(QQmlApplicationEngine *engine)
Set pointer to QQmlApplicationEngine.
Definition DemoRunner.h:70
void requestCloseWaypointDescription()
Emitted to indicate that the GUI close open the "Waypoint Description" dialog.
void requestOpenWeatherDialog(Weather::Observer *obs)
Emitted to indicate that the GUI should open the "Weather" page.
void requestOpenWaypointDescription(GeoMaps::Waypoint waypoint)
Emitted to indicate that the GUI should open the "Waypoint Description" dialog.
void requestOpenFlightRouteAddWPDialog()
Emitted to indicate that the GUI should open the "Add Waypoint" dialog.
void requestVAC(QString vacName)
Emitted to indicate that the GUI should set a VAC.
void requestShowSideView(bool show)
Emitted to indicate that the GUI should show the aircraft side view.
Waypoint, such as an airfield, a navaid station or a reporting point.
Definition Waypoint.h:41
static Q_INVOKABLE DemoRunner * demoRunner()
Pointer to appplication-wide static DemoRunner instance.
Holds and updates METAR and TAF for a given waypoint.
Definition Observer.h:37