QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
JoystickComponent.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4
5#include "VehicleComponent.h"
6
7Q_DECLARE_LOGGING_CATEGORY(JoystickComponentLog)
8
9class Joystick;
10
12{
13 Q_OBJECT
14 Q_MOC_INCLUDE("Joystick.h")
15
16 Q_PROPERTY(Joystick *activeJoystick READ activeJoystick NOTIFY activeJoystickChanged)
17 Q_PROPERTY(QString joystickStatusText READ joystickStatusText NOTIFY joystickStatusChanged)
18 Q_PROPERTY(QString joystickFeaturesText READ joystickFeaturesText NOTIFY activeJoystickChanged)
19 Q_PROPERTY(bool hasActiveJoystick READ hasActiveJoystick NOTIFY activeJoystickChanged)
20
21public:
22 explicit JoystickComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent = nullptr);
23 ~JoystickComponent() override;
24
25 QStringList setupCompleteChangedTriggerList() const final { return QStringList(); }
26 QString name() const final { return _name; }
27 QString description() const final;
28 QString iconResource() const final { return QStringLiteral("/qmlimages/Joystick.png"); }
29 bool requiresSetup() const final { return false; }
30 bool setupComplete() const final;
31 QUrl setupSource() const final;
32 QUrl summaryQmlSource() const final;
33
34 Joystick *activeJoystick() const { return _activeJoystick; }
35 bool hasActiveJoystick() const { return _activeJoystick != nullptr; }
36 QString joystickStatusText() const;
37 QString joystickFeaturesText() const;
38
39signals:
42
43private slots:
44 void _activeJoystickChanged(Joystick *joystick);
45 void _joystickCalibrationChanged();
46 void _joystickBatteryChanged();
47
48private:
49 const QString _name;
50 Joystick *_activeJoystick = nullptr;
51};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void joystickStatusChanged()
void activeJoystickChanged()