QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MockLinkWorker.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4
5class MockLink;
6class QTimer;
7
12class MockLinkWorker : public QObject
13{
14 Q_OBJECT
15
16public:
17 explicit MockLinkWorker(MockLink *link, QObject *parent = nullptr);
19
21 static constexpr int kTimer1HzIntervalMs = 1000;
22 static constexpr int kTimer10HzIntervalMs = 100;
23 static constexpr int kTimer500HzIntervalMs = 2;
24 static constexpr int kBootStatusTextDelayMs = 2000;
25 static constexpr int kStatusTextDelayMs = 10000;
26
27public slots:
28 void startWork();
29 void stopWork();
30
31private slots:
32 void run1HzTasks();
33 void run10HzTasks();
34 void run500HzTasks();
35
36 void sendStatusTextMessages();
37 void sendBootStatusTextMessages();
38
39private:
40 MockLink *_mockLink = nullptr;
41 QTimer *_timer1Hz = nullptr;
42 QTimer *_timer10Hz = nullptr;
43 QTimer *_timer500Hz = nullptr;
44 QTimer *_timerStatusText = nullptr;
45 QTimer *_timerBootStatusText = nullptr;
46};
MockLinkWorker(MockLink *link, QObject *parent=nullptr)
static constexpr int kTimer1HzIntervalMs
Timer intervals in milliseconds.
static constexpr int kBootStatusTextDelayMs
Delay before sending the non-critical status text messages.
static constexpr int kTimer500HzIntervalMs
500 Hz tasks (param list, log download)
static constexpr int kTimer10HzIntervalMs
10 Hz tasks (heartbeat, GPS, position)
static constexpr int kStatusTextDelayMs
Delay before sending status text messages.