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

10

11 12 13
#ifndef QGC_H
#define QGC_H

14
#include <QDateTime>
15
#include <QColor>
16
#include <QThread>
17

18
#include "QGCConfig.h"
19

20 21
namespace QGC
{
22 23
const static int defaultSystemId = 255;
const static int defaultComponentId = 0;
24

25 26 27 28
/**
 * @brief Get the current ground time in microseconds.
 * @note This does not have microsecond precision, it is limited to millisecond precision.
 */
29 30 31
quint64 groundTimeUsecs();
/** @brief Get the current ground time in milliseconds */
quint64 groundTimeMilliseconds();
32 33 34 35
/** 
 * @brief Get the current ground time in fractional seconds
 * @note Precision is limited to milliseconds.
 */
36
qreal groundTimeSeconds();
37 38 39 40
/** @brief Returns the angle limited to -pi - pi */
float limitAngleToPMPIf(float angle);
/** @brief Returns the angle limited to -pi - pi */
double limitAngleToPMPId(double angle);
41

42
const static int MAX_FLIGHT_TIME = 60 * 60 * 24 * 21;
43

44 45
class SLEEP : public QThread
{
46
    Q_OBJECT
47
public:
Tomaz Canabrava's avatar
Tomaz Canabrava committed
48 49 50
    using QThread::sleep;
    using QThread::msleep;
    using QThread::usleep;
51
};
52

53 54
quint32 crc32(const quint8 *src, unsigned len, unsigned state);

55 56
}

57 58
#define QGC_EVENTLOOP_DEBUG 0

59
#endif // QGC_H