QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
BulkRefreshJob.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QSet>
5#include <QtCore/QString>
6#include <QtCore/QStringList>
7#include <QtCore/QTimer>
8
9#include <functional>
10
12
15class BulkRefreshJob : public QObject
16{
17 Q_OBJECT
18
19public:
20 BulkRefreshJob(ParameterManager *mgr, int componentId, const QStringList &resolvedNames,
21 bool notifyFailure, std::function<void(const QString &)> requestFn,
22 QObject *parent);
23
24 static constexpr int kMaxRetryRounds = 3;
25 static constexpr int kRetryBaseDelayMs = 1000;
26
27private:
28 void _sendPendingRequests();
29 void _onParamSuccess(int componentId, const QString &paramName, int paramIndex);
30 void _onParamFailure(int componentId, const QString &paramName, int paramIndex);
31 void _checkRoundComplete();
32
33 ParameterManager *_mgr;
34 int _componentId;
35 bool _notifyFailure;
36 std::function<void(const QString&)> _requestFn;
37 QSet<QString> _pending;
38 QSet<QString> _failed;
39 int _round = 0;
40 const int _retryBaseDelayMs;
41 QTimer _retryTimer;
42};
BulkRefreshJob(ParameterManager *mgr, int componentId, const QStringList &resolvedNames, bool notifyFailure, std::function< void(const QString &)> requestFn, QObject *parent)
static constexpr int kMaxRetryRounds
Number of batch-level retry rounds before giving up.
static constexpr int kRetryBaseDelayMs
Base retry interval; doubled each round.