AP2ConfigWidget.cc 1.1 KB
Newer Older
1
#include <QMessageBox>
2 3 4 5 6
#include "AP2ConfigWidget.h"

AP2ConfigWidget::AP2ConfigWidget(QWidget *parent) : QWidget(parent)
{
    m_uas = 0;
7 8 9
}
void AP2ConfigWidget::initConnections()
{
10 11 12
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());
}
13

14 15 16 17 18
void AP2ConfigWidget::activeUASSet(UASInterface *uas)
{
    if (m_uas)
    {
        disconnect(m_uas,SIGNAL(parameterChanged(int,int,QString,QVariant)),this,SLOT(parameterChanged(int,int,QString,QVariant)));
19
        m_uas = 0;
20
    }
21
    if (!uas) return;
22 23 24 25 26 27
    m_uas = uas;
    connect(m_uas,SIGNAL(parameterChanged(int,int,QString,QVariant)),this,SLOT(parameterChanged(int,int,QString,QVariant)));
}

void AP2ConfigWidget::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
28 29 30 31
    Q_UNUSED(uas);
    Q_UNUSED(component);
    Q_UNUSED(parameterName);
    Q_UNUSED(value);
32
}
33 34 35 36
void AP2ConfigWidget::showNullMAVErrorMessageBox()
{
    QMessageBox::information(0,tr("Error"),tr("Please connect to a MAV before attempting to set configuration"));
}