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 kStatusTextDelayMs = 10000;
25
26public slots:
27 void startWork();
28 void stopWork();
29
30private slots:
31 void run1HzTasks();
32 void run10HzTasks();
33 void run500HzTasks();
34
35 void sendStatusTextMessages();
36
37private:
38 MockLink *_mockLink = nullptr;
39 QTimer *_timer1Hz = nullptr;
40 QTimer *_timer10Hz = nullptr;
41 QTimer *_timer500Hz = nullptr;
42 QTimer *_timerStatusText = nullptr;
43};
Worker class that runs periodic tasks for MockLink simulation.
static constexpr int kTimer1HzIntervalMs
Timer intervals in milliseconds.
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.