QGCCameraControl.h 22.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*!
 * @file
 *   @brief Camera Controller
 *   @author Gus Grubba <mavlink@grubba.com>
 *
 */

#pragma once

#include "QGCApplication.h"
#include <QLoggingCategory>

class QDomNode;
class QDomNodeList;
class QGCCameraParamIO;

Q_DECLARE_LOGGING_CATEGORY(CameraControlLog)
18
Q_DECLARE_LOGGING_CATEGORY(CameraControlVerboseLog)
19

20 21 22 23 24 25 26 27
//-----------------------------------------------------------------------------
class QGCVideoStreamInfo : public QObject
{
    Q_OBJECT
public:
    QGCVideoStreamInfo(QObject* parent, const mavlink_video_stream_information_t* si);

    Q_PROPERTY(QString      uri                 READ uri                NOTIFY infoChanged)
Gus Grubba's avatar
Gus Grubba committed
28
    Q_PROPERTY(QString      name                READ name               NOTIFY infoChanged)
29 30 31 32 33 34
    Q_PROPERTY(int          streamID            READ streamID           NOTIFY infoChanged)
    Q_PROPERTY(int          type                READ type               NOTIFY infoChanged)
    Q_PROPERTY(qreal        aspectRatio         READ aspectRatio        NOTIFY infoChanged)
    Q_PROPERTY(qreal        hfov                READ hfov               NOTIFY infoChanged)
    Q_PROPERTY(bool         isThermal           READ isThermal          NOTIFY infoChanged)

Gus Grubba's avatar
Gus Grubba committed
35 36
    QString uri             () { return QString(_streamInfo.uri);  }
    QString name            () { return QString(_streamInfo.name); }
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    qreal   aspectRatio     ();
    qreal   hfov            () { return _streamInfo.hfov; }
    int     type            () { return _streamInfo.type; }
    int     streamID        () { return _streamInfo.stream_id; }
    bool    isThermal       () { return _streamInfo.flags & VIDEO_STREAM_STATUS_FLAGS_THERMAL; }

    bool    update          (const mavlink_video_stream_status_t* vs);

signals:
    void    infoChanged     ();

private:
    mavlink_video_stream_information_t _streamInfo;
};

52 53 54 55
//-----------------------------------------------------------------------------
class QGCCameraOptionExclusion : public QObject
{
public:
Gus Grubba's avatar
Gus Grubba committed
56
    QGCCameraOptionExclusion(QObject* parent, QString param_, QString value_, QStringList exclusions_);
57 58 59 60 61 62 63 64 65
    QString param;
    QString value;
    QStringList exclusions;
};

//-----------------------------------------------------------------------------
class QGCCameraOptionRange : public QObject
{
public:
Gus Grubba's avatar
Gus Grubba committed
66
    QGCCameraOptionRange(QObject* parent, QString param_, QString value_, QString targetParam_, QString condition_, QStringList optNames_, QStringList optValues_);
67 68 69 70 71 72 73 74 75 76 77 78 79
    QString param;
    QString value;
    QString targetParam;
    QString condition;
    QStringList  optNames;
    QStringList  optValues;
    QVariantList optVariants;
};

//-----------------------------------------------------------------------------
class QGCCameraControl : public FactGroup
{
    Q_OBJECT
80
    friend class QGCCameraParamIO;
81
public:
Gus Grubba's avatar
Gus Grubba committed
82
    QGCCameraControl(const mavlink_camera_information_t* info, Vehicle* vehicle, int compID, QObject* parent = nullptr);
Gus Grubba's avatar
Gus Grubba committed
83
    virtual ~QGCCameraControl();
84 85 86

    //-- cam_mode
    enum CameraMode {
87
        CAM_MODE_UNDEFINED = -1,
88 89 90
        CAM_MODE_PHOTO  = 0,
        CAM_MODE_VIDEO  = 1,
        CAM_MODE_SURVEY = 2,
91 92
    };

Gus Grubba's avatar
Gus Grubba committed
93 94 95 96
    //-- Video Capture Status
    enum VideoStatus {
        VIDEO_CAPTURE_STATUS_STOPPED = 0,
        VIDEO_CAPTURE_STATUS_RUNNING,
97 98 99 100 101 102 103 104 105 106 107 108
        VIDEO_CAPTURE_STATUS_LAST,
        VIDEO_CAPTURE_STATUS_UNDEFINED = 255
    };

