AP2ConfigWidget.cc 987 Bytes
Newer Older
1
#include <QMessageBox>
2 3 4 5 6 7 8 9 10 11 12 13 14
#include "AP2ConfigWidget.h"

AP2ConfigWidget::AP2ConfigWidget(QWidget *parent) : QWidget(parent)
{
    m_uas = 0;
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());
}
void AP2ConfigWidget::activeUASSet(UASInterface *uas)
{
    if (m_uas)
    {
        disconnect(m_uas,SIGNAL(parameterChanged(int,int,QString,QVariant)),this,SLOT(parameterChanged(int,int,QString,QVariant)));
15
        m_uas = 0;
16
    }
17
    if (!uas) return;
18 19 20 21 22 23 24 25
    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)
{

}
26 27 28 29
void AP2ConfigWidget::showNullMAVErrorMessageBox()
{
    QMessageBox::information(0,tr("Error"),tr("Please connect to a MAV before attempting to set configuration"));
}