Linecharts.cc 826 Bytes
Newer Older
1 2
#include <QShowEvent>

3
#include "Linecharts.h"
4
#include "MultiVehicleManager.h"
5
#include "MainWindow.h"
6
#include "UAS.h"
7

Don Gagne's avatar
Don Gagne committed
8 9 10
Linecharts::Linecharts(const QString& title, QAction* action, MAVLinkDecoder* decoder, QWidget *parent)
    : MultiVehicleDockWidget(title, action, parent)
    , _mavlinkDecoder(decoder)
11
{
Don Gagne's avatar
Don Gagne committed
12
    init();
13

Don Gagne's avatar
Don Gagne committed
14
    this->setVisible(false);
15 16
}

Don Gagne's avatar
Don Gagne committed
17
QWidget* Linecharts::_newVehicleWidget(Vehicle* vehicle, QWidget* parent)
18
{
Don Gagne's avatar
Don Gagne committed
19
    LinechartWidget* widget = new LinechartWidget(vehicle->id(), parent);
20

Don Gagne's avatar
Don Gagne committed
21 22
    // Connect valueChanged signals
    connect(vehicle->uas(), &UAS::valueChanged, widget, &LinechartWidget::appendData);
23

Don Gagne's avatar
Don Gagne committed
24 25
    // Connect decoder
    connect(_mavlinkDecoder, &MAVLinkDecoder::valueChanged, widget, &LinechartWidget::appendData);
26

Don Gagne's avatar
Don Gagne committed
27 28
    // Select system
    widget->setActive(true);
lm's avatar
lm committed
29

Don Gagne's avatar
Don Gagne committed
30
    return widget;
31
}