Commit 43918649 authored by pixhawk's avatar pixhawk
Browse files

Merge branch 'master' of pixhawk.ethz.ch:qgroundcontrol

parents 15058112 26d325fe
......@@ -44,3 +44,4 @@ user_config.pri
*.cproject
*.sln
*.suo
*thirdParty*
......@@ -75,15 +75,13 @@ endif(NOT CMAKE_BUILD_TYPE)
enable_language(C)
enable_language(CXX)
# initialize variables
set(qgroundcontrol_LIBRARIES qgroundcontrolNavigation qgroundcontrolCommunication)
set(SCICOSLAB_BLOCKS stdBlocks;jsbsimBlocks;mavlinkBlocks)
# installer
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}-cpack")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}-cpack")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}")
set(CPACK_GENERATOR "DEB")
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_SET_DESTDIR TRUE)
set(CPACK_PACKAGE_CONTACT "James Goppert james.goppert@gmail.com")
......@@ -93,7 +91,8 @@ set(CPACK_PACKAGE_DESCRITION_SUMMARY "
A qt based ground-control program for unmanned systems.
")
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES}
/.git/;/build/;~$;.*\\\\.bin$;.*\\\\.swp$)
"/.git/";"/build/";"~$";".*\\\\.bin$";".*\\\\.swp$"
)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
set(CPACK_PACKAGE_VERSION_MAJOR ${qgroundcontrol_VERSION_MAJOR})
......@@ -125,7 +124,13 @@ if (UNIX)
find_package(Flite)
endif(UNIX)
find_package(OpenGL REQUIRED)
find_package(OpenSceneGraph 2.8.3 COMPONENTS osgGA osgDB osgUtil osgViewer)
find_package(OpenSceneGraph 2.9.9 COMPONENTS osgGA osgDB osgUtil osgViewer)
if ("OSG_LIBRARY-NOTFOUND" STREQUAL "${OSG_LIBRARY}")
set(OPENSCENEGRAPH_FOUND FALSE)
else()
set(OPENSCENEGRAPH_FOUND TRUE)
endif()
find_or_build_from_source(MAVLINK thirdParty/mavlink FOUND_GIT_REPO)
# build libraries from source if not found on system
......@@ -184,6 +189,7 @@ set(qgroundcontrolIncludes
lib/QMapControl
${PROJECT_BINARY_DIR}
)
set (qgroundcontrolLibs)
# dependency summary
message(STATUS "=======================================")
......@@ -191,52 +197,49 @@ message(STATUS "\tDEPENDENCY\t\tFOUND")
message(STATUS "=======================================")
# common dependencies
message(STATUS "\t\tMAVLINK\t\t${MAVLINK_FOUND}")
if (MAVLINK_FOUND)
message(STATUS "\t\tMAVLINK\t\tYES")
list(APPEND qgroundcontrolIncludes ${MAVLINK_INCLUDE_DIRS})
else()
message(STATUS "\t\tOpenSceneGraph\t\tNO")
endif (MAVLINK_FOUND)
endif()
message(STATUS "\t\tOpenSceneGraph\t${OPENSCENEGRAPH_FOUND}")
if (OPENSCENEGRAPH_FOUND)
message(STATUS "\t\tOpenSceneGraph\tYES")
list(APPEND qgroundcontrolIncludes ${OPENSCENEGRAPH_INCLUDE_DIRS})
else()
message(STATUS "\t\tOpenSceneGraph\t\tNO")
endif (OPENSCENEGRAPH_FOUND)
list(APPEND qgroundcontrolLibs ${OPENSCENEGRAPH_LIBRARIES})
endif()
message(STATUS "\t\tQT4\t\t${QT4_FOUND}")
if (QT4_FOUND)
message(STATUS "\t\tQT4\t\tYES")
list(APPEND qgroundcontrolIncludes ${QT_INCLUDE_DIRS})
else()
message(STATUS "\t\tQT4\t\tNO")
endif (QT4_FOUND)
list(APPEND qgroundcontrolLibs ${QT_LIBRARIES})
endif()
message(STATUS "\t\tPHONON\t\t${PHONON_FOUND}")
if (PHONON_FOUND)
message(STATUS "\t\tPHONON\t\tYES")
list(APPEND qgroundcontrolIncludes ${PHONON_INCLUDE_DIR}/phonon)
else()
message(STATUS "\t\tPHONON\t\tNO")
endif (PHONON_FOUND)
list(APPEND qgroundcontrolIncludes ${PHONON_INCLUDES})
list(APPEND qgroundcontrolLibs ${PHONON_LIBS})
endif()
message(STATUS "\t\tSDL\t\t${SDL_FOUND}")
if (SDL_FOUND)
message(STATUS "\t\tSDL\t\tYES")
list(APPEND qgroundcontrolIncludes ${SDL_INCLUDE_DIR})
else()
message(STATUS "\t\tSDL\t\tNO")
endif (SDL_FOUND)
list(APPEND qgroundcontrolLibs ${SDL_LIBRARY})
endif()
message(STATUS "\t\tOPENGL\t\t${OPENGL_FOUND}")
if (OPENGL_FOUND)
message(STATUS "\t\tOPENGL\t\tYES")
list(APPEND qgroundcontrolIncludes ${OPENGL_INCLUDE_DIR})
else()
message(STATUS "\t\tOPENGL\t\tNO")
endif (OPENGL_FOUND)
list(APPEND qgroundcontrolLibs ${OPENGL_LIBRARIES})
endif()
# unix only dependencies
if (UNIX)
message(STATUS "\t\tFLITE\t\t${FLITE_FOUND}")
if (FLITE_FOUND)
message(STATUS "\t\tFLITE\t\tYES")
list(APPEND qgroundcontrolIncludes ${FLITE_INCLUDE_DIR})
else()
message(STATUS "\t\tFLITE\t\tNO")
endif (FLITE_FOUND)
endif(UNIX)
list(APPEND qgroundcontrolLibs ${FLITE_LIBRARIES})
endif ()
endif()
# set include directories
include_directories(${qgroundcontrolIncludes})
......@@ -270,6 +273,7 @@ set(qgroundcontrolUiSrc
src/ui/HDDisplay.ui
src/ui/MAVLinkSettingsWidget.ui
src/ui/AudioOutputWidget.ui
src/ui/designer/QGCCommandButton.ui
src/ui/QGCSensorSettingsWidget.ui
src/ui/watchdog/WatchdogControl.ui
src/ui/watchdog/WatchdogProcessView.ui
......@@ -392,6 +396,7 @@ set(qgroundcontrolMocSrc
src/ui/map3D/QGCWebPage.h
src/ui/ObjectDetectionView.h
src/ui/SerialConfigurationWindow.h
src/ui/designer/QGCCommandButton.h
src/ui/QGCFirmwareUpdate.h
src/ui/CommConfigurationWindow.h
src/ui/MAVLinkSettingsWidget.h
......@@ -496,6 +501,7 @@ set (qgroundcontrolSrc
src/ui/ObjectDetectionView.cc
src/ui/ParameterInterface.cc
src/ui/QGCDataPlot2D.cc
src/ui/designer/QGCCommandButton.cc
src/ui/QGCFirmwareUpdate.cc
src/ui/QGCMAVLinkLogPlayer.cc
src/ui/QGCMainWindowAPConfigurator.cc
......@@ -562,12 +568,7 @@ add_executable(qgroundcontrol
)
add_dependencies(qgroundcontrol MAVLINK)
target_link_libraries(qgroundcontrol
${SDL_LIBRARY}
${OPENGL_LIBRARIES}
${OSG_LIBRARIES}
${QT_LIBRARIES}
${FLITE_LIBRARIES}
${PHONON_LIBS}
${qgroundcontrolLibs}
qextserialport qmapcontrol qwt)
# qgroundcontrol install
......
......@@ -19,53 +19,19 @@ macro(_phonon_find_version)
file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
set(PHONON_VERSION "${CMAKE_MATCH_1}")
message(STATUS "Phonon Version: ${PHONON_VERSION}")
endmacro(_phonon_find_version)
if(PHONON_FOUND)
# Already found, nothing more to do except figuring out the version
_phonon_find_version()
else(PHONON_FOUND)
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_FIND_QUIETLY TRUE)
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
# As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir)
find_library(PHONON_LIBRARY NAMES phonon phonon4 PATHS /usr/lib ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
# then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
find_library(PHONON_LIBRARY NAMES phonon phonon4)
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS /usr/include ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
# the dirs listed with HINTS are searched before the default sets of dirs
find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
set(PHONON_FOUND TRUE)
_phonon_find_version()
else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_FOUND FALSE)
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
if(PHONON_FOUND)
if(NOT PHONON_FIND_QUIETLY)
message(STATUS "Found Phonon: ${PHONON_LIBRARY}")
message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}")
endif(NOT PHONON_FIND_QUIETLY)
else(PHONON_FOUND)
if(Phonon_FIND_REQUIRED)
if(NOT PHONON_INCLUDE_DIR)
message(STATUS "Phonon includes NOT found!")
endif(NOT PHONON_INCLUDE_DIR)
if(NOT PHONON_LIBRARY)
message(STATUS "Phonon library NOT found!")
endif(NOT PHONON_LIBRARY)
message(FATAL_ERROR "Phonon library or includes NOT found!")
else(Phonon_FIND_REQUIRED)
message(STATUS "Unable to find Phonon")
endif(Phonon_FIND_REQUIRED)
endif(PHONON_FOUND)
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/phonon ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
_phonon_find_version()
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Phonon DEFAULT_MSG PHONON_INCLUDE_DIR PHONON_LIBRARY)
mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES)
endif(PHONON_FOUND)
mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY)
......@@ -362,7 +362,6 @@ function updateWaypoint(id, index, lat, lon, alt, action)
location.setAltitude(alt);
waypoints[index].setGeometry(location);
waypoints[index].setDescription(index+"");
console.log('WP LOC:' + lat + lon + alt);
}
else
{
......@@ -373,7 +372,7 @@ function updateWaypoint(id, index, lat, lon, alt, action)
if (index < 10) numberstring = '0' + numberstring
icon.setHref('http://google-maps-icons.googlecode.com/files/red' + numberstring +'.png');
var style = ge.createStyle('');
console.log('WP ICON created:' + 'http://google-maps-icons.googlecode.com/files/red' + numberstring +'.png');
//console.log('WP ICON created:' + 'http://google-maps-icons.googlecode.com/files/red' + numberstring +'.png');
style.getIconStyle().setIcon(icon);
//style.getIconStyle().setScale(0.5);
placemark.setStyleSelector(style);
......@@ -424,7 +423,7 @@ function createAircraft(id, type, color)
//planeColor = color;
createTrail(id, color);
console.log(color);
//console.log(color);
}
function createTrail(id, color)
......
......@@ -86,6 +86,13 @@ border: 1px solid #777777;
QMainWindow::separator:hover {
background: white;
}
QGCToolWidgetItem {
border: 1px solid #66666B;
border-radius: 3px;
padding: 10px 0px 0px 0px;
margin-top: 1ex; /* leave space at the top for the title */
}
QDockWidget {
border: 1px solid #32345E;
......
......@@ -153,6 +153,7 @@ FORMS += src/ui/MainWindow.ui \
src/ui/designer/QGCToolWidget.ui \
src/ui/designer/QGCParamSlider.ui \
src/ui/designer/QGCActionButton.ui \
src/ui/designer/QGCCommandButton.ui \
src/ui/QGCMAVLinkLogPlayer.ui \
src/ui/QGCWaypointListMulti.ui \
src/ui/mission/QGCCustomWaypointAction.ui \
......@@ -264,6 +265,7 @@ HEADERS += src/MG.h \
src/ui/designer/QGCToolWidget.h \
src/ui/designer/QGCParamSlider.h \
src/ui/designer/QGCActionButton.h \
src/ui/designer/QGCCommandButton.h \
src/ui/designer/QGCToolWidgetItem.h \
src/ui/QGCMAVLinkLogPlayer.h \
src/comm/MAVLinkSimulationWaypointPlanner.h \
......@@ -394,6 +396,7 @@ SOURCES += src/main.cc \
src/ui/designer/QGCToolWidget.cc \
src/ui/designer/QGCParamSlider.cc \
src/ui/designer/QGCActionButton.cc \
src/ui/designer/QGCCommandButton.cc \
src/ui/designer/QGCToolWidgetItem.cc \
src/ui/QGCMAVLinkLogPlayer.cc \
src/comm/MAVLinkSimulationWaypointPlanner.cc \
......
......@@ -36,7 +36,8 @@ This file is part of the PIXHAWK project
#include <QTimer>
#include <QStringList>
#ifdef Q_OS_MAC
#include <Phonon>
#include <MediaObject>
#include <AudioOutput>
#endif
#ifdef Q_OS_LINUX
//#include <flite/flite.h>
......
......@@ -29,8 +29,10 @@ This file is part of the QGROUNDCONTROL project
*
*/
#include "Waypoint.h"
#include <QStringList>
#include <QDebug>
#include "Waypoint.h"
Waypoint::Waypoint(quint16 _id, double _x, double _y, double _z, double _param1, double _param2, double _param3, double _param4,
bool _autocontinue, bool _current, MAV_FRAME _frame, MAV_CMD _action)
......@@ -55,6 +57,11 @@ Waypoint::~Waypoint()
}
bool Waypoint::isNavigationType()
{
return (action < MAV_CMD_NAV_LAST);
}
void Waypoint::save(QTextStream &saveStream)
{
QString position("%1\t%2\t%3");
......@@ -229,6 +236,8 @@ void Waypoint::setAcceptanceRadius(double radius)
void Waypoint::setParam1(double param1)
{
qDebug() << "SENDER:" << QObject::sender();
qDebug() << "PARAM1 SET REQ:" << param1;
if (this->param1 != param1)
{
this->param1 = param1;
......
......@@ -71,6 +71,8 @@ public:
MAV_FRAME getFrame() const { return frame; }
MAV_CMD getAction() const { return action; }
const QString& getName() const { return name; }
/** @brief Returns true if x, y, z contain reasonable navigation data */
bool isNavigationType();
void save(QTextStream &saveStream);
bool load(QTextStream &loadStream);
......
......@@ -1059,7 +1059,6 @@ void UAS::setHomePosition(double lat, double lon, double alt)
void UAS::setLocalOriginAtCurrentGPSPosition()
{
bool result = false;
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
......@@ -1766,6 +1765,38 @@ void UAS::setUASName(const QString& name)
emit systemSpecsChanged(uasId);
}
void UAS::executeCommand(MAV_CMD command)
{
mavlink_message_t msg;
mavlink_command_t cmd;
cmd.command = (uint8_t)command;
cmd.confirmation = 0;
cmd.param1 = 0.0f;
cmd.param2 = 0.0f;
cmd.param3 = 0.0f;
cmd.param4 = 0.0f;
cmd.target_system = uasId;
cmd.target_component = 0;
mavlink_msg_command_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &cmd);
sendMessage(msg);
}
void UAS::executeCommand(MAV_CMD command, int confirmation, float param1, float param2, float param3, float param4, int component)
{
mavlink_message_t msg;
mavlink_command_t cmd;
cmd.command = (uint8_t)command;
cmd.confirmation = confirmation;
cmd.param1 = param1;
cmd.param2 = param2;
cmd.param3 = param3;
cmd.param4 = param4;
cmd.target_system = uasId;
cmd.target_component = component;
mavlink_msg_command_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &cmd);
sendMessage(msg);
}
/**
* Sets an action
*
......
......@@ -214,6 +214,10 @@ public slots:
void setUASName(const QString& name);
/** @brief Executes an action **/
void setAction(MAV_ACTION action);
/** @brief Executes a command **/
void executeCommand(MAV_CMD command);
/** @brief Executes a command **/
void executeCommand(MAV_CMD command, int confirmation, float param1, float param2, float param3, float param4, int component);
/** @brief Set the current battery type and voltages */
void setBatterySpecs(const QString& specs);
/** @brief Get the current battery type and specs */
......
......@@ -189,6 +189,10 @@ public slots:
virtual void setUASName(const QString& name) = 0;
/** @brief Sets an action **/
virtual void setAction(MAV_ACTION action) = 0;
/** @brief Execute command immediately **/
virtual void executeCommand(MAV_CMD command) = 0;
/** @brief Executes a command **/
virtual void executeCommand(MAV_CMD command, int confirmation, float param1, float param2, float param3, float param4, int component) = 0;
/** @brief Selects the airframe */
virtual void setAirframe(int airframe) = 0;
......
......@@ -512,6 +512,22 @@ const QVector<Waypoint *> UASWaypointManager::getGlobalFrameWaypointList()
return wps;
}
const QVector<Waypoint *> UASWaypointManager::getGlobalFrameAndNavTypeWaypointList()
{
// TODO Keep this global frame list up to date
// with complete waypoint list
// instead of filtering on each request
QVector<Waypoint*> wps;
foreach (Waypoint* wp, waypoints)
{
if (wp->getFrame() == MAV_FRAME_GLOBAL && wp->isNavigationType())
{
wps.append(wp);
}
}
return wps;
}
int UASWaypointManager::getIndexOf(Waypoint* wp)
{
return waypoints.indexOf(wp);
......@@ -537,6 +553,26 @@ int UASWaypointManager::getGlobalFrameIndexOf(Waypoint* wp)
return -1;
}
int UASWaypointManager::getGlobalFrameAndNavTypeIndexOf(Waypoint* wp)
{
// Search through all waypoints,
// counting only those in global frame
int i = 0;
foreach (Waypoint* p, waypoints)
{
if (p->getFrame() == MAV_FRAME_GLOBAL && p->isNavigationType())
{
if (p == wp)
{
return i;
}
i++;
}
}
return -1;
}
int UASWaypointManager::getGlobalFrameCount()
{
// Search through all waypoints,
......@@ -553,6 +589,22 @@ int UASWaypointManager::getGlobalFrameCount()
return i;
}
int UASWaypointManager::getGlobalFrameAndNavTypeCount()
{
// Search through all waypoints,
// counting only those in global frame
int i = 0;
foreach (Waypoint* p, waypoints)
{
if (p->getFrame() == MAV_FRAME_GLOBAL && p->isNavigationType())
{
i++;
}
}
return i;
}
int UASWaypointManager::getLocalFrameCount()
{
// Search through all waypoints,
......
......@@ -87,11 +87,14 @@ public:
/*@{*/
const QVector<Waypoint *> &getWaypointList(void) { return waypoints; } ///< Returns a const reference to the waypoint list.
const QVector<Waypoint *> getGlobalFrameWaypointList(); ///< Returns a global waypoint list
const QVector<Waypoint *> getGlobalFrameAndNavTypeWaypointList(); ///< Returns a global waypoint list containing only waypoints suitable for navigation. Actions and other mission items are filtered out.
int getIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list
int getGlobalFrameIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only global waypoints
int getGlobalFrameAndNavTypeIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only global AND navigation mode waypoints
int getLocalFrameIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only local waypoints
int getMissionFrameIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only mission waypoints
int getGlobalFrameCount(); ///< Get the count of global waypoints in the list
int getGlobalFrameAndNavTypeCount(); ///< Get the count of global waypoints in navigation mode in the list
int getLocalFrameCount(); ///< Get the count of local waypoints in the list
/*@}*/
......
......@@ -111,9 +111,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
if(serial != 0)
{
QWidget* conf = new SerialConfigurationWindow(serial, this);
QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.linkGroupBox);
layout->addWidget(conf);
ui.linkGroupBox->setLayout(layout);
//QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.linkGroupBox);
//layout->addWidget(conf);
ui.linkScrollArea->setWidget(conf);
//ui.linkScrollArea->setLayout(layout);
ui.linkGroupBox->setTitle(tr("Serial Link"));
ui.linkType->setCurrentIndex(0);
//ui.linkGroupBox->setTitle(link->getName());
......@@ -123,9 +124,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
if (udp != 0)
{
QWidget* conf = new QGCUDPLinkConfiguration(udp, this);
QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.linkGroupBox);
layout->addWidget(conf);
ui.linkGroupBox->setLayout(layout);
//QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.linkGroupBox);
//layout->addWidget(conf);
//ui.linkGroupBox->setLayout(layout);
ui.linkScrollArea->setWidget(conf);
ui.linkGroupBox->setTitle(tr("UDP Link"));
ui.linkType->setCurrentIndex(1);
}
......@@ -162,9 +164,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
if (mavlink != 0)
{
QWidget* conf = new MAVLinkSettingsWidget(mavlink, this);
QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.protocolGroupBox);
layout->addWidget(conf);
ui.protocolGroupBox->setLayout(layout);
//QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight, ui.protocolGroupBox);
//layout->addWidget(conf);
//ui.protocolGroupBox->setLayout(layout);
ui.protocolScrollArea->setWidget(conf);
ui.protocolGroupBox->setTitle(protocol->getName()+" (Global Settings)");
}
else
......
......@@ -7,16 +7,19 @@
<x>0</x>
<y>0</y>
<width>413</width>
<height>404</height>
<height>484</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0,100,100,0">
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,1,1,100,100,1">
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -28,7 +31,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>10</height>
<height>5</height>
</size>
</property>
</spacer>
......@@ -73,6 +76,31 @@
<property name="title">
<string>Link</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="linkScrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>393</width>
<height>154</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
......@@ -80,6 +108,31 @@
<property name="title">
<string>Protocol</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="protocolScrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>393</width>
<height>154</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="5" column="0">
......@@ -97,6 +150,9 @@
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>12</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
......
......@@ -307,9 +307,11 @@ void MainWindow::buildCustomWidget()
if (!dock)
{
QDockWidget* dock = new QDockWidget(widgets.at(i)->windowTitle(), this);
dock->setObjectName(widgets.at(i)->objectName()+"_DOCK");
dock->setWidget(widgets.at(i));
connect(widgets.at(i), SIGNAL(destroyed()), dock, SLOT(deleteLater()));
QAction* showAction = new QAction(widgets.at(i)->windowTitle(), this);
showAction->setCheckable(true);
connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool)));
connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool)));
widgets.at(i)->setMainMenuAction(showAction);
......@@ -1045,6 +1047,7 @@ void MainWindow::createCustomWidget()
connect(tool, SIGNAL(destroyed()), dock, SLOT(deleteLater()));
dock->setWidget(tool);
QAction* showAction = new QAction("Show Unnamed Tool", this);
showAction->setCheckable(true);
connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool)));
connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool)));
tool->setMainMenuAction(showAction);
......
......@@ -130,6 +130,9 @@
<addaction name="separator"/>
<addaction name="actionMavlinkView"/>
<addaction name="actionUnconnectedView"/>
<addaction name="separator"/>
<addaction name="actionFullscreen"/>
<addaction name="actionNormal"/>
</widget>
<widget class="QMenu" name="menuMain">
<property name="title">
......@@ -437,6 +440,22 @@
<string>Settings</string>
</property>
</action>
<action name="actionFullscreen">
<property name="text">
<string>Fullscreen</string>
</property>
<property name="shortcut">
<string>Alt+Return</string>
</property>
</action>
<action name="actionNormal">
<property name="text">
<string>Normal</string>
</property>
<property name="shortcut">
<string>Esc</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
......@@ -459,5 +478,37 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionFullscreen</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>showFullScreen()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>249</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionNormal</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>showNormal()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>249</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -492,14 +492,14 @@ void MapWidget::updateWaypoint(int uas, Waypoint* wp, bool updateView)
if (uas == this->mav->getUASID())
{
// Only accept waypoints in global coordinate frame
if (wp->getFrame() == MAV_FRAME_GLOBAL)
if (wp->getFrame() == MAV_FRAME_GLOBAL && wp->isNavigationType())
{
// We're good, this is a global waypoint
// Get the index of this waypoint
// note the call to getGlobalFrameIndexOf()
// note the call to getGlobalFrameAndNavTypeIndexOf()
// as we're only handling global waypoints
int wpindex = UASManager::instance()->getUASForId(uas)->getWaypointManager()->getGlobalFrameIndexOf(wp);
int wpindex = UASManager::instance()->getUASForId(uas)->getWaypointManager()->getGlobalFrameAndNavTypeIndexOf(wp);
// If not found, return (this should never happen, but helps safety)
if (wpindex == -1) return;
......@@ -558,7 +558,7 @@ void MapWidget::updateWaypoint(int uas, Waypoint* wp, bool updateView)
// waypoint list. This implies that the coordinate frame of this
// waypoint was changed and the list containing only global
// waypoints was shortened. Thus update the whole list
if (waypointPath->points().count() > UASManager::instance()->getUASForId(uas)->getWaypointManager()->getGlobalFrameCount())
if (waypointPath->points().count() > UASManager::instance()->getUASForId(uas)->getWaypointManager()->getGlobalFrameAndNavTypeCount())
{
updateWaypointList(uas);
}
......@@ -659,7 +659,7 @@ void MapWidget::captureGeometryDrag(Geometry* geom, QPointF coordinate)
// Update waypoint data storage
if (mav)
{
QVector<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameWaypointList();
QVector<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
if (wps.size() > index)
{
......@@ -738,7 +738,7 @@ void MapWidget::updateWaypointList(int uas)
}
// Trim internal list to number of global waypoints in the waypoint manager list
int overSize = waypointPath->points().count() - uasInstance->getWaypointManager()->getGlobalFrameCount();
int overSize = waypointPath->points().count() - uasInstance->getWaypointManager()->getGlobalFrameAndNavTypeCount();
if (overSize > 0)
{
// Remove n waypoints at the end of the list
......
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>449</width>
<height>250</height>
<width>304</width>
<height>283</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,10">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0" columnstretch="100,1">
<property name="margin">
<number>6</number>
</property>
......@@ -284,13 +284,6 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="portlabel_5">
<property name="text">
<string>Data bits</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="dataBitsSpinBox">
<property name="sizePolicy">
......@@ -373,12 +366,19 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>431</width>
<height>47</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="portlabel_5">
<property name="text">
<string>Data bits</string>
</property>
</widget>
</item>
</layout>
<action name="actionDelete">
<property name="text">
......
Supports Markdown
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