Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
bf94b35d
Commit
bf94b35d
authored
Mar 26, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added opmapcontrol
parent
9396f137
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
93 additions
and
59 deletions
+93
-59
mapgraphicitem.h
lib/opmapcontrol/src/mapwidget/mapgraphicitem.h
+3
-0
opmapwidget.h
lib/opmapcontrol/src/mapwidget/opmapwidget.h
+2
-1
qgroundcontrol.pro
qgroundcontrol.pro
+20
-17
QGCCore.cc
src/QGCCore.cc
+6
-6
QGCCore.h
src/QGCCore.h
+5
-5
UDPLink.cc
src/comm/UDPLink.cc
+21
-15
configuration.h
src/configuration.h
+3
-3
main.cc
src/main.cc
+2
-2
HSIDisplay.cc
src/ui/HSIDisplay.cc
+3
-3
MainWindow.cc
src/ui/MainWindow.cc
+1
-1
MainWindow.h
src/ui/MainWindow.h
+3
-2
QGCMapWidget.cc
src/ui/QGCMapWidget.cc
+6
-0
QGCMapWidget.h
src/ui/QGCMapWidget.h
+16
-0
MAV2DIcon.h
src/ui/map/MAV2DIcon.h
+1
-2
Waypoint2DIcon.h
src/ui/map/Waypoint2DIcon.h
+1
-2
No files found.
lib/opmapcontrol/src/mapwidget/mapgraphicitem.h
View file @
bf94b35d
...
...
@@ -39,9 +39,12 @@
#include <QFont>
#include <QObject>
#include "waypointitem.h"
#include "configuration.h"
//#include "uavitem.h"
namespace
mapcontrol
{
using
namespace
mapcontrol
;
class
OPMapWidget
;
/**
* @brief The main graphicsItem used on the widget, contains the map and map logic
...
...
lib/opmapcontrol/src/mapwidget/opmapwidget.h
View file @
bf94b35d
...
...
@@ -37,6 +37,7 @@
#include <QtOpenGL/QGLWidget>
#include "waypointitem.h"
#include "QtSvg/QGraphicsSvgItem"
#include "configuration.h"
#include "uavitem.h"
#include "gpsitem.h"
#include "homeitem.h"
...
...
@@ -168,7 +169,7 @@ namespace mapcontrol
* @param config pointer to configuration classed to be used
* @return
*/
OPMapWidget
(
QWidget
*
parent
=
0
,
Configuration
*
config
=
new
Configuration
);
OPMapWidget
(
QWidget
*
parent
=
0
,
mapcontrol
::
Configuration
*
config
=
new
mapcontrol
::
Configuration
()
);
~
OPMapWidget
();
/**
...
...
qgroundcontrol.pro
View file @
bf94b35d
...
...
@@ -24,9 +24,9 @@
#
include
(
"../qmapcontrol/QMapControl/QMapControl.pri"
)
#
{
#
Include
bundled
version
if
necessary
include
(
lib
/
QMapControl
/
QMapControl
.
pri
)
#
include
(
lib
/
QMapControl
/
QMapControl
.
pri
)
include
(
lib
/
nmea
/
nmea
.
pri
)
#
include
(
lib
/
opmapcontrol
/
opmapcontrol
.
pri
)
include
(
lib
/
opmapcontrol
/
opmapcontrol
.
pri
)
#
message
(
"Including bundled QMapControl version as FALLBACK. This is fine on Linux and MacOS, but not the best choice in Windows"
)
QT
+=
network
\
...
...
@@ -34,7 +34,8 @@ QT += network \
svg
\
xml
\
phonon
\
webkit
webkit
\
sql
TEMPLATE
=
app
TARGET
=
qgroundcontrol
BASEDIR
=
$$
IN_PWD
...
...
@@ -104,13 +105,13 @@ include(src/lib/qextserialport/qextserialport.pri)
#
Include
QWT
plotting
library
include
(
src
/
lib
/
qwt
/
qwt
.
pri
)
DEPENDPATH
+=
.
\
lib
/
QMapControl
\
lib
/
QMapControl
/
src
\
#
lib
/
QMapControl
\
#
lib
/
QMapControl
/
src
\
lib
/
opmapcontrol
\
lib
/
opmapcontrol
/
src
\
plugins
INCLUDEPATH
+=
.
\
lib
/
QMapControl
\
#
lib
/
QMapControl
\
lib
/
opmapcontrol
\
$$
BASEDIR
/../
mavlink
/
include
...
...
@@ -132,7 +133,7 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
ObjectDetectionView
.
ui
\
src
/
ui
/
JoystickWidget
.
ui
\
src
/
ui
/
DebugConsole
.
ui
\
src
/
ui
/
MapWidget
.
ui
\
#
src
/
ui
/
MapWidget
.
ui
\
src
/
ui
/
XMLCommProtocolWidget
.
ui
\
src
/
ui
/
HDDisplay
.
ui
\
src
/
ui
/
MAVLinkSettingsWidget
.
ui
\
...
...
@@ -182,7 +183,7 @@ INCLUDEPATH += src \
src
/
ui
/
designer
HEADERS
+=
src
/
MG
.
h
\
src
/
Core
.
h
\
src
/
QGC
Core
.
h
\
src
/
uas
/
UASInterface
.
h
\
src
/
uas
/
UAS
.
h
\
src
/
uas
/
UASManager
.
h
\
...
...
@@ -218,7 +219,7 @@ HEADERS += src/MG.h \
src
/
input
/
JoystickInput
.
h
\
src
/
ui
/
JoystickWidget
.
h
\
src
/
ui
/
DebugConsole
.
h
\
src
/
ui
/
MapWidget
.
h
\
#
src
/
ui
/
MapWidget
.
h
\
src
/
ui
/
XMLCommProtocolWidget
.
h
\
src
/
ui
/
mavlink
/
DomItem
.
h
\
src
/
ui
/
mavlink
/
DomModel
.
h
\
...
...
@@ -245,8 +246,8 @@ HEADERS += src/MG.h \
src
/
ui
/
QGCPxImuFirmwareUpdate
.
h
\
src
/
ui
/
QGCDataPlot2D
.
h
\
src
/
ui
/
linechart
/
IncrementalPlot
.
h
\
src
/
ui
/
map
/
Waypoint2DIcon
.
h
\
src
/
ui
/
map
/
MAV2DIcon
.
h
\
#
src
/
ui
/
map
/
Waypoint2DIcon
.
h
\
#
src
/
ui
/
map
/
MAV2DIcon
.
h
\
src
/
ui
/
QGCRemoteControlView
.
h
\
src
/
ui
/
RadioCalibration
/
RadioCalibrationData
.
h
\
src
/
ui
/
RadioCalibration
/
RadioCalibrationWindow
.
h
\
...
...
@@ -278,7 +279,8 @@ HEADERS += src/MG.h \
src
/
ui
/
uas
/
UASControlParameters
.
h
\
src
/
ui
/
mission
/
QGCMissionDoWidget
.
h
\
src
/
ui
/
mission
/
QGCMissionConditionWidget
.
h
\
src
/
uas
/
QGCUASParamManager
.
h
src
/
uas
/
QGCUASParamManager
.
h
\
src
/
ui
/
QGCMapWidget
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
win32
-
msvc2008
:
{
...
...
@@ -318,7 +320,7 @@ contains(DEPENDENCIES_PRESENT, libfreenect) {
}
SOURCES
+=
src
/
main
.
cc
\
src
/
Core
.
cc
\
src
/
QGC
Core
.
cc
\
src
/
uas
/
UASManager
.
cc
\
src
/
uas
/
UAS
.
cc
\
src
/
comm
/
LinkManager
.
cc
\
...
...
@@ -349,7 +351,7 @@ SOURCES += src/main.cc \
src
/
input
/
JoystickInput
.
cc
\
src
/
ui
/
JoystickWidget
.
cc
\
src
/
ui
/
DebugConsole
.
cc
\
src
/
ui
/
MapWidget
.
cc
\
#
src
/
ui
/
MapWidget
.
cc
\
src
/
ui
/
XMLCommProtocolWidget
.
cc
\
src
/
ui
/
mavlink
/
DomItem
.
cc
\
src
/
ui
/
mavlink
/
DomModel
.
cc
\
...
...
@@ -376,8 +378,8 @@ SOURCES += src/main.cc \
src
/
ui
/
QGCPxImuFirmwareUpdate
.
cc
\
src
/
ui
/
QGCDataPlot2D
.
cc
\
src
/
ui
/
linechart
/
IncrementalPlot
.
cc
\
src
/
ui
/
map
/
Waypoint2DIcon
.
cc
\
src
/
ui
/
map
/
MAV2DIcon
.
cc
\
#
src
/
ui
/
map
/
Waypoint2DIcon
.
cc
\
#
src
/
ui
/
map
/
MAV2DIcon
.
cc
\
src
/
ui
/
QGCRemoteControlView
.
cc
\
src
/
ui
/
RadioCalibration
/
RadioCalibrationWindow
.
cc
\
src
/
ui
/
RadioCalibration
/
AirfoilServoCalibrator
.
cc
\
...
...
@@ -408,7 +410,8 @@ SOURCES += src/main.cc \
src
/
ui
/
uas
/
UASControlParameters
.
cpp
\
src
/
ui
/
mission
/
QGCMissionDoWidget
.
cc
\
src
/
ui
/
mission
/
QGCMissionConditionWidget
.
cc
\
src
/
uas
/
QGCUASParamManager
.
cc
src
/
uas
/
QGCUASParamManager
.
cc
\
src
/
ui
/
QGCMapWidget
.
cc
macx
|
win32
-
msvc2008
:
{
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/Core.cc
→
src/
QGC
Core.cc
View file @
bf94b35d
...
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
* @file
* @brief Implementation of class Core
* @brief Implementation of class
QGC
Core
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
...
...
@@ -43,7 +43,7 @@ This file is part of the QGROUNDCONTROL project
#include "configuration.h"
#include "QGC.h"
#include "Core.h"
#include "
QGC
Core.h"
#include "MG.h"
#include "MainWindow.h"
#include "GAudioOutput.h"
...
...
@@ -66,7 +66,7 @@ This file is part of the QGROUNDCONTROL project
**/
Core
::
Core
(
int
&
argc
,
char
*
argv
[])
:
QApplication
(
argc
,
argv
)
QGCCore
::
QGC
Core
(
int
&
argc
,
char
*
argv
[])
:
QApplication
(
argc
,
argv
)
{
...
...
@@ -207,7 +207,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
* @brief Destructor for the groundstation. It destroys all loaded instances.
*
**/
Core
::~
Core
()
QGCCore
::~
QGC
Core
()
{
//mainWindow->storeSettings();
mainWindow
->
hide
();
...
...
@@ -223,7 +223,7 @@ Core::~Core()
* The link manager keeps track of all communication links and provides the global
* packet queue. It is the main communication hub
**/
void
Core
::
startLinkManager
()
void
QGC
Core
::
startLinkManager
()
{
LinkManager
::
instance
();
}
...
...
@@ -232,7 +232,7 @@ void Core::startLinkManager()
* @brief Start the Unmanned Air System Manager
*
**/
void
Core
::
startUASManager
()
void
QGC
Core
::
startUASManager
()
{
// Load UAS plugins
QDir
pluginsDir
=
QDir
(
qApp
->
applicationDirPath
());
...
...
src/Core.h
→
src/
QGC
Core.h
View file @
bf94b35d
...
...
@@ -30,8 +30,8 @@ This file is part of the PIXHAWK project
*/
#ifndef
_CORE_H_
#define
_CORE_H_
#ifndef
QGC_CORE_H
#define
QGC_CORE_H
#include <QApplication>
...
...
@@ -51,13 +51,13 @@ This file is part of the PIXHAWK project
* the central management unit of the groundstation application.
*
**/
class
Core
:
public
QApplication
class
QGC
Core
:
public
QApplication
{
Q_OBJECT
public:
Core
(
int
&
argc
,
char
*
argv
[]);
~
Core
();
QGC
Core
(
int
&
argc
,
char
*
argv
[]);
~
QGC
Core
();
protected:
void
startLinkManager
();
...
...
src/comm/UDPLink.cc
View file @
bf94b35d
...
...
@@ -90,29 +90,35 @@ void UDPLink::addHost(const QString& host)
{
qDebug
()
<<
"HOST: "
<<
host
.
split
(
":"
).
first
();
QHostInfo
info
=
QHostInfo
::
fromName
(
host
.
split
(
":"
).
first
());
// Add host
QList
<
QHostAddress
>
hostAddresses
=
info
.
addresses
();
QHostAddress
address
;
for
(
int
i
=
0
;
i
<
hostAddresses
.
size
();
i
++
)
if
(
info
.
error
()
==
QHostInfo
::
NoError
)
{
// Exclude loopback IPv4 and all IPv6 addresses
if
(
!
hostAddresses
.
at
(
i
).
toString
().
contains
(
":"
))
// Add host
QList
<
QHostAddress
>
hostAddresses
=
info
.
addresses
();
QHostAddress
address
;
for
(
int
i
=
0
;
i
<
hostAddresses
.
size
();
i
++
)
{
address
=
hostAddresses
.
at
(
i
);
// Exclude loopback IPv4 and all IPv6 addresses
if
(
!
hostAddresses
.
at
(
i
).
toString
().
contains
(
":"
))
{
address
=
hostAddresses
.
at
(
i
);
}
}
hosts
.
append
(
address
);
qDebug
()
<<
"Address:"
<<
address
.
toString
();
// Set port according to user input
ports
.
append
(
host
.
split
(
":"
).
last
().
toInt
());
}
hosts
.
append
(
address
);
qDebug
()
<<
"Address:"
<<
address
.
toString
();
// Set port according to user input
ports
.
append
(
host
.
split
(
":"
).
last
().
toInt
());
}
else
{
QHostInfo
info
=
QHostInfo
::
fromName
(
host
);
// Add host
hosts
.
append
(
info
.
addresses
().
first
());
// Set port according to default (this port)
ports
.
append
(
port
);
if
(
info
.
error
()
==
QHostInfo
::
NoError
)
{
// Add host
hosts
.
append
(
info
.
addresses
().
first
());
// Set port according to default (this port)
ports
.
append
(
port
);
}
}
}
...
...
src/configuration.h
View file @
bf94b35d
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#ifndef
QGC_
CONFIGURATION_H
#define
QGC_
CONFIGURATION_H
#include "mavlink.h"
#include <QString>
...
...
@@ -27,4 +27,4 @@ namespace QGC
const
int
APPLICATIONVERSION
=
83
;
// 0.8.0
}
#endif // CONFIGURATION_H
#endif //
QGC_
CONFIGURATION_H
src/main.cc
View file @
bf94b35d
...
...
@@ -29,7 +29,7 @@ This file is part of the QGROUNDCONTROL project
*/
#include <QtGui/QApplication>
#include "Core.h"
#include "
QGC
Core.h"
#include "MainWindow.h"
#include "configuration.h"
...
...
@@ -70,6 +70,6 @@ int main(int argc, char *argv[])
qInstallMsgHandler
(
msgHandler
);
#endif
Core
core
(
argc
,
argv
);
QGC
Core
core
(
argc
,
argv
);
return
core
.
exec
();
}
src/ui/HSIDisplay.cc
View file @
bf94b35d
...
...
@@ -40,8 +40,8 @@ This file is part of the QGROUNDCONTROL project
#include "QGC.h"
#include "Waypoint.h"
#include "UASWaypointManager.h"
#include "Waypoint2DIcon.h"
#include "MAV2DIcon.h"
//
#include "Waypoint2DIcon.h"
//
#include "MAV2DIcon.h"
#include <QDebug>
...
...
@@ -246,7 +246,7 @@ void HSIDisplay::renderOverlay()
// Translate to center
painter
.
translate
((
xCenterPos
)
*
scalingFactor
,
(
yCenterPos
)
*
scalingFactor
);
QColor
uasColor
=
uas
->
getColor
();
MAV2DIcon
::
drawAirframePolygon
(
uas
->
getAirframe
(),
painter
,
static_cast
<
int
>
((
vwidth
/
4.0
f
)
*
scalingFactor
*
1.1
f
),
uasColor
,
0.0
f
);
//
MAV2DIcon::drawAirframePolygon(uas->getAirframe(), painter, static_cast<int>((vwidth/4.0f)*scalingFactor*1.1f), uasColor, 0.0f);
// Translate back
painter
.
translate
(
-
(
xCenterPos
)
*
scalingFactor
,
-
(
yCenterPos
)
*
scalingFactor
);
}
...
...
src/ui/MainWindow.cc
View file @
bf94b35d
...
...
@@ -383,7 +383,7 @@ void MainWindow::buildCommonWidgets()
// Center widgets
if
(
!
mapWidget
)
{
mapWidget
=
new
MapWidget
(
this
);
mapWidget
=
new
mapcontrol
::
OPMapWidget
(
this
);
//new
MapWidget(this);
addToCentralWidgetsMenu
(
mapWidget
,
"Maps"
,
SLOT
(
showCentralWidget
()),
CENTRAL_MAP
);
}
...
...
src/ui/MainWindow.h
View file @
bf94b35d
...
...
@@ -55,7 +55,7 @@ This file is part of the QGROUNDCONTROL project
#include "JoystickWidget.h"
#include "input/JoystickInput.h"
#include "DebugConsole.h"
#include "MapWidget.h"
//
#include "MapWidget.h"
#include "ParameterInterface.h"
#include "XMLCommProtocolWidget.h"
#include "HDDisplay.h"
...
...
@@ -63,6 +63,7 @@ This file is part of the QGROUNDCONTROL project
#include "HSIDisplay.h"
#include "QGCDataPlot2D.h"
#include "QGCRemoteControlView.h"
#include "opmapcontrol.h"
#if (defined Q_OS_MAC) | (defined _MSC_VER)
#include "QGCGoogleEarthView.h"
#endif
...
...
@@ -366,7 +367,7 @@ protected:
QPointer
<
HUD
>
hudWidget
;
QPointer
<
MapWidget
>
mapWidget
;
QPointer
<
mapcontrol
::
OP
MapWidget
>
mapWidget
;
QPointer
<
XMLCommProtocolWidget
>
protocolWidget
;
QPointer
<
QGCDataPlot2D
>
dataplotWidget
;
#ifdef QGC_OSG_ENABLED
...
...
src/ui/QGCMapWidget.cc
0 → 100644
View file @
bf94b35d
#include "QGCMapWidget.h"
QGCMapWidget
::
QGCMapWidget
(
QWidget
*
parent
)
:
OPMapWidget
(
parent
)
{
}
src/ui/QGCMapWidget.h
0 → 100644
View file @
bf94b35d
#ifndef QGCMAPWIDGET_H
#define QGCMAPWIDGET_H
class
QGCMapWidget
:
public
OPMapWidget
{
Q_OBJECT
public:
explicit
QGCMapWidget
(
QWidget
*
parent
=
0
);
signals:
public
slots
:
};
#endif // QGCMAPWIDGET_H
src/ui/map/MAV2DIcon.h
View file @
bf94b35d
...
...
@@ -2,11 +2,10 @@
#define MAV2DICON_H
#include <QGraphicsItem>
#include "qmapcontrol.h"
#include "UASInterface.h"
class
MAV2DIcon
:
public
qmapcontrol
::
Point
class
MAV2DIcon
:
public
QGraphicsItem
{
public:
enum
...
...
src/ui/map/Waypoint2DIcon.h
View file @
bf94b35d
...
...
@@ -2,11 +2,10 @@
#define WAYPOINT2DICON_H
#include <QGraphicsItem>
#include "qmapcontrol.h"
#include "Waypoint.h"
class
Waypoint2DIcon
:
public
qmapcontrol
::
Point
class
Waypoint2DIcon
:
public
QGraphicsItem
{
public:
/*!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment