mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
CC-39 Have GCS detect whether the board is a CC or an OP, and update the INS calibration widget accordingly.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3094 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
48c20d37a9
commit
57adfdb708
@ -8,5 +8,6 @@
|
||||
<dependency name="Core" version="1.0.0"/>
|
||||
<dependency name="UAVObjects" version="1.0.0"/>
|
||||
<dependency name="UAVTalk" version="1.0.0"/>
|
||||
<dependency name="UAVObjectUtil" version="1.0.0"/>
|
||||
</dependencyList>
|
||||
</plugin>
|
||||
|
@ -6,6 +6,7 @@ include(../../openpilotgcsplugin.pri)
|
||||
include(../../plugins/uavtalk/uavtalk.pri)
|
||||
include(../../plugins/coreplugin/coreplugin.pri)
|
||||
include(../../plugins/uavobjects/uavobjects.pri)
|
||||
include(../../plugins/uavobjectutil/uavobjectutil.pri)
|
||||
|
||||
INCLUDEPATH += ../../libs/eigen
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "configahrswidget.h"
|
||||
#include "configgadgetwidget.h"
|
||||
|
||||
#include "fancytabwidget.h"
|
||||
#include "configairframewidget.h"
|
||||
#include "configccattitudewidget.h"
|
||||
#include "configinputwidget.h"
|
||||
@ -36,6 +35,7 @@
|
||||
#include "configstabilizationwidget.h"
|
||||
#include "configtelemetrywidget.h"
|
||||
|
||||
#include "uavobjectutilmanager.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
@ -50,7 +50,7 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
|
||||
FancyTabWidget *ftw = new FancyTabWidget(this, true);
|
||||
ftw = new FancyTabWidget(this, true);
|
||||
|
||||
ftw->setIconSize(64);
|
||||
|
||||
@ -79,8 +79,6 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
qwd = new ConfigTelemetryWidget(this);
|
||||
ftw->insertTab(5, qwd, QIcon(":/configgadget/images/XBee.svg"), QString("Telemetry"));
|
||||
|
||||
qwd = new ConfigCCAttitudeWidget(this);
|
||||
ftw->insertTab(5, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("CC Attitude"));
|
||||
|
||||
// qwd = new ConfigPipXtremeWidget(this);
|
||||
// ftw->insertTab(5, qwd, QIcon(":/configgadget/images/PipXtreme.png"), QString("PipXtreme"));
|
||||
@ -109,6 +107,31 @@ void ConfigGadgetWidget::resizeEvent(QResizeEvent *event)
|
||||
}
|
||||
|
||||
void ConfigGadgetWidget::onAutopilotConnect() {
|
||||
|
||||
// First of all, check what Board type we are talking to, and
|
||||
// if necessary, remove/add tabs in the config gadget:
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||
if (utilMngr) {
|
||||
int board = utilMngr->getBoardModel();
|
||||
qDebug() << "Board model: " << board;
|
||||
if ((board & 0xff00) == 1024) {
|
||||
// CopterControl family
|
||||
// Delete the INS panel, replace with CC Panel:
|
||||
ftw->setCurrentIndex(0);
|
||||
ftw->removeTab(3);
|
||||
QWidget *qwd = new ConfigCCAttitudeWidget(this);
|
||||
ftw->insertTab(3, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("Attitude"));
|
||||
} else if ((board & 0xff00) == 256 ) {
|
||||
// Mainboard family
|
||||
ftw->setCurrentIndex(0);
|
||||
ftw->removeTab(3);
|
||||
QWidget *qwd = new ConfigAHRSWidget(this);
|
||||
ftw->insertTab(3, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
emit autopilotConnected();
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <QtGui/QWidget>
|
||||
#include <QList>
|
||||
|
||||
#include "fancytabwidget.h"
|
||||
|
||||
|
||||
class ConfigGadgetWidget: public QWidget
|
||||
{
|
||||
@ -52,6 +54,7 @@ signals:
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent * event);
|
||||
FancyTabWidget *ftw;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user