    //-- Photo Capture Status
    enum PhotoStatus {
        PHOTO_CAPTURE_IDLE = 0,
        PHOTO_CAPTURE_IN_PROGRESS,
        PHOTO_CAPTURE_INTERVAL_IDLE,
        PHOTO_CAPTURE_INTERVAL_IN_PROGRESS,
        PHOTO_CAPTURE_LAST,
        PHOTO_CAPTURE_STATUS_UNDEFINED = 255
Gus Grubba's avatar
Gus Grubba committed
109 110
    };

111 112 113 114 115 116
    //-- Photo Capture Modes
    enum PhotoMode {
        PHOTO_CAPTURE_SINGLE = 0,
        PHOTO_CAPTURE_TIMELAPSE,
    };

117 118 119 120 121 122 123 124
    //-- Storage Status
    enum StorageStatus {
        STORAGE_EMPTY = STORAGE_STATUS_EMPTY,
        STORAGE_UNFORMATTED = STORAGE_STATUS_UNFORMATTED,
        STORAGE_READY = STORAGE_STATUS_READY,
        STORAGE_NOT_SUPPORTED = STORAGE_STATUS_NOT_SUPPORTED
    };

125 126 127 128 129 130 131
    enum ThermalViewMode {
        THERMAL_OFF = 0,
        THERMAL_BLEND,
        THERMAL_FULL,
        THERMAL_PIP,
    };

132 133 134 135
    Q_ENUM(CameraMode)
    Q_ENUM(VideoStatus)
    Q_ENUM(PhotoStatus)
    Q_ENUM(PhotoMode)
136
    Q_ENUM(StorageStatus)
137
    Q_ENUM(ThermalViewMode)
138 139 140 141 142 143 144 145 146 147 148

    Q_PROPERTY(int          version             READ version            NOTIFY infoChanged)
    Q_PROPERTY(QString      modelName           READ modelName          NOTIFY infoChanged)
    Q_PROPERTY(QString      vendor              READ vendor             NOTIFY infoChanged)
    Q_PROPERTY(QString      firmwareVersion     READ firmwareVersion    NOTIFY infoChanged)
    Q_PROPERTY(qreal        focalLength         READ focalLength        NOTIFY infoChanged)
    Q_PROPERTY(QSizeF       sensorSize          READ sensorSize         NOTIFY infoChanged)
    Q_PROPERTY(QSize        resolution          READ resolution         NOTIFY infoChanged)
    Q_PROPERTY(bool         capturesVideo       READ capturesVideo      NOTIFY infoChanged)
    Q_PROPERTY(bool         capturesPhotos      READ capturesPhotos     NOTIFY infoChanged)
    Q_PROPERTY(bool         hasModes            READ hasModes           NOTIFY infoChanged)
149 150
    Q_PROPERTY(bool         hasZoom             READ hasZoom            NOTIFY infoChanged)
    Q_PROPERTY(bool         hasFocus            READ hasFocus           NOTIFY infoChanged)
151
    Q_PROPERTY(bool         hasVideoStream      READ hasVideoStream     NOTIFY infoChanged)
152 153 154
    Q_PROPERTY(bool         photosInVideoMode   READ photosInVideoMode  NOTIFY infoChanged)
    Q_PROPERTY(bool         videoInPhotoMode    READ videoInPhotoMode   NOTIFY infoChanged)
    Q_PROPERTY(bool         isBasic             READ isBasic            NOTIFY infoChanged)
Gus Grubba's avatar
Gus Grubba committed
155 156 157
    Q_PROPERTY(quint32      storageFree         READ storageFree        NOTIFY storageFreeChanged)
    Q_PROPERTY(QString      storageFreeStr      READ storageFreeStr     NOTIFY storageFreeChanged)
    Q_PROPERTY(quint32      storageTotal        READ storageTotal       NOTIFY storageTotalChanged)
158 159
    Q_PROPERTY(int          batteryRemaining    READ batteryRemaining       NOTIFY batteryRemainingChanged)
    Q_PROPERTY(QString      batteryRemainingStr READ batteryRemainingStr    NOTIFY batteryRemainingChanged)
160 161 162 163 164 165 166 167
    Q_PROPERTY(bool         paramComplete       READ paramComplete      NOTIFY parametersReady)

    Q_PROPERTY(qreal        zoomLevel           READ zoomLevel          WRITE  setZoomLevel         NOTIFY zoomLevelChanged)
    Q_PROPERTY(qreal        focusLevel          READ focusLevel         WRITE  setFocusLevel        NOTIFY focusLevelChanged)

