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

40
const static int MAX_FLIGHT_TIME = 60 * 60 * 24 * 21;
41

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

51 52
quint32 crc32(const quint8 *src, unsigned len, unsigned state);

53 54
}

55 56
#define QGC_EVENTLOOP_DEBUG 0

57
#endif // QGC_H