CameraMetaData.h 3.63 KB
Newer Older
1 2
/****************************************************************************
 *
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10
#pragma once
11 12 13 14 15 16 17 18 19

#include <QObject>

/// Set of meta data which describes a camera available on the vehicle
class CameraMetaData : public QObject
{
    Q_OBJECT

public:
20 21 22
    CameraMetaData(const QString&   canonicalName,
                   const QString&   brand,
                   const QString&   model,
23 24 25 26 27
                   double           sensorWidth,
                   double           sensorHeight,
                   double           imageWidth,
                   double           imageHeight,
                   double           focalLength,
28 29
                   bool             landscape,
                   bool             fixedOrientation,
30
                   double           minTriggerInterval,
31 32
                   const QString&   deprecatedTranslatedName,
                   QObject*         parent = nullptr);
33

34 35 36 37 38 39 40 41 42 43 44 45
    Q_PROPERTY(QString  canonicalName               MEMBER canonicalName            CONSTANT)
    Q_PROPERTY(QString  deprecatedTranslatedName    MEMBER deprecatedTranslatedName CONSTANT)
    Q_PROPERTY(QString  brand                       MEMBER brand                    CONSTANT)
    Q_PROPERTY(QString  model                       MEMBER model                    CONSTANT)
    Q_PROPERTY(double   sensorWidth                 MEMBER sensorWidth              CONSTANT)
    Q_PROPERTY(double   sensorHeight                MEMBER sensorHeight             CONSTANT)
    Q_PROPERTY(double   imageWidth                  MEMBER imageWidth               CONSTANT)
    Q_PROPERTY(double   imageHeight                 MEMBER imageHeight              CONSTANT)
    Q_PROPERTY(double   focalLength                 MEMBER focalLength              CONSTANT)
    Q_PROPERTY(bool     landscape                   MEMBER landscape                CONSTANT)
    Q_PROPERTY(bool     fixedOrientation            MEMBER fixedOrientation         CONSTANT)
    Q_PROPERTY(double   minTriggerInterval          MEMBER minTriggerInterval       CONSTANT)
46

47 48 49 50 51 52 53 54 55 56 57
    QString canonicalName;                  ///< Canonical name saved in plan files. Not translated.
    QString brand;                          ///< Camera brand. Used for grouping.
    QString model;                          ///< Camerar model
    double  sensorWidth;                    ///< Sensor size in millimeters
    double  sensorHeight;                   ///< Sensor size in millimeters
    double  imageWidth;                     ///< Image size in pixels
    double  imageHeight;                    ///< Image size in pixels
    double  focalLength;                    ///< Focal length in millimeters
    bool    landscape;                      ///< true: camera is in landscape orientation
    bool    fixedOrientation;               ///< true: camera is in fixed orientation
    double  minTriggerInterval;             ///< Minimum time in seconds between each photo taken, 0 for not specified
58

59 60 61 62 63
    /// In older builds camera names were incorrect marked for translation. This leads to plan files which have are language
    /// dependant which is not a good thing. Newer plan files use the canonical name which is not translated. In order to support
    /// loading older plan files we continue to include the incorrect translation so we can match against them as needed.
    /// Newly added CameraMetaData entries should leave this value empty.
    QString deprecatedTranslatedName;
64
};