    Q_PROPERTY(Fact*        exposureMode        READ exposureMode       NOTIFY parametersReady)
    Q_PROPERTY(Fact*        ev                  READ ev                 NOTIFY parametersReady)
    Q_PROPERTY(Fact*        iso                 READ iso                NOTIFY parametersReady)
168
    Q_PROPERTY(Fact*        shutterSpeed        READ shutterSpeed       NOTIFY parametersReady)
169 170
    Q_PROPERTY(Fact*        aperture            READ aperture           NOTIFY parametersReady)
    Q_PROPERTY(Fact*        wb                  READ wb                 NOTIFY parametersReady)
171
    Q_PROPERTY(Fact*        mode                READ mode               NOTIFY parametersReady)
172

173 174 175 176
    Q_PROPERTY(QStringList  activeSettings      READ activeSettings                                 NOTIFY activeSettingsChanged)
    Q_PROPERTY(VideoStatus  videoStatus         READ videoStatus                                    NOTIFY videoStatusChanged)
    Q_PROPERTY(PhotoStatus  photoStatus         READ photoStatus                                    NOTIFY photoStatusChanged)
    Q_PROPERTY(CameraMode   cameraMode          READ cameraMode         WRITE   setCameraMode       NOTIFY cameraModeChanged)
177
    Q_PROPERTY(StorageStatus storageStatus      READ storageStatus                                  NOTIFY storageStatusChanged)
178 179 180
    Q_PROPERTY(qreal        photoLapse          READ photoLapse         WRITE   setPhotoLapse       NOTIFY photoLapseChanged)
    Q_PROPERTY(int          photoLapseCount     READ photoLapseCount    WRITE   setPhotoLapseCount  NOTIFY photoLapseCountChanged)
    Q_PROPERTY(PhotoMode    photoMode           READ photoMode          WRITE   setPhotoMode        NOTIFY photoModeChanged)
181 182 183 184
    Q_PROPERTY(int          currentStream       READ currentStream      WRITE   setCurrentStream    NOTIFY currentStreamChanged)
    Q_PROPERTY(bool         autoStream          READ autoStream                                     NOTIFY autoStreamChanged)
    Q_PROPERTY(QmlObjectListModel* streams      READ streams                                        NOTIFY streamsChanged)
    Q_PROPERTY(QGCVideoStreamInfo* currentStreamInstance READ currentStreamInstance                 NOTIFY currentStreamChanged)
185
    Q_PROPERTY(QGCVideoStreamInfo* thermalStreamInstance READ thermalStreamInstance                 NOTIFY thermalStreamChanged)
186 187
    Q_PROPERTY(quint32      recordTime          READ recordTime                                     NOTIFY recordTimeChanged)
    Q_PROPERTY(QString      recordTimeStr       READ recordTimeStr                                  NOTIFY recordTimeChanged)
Gus Grubba's avatar
Gus Grubba committed
188
    Q_PROPERTY(QStringList  streamLabels        READ streamLabels                                   NOTIFY streamLabelsChanged)
189 190
    Q_PROPERTY(ThermalViewMode thermalMode      READ thermalMode        WRITE  setThermalMode       NOTIFY thermalModeChanged)
    Q_PROPERTY(double       thermalOpacity      READ thermalOpacity     WRITE  setThermalOpacity    NOTIFY thermalOpacityChanged)
191

Gus Grubba's avatar
Gus Grubba committed
192 193 194 195
    Q_INVOKABLE virtual void setVideoMode   ();
    Q_INVOKABLE virtual void setPhotoMode   ();
    Q_INVOKABLE virtual void toggleMode     ();
    Q_INVOKABLE virtual bool takePhoto      ();
196
    Q_INVOKABLE virtual bool stopTakePhoto  ();
Gus Grubba's avatar
Gus Grubba committed
197 198 199 200 201
    Q_INVOKABLE virtual bool startVideo     ();
    Q_INVOKABLE virtual bool stopVideo      ();
    Q_INVOKABLE virtual bool toggleVideo    ();
    Q_INVOKABLE virtual void resetSettings  ();
    Q_INVOKABLE virtual void formatCard     (int id = 1);
202 203 204
    Q_INVOKABLE virtual void stepZoom       (int direction);
    Q_INVOKABLE virtual void startZoom      (int direction);
    Q_INVOKABLE virtual void stopZoom       ();
205 206
    Q_INVOKABLE virtual void stopStream     ();
    Q_INVOKABLE virtual void resumeStream   ();
Gus Grubba's avatar
Gus Grubba committed
207 208 209 210 211

