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 generateManualScreenshots();
84
85signals:
88
91
94
97
100
103
106
111 void requestVAC(QString vacName);
112
117 void requestMapBearing(int bearing);
118
119private:
120 Q_DISABLE_COPY_MOVE(DemoRunner)
121
122 QPointer<QQmlApplicationEngine> m_engine;
123
124 void generateScreenshotsForDevices(const QStringList &, bool);
125
126 static void saveScreenshot(bool, QQuickWindow *, const QString&);
127};
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.
DemoRunner(QObject *parent=nullptr)
Creates a new DemoRunner.
void requestOpenRoutePage()
Emitted to indicate that the GUI should open the "Route & Wind" page.
void requestMapBearing(int bearing)
Emitted to indicate that the GUI should set a map bearing.
void setEngine(QQmlApplicationEngine *engine)
Set pointer to QQmlApplicationEngine.
Definition DemoRunner.h:70
void requestOpenWeatherDialog(Weather::Observer *obs)
Emitted to indicate that the GUI should open the "Weather" page.
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.
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