QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RCChannelMonitorController.cc
Go to the documentation of this file.
2#include "Vehicle.h"
4
5QGC_LOGGING_CATEGORY(RCChannelMonitorControllerLog, "QMLControls.RCChannelMonitorController")
6
8 : FactPanelController(parent)
9{
10 // qCDebug(RCChannelMonitorControllerLog) << Q_FUNC_INFO << this;
11
12 (void) connect(_vehicle, &Vehicle::rcChannelsChanged, this, &RCChannelMonitorController::channelValuesChanged);
13}
14
15RCChannelMonitorController::~RCChannelMonitorController()
16{
17 // qCDebug(RCChannelMonitorControllerLog) << Q_FUNC_INFO << this;
18}
19
20void RCChannelMonitorController::channelValuesChanged(QVector<int> pwmValues)
21{
22 int channelCount = pwmValues.size();
23
24 if (_chanCount != channelCount) {
25 _chanCount = channelCount;
26 emit channelCountChanged(_chanCount);
27 }
28
29 for (int channel = 0; channel < channelCount; channel++) {
30 emit channelValueChanged(channel, pwmValues[channel]);
31 }
32}
#define QGC_LOGGING_CATEGORY(name, categoryStr)
Used for handling missing Facts from C++ code.
void channelValueChanged(int channel, int rcValue)
void channelCountChanged(int channelCount)
void rcChannelsChanged(QVector< int > channelValues)