    virtual int         version             () { return _version; }
    virtual QString     modelName           () { return _modelName; }
    virtual QString     vendor              () { return _vendor; }
    virtual QString     firmwareVersion     ();
Gus Grubba's avatar
Gus Grubba committed
212 213
    virtual qreal       focalLength         () { return static_cast<qreal>(_info.focal_length); }
    virtual QSizeF      sensorSize          () { return QSizeF(static_cast<qreal>(_info.sensor_size_h), static_cast<qreal>(_info.sensor_size_v)); }
Gus Grubba's avatar
Gus Grubba committed
214 215 216 217
    virtual QSize       resolution          () { return QSize(_info.resolution_h, _info.resolution_v); }
    virtual bool        capturesVideo       () { return _info.flags & CAMERA_CAP_FLAGS_CAPTURE_VIDEO; }
    virtual bool        capturesPhotos      () { return _info.flags & CAMERA_CAP_FLAGS_CAPTURE_IMAGE; }
    virtual bool        hasModes            () { return _info.flags & CAMERA_CAP_FLAGS_HAS_MODES; }
218 219
    virtual bool        hasZoom             () { return _info.flags & CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM; }
    virtual bool        hasFocus            () { return _info.flags & CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS; }
220
    virtual bool        hasVideoStream      () { return _info.flags & CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM; }
Gus Grubba's avatar
Gus Grubba committed
221 222 223 224 225 226
    virtual bool        photosInVideoMode   () { return _info.flags & CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE; }
    virtual bool        videoInPhotoMode    () { return _info.flags & CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE; }

    virtual int         compID              () { return _compID; }
    virtual bool        isBasic             () { return _settings.size() == 0; }
    virtual VideoStatus videoStatus         ();
227
    virtual PhotoStatus photoStatus         ();
228 229 230
    virtual PhotoMode   photoMode           () { return _photoMode; }
    virtual qreal       photoLapse          () { return _photoLapse; }
    virtual int         photoLapseCount     () { return _photoLapseCount; }
Gus Grubba's avatar
Gus Grubba committed
231
    virtual CameraMode  cameraMode          () { return _cameraMode; }
232
    virtual StorageStatus storageStatus     () { return _storageStatus; }
Gus Grubba's avatar
Gus Grubba committed
233
    virtual QStringList activeSettings      ();
Gus Grubba's avatar
Gus Grubba committed
234 235 236
    virtual quint32     storageFree         () { return _storageFree;  }
    virtual QString     storageFreeStr      ();
    virtual quint32     storageTotal        () { return _storageTotal; }
237 238
    virtual int         batteryRemaining    () { return _batteryRemaining; }
    virtual QString     batteryRemainingStr ();
239 240 241
    virtual bool        paramComplete       () { return _paramComplete; }
    virtual qreal       zoomLevel           () { return _zoomLevel; }
    virtual qreal       focusLevel          () { return _focusLevel; }
Gus Grubba's avatar
Gus Grubba committed
242

243 244
    virtual QmlObjectListModel* streams     () { return &_streams; }
    virtual QGCVideoStreamInfo* currentStreamInstance();
245
    virtual QGCVideoStreamInfo* thermalStreamInstance();
246 247 248
    virtual int          currentStream      () { return _currentStream; }
    virtual void         setCurrentStream   (int stream);
    virtual bool         autoStream         ();
249 250
    virtual quint32      recordTime         () { return _recordTime; }
    virtual QString      recordTimeStr      ();
251

252 253 254
    virtual Fact*       exposureMode        ();
    virtual Fact*       ev                  ();
    virtual Fact*       iso                 ();
255
    virtual Fact*       shutterSpeed        ();
256 257
    virtual Fact*       aperture            ();
    virtual Fact*       wb                  ();
258
    virtual Fact*       mode                ();
259

Gus Grubba's avatar
Gus Grubba committed
260
    //-- Stream names to show the user (for selection)
261 262 263 264 265 266
    virtual QStringList streamLabels        () { return _streamLabels; }

    virtual ThermalViewMode thermalMode     () { return _thermalMode; }
    virtual void        setThermalMode      (ThermalViewMode mode);
    virtual double      thermalOpacity      () { return _thermalOpacity; }
    virtual void        setThermalOpacity   (double val);
Gus Grubba's avatar
Gus Grubba committed
267

268 269
    virtual void        setZoomLevel        (qreal level);
    virtual void        setFocusLevel       (qreal level);
Gus Grubba's avatar
Gus Grubba committed
270
    virtual void        setCameraMode       (CameraMode mode);
271 272 273
    virtual void        setPhotoMode        (PhotoMode mode);
    virtual void        setPhotoLapse       (qreal interval);
    virtual void        setPhotoLapseCount  (int count);
Gus Grubba's avatar
Gus Grubba committed
274 275 276 277 278 279

