1
0
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:
edouard 2011-03-28 21:15:44 +00:00 committed by edouard
parent 48c20d37a9
commit 57adfdb708
4 changed files with 91 additions and 63 deletions

View File

@ -8,5 +8,6 @@
<dependency name="Core" version="1.0.0"/> <dependency name="Core" version="1.0.0"/>
<dependency name="UAVObjects" version="1.0.0"/> <dependency name="UAVObjects" version="1.0.0"/>
<dependency name="UAVTalk" version="1.0.0"/> <dependency name="UAVTalk" version="1.0.0"/>
<dependency name="UAVObjectUtil" version="1.0.0"/>
</dependencyList> </dependencyList>
</plugin> </plugin>

View File

@ -6,6 +6,7 @@ include(../../openpilotgcsplugin.pri)
include(../../plugins/uavtalk/uavtalk.pri) include(../../plugins/uavtalk/uavtalk.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/uavobjects/uavobjects.pri) include(../../plugins/uavobjects/uavobjects.pri)
include(../../plugins/uavobjectutil/uavobjectutil.pri)
INCLUDEPATH += ../../libs/eigen INCLUDEPATH += ../../libs/eigen

View File

@ -28,7 +28,6 @@
#include "configahrswidget.h" #include "configahrswidget.h"
#include "configgadgetwidget.h" #include "configgadgetwidget.h"
#include "fancytabwidget.h"
#include "configairframewidget.h" #include "configairframewidget.h"
#include "configccattitudewidget.h" #include "configccattitudewidget.h"
#include "configinputwidget.h" #include "configinputwidget.h"
@ -36,6 +35,7 @@
#include "configstabilizationwidget.h" #include "configstabilizationwidget.h"
#include "configtelemetrywidget.h" #include "configtelemetrywidget.h"
#include "uavobjectutilmanager.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
@ -50,7 +50,7 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
{ {
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
FancyTabWidget *ftw = new FancyTabWidget(this, true); ftw = new FancyTabWidget(this, true);
ftw->setIconSize(64); ftw->setIconSize(64);
@ -79,8 +79,6 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
qwd = new ConfigTelemetryWidget(this); qwd = new ConfigTelemetryWidget(this);
ftw->insertTab(5, qwd, QIcon(":/configgadget/images/XBee.svg"), QString("Telemetry")); 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); // qwd = new ConfigPipXtremeWidget(this);
// ftw->insertTab(5, qwd, QIcon(":/configgadget/images/PipXtreme.png"), QString("PipXtreme")); // ftw->insertTab(5, qwd, QIcon(":/configgadget/images/PipXtreme.png"), QString("PipXtreme"));
@ -109,6 +107,31 @@ void ConfigGadgetWidget::resizeEvent(QResizeEvent *event)
} }
void ConfigGadgetWidget::onAutopilotConnect() { 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(); emit autopilotConnected();
} }

View File

@ -35,6 +35,8 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QList> #include <QList>
#include "fancytabwidget.h"
class ConfigGadgetWidget: public QWidget class ConfigGadgetWidget: public QWidget
{ {
@ -52,6 +54,7 @@ signals:
protected: protected:
void resizeEvent(QResizeEvent * event); void resizeEvent(QResizeEvent * event);
FancyTabWidget *ftw;
}; };