mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
'Add waypoint' & 'clear all waypoints' now operational on the new map plug-in.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@929 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
6800a73dbf
commit
1faa9b4073
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.9 KiB |
@ -10,11 +10,11 @@
|
||||
<file>images/left_but.png</file>
|
||||
<file>images/next_waypoint.png</file>
|
||||
<file>images/prev_waypoint.png</file>
|
||||
<file>images/combobox_down_arrow.png</file>
|
||||
<file>images/plus2.png</file>
|
||||
<file>images/minus2.png</file>
|
||||
<file>images/home.png</file>
|
||||
<file>images/hold.png</file>
|
||||
<file>images/go.png</file>
|
||||
<file>images/combobox_down_arrow.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -37,6 +37,20 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QSplitter::handle {
|
||||
/* image: url(images/splitter.png); */
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 80), stop:1 rgba(0, 0, 0, 80));
|
||||
}
|
||||
|
||||
QSplitter::handle:horizontal {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
QSplitter::handle:vertical {
|
||||
width: 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
@ -46,6 +60,9 @@
|
||||
<property name="opaqueResize">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="handleWidth">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>704</width>
|
||||
<height>327</height>
|
||||
<height>422</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -534,6 +534,9 @@ p, li { white-space: pre-wrap; }
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>OpenHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Zoom level</string>
|
||||
</property>
|
||||
@ -655,8 +658,18 @@ color: rgb(255, 255, 255);</string>
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255));
|
||||
</string>
|
||||
<string notr="true">QSplitter::handle {
|
||||
/* image: url(images/splitter.png); */
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 255, 255, 48), stop:1 rgba(0, 0, 0, 48));
|
||||
}
|
||||
|
||||
QSplitter::handle:horizontal {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
QSplitter::handle:vertical {
|
||||
width: 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
@ -670,8 +683,11 @@ color: rgb(255, 255, 255);</string>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="opaqueResize">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="handleWidth">
|
||||
<number>7</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
@ -844,13 +860,13 @@ border-radius: 2px;
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<width>60</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -870,11 +886,11 @@ color: rgb(255, 255, 255);
|
||||
border: 0px;
|
||||
}
|
||||
QToolButton:hover {
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(128, 128, 128, 255), stop:1 rgba(64, 64, 64, 255));
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(48, 48, 48, 255));
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
QToolButton:pressed {
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(180, 180, 180, 255));
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
@ -898,6 +914,44 @@ border-radius: 3px;
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonHoldPosition">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>UAV hold position</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="opmap.qrc">
|
||||
<normaloff>:/opmap/images/hold.png</normaloff>:/opmap/images/hold.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonHome">
|
||||
<property name="enabled">
|
||||
@ -933,8 +987,8 @@ border-radius: 3px;
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@ -974,8 +1028,8 @@ border-radius: 3px;
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
@ -1012,46 +1066,8 @@ border-radius: 3px;
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonHoldPosition">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>UAV hold position</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="opmap.qrc">
|
||||
<normaloff>:/opmap/images/hold.png</normaloff>:/opmap/images/hold.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
@ -1088,8 +1104,8 @@ border-radius: 3px;
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
@ -1135,7 +1151,7 @@ color: rgba(255, 255, 255, 70);
|
||||
|
||||
QLabel { /* all label types */
|
||||
/* background-color: rgba(255, 255, 255, 0); */
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 128), stop:1 rgba(128, 128, 128, 128));
|
||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 128), stop:1 rgba(128, 128, 128, 128));
|
||||
color: rgb(255, 255, 255);
|
||||
/*border: 1px solid black;*/
|
||||
border: none;
|
||||
|
@ -72,6 +72,8 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
m_map->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
m_map->configuration->DragButton = Qt::LeftButton; // use the left mouse button for map dragging
|
||||
|
||||
m_map->setStyleSheet(" QToolTip { background-color: white; color: black; border: 1px solid black; padding: 5px; border-radius: 2px; /* opacity: 170; */ } ");
|
||||
}
|
||||
|
||||
// **************
|
||||
@ -154,6 +156,10 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
connect(m_map, SIGNAL(OnMapTypeChanged(MapType::Types)), this, SLOT(OnMapTypeChanged(MapType::Types))); // map type changed
|
||||
connect(m_map, SIGNAL(OnEmptyTileError(int, core::Point)), this, SLOT(OnEmptyTileError(int, core::Point))); // tile error
|
||||
connect(m_map, SIGNAL(OnTilesStillToLoad(int)), this, SLOT(OnTilesStillToLoad(int))); // tile loading signals
|
||||
connect(m_map, SIGNAL(WPNumberChanged(int const&,int const&,WayPointItem*)), this, SLOT(WPNumberChanged(int const&,int const&,WayPointItem*)));
|
||||
connect(m_map, SIGNAL(WPValuesChanged(WayPointItem*)), this, SLOT(WPValuesChanged(WayPointItem*)));
|
||||
connect(m_map, SIGNAL(WPInserted(int const&, WayPointItem*)), this, SLOT(WPInserted(int const&, WayPointItem*)));
|
||||
connect(m_map, SIGNAL(WPDeleted(int const&)), this, SLOT(WPDeleted(int const&)));
|
||||
|
||||
m_map->SetMaxZoom(19); // increase the maximum zoom level
|
||||
m_map->SetMouseWheelZoomType(internals::MouseWheelZoomType::MousePositionWithoutCenter); // set how the mouse wheel zoom functions
|
||||
@ -252,6 +258,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
|
||||
OPMapGadgetWidget::~OPMapGadgetWidget()
|
||||
{
|
||||
clearWayPoints();
|
||||
if (m_map_overlay_widget) delete m_map_overlay_widget;
|
||||
if (wayPoint_treeView_model) delete wayPoint_treeView_model;
|
||||
if (waypoint_editor) delete waypoint_editor;
|
||||
@ -538,14 +545,37 @@ void OPMapGadgetWidget::OnTileLoadComplete()
|
||||
|
||||
void OPMapGadgetWidget::OnMapZoomChanged()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnMapTypeChanged(MapType::Types type)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnEmptyTileError(int zoom, core::Point pos)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::WPNumberChanged(int const& oldnumber, int const& newnumber, WayPointItem* waypoint)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::WPValuesChanged(WayPointItem* waypoint)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::WPInserted(int const& number, WayPointItem* waypoint)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::WPDeleted(int const& number)
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
// *************************************************************************************
|
||||
@ -643,14 +673,33 @@ void OPMapGadgetWidget::on_horizontalSliderZoom_sliderMoved(int position)
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonHome_clicked()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonPrevWaypoint_clicked()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonNextWaypoint_clicked()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonHoldPosition_clicked()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonGo_clicked()
|
||||
{
|
||||
// to do
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonAddWaypoint_clicked()
|
||||
{
|
||||
addWayPoint();
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonWaypointEditor_clicked()
|
||||
@ -1009,6 +1058,22 @@ void OPMapGadgetWidget::openWayPointEditor()
|
||||
|
||||
void OPMapGadgetWidget::addWayPoint()
|
||||
{
|
||||
if (m_map)
|
||||
{
|
||||
m_waypoint_list_mutex.lock();
|
||||
|
||||
// create a waypoint
|
||||
t_waypoint waypoint;
|
||||
waypoint.item = m_map->WPCreate();
|
||||
waypoint.time_seconds = 0;
|
||||
waypoint.hold_time_seconds = 0;
|
||||
|
||||
// and remember it
|
||||
m_waypoint_list.append(waypoint);
|
||||
|
||||
m_waypoint_list_mutex.unlock();
|
||||
}
|
||||
|
||||
// to do
|
||||
}
|
||||
|
||||
@ -1019,7 +1084,10 @@ void OPMapGadgetWidget::deleteWayPoint()
|
||||
|
||||
void OPMapGadgetWidget::clearWayPoints()
|
||||
{
|
||||
// to do
|
||||
m_waypoint_list_mutex.lock();
|
||||
if (m_map) m_map->WPDeleteAll();
|
||||
m_waypoint_list.clear();
|
||||
m_waypoint_list_mutex.unlock();
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::gridLines()
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <QtGui/QMenu>
|
||||
#include <QStringList>
|
||||
#include <QStandardItemModel>
|
||||
#include <QList>
|
||||
#include <QMutex>
|
||||
|
||||
#include "uavobjects/uavobjectmanager.h"
|
||||
#include "uavobjects/positionactual.h"
|
||||
@ -48,6 +50,18 @@ namespace Ui
|
||||
|
||||
using namespace mapcontrol;
|
||||
|
||||
// ******************************************************
|
||||
|
||||
// waypoint structure
|
||||
typedef struct t_waypoint
|
||||
{
|
||||
mapcontrol::WayPointItem *item;
|
||||
int time_seconds;
|
||||
int hold_time_seconds;
|
||||
} t_waypoint;
|
||||
|
||||
// ******************************************************
|
||||
|
||||
class OPMapGadgetWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -79,7 +93,11 @@ private slots:
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
||||
// user control signals
|
||||
/**
|
||||
* @brief signals received from the various map plug-in widget user controls
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
void on_toolButtonReload_clicked();
|
||||
void on_comboBoxFindPlace_returnPressed();
|
||||
void on_toolButtonFindPlace_clicked();
|
||||
@ -90,15 +108,20 @@ private slots:
|
||||
void on_toolButtonMapHome_clicked();
|
||||
void on_toolButtonMapUAV_clicked();
|
||||
void on_horizontalSliderZoom_sliderMoved(int position);
|
||||
void on_toolButtonAddWaypoint_clicked();
|
||||
void on_toolButtonWaypointEditor_clicked();
|
||||
|
||||
void on_treeViewWaypoints_clicked(QModelIndex index);
|
||||
|
||||
void on_toolButtonHome_clicked();
|
||||
void on_toolButtonNextWaypoint_clicked();
|
||||
void on_toolButtonPrevWaypoint_clicked();
|
||||
void on_toolButtonHoldPosition_clicked();
|
||||
void on_toolButtonGo_clicked();
|
||||
|
||||
// map signals
|
||||
/**
|
||||
* @brief signals received from the map object
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
void zoomChanged(double zoom);
|
||||
void OnCurrentPositionChanged(internals::PointLatLng point);
|
||||
void OnTileLoadComplete();
|
||||
@ -108,8 +131,16 @@ private slots:
|
||||
void OnMapTypeChanged(MapType::Types type);
|
||||
void OnEmptyTileError(int zoom, core::Point pos);
|
||||
void OnTilesStillToLoad(int number);
|
||||
void WPNumberChanged(int const& oldnumber,int const& newnumber, WayPointItem* waypoint);
|
||||
void WPValuesChanged(WayPointItem* waypoint);
|
||||
void WPInserted(int const& number, WayPointItem* waypoint);
|
||||
void WPDeleted(int const& number);
|
||||
|
||||
// context menu signals
|
||||
/**
|
||||
* @brief mouse right click context menu signals
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
void reload();
|
||||
void findPlace();
|
||||
void goZoomIn();
|
||||
@ -171,6 +202,9 @@ private:
|
||||
|
||||
QStandardItemModel *wayPoint_treeView_model;
|
||||
|
||||
QList<t_waypoint> m_waypoint_list;
|
||||
QMutex m_waypoint_list_mutex;
|
||||
|
||||
void createActions();
|
||||
|
||||
QAction *closeAct;
|
||||
|
Loading…
Reference in New Issue
Block a user