    virtual void        handleSettings      (const mavlink_camera_settings_t& settings);
    virtual void        handleCaptureStatus (const mavlink_camera_capture_status_t& capStatus);
    virtual void        handleParamAck      (const mavlink_param_ext_ack_t& ack);
    virtual void        handleParamValue    (const mavlink_param_ext_value_t& value);
    virtual void        handleStorageInfo   (const mavlink_storage_information_t& st);
280
    virtual void        handleBatteryStatus (const mavlink_battery_status_t& bs);
281 282
    virtual void        handleVideoInfo     (const mavlink_video_stream_information_t *vi);
    virtual void        handleVideoStatus   (const mavlink_video_stream_status_t *vs);
283 284

    //-- Notify controller a parameter has changed
Gus Grubba's avatar
Gus Grubba committed
285
    virtual void        factChanged         (Fact* pFact);
286 287
    //-- Allow controller to modify or invalidate incoming parameter
    virtual bool        incomingParameter   (Fact* pFact, QVariant& newValue);
288 289
    //-- Allow controller to modify or invalidate parameter change
    virtual bool        validateParameter   (Fact* pFact, QVariant& newValue);
290

291 292 293 294 295 296 297 298 299
    // Known Parameters
    static const char* kCAM_EV;
    static const char* kCAM_EXPMODE;
    static const char* kCAM_ISO;
    static const char* kCAM_SHUTTERSPD;
    static const char* kCAM_APERTURE;
    static const char* kCAM_WBMODE;
    static const char* kCAM_MODE;

300 301
signals:
    void    infoChanged                     ();
Gus Grubba's avatar
Gus Grubba committed
302
    void    videoStatusChanged              ();
303
    void    photoStatusChanged              ();
304 305 306
    void    photoModeChanged                ();
    void    photoLapseChanged               ();
    void    photoLapseCountChanged          ();
307 308
    void    cameraModeChanged               ();
    void    activeSettingsChanged           ();
Gus Grubba's avatar
Gus Grubba committed
309 310
    void    storageFreeChanged              ();
    void    storageTotalChanged             ();
311
    void    batteryRemainingChanged         ();
Gus Grubba's avatar
Gus Grubba committed
312
    void    dataReady                       (QByteArray data);
Gus Grubba's avatar
Gus Grubba committed
313
    void    parametersReady                 ();
314 315
    void    zoomLevelChanged                ();
    void    focusLevelChanged               ();
316 317
    void    streamsChanged                  ();
    void    currentStreamChanged            ();
318
    void    thermalStreamChanged            ();
319
    void    autoStreamChanged               ();
320
    void    recordTimeChanged               ();
Gus Grubba's avatar
Gus Grubba committed
321
    void    streamLabelsChanged             ();
322 323
    void    thermalModeChanged              ();
    void    thermalOpacityChanged           ();
324
    void    storageStatusChanged            ();
Gus Grubba's avatar
Gus Grubba committed
325 326 327

protected:
    virtual void    _setVideoStatus         (VideoStatus status);
328
    virtual void    _setPhotoStatus         (PhotoStatus status);
Gus Grubba's avatar
Gus Grubba committed
329
    virtual void    _setCameraMode          (CameraMode mode);
330 331
    virtual void    _requestStreamInfo      (uint8_t streamID);
    virtual void    _requestStreamStatus    (uint8_t streamID);
332
    virtual QGCVideoStreamInfo* _findStream (uint8_t streamID, bool report = true);
333
    virtual QGCVideoStreamInfo* _findStream (const QString name);
334

335
protected slots:
Gus Grubba's avatar
Gus Grubba committed
336 337 338 339 340 341 342 343 344 345
    virtual void    _initWhenReady          ();
    virtual void    _requestCameraSettings  ();
    virtual void    _requestAllParameters   ();
    virtual void    _requestParamUpdates    ();
    virtual void    _requestCaptureStatus   ();
    virtual void    _requestStorageInfo     ();
    virtual void    _downloadFinished       ();
    virtual void    _mavCommandResult       (int vehicleId, int component, int command, int result, bool noReponseFromVehicle);
    virtual void    _dataReady              (QByteArray data);
    virtual void    _paramDone              ();
346 347
    virtual void    _streamTimeout          ();
    virtual void    _streamStatusTimeout    ();
348 349
    virtual void    _recTimerHandler        ();
    virtual void    _checkForVideoStreams   ();
350

351 352 353
private:
    bool    _handleLocalization             (QByteArray& bytes);
    bool    _replaceLocaleStrings           (const QDomNode node, QByteArray& bytes);
Gus Grubba's avatar
Gus Grubba committed
354
    bool    _loadCameraDefinitionFile       (QByteArray& bytes);
355 356 357 358 359 360 361 362 363
    bool    _loadConstants                  (const QDomNodeList nodeList);
    bool    _loadSettings                   (const QDomNodeList nodeList);
    void    _processRanges                  ();
    bool    _processCondition               (const QString condition);
    bool    _processConditionTest           (const QString conditionTest);
    bool    _loadNameValue                  (QDomNode option, const QString factName, FactMetaData* metaData, QString& optName, QString& optValue, QVariant& optVariant);
    bool    _loadRanges                     (QDomNode option, const QString factName, QString paramValue);
    void    _updateActiveList               ();
    void    _updateRanges                   (Fact* pFact);
Gus Grubba's avatar
Gus Grubba committed
364
    void    _httpRequest                    (const QString& url);
Gus Grubba's avatar
Gus Grubba committed
365
    void    _handleDefinitionFile           (const QString& url);
366 367

