Commit 0309f130 authored by Bryant Mairs's avatar Bryant Mairs

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into del_slugs

parents 80e96ad7 e4977186
#
# [REQUIRED] Tell the Linux build to look in a few additional places for libs
#
LinuxBuild {
INCLUDEPATH += \
/usr/include \
/usr/local/include
LIBS += \
-L/usr/lib
linux-g++-64 {
LIBS += \
-L/usr/local/lib64 \
-L/usr/lib64
}
}
#
# [REQUIRED] Add support for <inttypes.h> to Windows.
#
......@@ -261,36 +243,6 @@ else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_GOOGLE_EAR
message("Skipping support for Google Earth view (unsupported platform)")
}
#
# [OPTIONAL] Protcol Buffers for PixHawk
#
LinuxBuild : contains(MAVLINK_DIALECT, pixhawk) {
exists(/usr/local/include/google/protobuf) | exists(/usr/include/google/protobuf) {
message("Including support for Protocol Buffers")
DEFINES += QGC_PROTOBUF_ENABLED
LIBS += \
-lprotobuf \
-lprotobuf-lite \
-lprotoc
HEADERS += \
libs/mavlink/include/mavlink/v1.0/pixhawk/pixhawk.pb.h \
src/ui/map3D/ObstacleGroupNode.h \
src/ui/map3D/GLOverlayGeode.h
SOURCES += \
libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \
src/ui/map3D/ObstacleGroupNode.cc \
src/ui/map3D/GLOverlayGeode.cc
} else {
warning("Skipping support for Protocol Buffers (missing libraries, see README)")
}
} else {
message("Skipping support for Protocol Buffers (unsupported platform)")
}
#
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
......@@ -341,13 +293,15 @@ contains(DEFINES, DISABLE_XBEE) {
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_XBEE) {
message("Skipping support for native XBee API (manual override from user_config.pri)")
} else:LinuxBuild {
exists(/usr/include/xbee.h) {
linux-g++-64 {
message("Skipping support for XBee API (64-bit Linux builds not supported)")
} else:exists(/usr/include/xbee.h) {
message("Including support for XBee API")
HEADERS += $$XBEE_DEPENDENT_HEADERS
SOURCES += $$XBEE_DEPENDENT_SOURCES
DEFINES += $$XBEE_DEFINES
LIBS += -lxbee
LIBS += -L/usr/lib -lxbee
} else {
warning("Skipping support for XBee API (missing libraries, see README)")
}
......
......@@ -159,11 +159,8 @@ WindowsBuild {
DESTDIR_WIN = $$replace(DESTDIR, "/", "\\")
D_DIR = $$[QT_INSTALL_LIBEXECS]
DLL_DIR = $$replace(D_DIR, "/", "\\")
P_DIR = $$[QT_INSTALL_PLUGINS]
PLUGIN_DIR = $$replace(P_DIR, "/", "\\")
# Copy dependencies
DebugBuild: DLL_QT_DEBUGCHAR = "d"
ReleaseBuild: DLL_QT_DEBUGCHAR = ""
COPY_FILE_LIST = \
......
......@@ -334,6 +334,14 @@ QMenu::separator {
margin: 8px 5px 4px 5px;
}
/*
* Fix for bug in Qt5 where QMenuBar items are styled natively on Windows, ignoring inherited settings.
* so we explicitly set their background color here (should match catch-all style background color).
*/
QMenuBar::item {
background-color: #222;
}
QMenuBar::item:selected {
background-color: #CCC;
color: #000;
......
......@@ -278,6 +278,14 @@ QMenu::separator {
margin: 8px 5px 4px 5px;
}
/*
* Fix for bug in Qt5 where QMenuBar items are styled natively on Windows, ignoring inherited settings.
* so we explicitly set their background color here (should match catch-all style background color).
*/
QMenuBar::item {
background-color: #F6F6F6;
}
QMenuBar::item:selected {
background-color: #555;
color: #FFF;
......
Subproject commit 04b1ad5b284d5e916858ca9f928e93d97bbf6ad9
Subproject commit 77d9553174779947b45aa08d29129dcb659f5b5e
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qtconcurrent/multitask.h"
#include "qtconcurrent/runextensions.h"
/**
******************************************************************************
*
* @file multitask.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup
* @{
*
*****************************************************************************/
/*
* 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 MULTITASK_H
#define MULTITASK_H
#include "qtconcurrent_global.h"
#include "runextensions.h"
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QEventLoop>
#include <QtCore/QFutureWatcher>
#include <QtCore/QtConcurrentRun>
#include <QtCore/QThreadPool>
#include <QtDebug>
QT_BEGIN_NAMESPACE
namespace QtConcurrent {
class QTCONCURRENT_EXPORT MultiTaskBase : public QObject, public QRunnable
{
Q_OBJECT
protected slots:
virtual void cancelSelf() = 0;
virtual void setFinished() = 0;
virtual void setProgressRange(int min, int max) = 0;
virtual void setProgressValue(int value) = 0;
virtual void setProgressText(QString value) = 0;
};
template <typename Class, typename R>
class MultiTask : public MultiTaskBase
{
public:
MultiTask(void (Class::*fn)(QFutureInterface<R> &), const QList<Class *> &objects)
: fn(fn),
objects(objects)
{
maxProgress = 100*objects.size();
}
QFuture<R> future()
{
futureInterface.reportStarted();
return futureInterface.future();
}
void run()
{
QThreadPool::globalInstance()->releaseThread();
futureInterface.setProgressRange(0, maxProgress);
foreach (Class *object, objects) {
QFutureWatcher<R> *watcher = new QFutureWatcher<R>();
watchers.insert(object, watcher);
finished.insert(watcher, false);
connect(watcher, SIGNAL(finished()), this, SLOT(setFinished()));
connect(watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int)));
connect(watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int)));
connect(watcher, SIGNAL(progressTextChanged(QString)), this, SLOT(setProgressText(QString)));
watcher->setFuture(QtConcurrent::run(fn, object));
}
selfWatcher = new QFutureWatcher<R>();
connect(selfWatcher, SIGNAL(canceled()), this, SLOT(cancelSelf()));
selfWatcher->setFuture(futureInterface.future());
loop = new QEventLoop;
loop->exec();
futureInterface.reportFinished();
QThreadPool::globalInstance()->reserveThread();
qDeleteAll(watchers.values());
delete selfWatcher;
delete loop;
}
protected:
void cancelSelf()
{
foreach (QFutureWatcher<R> *watcher, watchers)
watcher->future().cancel();
}
void setFinished()
{
updateProgress();
QFutureWatcher<R> *watcher = static_cast<QFutureWatcher<R> *>(sender());
if (finished.contains(watcher))
finished[watcher] = true;
bool allFinished = true;
const QList<bool> finishedValues = finished.values();
foreach (bool isFinished, finishedValues) {
if (!isFinished) {
allFinished = false;
break;
}
}
if (allFinished)
loop->quit();
}
void setProgressRange(int min, int max)
{
Q_UNUSED(min)
Q_UNUSED(max)
updateProgress();
}
void setProgressValue(int value)
{
Q_UNUSED(value)
updateProgress();
}
void setProgressText(QString value)
{
Q_UNUSED(value)
updateProgressText();
}
private:
void updateProgress()
{
int progressSum = 0;
const QList<QFutureWatcher<R> *> watchersValues = watchers.values();
foreach (QFutureWatcher<R> *watcher, watchersValues) {
if (watcher->progressMinimum() == watcher->progressMaximum()) {
if (watcher->future().isFinished() && !watcher->future().isCanceled())
progressSum += 100;
} else {
progressSum += 100*(watcher->progressValue()-watcher->progressMinimum())/(watcher->progressMaximum()-watcher->progressMinimum());
}
}
futureInterface.setProgressValue(progressSum);
}
void updateProgressText()
{
QString text;
const QList<QFutureWatcher<R> *> watchersValues = watchers.values();
foreach (QFutureWatcher<R> *watcher, watchersValues) {
if (!watcher->progressText().isEmpty())
text += watcher->progressText() + "\n";
}
text = text.trimmed();
futureInterface.setProgressValueAndText(futureInterface.progressValue(), text);
}
QFutureInterface<R> futureInterface;
void (Class::*fn)(QFutureInterface<R> &);
QList<Class *> objects;
QFutureWatcher<R> *selfWatcher;
QMap<Class *, QFutureWatcher<R> *> watchers;
QMap<QFutureWatcher<R> *, bool> finished;
QEventLoop *loop;
int maxProgress;
};
template <typename Class, typename T>
QFuture<T> run(void (Class::*fn)(QFutureInterface<T> &), const QList<Class *> &objects, int priority = 0)
{
MultiTask<Class, T> *task = new MultiTask<Class, T>(fn, objects);
QFuture<T> future = task->future();
QThreadPool::globalInstance()->start(task, priority);
return future;
}
} // namespace QtConcurrent
QT_END_NAMESPACE
#endif // MULTITASK_H
LIBS *= -l$$qtLibraryTarget(QtConcurrent)
TEMPLATE = lib
TARGET = QtConcurrent
DEFINES += BUILD_QTCONCURRENT
include(../../openpilotgcslibrary.pri)
HEADERS += \
qtconcurrent_global.h \
multitask.h \
runextensions.h
/**
******************************************************************************
*
* @file qtconcurrent_global.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup
* @{
*
*****************************************************************************/
/*
* 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 QTCONCURRENT_GLOBAL_H
#define QTCONCURRENT_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(BUILD_QTCONCURRENT)
# define QTCONCURRENT_EXPORT Q_DECL_EXPORT
#else
# define QTCONCURRENT_EXPORT Q_DECL_IMPORT
#endif
#endif // QTCONCURRENT_GLOBAL_H
This diff is collapsed.
......@@ -756,8 +756,7 @@ HEADERS += \
src/qgcunittest/FlightModeConfigTest.h \
src/qgcunittest/FlightGearTest.h \
src/qgcunittest/TCPLinkTest.h \
src/qgcunittest/TCPLoopBackServer.h \
src/qgcunittest/QGCUASFileManagerTest.h
src/qgcunittest/TCPLoopBackServer.h
SOURCES += \
src/qgcunittest/UASUnitTest.cc \
......@@ -769,5 +768,4 @@ SOURCES += \
src/qgcunittest/FlightModeConfigTest.cc \
src/qgcunittest/FlightGearTest.cc \
src/qgcunittest/TCPLinkTest.cc \
src/qgcunittest/TCPLoopBackServer.cc \
src/qgcunittest/QGCUASFileManagerTest.cc
src/qgcunittest/TCPLoopBackServer.cc
import QtQuick 1.1
import QtQuick 2.1
import "./components"
......
import QtQuick 1.1
import QtQuick 2.1
Rectangle {
signal clicked
......
import QtQuick 1.1
import QtQuick 2.1
Rectangle {
......
import QtQuick 1.1
import QtQuick 2.1
Rectangle {
id: statusDisplay
......
import QtQuick 1.1
import QtQuick 2.1
Rectangle {
signal clicked
......
Subproject commit 09109881e7a2dc1a0c381264d531e9b7930a7c80
Subproject commit 4a1cf20507252eafecb2e06618e73afceeb76608
......@@ -32,10 +32,6 @@
#include "QGCMAVLinkUASFactory.h"
#include "QGC.h"
#ifdef QGC_PROTOBUF_ENABLED
#include <google/protobuf/descriptor.h>
#endif
Q_DECLARE_METATYPE(mavlink_message_t)
/**
......@@ -317,87 +313,6 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
rstatus.txbuf, rstatus.noise, rstatus.remnoise);
}
#if defined(QGC_PROTOBUF_ENABLED)
if (message.msgid == MAVLINK_MSG_ID_EXTENDED_MESSAGE)
{
mavlink_extended_message_t extended_message;
extended_message.base_msg = message;
// read extended header
uint8_t* payload = reinterpret_cast<uint8_t*>(message.payload64);
memcpy(&extended_message.extended_payload_len, payload + 3, 4);
// Check if message is valid
if
(b.size() != MAVLINK_NUM_NON_PAYLOAD_BYTES+MAVLINK_EXTENDED_HEADER_LEN+ extended_message.extended_payload_len)
{
//invalid message
qDebug() << "GOT INVALID EXTENDED MESSAGE, ABORTING";
return;
}
const uint8_t* extended_payload = reinterpret_cast<const uint8_t*>(b.constData()) + MAVLINK_NUM_NON_PAYLOAD_BYTES + MAVLINK_EXTENDED_HEADER_LEN;
// copy extended payload data
memcpy(extended_message.extended_payload, extended_payload, extended_message.extended_payload_len);
#if defined(QGC_USE_PIXHAWK_MESSAGES)
if (protobufManager.cacheFragment(extended_message))
{
std::tr1::shared_ptr<google::protobuf::Message> protobuf_msg;
if (protobufManager.getMessage(protobuf_msg))
{
const google::protobuf::Descriptor* descriptor = protobuf_msg->GetDescriptor();
if (!descriptor)
{
continue;
}
const google::protobuf::FieldDescriptor* headerField = descriptor->FindFieldByName("header");
if (!headerField)
{
continue;
}
const google::protobuf::Descriptor* headerDescriptor = headerField->message_type();
if (!headerDescriptor)
{
continue;
}
const google::protobuf::FieldDescriptor* sourceSysIdField = headerDescriptor->FindFieldByName("source_sysid");
if (!sourceSysIdField)
{
continue;
}
const google::protobuf::Reflection* reflection = protobuf_msg->GetReflection();
const google::protobuf::Message& headerMsg = reflection->GetMessage(*protobuf_msg, headerField);
const google::protobuf::Reflection* headerReflection = headerMsg.GetReflection();
int source_sysid = headerReflection->GetInt32(headerMsg, sourceSysIdField);
UASInterface* uas = UASManager::instance()->getUASForId(source_sysid);
if (uas != NULL)
{
emit extendedMessageReceived(link, protobuf_msg);
}
}
}
#endif
position += extended_message.extended_payload_len;
continue;
}
#endif
// Log data
if (m_loggingEnabled && m_logfile)
{
......
......@@ -42,15 +42,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLink.h"
#include "QGC.h"
#if defined(QGC_PROTOBUF_ENABLED)
#include <tr1/memory>
#include <google/protobuf/message.h>
#if defined(QGC_USE_PIXHAWK_MESSAGES)
#include <mavlink_protobuf_manager.hpp>
#endif
#endif
/**
* @brief MAVLink micro air vehicle protocol reference implementation.
*
......@@ -239,17 +230,9 @@ protected:
int systemId;
bool _should_exit;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
mavlink::ProtobufManager protobufManager;
#endif
signals:
/** @brief Message received and directly copied via signal */
void messageReceived(LinkInterface* link, mavlink_message_t message);
#if defined(QGC_PROTOBUF_ENABLED)
/** @brief Message received via signal */
void extendedMessageReceived(LinkInterface *link, std::tr1::shared_ptr<google::protobuf::Message> message);
#endif
/** @brief Emitted if heartbeat emission mode is changed */
void heartbeatChanged(bool heartbeats);
/** @brief Emitted if logging is started / stopped */
......
......@@ -55,7 +55,7 @@ This file is part of the QGROUNDCONTROL project
void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
const char symbols[] = { 'I', 'E', '!', 'X' };
QString output = QString("[%1] in %2:%3 - \"%2\"").arg(symbols[type]).arg(context.file).arg(context.line).arg(msg);
QString output = QString("[%1] at %2:%3 - \"%4\"").arg(symbols[type]).arg(context.file).arg(context.line).arg(msg);
std::cerr << output.toStdString() << std::endl;
if( type == QtFatalMsg ) abort();
}
......
......@@ -97,18 +97,6 @@ public:
virtual double getPitch() const { Q_ASSERT(false); return std::numeric_limits<double>::quiet_NaN(); };
virtual double getYaw() const { Q_ASSERT(false); return std::numeric_limits<double>::quiet_NaN(); };
virtual bool getSelected() const { Q_ASSERT(false); return false; };
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
virtual px::GLOverlay getOverlay() { Q_ASSERT(false); };
virtual px::GLOverlay getOverlay(qreal& receivedTimestamp) { Q_ASSERT(false); };
virtual px::ObstacleList getObstacleList() { Q_ASSERT(false); };
virtual px::ObstacleList getObstacleList(qreal& receivedTimestamp) { Q_ASSERT(false); };
virtual px::Path getPath() { Q_ASSERT(false); };
virtual px::Path getPath(qreal& receivedTimestamp) { Q_ASSERT(false); };
virtual px::PointCloudXYZRGB getPointCloud() { Q_ASSERT(false); };
virtual px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) { Q_ASSERT(false); };
virtual px::RGBDImage getRGBDImage() { Q_ASSERT(false); };
virtual px::RGBDImage getRGBDImage(qreal& receivedTimestamp) { Q_ASSERT(false); };
#endif
virtual bool isArmed() const { Q_ASSERT(false); return false; };
virtual int getAirframe() const { Q_ASSERT(false); return 0; };
virtual UASWaypointManager* getWaypointManager(void) { Q_ASSERT(false); return NULL; };
......
......@@ -206,14 +206,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
#endif
}
#if defined(QGC_PROTOBUF_ENABLED)
void PxQuadMAV::receiveExtendedMessage(LinkInterface* link, std::tr1::shared_ptr<google::protobuf::Message> message)
{
UAS::receiveExtendedMessage(link, message);
}
#endif
void PxQuadMAV::sendProcessCommand(int watchdogId, int processId, unsigned int command)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
......
......@@ -35,10 +35,6 @@ public:
public slots:
/** @brief Receive a MAVLink message from this MAV */
void receiveMessage(LinkInterface* link, mavlink_message_t message);
#if defined(QGC_PROTOBUF_ENABLED)
/** @brief Receive a Protobuf message from this MAV */
void receiveExtendedMessage(LinkInterface* link, std::tr1::shared_ptr<google::protobuf::Message> message);
#endif
/** @brief Send a command to an onboard process */
void sendProcessCommand(int watchdogId, int processId, unsigned int command);
signals:
......
......@@ -36,9 +36,6 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
// Connect this robot to the UAS object
connect(mavlink, SIGNAL(messageReceived(LinkInterface*, mavlink_message_t)), mav, SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
connect(mavlink, SIGNAL(messageReceived(LinkInterface*,mavlink_message_t)), mav->getFileManager(), SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
#ifdef QGC_PROTOBUF_ENABLED
connect(mavlink, SIGNAL(extendedMessageReceived(LinkInterface*, std::tr1::shared_ptr<google::protobuf::Message>)), mav, SLOT(receiveExtendedMessage(LinkInterface*, std::tr1::shared_ptr<google::protobuf::Message>)));
#endif
uas = mav;
}
break;
......@@ -53,9 +50,6 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
// else the slot of the parent object is called (and thus the special
// packets never reach their goal)
connect(mavlink, SIGNAL(messageReceived(LinkInterface*, mavlink_message_t)), mav, SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
#ifdef QGC_PROTOBUF_ENABLED
connect(mavlink, SIGNAL(extendedMessageReceived(LinkInterface*, std::tr1::shared_ptr<google::protobuf::Message>)), mav, SLOT(receiveExtendedMessage(LinkInterface*, std::tr1::shared_ptr<google::protobuf::Message>)));
#endif
uas = mav;
}
break;
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#include "QGCUASFileManager.h"
......@@ -86,14 +86,14 @@ quint32 QGCUASFileManager::crc32(Request* request, unsigned state)
{
uint8_t* data = (uint8_t*)request;
size_t cbData = sizeof(RequestHeader) + request->hdr.size;
// Always calculate CRC with 0 initial CRC value
quint32 crcSave = request->hdr.crc32;
request->hdr.crc32 = 0;
for (size_t i=0; i < cbData; i++)
state = crctab[(state ^ data[i]) & 0xff] ^ (state >> 8);
request->hdr.crc32 = crcSave;
return state;
......@@ -104,17 +104,17 @@ void QGCUASFileManager::_openAckResponse(Request* openAck)
{
_currentOperation = kCORead;
_activeSession = openAck->hdr.session;
_readOffset = 0; // Start reading at beginning of file
_readFileAccumulator.clear(); // Start with an empty file
Request request;
request.hdr.magic = 'f';
request.hdr.session = _activeSession;
request.hdr.opcode = kCmdRead;
request.hdr.offset = _readOffset;
request.hdr.size = sizeof(request.data);
_sendRequest(&request);
}
......@@ -124,13 +124,13 @@ void QGCUASFileManager::_closeReadSession(bool success)
{
if (success) {
QString downloadFilePath = _readFileDownloadDir.absoluteFilePath(_readFileDownloadFilename);
QFile file(downloadFilePath);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
_emitErrorMessage(tr("Unable to open local file for writing (%1)").arg(downloadFilePath));
return;
}
qint64 bytesWritten = file.write((const char *)_readFileAccumulator, _readFileAccumulator.length());
if (bytesWritten != _readFileAccumulator.length()) {
file.close();
......@@ -138,10 +138,10 @@ void QGCUASFileManager::_closeReadSession(bool success)
return;
}
file.close();
_emitStatusMessage(tr("Download complete '%1'").arg(downloadFilePath));
}
// Close the open session
_sendTerminateCommand();
}
......@@ -155,7 +155,7 @@ void QGCUASFileManager::_readAckResponse(Request* readAck)
_emitErrorMessage(tr("Read: Incorrect session returned"));
return;
}
if (readAck->hdr.offset != _readOffset) {
_currentOperation = kCOIdle;
_readFileAccumulator.clear();
......@@ -164,20 +164,20 @@ void QGCUASFileManager::_readAckResponse(Request* readAck)
}
_readFileAccumulator.append((const char*)readAck->data, readAck->hdr.size);
if (readAck->hdr.size == sizeof(readAck->data)) {
// Possibly still more data to read, send next read request
_currentOperation = kCORead;
_readOffset += readAck->hdr.size;
Request request;
request.hdr.magic = 'f';
request.hdr.session = _activeSession;
request.hdr.opcode = kCmdRead;
request.hdr.offset = _readOffset;
_sendRequest(&request);
} else {
// We only receieved a partial buffer back. These means we are at EOF
......@@ -194,15 +194,15 @@ void QGCUASFileManager::_listAckResponse(Request* listAck)
_emitErrorMessage(tr("List: Offset returned (%1) differs from offset requested (%2)").arg(listAck->hdr.offset).arg(_listOffset));
return;
}
uint8_t offset = 0;
uint8_t cListEntries = 0;
uint8_t cBytes = listAck->hdr.size;
// parse filenames out of the buffer
while (offset < cBytes) {
const char * ptr = ((const char *)listAck->data) + offset;
// get the length of the name
uint8_t cBytesLeft = cBytes - offset;
size_t nlen = strnlen(ptr, cBytesLeft);
......@@ -221,10 +221,10 @@ void QGCUASFileManager::_listAckResponse(Request* listAck)
// put it in the view
_emitStatusMessage(ptr);
}
// account for the name + NUL
offset += nlen + 1;
cListEntries++;
}
......@@ -244,12 +244,17 @@ void QGCUASFileManager::_listAckResponse(Request* listAck)
void QGCUASFileManager::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
Q_UNUSED(link);
if (message.msgid != MAVLINK_MSG_ID_ENCAPSULATED_DATA) {
// wtf, not for us
return;
}
// XXX: hack to prevent files from videostream to interfere
if (message.compid != MAV_COMP_ID_IMU) {
return;
}
_clearAckTimeout();
mavlink_encapsulated_data_t data;
......@@ -257,28 +262,28 @@ void QGCUASFileManager::receiveMessage(LinkInterface* link, mavlink_message_t me
Request* request = (Request*)&data.data[0];
// FIXME: Check CRC
if (request->hdr.opcode == kRspAck) {
switch (_currentOperation) {
case kCOIdle:
// we should not be seeing anything here.. shut the other guy up
_sendCmdReset();
break;
case kCOAck:
// We are expecting an ack back
_currentOperation = kCOIdle;
break;
case kCOList:
_listAckResponse(request);
break;
case kCOOpen:
_openAckResponse(request);
break;
case kCORead:
_readAckResponse(request);
break;
......@@ -289,12 +294,12 @@ void QGCUASFileManager::receiveMessage(LinkInterface* link, mavlink_message_t me
}
} else if (request->hdr.opcode == kRspNak) {
Q_ASSERT(request->hdr.size == 1); // Should only have one byte of error code
OperationState previousOperation = _currentOperation;
uint8_t errorCode = request->data[0];
_currentOperation = kCOIdle;
if (previousOperation == kCOList && errorCode == kErrEOF) {
// This is not an error, just the end of the read loop
emit listComplete();
......@@ -351,9 +356,9 @@ void QGCUASFileManager::_sendListCommand(void)
request.hdr.session = 0;
request.hdr.opcode = kCmdList;
request.hdr.offset = _listOffset;
_fillRequestWithString(&request, _listPath);
_sendRequest(&request);
}
......@@ -365,9 +370,9 @@ void QGCUASFileManager::downloadPath(const QString& from, const QDir& downloadDi
if (from.isEmpty()) {
return;
}
_readFileDownloadDir.setPath(downloadDir.absolutePath());
// We need to strip off the file name from the fully qualified path. We can't use the usual QDir
// routines because this path does not exist locally.
int i;
......@@ -378,9 +383,9 @@ void QGCUASFileManager::downloadPath(const QString& from, const QDir& downloadDi
}
i++; // move past slash
_readFileDownloadFilename = from.right(from.size() - i);
emit resetStatusMessages();
_currentOperation = kCOOpen;
Request request;
......@@ -436,18 +441,18 @@ bool QGCUASFileManager::_sendOpcodeOnlyCmd(uint8_t opcode, OperationState newOpS
// Can't have multiple commands in play at the same time
return false;
}
Request request;
request.hdr.magic = 'f';
request.hdr.session = 0;
request.hdr.opcode = opcode;
request.hdr.offset = 0;
request.hdr.size = 0;
_currentOperation = newOpState;
_sendRequest(&request);
return true;
}
......@@ -455,7 +460,7 @@ bool QGCUASFileManager::_sendOpcodeOnlyCmd(uint8_t opcode, OperationState newOpS
void QGCUASFileManager::_setupAckTimeout(void)
{
Q_ASSERT(!_ackTimer.isActive());
_ackTimer.setSingleShot(true);
_ackTimer.start(_ackTimerTimeoutMsecs);
}
......@@ -464,7 +469,7 @@ void QGCUASFileManager::_setupAckTimeout(void)
void QGCUASFileManager::_clearAckTimeout(void)
{
Q_ASSERT(_ackTimer.isActive());
_ackTimer.stop();
}
......@@ -513,7 +518,7 @@ void QGCUASFileManager::_emitStatusMessage(const QString& msg)
void QGCUASFileManager::_sendRequest(Request* request)
{
mavlink_message_t message;
_setupAckTimeout();
request->hdr.crc32 = crc32(request);
......
......@@ -30,10 +30,6 @@
#include <Eigen/Geometry>
#include <comm/px4_custom_mode.h>
#ifdef QGC_PROTOBUF_ENABLED
#include <google/protobuf/descriptor.h>
#endif
/**
* Gets the settings from the previous UAS (name, airframe, autopilot, battery specs)
* by calling readSettings. This means the new UAS will have the same settings
......@@ -128,14 +124,6 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(),
nedPosGlobalOffset(0,0,0),
nedAttGlobalOffset(0,0,0),
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
receivedOverlayTimestamp(0.0),
receivedObstacleListTimestamp(0.0),
receivedPathTimestamp(0.0),
receivedPointCloudTimestamp(0.0),
receivedRGBDImageTimestamp(0.0),
#endif
airSpeed(std::numeric_limits<double>::quiet_NaN()),
groundSpeed(std::numeric_limits<double>::quiet_NaN()),
waypointManager(this),
......@@ -1545,105 +1533,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
#if defined(QGC_PROTOBUF_ENABLED)
/**
* Receive an extended message.
* @param link
* @param message
*/
void UAS::receiveExtendedMessage(LinkInterface* link, std::tr1::shared_ptr<google::protobuf::Message> message)
{
if (!link)
{
return;
}
if (!links->contains(link))
{
addLink(link);
}
const google::protobuf::Descriptor* descriptor = message->GetDescriptor();
if (!descriptor)
{
return;
}
const google::protobuf::FieldDescriptor* headerField = descriptor->FindFieldByName("header");
if (!headerField)
{
return;
}
const google::protobuf::Descriptor* headerDescriptor = headerField->message_type();
if (!headerDescriptor)
{
return;
}
const google::protobuf::FieldDescriptor* sourceSysIdField = headerDescriptor->FindFieldByName("source_sysid");
if (!sourceSysIdField)
{
return;
}
const google::protobuf::Reflection* reflection = message->GetReflection();
const google::protobuf::Message& headerMsg = reflection->GetMessage(*message, headerField);
const google::protobuf::Reflection* headerReflection = headerMsg.GetReflection();
int source_sysid = headerReflection->GetInt32(headerMsg, sourceSysIdField);
if (source_sysid != uasId)
{
return;
}
#ifdef QGC_USE_PIXHAWK_MESSAGES
if (message->GetTypeName() == overlay.GetTypeName())
{
receivedOverlayTimestamp = QGC::groundTimeSeconds();
overlayMutex.lock();
overlay.CopyFrom(*message);
overlayMutex.unlock();
emit overlayChanged(this);
}
else if (message->GetTypeName() == obstacleList.GetTypeName())
{
receivedObstacleListTimestamp = QGC::groundTimeSeconds();
obstacleListMutex.lock();
obstacleList.CopyFrom(*message);
obstacleListMutex.unlock();
emit obstacleListChanged(this);
}
else if (message->GetTypeName() == path.GetTypeName())
{
receivedPathTimestamp = QGC::groundTimeSeconds();
pathMutex.lock();
path.CopyFrom(*message);
pathMutex.unlock();
emit pathChanged(this);
}
else if (message->GetTypeName() == pointCloud.GetTypeName())
{
receivedPointCloudTimestamp = QGC::groundTimeSeconds();
pointCloudMutex.lock();
pointCloud.CopyFrom(*message);
pointCloudMutex.unlock();
emit pointCloudChanged(this);
}
else if (message->GetTypeName() == rgbdImage.GetTypeName())
{
receivedRGBDImageTimestamp = QGC::groundTimeSeconds();
rgbdImageMutex.lock();
rgbdImage.CopyFrom(*message);
rgbdImageMutex.unlock();
emit rgbdImageChanged(this);
}
#endif
}
#endif
/**
* Set the home position of the UAS.
* @param lat The latitude fo the home position
......
......@@ -45,13 +45,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCUASParamManagerInterface.h"
#include "RadioCalibration/RadioCalibrationData.h"
#ifdef QGC_PROTOBUF_ENABLED
#include <tr1/memory>
#ifdef QGC_USE_PIXHAWK_MESSAGES
#include <pixhawk/pixhawk.pb.h>
#endif
#endif
class QGCUASFileManager;
enum BatteryType
......@@ -136,19 +129,6 @@ public:
virtual bool getSelected() const = 0;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
virtual px::GLOverlay getOverlay() = 0;
virtual px::GLOverlay getOverlay(qreal& receivedTimestamp) = 0;
virtual px::ObstacleList getObstacleList() = 0;
virtual px::ObstacleList getObstacleList(qreal& receivedTimestamp) = 0;
virtual px::Path getPath() = 0;
virtual px::Path getPath(qreal& receivedTimestamp) = 0;
virtual px::PointCloudXYZRGB getPointCloud() = 0;
virtual px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) = 0;
virtual px::RGBDImage getRGBDImage() = 0;
virtual px::RGBDImage getRGBDImage(qreal& receivedTimestamp) = 0;
#endif
virtual bool isArmed() const = 0;
/** @brief Set the airframe of this MAV */
......@@ -603,19 +583,6 @@ signals:
/** @brief Radio Calibration Data has been received from the MAV*/
void radioCalibrationReceived(const QPointer<RadioCalibrationData>&);
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
/** @brief Overlay data has been changed */
void overlayChanged(UASInterface* uas);
/** @brief Obstacle list data has been changed */
void obstacleListChanged(UASInterface* uas);
/** @brief Path data has been changed */
void pathChanged(UASInterface* uas);
/** @brief Point cloud data has been changed */
void pointCloudChanged(UASInterface* uas);
/** @brief RGBD image data has been changed */
void rgbdImageChanged(UASInterface* uas);
#endif
/**
* @brief Localization quality changed
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
......
......@@ -47,7 +47,7 @@ DebugConsole::DebugConsole(QWidget *parent) :
currLink(NULL),
holdOn(false),
convertToAscii(true),
filterMAVLINK(false),
filterMAVLINK(true),
autoHold(true),
bytesToIgnore(0),
lastByte(-1),
......
......@@ -190,13 +190,11 @@ void MainWindow::init()
menuActionHelper->setMenu(ui.menuTools);
// Qt 4 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar.
// TODO: Check that this is still necessary on Qt5 on Ubuntu
#ifdef Q_OS_LINUX
menuBar()->setNativeMenuBar(false);
#endif
// We only need this menu if we have more than one system
// ui.menuConnected_Systems->setEnabled(false);
// Set dock options
setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks);
......@@ -437,7 +435,6 @@ MainWindow::~MainWindow()
}
}
// Delete all UAS objects
delete debugConsole;
delete menuActionHelper;
for (int i=0;i<commsWidgetList.size();i++)
{
......@@ -665,18 +662,8 @@ void MainWindow::buildCommonWidgets()
menuActionHelper->createToolAction(tr("Status Details"), "UAS_STATUS_DETAILS_DOCKWIDGET");
{
if (!debugConsole)
{
debugConsole = new DebugConsole();
debugConsole->setWindowTitle("Communications Console");
debugConsole->hide();
QAction* tempAction = ui.menuTools->addAction(tr("Communication Console"));
tempAction->setCheckable(true);
connect(tempAction,SIGNAL(triggered(bool)),debugConsole,SLOT(setShown(bool)));
}
}
createDockWidget(simView,new HSIDisplay(this),tr("Horizontal Situation"),"HORIZONTAL_SITUATION_INDICATOR_DOCKWIDGET",VIEW_SIMULATION,Qt::BottomDockWidgetArea);
createDockWidget(pilotView, new DebugConsole(this), tr("Communications Console"), "COMMUNICATION_CONSOLE_DOCKWIDGET", VIEW_FLIGHT, Qt::LeftDockWidgetArea);
//createDockWidget(simView,new HSIDisplay(this),tr("Horizontal Situation"),"HORIZONTAL_SITUATION_INDICATOR_DOCKWIDGET",VIEW_SIMULATION,Qt::BottomDockWidgetArea);
menuActionHelper->createToolAction(tr("Flight Display"), "HEAD_DOWN_DISPLAY_1_DOCKWIDGET");
menuActionHelper->createToolAction(tr("Actuator Status"), "HEAD_DOWN_DISPLAY_2_DOCKWIDGET");
......@@ -685,7 +672,7 @@ void MainWindow::buildCommonWidgets()
createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::RightDockWidgetArea);
createDockWidget(simView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea);
createDockWidget(pilotView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea);
createDockWidget(plannerView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea);
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this);
infoview->addSource(mavlinkDecoder);
......
......@@ -463,8 +463,6 @@ protected:
QPointer<QGCToolBar> toolBar;
QPointer<QGCStatusBar> customStatusBar;
QPointer<DebugConsole> debugConsole;
QPointer<QDockWidget> mavlinkInspectorWidget;
QPointer<MAVLinkDecoder> mavlinkDecoder;
QPointer<QDockWidget> mavlinkSenderWidget;
......
......@@ -377,6 +377,9 @@
<property name="text">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Application settings</string>
</property>
</action>
<action name="actionFullscreen">
<property name="checkable">
......@@ -439,10 +442,10 @@
<normaloff>:/files/images/categories/preferences-system.svg</normaloff>:/files/images/categories/preferences-system.svg</iconset>
</property>
<property name="text">
<string>Config</string>
<string>Vehicle Setup</string>
</property>
<property name="toolTip">
<string>Configuration options of the vehicle.</string>
<string>Hardware setup of the vehicle</string>
</property>
</action>
<action name="actionAdvanced_Mode">
......
......@@ -104,8 +104,13 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateView()));
updateTimer.start();
ui->advancedGroupBox->hide();
connect(ui->advancedCheckBox,SIGNAL(toggled(bool)),ui->advancedGroupBox,SLOT(setShown(bool)));
// Make sure the advanced features match what the checkbox indicates on startup and listen for
// future changes.
if (!ui->advancedCheckBox->isChecked())
{
ui->advancedGroupBox->hide();
}
connect(ui->advancedCheckBox, SIGNAL(toggled(bool)), ui->advancedGroupBox,SLOT(setVisible(bool)));
}
void QGCVehicleConfig::rcMenuButtonClicked()
{
......
......@@ -132,7 +132,8 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
connect(ui.parEven, SIGNAL(toggled(bool)), this, SLOT(setParityEven(bool)));
connect(ui.dataBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setDataBits(int)));
connect(ui.stopBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setStopBits(int)));
connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.advGroupBox,SLOT(setShown(bool)));
connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.advGroupBox, SLOT(setVisible(bool)));
ui.advCheckBox->setCheckable(true);
ui.advCheckBox->setChecked(false);
ui.advGroupBox->setVisible(false);
......
......@@ -38,7 +38,7 @@ ApmFirmwareConfig::ApmFirmwareConfig(QWidget *parent) : QWidget(parent)
ui.progressBar->setValue(0);
ui.textBrowser->setVisible(false);
connect(ui.showOutputCheckBox,SIGNAL(clicked(bool)),ui.textBrowser,SLOT(setShown(bool)));
connect(ui.showOutputCheckBox,SIGNAL(clicked(bool)),ui.textBrowser,SLOT(setVisible(bool)));
/*addBetaLabel(ui.roverPushButton);
addBetaLabel(ui.planePushButton);
......
......@@ -49,13 +49,13 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
ui.osdButton->setVisible(false);
ui.cameraGimbalButton->setVisible(false);
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.radio3DRButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.batteryMonitorButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.sonarButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.opticalFlowButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.osdButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.cameraGimbalButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.antennaTrackerButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.radio3DRButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.batteryMonitorButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.sonarButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.opticalFlowButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.osdButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.cameraGimbalButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.antennaTrackerButton,SLOT(setVisible(bool)));
connect(ui.frameTypeButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
......@@ -157,27 +157,27 @@ void ApmHardwareConfig::activeUASSet(UASInterface *uas)
}
if (uas->getSystemType() == MAV_TYPE_FIXED_WING)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.arduPlaneLevelButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.airspeedButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.arduPlaneLevelButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setVisible(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.airspeedButton,SLOT(setVisible(bool)));
}
else if (uas->getSystemType() == MAV_TYPE_QUADROTOR)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.frameTypeButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.accelCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.frameTypeButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.accelCalibrateButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setVisible(bool)));
}
else if (uas->getSystemType() == MAV_TYPE_GROUND_ROVER)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setVisible(bool)));
}
else
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setVisible(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setVisible(bool)));
}
ui.firmwareButton->setVisible(true);
ui.manditoryHardware->setVisible(true);
......
......@@ -100,8 +100,6 @@ IncrementalPlot::IncrementalPlot(QWidget *parent):
resetScaling();
legend = NULL;
connect(this, SIGNAL(legendChecked(QwtPlotItem*,bool)), this, SLOT(handleLegendClick(QwtPlotItem*,bool)));
}
IncrementalPlot::~IncrementalPlot()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment