Commit 21827374 authored by Lorenz Meier's avatar Lorenz Meier

Adding vehicle configuration widget, fixed link disconnected logic for serial links

parent 337b2eeb
......@@ -222,7 +222,8 @@ FORMS += src/ui/MainWindow.ui \
src/ui/mission/QGCMissionNavTakeoff.ui \
src/ui/mission/QGCMissionNavSweep.ui \
src/ui/mission/QGCMissionDoStartSearch.ui \
src/ui/mission/QGCMissionDoFinishSearch.ui
src/ui/mission/QGCMissionDoFinishSearch.ui \
src/ui/QGCVehicleConfig.ui
INCLUDEPATH += src \
src/ui \
src/ui/linechart \
......@@ -356,7 +357,8 @@ HEADERS += src/MG.h \
src/ui/mission/QGCMissionNavTakeoff.h \
src/ui/mission/QGCMissionNavSweep.h \
src/ui/mission/QGCMissionDoStartSearch.h \
src/ui/mission/QGCMissionDoFinishSearch.h
src/ui/mission/QGCMissionDoFinishSearch.h \
src/ui/QGCVehicleConfig.h
# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010::HEADERS += src/ui/map3D/QGCGoogleEarthView.h
......@@ -510,7 +512,8 @@ SOURCES += src/main.cc \
src/ui/mission/QGCMissionNavTakeoff.cc \
src/ui/mission/QGCMissionNavSweep.cc \
src/ui/mission/QGCMissionDoStartSearch.cc \
src/ui/mission/QGCMissionDoFinishSearch.cc
src/ui/mission/QGCMissionDoFinishSearch.cc \
src/ui/QGCVehicleConfig.cc
# Enable Google Earth only on Mac OS and Windows with Visual Studio compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010::SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
......
......@@ -436,12 +436,19 @@ void SerialLink::checkForBytes()
{
readBytes();
}
else if (available < 0) {
/* Error, close port */
port->close();
emit disconnected();
emit connected(false);
emit communicationError(this->getName(), tr("Could not send data - link %1 is disconnected!").arg(this->getName()));
}
}
else
{
emit disconnected();
emit connected(false);
}
// else
// {
// emit disconnected();
// emit connected(false);
// }
}
......
......@@ -1151,6 +1151,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_DEBUG:
case MAVLINK_MSG_ID_NAMED_VALUE_FLOAT:
case MAVLINK_MSG_ID_NAMED_VALUE_INT:
case MAVLINK_MSG_ID_MANUAL_CONTROL:
break;
default:
{
......
......@@ -438,10 +438,10 @@ void MainWindow::buildCommonWidgets()
if (!parametersDockWidget)
{
parametersDockWidget = new QDockWidget(tr("Calibration and Onboard Parameters"), this);
parametersDockWidget = new QDockWidget(tr("Onboard Parameters"), this);
parametersDockWidget->setWidget( new ParameterInterface(this) );
parametersDockWidget->setObjectName("PARAMETER_INTERFACE_DOCKWIDGET");
addTool(parametersDockWidget, tr("Calibration and Parameters"), Qt::RightDockWidgetArea);
addTool(parametersDockWidget, tr("Onboard Parameters"), Qt::RightDockWidgetArea);
}
if (!hsiDockWidget)
......@@ -556,25 +556,35 @@ void MainWindow::buildCommonWidgets()
addCentralWidget(firmwareUpdateWidget, "Firmware Update");
}
if (!hudWidget) {
if (!hudWidget)
{
hudWidget = new HUD(320, 240, this);
addCentralWidget(hudWidget, tr("Head Up Display"));
}
if (!dataplotWidget) {
if (!configWidget)
{
configWidget = new QGCVehicleConfig(this);
addCentralWidget(configWidget, tr("Vehicle Configuration"));
}
if (!dataplotWidget)
{
dataplotWidget = new QGCDataPlot2D(this);
addCentralWidget(dataplotWidget, tr("Logfile Plot"));
}
#ifdef QGC_OSG_ENABLED
if (!_3DWidget) {
if (!_3DWidget)
{
_3DWidget = Q3DWidgetFactory::get("PIXHAWK", this);
addCentralWidget(_3DWidget, tr("Local 3D"));
}
#endif
#if (defined _MSC_VER) | (defined Q_OS_MAC)
if (!gEarthWidget) {
if (!gEarthWidget)
{
gEarthWidget = new QGCGoogleEarthView(this);
addCentralWidget(gEarthWidget, tr("Google Earth"));
}
......
......@@ -76,6 +76,7 @@ This file is part of the QGROUNDCONTROL project
#include "UASControlParameters.h"
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkLogPlayer.h"
#include "QGCVehicleConfig.h"
#include "MAVLinkDecoder.h"
class QGCMapTool;
......@@ -313,6 +314,7 @@ protected:
// Center widgets
QPointer<Linecharts> linechartWidget;
QPointer<HUD> hudWidget;
QPointer<QGCVehicleConfig> configWidget;
QPointer<QGCMapTool> mapWidget;
QPointer<XMLCommProtocolWidget> protocolWidget;
QPointer<QGCDataPlot2D> dataplotWidget;
......
#include "QGCVehicleConfig.h"
#include "ui_QGCVehicleConfig.h"
QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCVehicleConfig)
{
ui->setupUi(this);
}
QGCVehicleConfig::~QGCVehicleConfig()
{
delete ui;
}
#ifndef QGCVEHICLECONFIG_H
#define QGCVEHICLECONFIG_H
#include <QWidget>
namespace Ui {
class QGCVehicleConfig;
}
class QGCVehicleConfig : public QWidget
{
Q_OBJECT
public:
explicit QGCVehicleConfig(QWidget *parent = 0);
~QGCVehicleConfig();
private:
Ui::QGCVehicleConfig *ui;
};
#endif // QGCVEHICLECONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCVehicleConfig</class>
<widget class="QWidget" name="QGCVehicleConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>499</width>
<height>451</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="rcTab">
<attribute name="title">
<string>Tab 1</string>
</attribute>
<widget class="QSlider" name="yawSlider">
<property name="geometry">
<rect>
<x>10</x>
<y>230</y>
<width>160</width>
<height>22</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QSlider" name="throttleSlider">
<property name="geometry">
<rect>
<x>170</x>
<y>80</y>
<width>22</width>
<height>160</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QSlider" name="rollSlider">
<property name="geometry">
<rect>
<x>220</x>
<y>230</y>
<width>160</width>
<height>22</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QSlider" name="pitchSlider">
<property name="geometry">
<rect>
<x>380</x>
<y>80</y>
<width>22</width>
<height>160</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QSlider" name="chan5Slider">
<property name="geometry">
<rect>
<x>30</x>
<y>300</y>
<width>22</width>
<height>71</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QSlider" name="chan6Slider">
<property name="geometry">
<rect>
<x>60</x>
<y>300</y>
<width>22</width>
<height>71</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QSlider" name="chan7Slider">
<property name="geometry">
<rect>
<x>90</x>
<y>300</y>
<width>22</width>
<height>71</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QSlider" name="chan8Slider">
<property name="geometry">
<rect>
<x>120</x>
<y>300</y>
<width>22</width>
<height>71</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>141</width>
<height>151</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>220</x>
<y>70</y>
<width>151</width>
<height>141</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
<widget class="QComboBox" name="rcTypeComboBox">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>171</width>
<height>26</height>
</rect>
</property>
<item>
<property name="text">
<string>Select RC model</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>210</x>
<y>20</y>
<width>191</width>
<height>26</height>
</rect>
</property>
<item>
<property name="text">
<string>Select RC mode</string>
</property>
</item>
</widget>
<widget class="QProgressBar" name="yawProgressBar">
<property name="geometry">
<rect>
<x>10</x>
<y>250</y>
<width>171</width>
<height>23</height>
</rect>
</property>
<property name="value">
<number>24</number>
</property>
</widget>
</widget>
<widget class="QWidget" name="sensorTab">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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