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,10 +79,8 @@ 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);
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
@ -1,58 +1,61 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file configgadgetwidget.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @addtogroup GCSPlugins GCS Plugins
|
||||
* @{
|
||||
* @addtogroup ConfigPlugin Config Plugin
|
||||
* @{
|
||||
* @brief The Configuration Gadget used to update settings in the firmware
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef CONFIGGADGETWIDGET_H
|
||||
#define CONFIGGADGETWIDGET_H
|
||||
|
||||
#include "uavtalk/telemetrymanager.h"
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "uavobjectmanager.h"
|
||||
#include "uavobject.h"
|
||||
#include "objectpersistence.h"
|
||||
#include <QtGui/QWidget>
|
||||
#include <QList>
|
||||
|
||||
|
||||
class ConfigGadgetWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConfigGadgetWidget(QWidget *parent = 0);
|
||||
~ConfigGadgetWidget();
|
||||
|
||||
public slots:
|
||||
void onAutopilotConnect();
|
||||
|
||||
signals:
|
||||
void autopilotConnected();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent * event);
|
||||
|
||||
};
|
||||
|
||||
#endif // CONFIGGADGETWIDGET_H
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file configgadgetwidget.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @addtogroup GCSPlugins GCS Plugins
|
||||
* @{
|
||||
* @addtogroup ConfigPlugin Config Plugin
|
||||
* @{
|
||||
* @brief The Configuration Gadget used to update settings in the firmware
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef CONFIGGADGETWIDGET_H
|
||||
#define CONFIGGADGETWIDGET_H
|
||||
|
||||
#include "uavtalk/telemetrymanager.h"
|
||||
#include "extensionsystem/pluginmanager.h"
|
||||
#include "uavobjectmanager.h"
|
||||
#include "uavobject.h"
|
||||
#include "objectpersistence.h"
|
||||
#include <QtGui/QWidget>
|
||||
#include <QList>
|
||||
|
||||
#include "fancytabwidget.h"
|
||||
|
||||
|
||||
class ConfigGadgetWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConfigGadgetWidget(QWidget *parent = 0);
|
||||
~ConfigGadgetWidget();
|
||||
|
||||
public slots:
|
||||
void onAutopilotConnect();
|
||||
|
||||
signals:
|
||||
void autopilotConnected();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent * event);
|
||||
FancyTabWidget *ftw;
|
||||
|
||||
};
|
||||
|
||||
#endif // CONFIGGADGETWIDGET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user