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
b789a690
Commit
b789a690
authored
Jan 07, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code
parent
360cc7c6
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
4 additions
and
320 deletions
+4
-320
qgroundcontrol.pro
qgroundcontrol.pro
+0
-2
HomePositionManager.cc
src/HomePositionManager.cc
+0
-186
HomePositionManager.h
src/HomePositionManager.h
+0
-108
QGCApplication.cc
src/QGCApplication.cc
+0
-2
QGCApplication.h
src/QGCApplication.h
+0
-1
QGCToolbox.cc
src/QGCToolbox.cc
+0
-5
QGCToolbox.h
src/QGCToolbox.h
+0
-3
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+0
-2
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+0
-4
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+4
-4
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+0
-1
UAS.cc
src/uas/UAS.cc
+0
-1
MainWindow.cc
src/ui/MainWindow.cc
+0
-1
No files found.
qgroundcontrol.pro
View file @
b789a690
...
...
@@ -423,7 +423,6 @@ HEADERS += \
src/FlightMap/Widgets/ValuesWidgetController.h \
src/FollowMe/FollowMe.h \
src/GAudioOutput.h \
src/HomePositionManager.h \
src/Joystick/Joystick.h \
src/Joystick/JoystickManager.h \
src/JsonHelper.h \
...
...
@@ -588,7 +587,6 @@ SOURCES += \
src/FlightMap/Widgets/ValuesWidgetController.cc \
src/FollowMe/FollowMe.cc \
src/GAudioOutput.cc \
src/HomePositionManager.cc \
src/Joystick/Joystick.cc \
src/Joystick/JoystickManager.cc \
src/JsonHelper.cc \
...
...
src/HomePositionManager.cc
deleted
100644 → 0
View file @
360cc7c6
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include <QList>
#include <QApplication>
#include <QTimer>
#include <QSettings>
#include <QtQml>
#include "UAS.h"
#include "UASInterface.h"
#include "HomePositionManager.h"
#include "QGC.h"
#include "QGCApplication.h"
#include "MultiVehicleManager.h"
#define PI 3.1415926535897932384626433832795
#define MEAN_EARTH_DIAMETER 12756274.0
#define UMR 0.017453292519943295769236907684886
const
char
*
HomePositionManager
::
_settingsGroup
=
"HomePositionManager"
;
const
char
*
HomePositionManager
::
_latitudeKey
=
"Latitude"
;
const
char
*
HomePositionManager
::
_longitudeKey
=
"Longitude"
;
const
char
*
HomePositionManager
::
_altitudeKey
=
"Altitude"
;
HomePositionManager
::
HomePositionManager
(
QGCApplication
*
app
)
:
QGCTool
(
app
)
,
homeLat
(
47.3769
)
,
homeLon
(
8.549444
)
,
homeAlt
(
470.0
)
{
qmlRegisterUncreatableType
<
HomePositionManager
>
(
"QGroundControl"
,
1
,
0
,
"HomePositionManager"
,
"Reference only"
);
}
void
HomePositionManager
::
setToolbox
(
QGCToolbox
*
toolbox
)
{
QGCTool
::
setToolbox
(
toolbox
);
_loadSettings
();
}
void
HomePositionManager
::
_storeSettings
(
void
)
{
QSettings
settings
;
settings
.
remove
(
_settingsGroup
);
settings
.
beginGroup
(
_settingsGroup
);
for
(
int
i
=
0
;
i
<
_homePositions
.
count
();
i
++
)
{
HomePosition
*
homePos
=
qobject_cast
<
HomePosition
*>
(
_homePositions
[
i
]);
qDebug
()
<<
"Saving"
<<
homePos
->
name
();
settings
.
beginGroup
(
homePos
->
name
());
settings
.
setValue
(
_latitudeKey
,
homePos
->
coordinate
().
latitude
());
settings
.
setValue
(
_longitudeKey
,
homePos
->
coordinate
().
longitude
());
settings
.
setValue
(
_altitudeKey
,
homePos
->
coordinate
().
altitude
());
settings
.
endGroup
();
}
settings
.
endGroup
();
// Deprecated settings for old editor
settings
.
beginGroup
(
"QGC_UASMANAGER"
);
settings
.
setValue
(
"HOMELAT"
,
homeLat
);
settings
.
setValue
(
"HOMELON"
,
homeLon
);
settings
.
setValue
(
"HOMEALT"
,
homeAlt
);
settings
.
endGroup
();
}
void
HomePositionManager
::
_loadSettings
(
void
)
{
QSettings
settings
;
_homePositions
.
clear
();
settings
.
beginGroup
(
_settingsGroup
);
foreach
(
const
QString
&
name
,
settings
.
childGroups
())
{
QGeoCoordinate
coordinate
;
qDebug
()
<<
"Load setting"
<<
name
;
settings
.
beginGroup
(
name
);
coordinate
.
setLatitude
(
settings
.
value
(
_latitudeKey
).
toDouble
());
coordinate
.
setLongitude
(
settings
.
value
(
_longitudeKey
).
toDouble
());
coordinate
.
setAltitude
(
settings
.
value
(
_altitudeKey
).
toDouble
());
settings
.
endGroup
();
_homePositions
.
append
(
new
HomePosition
(
name
,
coordinate
,
this
));
}
settings
.
endGroup
();
if
(
_homePositions
.
count
()
==
0
)
{
_homePositions
.
append
(
new
HomePosition
(
"ETH Campus"
,
QGeoCoordinate
(
47.3769
,
8.549444
,
470.0
),
this
));
}
}
void
HomePositionManager
::
updateHomePosition
(
const
QString
&
name
,
const
QGeoCoordinate
&
coordinate
)
{
HomePosition
*
homePos
=
NULL
;
for
(
int
i
=
0
;
i
<
_homePositions
.
count
();
i
++
)
{
homePos
=
qobject_cast
<
HomePosition
*>
(
_homePositions
[
i
]);
if
(
homePos
->
name
()
==
name
)
{
break
;
}
homePos
=
NULL
;
}
if
(
homePos
==
NULL
)
{
HomePosition
*
homePos
=
new
HomePosition
(
name
,
coordinate
,
this
);
_homePositions
.
append
(
homePos
);
}
else
{
homePos
->
setName
(
name
);
homePos
->
setCoordinate
(
coordinate
);
}
_storeSettings
();
}
void
HomePositionManager
::
deleteHomePosition
(
const
QString
&
name
)
{
// Don't allow delete of last position
if
(
_homePositions
.
count
()
==
1
)
{
return
;
}
qDebug
()
<<
"Attempting delete"
<<
name
;
for
(
int
i
=
0
;
i
<
_homePositions
.
count
();
i
++
)
{
if
(
qobject_cast
<
HomePosition
*>
(
_homePositions
[
i
])
->
name
()
==
name
)
{
qDebug
()
<<
"Deleting"
<<
name
;
_homePositions
.
removeAt
(
i
);
break
;
}
}
_storeSettings
();
}
HomePosition
::
HomePosition
(
const
QString
&
name
,
const
QGeoCoordinate
&
coordinate
,
HomePositionManager
*
homePositionManager
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_coordinate
(
coordinate
)
,
_homePositionManager
(
homePositionManager
)
{
setObjectName
(
name
);
}
HomePosition
::~
HomePosition
()
{
}
QString
HomePosition
::
name
(
void
)
{
return
objectName
();
}
void
HomePosition
::
setName
(
const
QString
&
name
)
{
setObjectName
(
name
);
_homePositionManager
->
_storeSettings
();
emit
nameChanged
(
name
);
}
QGeoCoordinate
HomePosition
::
coordinate
(
void
)
{
return
_coordinate
;
}
void
HomePosition
::
setCoordinate
(
const
QGeoCoordinate
&
coordinate
)
{
_coordinate
=
coordinate
;
_homePositionManager
->
_storeSettings
();
emit
coordinateChanged
(
coordinate
);
}
src/HomePositionManager.h
deleted
100644 → 0
View file @
360cc7c6
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef HomePositionManager_H
#define HomePositionManager_H
#include "QmlObjectListModel.h"
#include "QGCToolbox.h"
#include <QGeoCoordinate>
class
HomePositionManager
;
class
HomePosition
:
public
QObject
{
Q_OBJECT
public:
HomePosition
(
const
QString
&
name
,
const
QGeoCoordinate
&
coordinate
,
HomePositionManager
*
homePositionManager
,
QObject
*
parent
=
NULL
);
~
HomePosition
();
Q_PROPERTY
(
QString
name
READ
name
WRITE
setName
NOTIFY
nameChanged
)
Q_PROPERTY
(
QGeoCoordinate
coordinate
READ
coordinate
WRITE
setCoordinate
NOTIFY
coordinateChanged
)
// Property accessors
QString
name
(
void
);
void
setName
(
const
QString
&
name
);
QGeoCoordinate
coordinate
(
void
);
void
setCoordinate
(
const
QGeoCoordinate
&
coordinate
);
signals:
void
nameChanged
(
const
QString
&
name
);
void
coordinateChanged
(
const
QGeoCoordinate
&
coordinate
);
private:
QGeoCoordinate
_coordinate
;
HomePositionManager
*
_homePositionManager
;
};
class
HomePositionManager
:
public
QGCTool
{
Q_OBJECT
public:
HomePositionManager
(
QGCApplication
*
app
);
Q_PROPERTY
(
QmlObjectListModel
*
homePositions
READ
homePositions
CONSTANT
)
/// If name is not already a home position a new one will be added, otherwise the existing
/// home position will be updated
Q_INVOKABLE
void
updateHomePosition
(
const
QString
&
name
,
const
QGeoCoordinate
&
coordinate
);
Q_INVOKABLE
void
deleteHomePosition
(
const
QString
&
name
);
// Property accesors
QmlObjectListModel
*
homePositions
(
void
)
{
return
&
_homePositions
;
}
// Should only be called by HomePosition
void
_storeSettings
(
void
);
// Override from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
private:
void
_loadSettings
(
void
);
QmlObjectListModel
_homePositions
;
static
const
char
*
_settingsGroup
;
static
const
char
*
_latitudeKey
;
static
const
char
*
_longitudeKey
;
static
const
char
*
_altitudeKey
;
// Everything below is deprecated and will be removed once old Map code is removed
public:
// Deprecated methods
/** @brief Get home position latitude */
double
getHomeLatitude
()
const
{
return
homeLat
;
}
/** @brief Get home position longitude */
double
getHomeLongitude
()
const
{
return
homeLon
;
}
/** @brief Get home position altitude */
double
getHomeAltitude
()
const
{
return
homeAlt
;
}
protected:
double
homeLat
;
double
homeLon
;
double
homeAlt
;
};
#endif
src/QGCApplication.cc
View file @
b789a690
...
...
@@ -39,7 +39,6 @@
#include "CmdLineOptParser.h"
#include "UDPLink.h"
#include "LinkManager.h"
#include "HomePositionManager.h"
#include "UASMessageHandler.h"
#include "QGCTemporaryFile.h"
#include "QGCPalette.h"
...
...
@@ -63,7 +62,6 @@
#include "QmlObjectListModel.h"
#include "MissionManager.h"
#include "QGroundControlQmlGlobal.h"
#include "HomePositionManager.h"
#include "FlightMapSettings.h"
#include "CoordinateVector.h"
#include "MainToolBarController.h"
...
...
src/QGCApplication.h
View file @
b789a690
...
...
@@ -27,7 +27,6 @@
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "FlightMapSettings.h"
#include "HomePositionManager.h"
#include "FirmwarePluginManager.h"
#include "MultiVehicleManager.h"
#include "JoystickManager.h"
...
...
src/QGCToolbox.cc
View file @
b789a690
...
...
@@ -15,7 +15,6 @@
#ifndef __mobile__
#include "GPSManager.h"
#endif
#include "HomePositionManager.h"
#include "JoystickManager.h"
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
...
...
@@ -43,7 +42,6 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
#ifndef __mobile__
,
_gpsManager
(
NULL
)
#endif
,
_homePositionManager
(
NULL
)
,
_imageProvider
(
NULL
)
,
_joystickManager
(
NULL
)
,
_linkManager
(
NULL
)
...
...
@@ -67,7 +65,6 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
#ifndef __mobile__
_gpsManager
=
new
GPSManager
(
app
);
#endif
_homePositionManager
=
new
HomePositionManager
(
app
);
_imageProvider
=
new
QGCImageProvider
(
app
);
_joystickManager
=
new
JoystickManager
(
app
);
_linkManager
=
new
LinkManager
(
app
);
...
...
@@ -92,7 +89,6 @@ void QGCToolbox::setChildToolboxes(void)
#ifndef __mobile__
_gpsManager
->
setToolbox
(
this
);
#endif
_homePositionManager
->
setToolbox
(
this
);
_imageProvider
->
setToolbox
(
this
);
_joystickManager
->
setToolbox
(
this
);
_linkManager
->
setToolbox
(
this
);
...
...
@@ -115,7 +111,6 @@ QGCToolbox::~QGCToolbox()
delete
_factSystem
;
delete
_firmwarePluginManager
;
delete
_flightMapSettings
;
delete
_homePositionManager
;
delete
_joystickManager
;
delete
_linkManager
;
delete
_mavlinkProtocol
;
...
...
src/QGCToolbox.h
View file @
b789a690
...
...
@@ -18,7 +18,6 @@ class FirmwarePluginManager;
class
FlightMapSettings
;
class
GAudioOutput
;
class
GPSManager
;
class
HomePositionManager
;
class
JoystickManager
;
class
FollowMe
;
class
LinkManager
;
...
...
@@ -44,7 +43,6 @@ public:
FirmwarePluginManager
*
firmwarePluginManager
(
void
)
{
return
_firmwarePluginManager
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
GAudioOutput
*
audioOutput
(
void
)
{
return
_audioOutput
;
}
HomePositionManager
*
homePositionManager
(
void
)
{
return
_homePositionManager
;
}
JoystickManager
*
joystickManager
(
void
)
{
return
_joystickManager
;
}
LinkManager
*
linkManager
(
void
)
{
return
_linkManager
;
}
MAVLinkProtocol
*
mavlinkProtocol
(
void
)
{
return
_mavlinkProtocol
;
}
...
...
@@ -75,7 +73,6 @@ private:
#ifndef __mobile__
GPSManager
*
_gpsManager
;
#endif
HomePositionManager
*
_homePositionManager
;
QGCImageProvider
*
_imageProvider
;
JoystickManager
*
_joystickManager
;
LinkManager
*
_linkManager
;
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
b789a690
...
...
@@ -37,7 +37,6 @@ const char* QGroundControlQmlGlobal::_baseFontPointSizeKey = "BaseDeviceFon
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCApplication
*
app
)
:
QGCTool
(
app
)
,
_flightMapSettings
(
NULL
)
,
_homePositionManager
(
NULL
)
,
_linkManager
(
NULL
)
,
_multiVehicleManager
(
NULL
)
,
_mapEngineManager
(
NULL
)
...
...
@@ -66,7 +65,6 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
{
QGCTool
::
setToolbox
(
toolbox
);
_flightMapSettings
=
toolbox
->
flightMapSettings
();
_homePositionManager
=
toolbox
->
homePositionManager
();
_linkManager
=
toolbox
->
linkManager
();
_multiVehicleManager
=
toolbox
->
multiVehicleManager
();
_mapEngineManager
=
toolbox
->
mapEngineManager
();
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
b789a690
...
...
@@ -17,7 +17,6 @@
#include "QGCToolbox.h"
#include "QGCApplication.h"
#include "LinkManager.h"
#include "HomePositionManager.h"
#include "FlightMapSettings.h"
#include "SettingsFact.h"
#include "FactMetaData.h"
...
...
@@ -65,7 +64,6 @@ public:
Q_ENUMS
(
SpeedUnits
)
Q_PROPERTY
(
FlightMapSettings
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
HomePositionManager
*
homePositionManager
READ
homePositionManager
CONSTANT
)
Q_PROPERTY
(
LinkManager
*
linkManager
READ
linkManager
CONSTANT
)
Q_PROPERTY
(
MultiVehicleManager
*
multiVehicleManager
READ
multiVehicleManager
CONSTANT
)
Q_PROPERTY
(
QGCMapEngineManager
*
mapEngineManager
READ
mapEngineManager
CONSTANT
)
...
...
@@ -163,7 +161,6 @@ public:
// Property accesors
FlightMapSettings
*
flightMapSettings
()
{
return
_flightMapSettings
;
}
HomePositionManager
*
homePositionManager
()
{
return
_homePositionManager
;
}
LinkManager
*
linkManager
()
{
return
_linkManager
;
}
MultiVehicleManager
*
multiVehicleManager
()
{
return
_multiVehicleManager
;
}
QGCMapEngineManager
*
mapEngineManager
()
{
return
_mapEngineManager
;
}
...
...
@@ -235,7 +232,6 @@ private:
static
QMap
<
QString
,
FactMetaData
*>&
nameToMetaDataMap
(
void
);
FlightMapSettings
*
_flightMapSettings
;
HomePositionManager
*
_homePositionManager
;
LinkManager
*
_linkManager
;
MultiVehicleManager
*
_multiVehicleManager
;
QGCMapEngineManager
*
_mapEngineManager
;
...
...
src/comm/QGCFlightGearLink.cc
View file @
b789a690
...
...
@@ -32,7 +32,6 @@
#include "QGC.h"
#include "QGCFileDialog.h"
#include "QGCMessageBox.h"
#include "HomePositionManager.h"
#include "QGCApplication.h"
#include "Vehicle.h"
#include "UAS.h"
...
...
@@ -939,11 +938,12 @@ bool QGCFlightGearLink::connectSimulation()
}
// We start out at our home position
_fgArgList
<<
QString
(
"--lat=%1"
).
arg
(
qgcApp
()
->
toolbox
()
->
homePositionManager
()
->
getHomeLatitude
());
_fgArgList
<<
QString
(
"--lon=%1"
).
arg
(
qgcApp
()
->
toolbox
()
->
homePositionManager
()
->
getHomeLongitude
());
QGeoCoordinate
homePosition
=
qgcApp
()
->
lastKnownHomePosition
();
_fgArgList
<<
QString
(
"--lat=%1"
).
arg
(
homePosition
.
latitude
());
_fgArgList
<<
QString
(
"--lon=%1"
).
arg
(
homePosition
.
longitude
());
// The altitude is not set because an altitude not equal to the ground altitude leads to a non-zero default throttle in flightgear
// Without the altitude-setting the aircraft is positioned on the ground
//_fgArgList << QString("--altitude=%1").arg(
qgcApp()->toolbox()->homePositionManager()->getHomeA
ltitude());
//_fgArgList << QString("--altitude=%1").arg(
homePosition.a
ltitude());
#ifdef DEBUG_FLIGHTGEAR_CONNECT
// This tell FlightGear to output highest debug level of log output. Handy for debuggin failures by looking at the FG
...
...
src/comm/QGCXPlaneLink.cc
View file @
b789a690
...
...
@@ -30,7 +30,6 @@
#include "UAS.h"
#include "UASInterface.h"
#include "QGCMessageBox.h"
#include "HomePositionManager.h"
QGCXPlaneLink
::
QGCXPlaneLink
(
Vehicle
*
vehicle
,
QString
remoteHost
,
QHostAddress
localHost
,
quint16
localPort
)
:
_vehicle
(
vehicle
),
...
...
src/uas/UAS.cc
View file @
b789a690
...
...
@@ -23,7 +23,6 @@
#include "UAS.h"
#include "LinkInterface.h"
#include "HomePositionManager.h"
#include "QGC.h"
#include "GAudioOutput.h"
#include "MAVLinkProtocol.h"
...
...
src/ui/MainWindow.cc
View file @
b789a690
...
...
@@ -37,7 +37,6 @@
#include "MAVLinkDecoder.h"
#include "QGCApplication.h"
#include "MultiVehicleManager.h"
#include "HomePositionManager.h"
#include "LogCompressor.h"
#include "UAS.h"
#include "QGCImageProvider.h"
...
...
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