3#include <QtCore/QElapsedTimer>
6#include <QtCore/QObject>
7#include <QtCore/QPointer>
8#include <QtCore/QTimer>
9#include <QtCore/QVariantList>
10#include <QtQmlIntegration/QtQmlIntegration>
20class QGCCameraManagerTest;
31 Q_MOC_INCLUDE(
"Joystick.h")
32 Q_MOC_INCLUDE(
"MavlinkCameraControlInterface.h")
40#ifdef QGC_UNITTEST_BUILD
41 friend class QGCCameraManagerTest;
97 int _zoomValueCurrent = 0;
126 void _initialConnectCompleted();
127 void _setCurrentZoomLevel(
int level);
147 QPointer<SimulatedCameraControl> _simulatedCameraControl;
148 QPointer<Joystick> _activeJoystick;
149 bool _vehicleReadyState =
false;
150 int _currentTask = 0;
152 QStringList _cameraLabels;
153 int _currentCameraIndex = 0;
154 QElapsedTimer _lastZoomChange;
155 QElapsedTimer _lastFocusChange;
156 QElapsedTimer _lastCameraChange;
157 QTimer _camerasLostHeartbeatTimer;
158 QMap<QString, CameraStruct*> _cameraInfoRequest;
159 QHash<uint8_t, CameraInfoRequestContext*> _cameraInfoContexts;
160 static QVariantList _cameraList;
161 bool _initialConnectComplete =
false;
163 QHash<int, double> _aspectByCompId;
struct __mavlink_message mavlink_message_t
Abstract base class for all camera controls: real and simulated.
void currentZoomLevelChanged()
void setCurrentCamera(int sel)
void _vehicleReady(bool ready)
void _checkForLostCameras()
const QVariantList & cameraList() const
Q_INVOKABLE void requestCameraFovForComp(int compId)
QmlObjectListModel * cameras()
void cameraLabelsChanged()
MavlinkCameraControlInterface * currentCameraInstance()
QGCVideoStreamInfo * currentStreamInstance()
void _stepZoom(int direction)
void _startZoom(int direction)
void _startVideoRecording()
double aspectForComp(int compId) const
double currentCameraAspect()
QGCVideoStreamInfo * thermalStreamInstance()
Vehicle * vehicle() const
void _toggleVideoRecording()
void _mavlinkMessageReceived(const mavlink_message_t &message)
void currentCameraChanged()
CameraInfoRequestContext * cameraInfoContext(uint8_t compId)
Returns the lazily created, manager-lifetime context for compId.
void _stepFocus(int direction)
CameraStruct * findCameraStruct(uint8_t compId) const
int currentZoomLevel() const
void _stepCamera(int direction)
void _activeJoystickChanged(Joystick *joystick)
const QmlObjectListModel * cameras() const
void _stepStream(int direction)
void _startFocus(int direction)
QStringList cameraLabels() const
void _stopVideoRecording()
int currentCamera() const
Encapsulates the contents of a VIDEO_STREAM_INFORMATION message.
Creates a simulated Camera Control which supports:
QPointer< QGCCameraManager > manager
QElapsedTimer lastHeartbeat
Vehicle * vehicle
Raw pointer is safe: CameraStruct is owned by QGCCameraManager which is a child of Vehicle.
QPointer< QGCCameraManager > manager