    QStringList     _loadExclusions         (QDomNode option);
368
    QStringList     _loadUpdates            (QDomNode option);
369 370
    QString         _getParamName           (const char* param_id);

Gus Grubba's avatar
Gus Grubba committed
371
protected:
372 373
    Vehicle*                            _vehicle            = nullptr;
    int                                 _compID             = 0;
374
    mavlink_camera_information_t        _info;
375 376 377 378 379 380 381
    int                                 _version            = 0;
    bool                                _cached             = false;
    bool                                _paramComplete      = false;
    qreal                               _zoomLevel          = 0.0;
    qreal                               _focusLevel         = 0.0;
    uint32_t                            _storageFree        = 0;
    uint32_t                            _storageTotal       = 0;
382
    int                                 _batteryRemaining   = -1;
383
    QNetworkAccessManager*              _netManager         = nullptr;
384 385
    QString                             _modelName;
    QString                             _vendor;
386
    QString                             _cacheFile;
387
    CameraMode                          _cameraMode         = CAM_MODE_UNDEFINED;
388
    StorageStatus                       _storageStatus      = STORAGE_NOT_SUPPORTED;
389 390 391 392 393
    PhotoMode                           _photoMode          = PHOTO_CAPTURE_SINGLE;
    qreal                               _photoLapse         = 1.0;
    int                                 _photoLapseCount    = 0;
    VideoStatus                         _video_status       = VIDEO_CAPTURE_STATUS_UNDEFINED;
    PhotoStatus                         _photo_status       = PHOTO_CAPTURE_STATUS_UNDEFINED;
394 395
    QStringList                         _activeSettings;
    QStringList                         _settings;
Gus Grubba's avatar
Gus Grubba committed
396
    QTimer                              _captureStatusTimer;
397 398 399 400 401
    QList<QGCCameraOptionExclusion*>    _valueExclusions;
    QList<QGCCameraOptionRange*>        _optionRanges;
    QMap<QString, QStringList>          _originalOptNames;
    QMap<QString, QVariantList>         _originalOptValues;
    QMap<QString, QGCCameraParamIO*>    _paramIO;
402 403 404
    int                                 _storageInfoRetries = 0;
    int                                 _captureInfoRetries = 0;
    bool                                _resetting          = false;
405 406 407
    QTimer                              _recTimer;
    QTime                               _recTime;
    uint32_t                            _recordTime         = 0;
408
    //-- Parameters that require a full update
409
    QMap<QString, QStringList>          _requestUpdates;
410
    QStringList                         _updatesToRequest;
411 412 413 414 415 416 417
    //-- Video Streams
    int                                 _requestCount       = 0;
    int                                 _currentStream      = 0;
    int                                 _expectedCount      = 1;
    QTimer                              _streamInfoTimer;
    QTimer                              _streamStatusTimer;
    QmlObjectListModel                  _streams;
Gus Grubba's avatar
Gus Grubba committed
418
    QStringList                         _streamLabels;
419 420
    ThermalViewMode                     _thermalMode        = THERMAL_BLEND;
    double                              _thermalOpacity     = 85.0;
421
};