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
988e99fe
Commit
988e99fe
authored
Jul 21, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:pixhawk/qgroundcontrol into dev
parents
577258d5
6a38548a
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
143 additions
and
50 deletions
+143
-50
qgroundcontrol_installer.nsi
deploy/qgroundcontrol_installer.nsi
+1
-1
qgroundcontrol.pri
qgroundcontrol.pri
+6
-0
QGC.h
src/QGC.h
+16
-3
MAVLinkSimulationWaypointPlanner.cc
src/comm/MAVLinkSimulationWaypointPlanner.cc
+3
-3
uavitem.cpp
src/libs/opmapcontrol/src/mapwidget/uavitem.cpp
+1
-1
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+1
-1
HUD.cc
src/ui/HUD.cc
+0
-14
QGCDataPlot2D.cc
src/ui/QGCDataPlot2D.cc
+45
-6
QGCDataPlot2D.ui
src/ui/QGCDataPlot2D.ui
+4
-4
QGCMapTool.cc
src/ui/map/QGCMapTool.cc
+2
-0
QGCMapTool.h
src/ui/map/QGCMapTool.h
+1
-0
QGCMapToolBar.cc
src/ui/map/QGCMapToolBar.cc
+33
-0
QGCMapToolBar.h
src/ui/map/QGCMapToolBar.h
+5
-0
QGCMapToolBar.ui
src/ui/map/QGCMapToolBar.ui
+7
-0
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+18
-17
No files found.
deploy/qgroundcontrol_installer.nsi
View file @
988e99fe
...
...
@@ -16,7 +16,7 @@ LicenseData ..\license.txt
Section ""
SetOutPath $INSTDIR
File ..\release\*.*
File
/r
..\release\*.*
WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe
SectionEnd
...
...
qgroundcontrol.pri
View file @
988e99fe
...
...
@@ -320,8 +320,14 @@ win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit))
# QAxContainer support is needed for the Internet Control
# element showing the Google Earth window
CONFIG += qaxcontainer
# The EIGEN library needs this define
# to make the internal min/max functions work
DEFINES += NOMINMAX
# QWebkit is not needed on MS-Windows compilation environment
CONFIG -= webkit
...
...
src/QGC.h
View file @
988e99fe
...
...
@@ -33,9 +33,22 @@
/* Windows fixes */
#ifdef _MSC_VER
#include <math.h>
#define isnan(x) _isnan(x)
#define isinf(x) (!_finite(x))
/* Needed define for Eigen */
//#define NOMINMAX
#include <limits>
template
<
typename
T
>
inline
bool
isnan
(
T
value
)
{
return
value
!=
value
;
}
// requires #include <limits>
template
<
typename
T
>
inline
bool
isinf
(
T
value
)
{
return
std
::
numeric_limits
<
T
>::
has_infinity
&&
(
value
==
std
::
numeric_limits
<
T
>::
infinity
()
||
(
-
1
*
value
)
==
std
::
numeric_limits
<
T
>::
infinity
());
}
#else
#include <cmath>
#ifndef isnan
...
...
src/comm/MAVLinkSimulationWaypointPlanner.cc
View file @
988e99fe
...
...
@@ -820,7 +820,7 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t*
mavlink_msg_action_decode
(
msg
,
&
action
);
if
(
action
.
target
==
systemid
)
{
if
(
verbose
)
qDebug
(
"Waypoint: received message with action %d
\n
"
,
action
.
action
);
switch
(
action
.
action
)
{
//
switch (action.action) {
// case MAV_ACTION_LAUNCH:
// if (verbose) std::cerr << "Launch received" << std::endl;
// current_active_wp_id = 0;
...
...
@@ -847,7 +847,7 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t*
// default:
// if (verbose) std::cerr << "Unknown action received with id " << action.action << ", no action taken" << std::endl;
// break;
}
//
}
}
break
;
}
...
...
src/libs/opmapcontrol/src/mapwidget/uavitem.cpp
View file @
988e99fe
...
...
@@ -86,7 +86,7 @@ namespace mapcontrol
}
else
if
(
trailtype
==
UAVTrailType
::
ByDistance
)
{
if
(
qAbs
(
internals
::
PureProjection
::
DistanceBetweenLatLng
(
lastcoord
,
position
))
>
traildistance
)
if
(
qAbs
(
internals
::
PureProjection
::
DistanceBetweenLatLng
(
lastcoord
,
position
)
*
1000
)
>
traildistance
)
{
trail
->
addToGroup
(
new
TrailItem
(
position
,
altitude
,
color
,
this
));
if
(
!
lasttrailline
.
IsEmpty
())
...
...
src/uas/QGCUASParamManager.cc
View file @
988e99fe
...
...
@@ -20,7 +20,7 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) :
*/
void
QGCUASParamManager
::
requestParameterListUpdate
(
int
component
)
{
Q_UNUSED
(
component
);
}
src/ui/HUD.cc
View file @
988e99fe
...
...
@@ -51,20 +51,6 @@ This file is part of the QGROUNDCONTROL project
#define GL_MULTISAMPLE 0x809D
#endif
template
<
typename
T
>
inline
bool
isnan
(
T
value
)
{
return
value
!=
value
;
}
// requires #include <limits>
template
<
typename
T
>
inline
bool
isinf
(
T
value
)
{
return
std
::
numeric_limits
<
T
>::
has_infinity
&&
(
value
==
std
::
numeric_limits
<
T
>::
infinity
()
||
(
-
1
*
value
)
==
std
::
numeric_limits
<
T
>::
infinity
());
}
/**
* @warning The HUD widget will not start painting its content automatically
* to update the view, start the auto-update by calling HUD::start().
...
...
src/ui/QGCDataPlot2D.cc
View file @
988e99fe
...
...
@@ -405,8 +405,6 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
int
curveNameIndex
=
0
;
//int xValueIndex = curveNames.indexOf(xAxisName);
QString
xAxisFilter
;
if
(
xAxisName
==
""
)
{
xAxisFilter
=
curveNames
.
first
();
...
...
@@ -414,6 +412,34 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
xAxisFilter
=
xAxisName
;
}
// Fill y-axis renaming lookup table
// Allow the user to rename data dimensions in the plot
QMap
<
QString
,
QString
>
renaming
;
QStringList
yCurves
=
yAxisFilter
.
split
(
"|"
,
QString
::
SkipEmptyParts
);
// Figure out the correct renaming
for
(
int
i
=
0
;
i
<
yCurves
.
count
();
++
i
)
{
if
(
yCurves
.
at
(
i
).
contains
(
":"
))
{
QStringList
parts
=
yCurves
.
at
(
i
).
split
(
":"
,
QString
::
SkipEmptyParts
);
if
(
parts
.
count
()
>
1
)
{
// Insert renaming map
renaming
.
insert
(
parts
.
first
(),
parts
.
last
());
// Replace curve value with first part only
yCurves
.
replace
(
i
,
parts
.
first
());
}
}
// else
// {
// // Insert same value, not renaming anything
// renaming.insert(yCurves.at(i), yCurves.at(i));
// }
}
foreach
(
curveName
,
curveNames
)
{
// Add to plot x axis selection
ui
->
xAxis
->
addItem
(
curveName
);
...
...
@@ -421,14 +447,19 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
ui
->
xRegressionComboBox
->
addItem
(
curveName
);
ui
->
yRegressionComboBox
->
addItem
(
curveName
);
if
(
curveName
!=
xAxisFilter
)
{
if
((
yAxisFilter
==
""
)
||
y
AxisFilter
.
contains
(
curveName
))
{
if
((
yAxisFilter
==
""
)
||
y
Curves
.
contains
(
curveName
))
{
yValues
.
insert
(
curveName
,
new
QVector
<
double
>
());
xValues
.
insert
(
curveName
,
new
QVector
<
double
>
());
// Add separator starting with second item
if
(
curveNameIndex
>
0
&&
curveNameIndex
<
curveNames
.
count
())
{
ui
->
yAxis
->
setText
(
ui
->
yAxis
->
text
()
+
"|"
);
}
ui
->
yAxis
->
setText
(
ui
->
yAxis
->
text
()
+
curveName
);
// If this curve was renamed, re-add the renaming to the text field
QString
renamingText
=
""
;
if
(
renaming
.
contains
(
curveName
))
renamingText
=
QString
(
":%1"
).
arg
(
renaming
.
value
(
curveName
));
ui
->
yAxis
->
setText
(
ui
->
yAxis
->
text
()
+
curveName
+
renamingText
);
// Insert same value, not renaming anything
if
(
!
renaming
.
contains
(
curveName
))
renaming
.
insert
(
curveName
,
curveName
);
curveNameIndex
++
;
}
}
...
...
@@ -478,7 +509,8 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
foreach
(
curveName
,
curveNames
)
{
// Y AXIS HANDLING
if
(
curveName
!=
xAxisFilter
&&
(
yAxisFilter
==
""
||
yAxisFilter
.
contains
(
curveName
)))
// Only plot non-x curver and those selected in the yAxisFilter (or all if the filter is not set)
if
(
curveName
!=
xAxisFilter
&&
(
yAxisFilter
==
""
||
yCurves
.
contains
(
curveName
)))
{
bool
oky
;
int
curveNameIndex
=
curveNames
.
indexOf
(
curveName
);
...
...
@@ -504,8 +536,15 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil
// Add data array of each curve to the plot at once (fast)
// Iterates through all x-y curve combinations
for
(
int
i
=
0
;
i
<
yValues
.
count
();
i
++
)
{
if
(
renaming
.
contains
(
yValues
.
keys
().
at
(
i
)))
{
plot
->
appendData
(
renaming
.
value
(
yValues
.
keys
().
at
(
i
)),
xValues
.
values
().
at
(
i
)
->
data
(),
yValues
.
values
().
at
(
i
)
->
data
(),
xValues
.
values
().
at
(
i
)
->
count
());
}
else
{
plot
->
appendData
(
yValues
.
keys
().
at
(
i
),
xValues
.
values
().
at
(
i
)
->
data
(),
yValues
.
values
().
at
(
i
)
->
data
(),
xValues
.
values
().
at
(
i
)
->
count
());
}
}
plot
->
updateScale
();
plot
->
setStyleText
(
ui
->
style
->
currentText
());
}
...
...
src/ui/QGCDataPlot2D.ui
View file @
988e99fe
...
...
@@ -6,14 +6,14 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
1
07
3
</width>
<height>
3
08
</height>
<width>
1
46
3
</width>
<height>
3
11
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<layout
class=
"QGridLayout"
name=
"gridLayout"
columnstretch=
"1,1,1,1,100,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
...
...
@@ -303,7 +303,7 @@
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<width>
5
</width>
<height>
20
</height>
</size>
</property>
...
...
src/ui/map/QGCMapTool.cc
View file @
988e99fe
#include "QGCMapTool.h"
#include "ui_QGCMapTool.h"
#include <QAction>
#include <QMenu>
QGCMapTool
::
QGCMapTool
(
QWidget
*
parent
)
:
QWidget
(
parent
),
...
...
src/ui/map/QGCMapTool.h
View file @
988e99fe
...
...
@@ -2,6 +2,7 @@
#define QGCMAPTOOL_H
#include <QWidget>
#include <QMenu>
namespace
Ui
{
class
QGCMapTool
;
...
...
src/ui/map/QGCMapToolBar.cc
View file @
988e99fe
...
...
@@ -29,9 +29,42 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
// Edit mode handling
ui
->
editButton
->
hide
();
// const int uavTrailTimeList[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // seconds
// const int uavTrailTimeCount = 10;
// const int uavTrailDistanceList[] = {1, 2, 5, 10, 20, 50, 100, 200, 500}; // meters
// const int uavTrailDistanceCount = 9;
// optionsMenu.setParent(this);
// // Build up menu
// //trailPlotMenu(tr("Add trail dot every.."), this);
// for (int i = 0; i < uavTrailTimeCount; ++i)
// {
// trailPlotMenu.addAction(QString("%1 second%2").arg(uavTrailTimeList[i]).arg((uavTrailTimeList[i] > 1) ? "s" : ""), this, SLOT(setUAVTrailTime()));
// }
// for (int i = 0; i < uavTrailDistanceCount; ++i)
// {
// trailPlotMenu.addAction(QString("%1 meter%2").arg(uavTrailDistanceList[i]).arg((uavTrailDistanceList[i] > 1) ? "s" : ""), this, SLOT(setUAVTrailDistance()));
// }
// optionsMenu.addMenu(&trailPlotMenu);
// ui->optionsButton->setMenu(&optionsMenu);
}
}
void
QGCMapToolBar
::
setUAVTrailTime
()
{
}
void
QGCMapToolBar
::
setUAVTrailDistance
()
{
}
void
QGCMapToolBar
::
tileLoadStart
()
{
ui
->
posLabel
->
setText
(
QString
(
"Starting to load tiles.."
));
...
...
src/ui/map/QGCMapToolBar.h
View file @
988e99fe
...
...
@@ -2,6 +2,7 @@
#define QGCMAPTOOLBAR_H
#include <QWidget>
#include <QMenu>
class
QGCMapWidget
;
...
...
@@ -23,9 +24,13 @@ public slots:
void
tileLoadStart
();
void
tileLoadEnd
();
void
tileLoadProgress
(
int
progress
);
void
setUAVTrailTime
();
void
setUAVTrailDistance
();
protected:
QGCMapWidget
*
map
;
QMenu
optionsMenu
;
QMenu
trailPlotMenu
;
private:
Ui
::
QGCMapToolBar
*
ui
;
...
...
src/ui/map/QGCMapToolBar.ui
View file @
988e99fe
...
...
@@ -69,6 +69,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"optionsButton"
>
<property
name=
"text"
>
<string>
Options
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
...
...
src/ui/map/QGCMapWidget.cc
View file @
988e99fe
...
...
@@ -26,6 +26,9 @@ QGCMapWidget::~QGCMapWidget()
void
QGCMapWidget
::
showEvent
(
QShowEvent
*
event
)
{
// FIXME XXX this is a hack to trick OPs current 1-system design
SetShowUAV
(
false
);
// Pass on to parent widget
OPMapWidget
::
showEvent
(
event
);
...
...
@@ -57,30 +60,25 @@ void QGCMapWidget::showEvent(QShowEvent* event)
// magic_waypoint.time_seconds = 0;
// magic_waypoint.hold_time_seconds = 0;
const
int
safe_area_radius_list
[]
=
{
5
,
10
,
20
,
50
,
100
,
200
,
500
,
1000
,
2000
,
5000
};
// meters
const
int
uav_trail_time_list
[]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
// seconds
const
int
uav_trail_distance_list
[]
=
{
1
,
2
,
5
,
10
,
20
,
50
,
100
,
200
,
500
};
// meters
SetMouseWheelZoomType
(
internals
::
MouseWheelZoomType
::
MousePositionWithoutCenter
);
// set how the mouse wheel zoom functions
SetFollowMouse
(
true
);
// we want a contiuous mouse position reading
SetShowHome
(
true
);
// display the HOME position on the map
SetShowUAV
(
true
);
// display the UAV position on the map
//
SetShowUAV(true); // display the UAV position on the map
//SetShowDiagnostics(true); // Not needed in flight / production mode
Home
->
SetSafeArea
(
safe_area_radius_list
[
0
]);
// set radius (meters)
Home
->
SetSafeArea
(
30
);
// set radius (meters)
Home
->
SetShowSafeArea
(
true
);
// show the safe area
// UAV->SetTrailTime(uav_trail_time_list[0]); // seconds
// UAV->SetTrailDistance(uav_trail_distance_list[1]); // meters
//
//
UAV->SetTrailTime(uav_trail_time_list[0]); // seconds
//
//
UAV->SetTrailDistance(uav_trail_distance_list[1]); // meters
// UAV->SetTrailType(
UAVTrailType::ByTimeElapsed);
// UAV->SetTrailType(
UAVTrailType::ByDistance);
//// UAV->SetTrailType(mapcontrol::
UAVTrailType::ByTimeElapsed);
//// UAV->SetTrailType(mapcontrol::
UAVTrailType::ByDistance);
GPS
->
SetTrailTime
(
uav_trail_time_list
[
0
]);
// seconds
GPS
->
SetTrailDistance
(
uav_trail_distance_list
[
1
]);
// meters
//
GPS->SetTrailTime(uav_trail_time_list[0]); // seconds
//
GPS->SetTrailDistance(uav_trail_distance_list[1]); // meters
// GPS->SetTrailType(UAVTrailType::ByTimeElapsed);
...
...
@@ -245,9 +243,9 @@ void QGCMapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lo
newUAV
->
setParentItem
(
map
);
UAVS
.
insert
(
uas
->
getUASID
(),
newUAV
);
uav
=
GetUAV
(
uas
->
getUASID
());
//
uav->SetTrailTime(1);
//
uav->SetTrailDistance(5);
//
uav->SetTrailType(mapcontrol::UAVTrailType::ByTimeElapsed);
uav
->
SetTrailTime
(
1
);
uav
->
SetTrailDistance
(
5
);
uav
->
SetTrailType
(
mapcontrol
::
UAVTrailType
::
ByTimeElapsed
);
}
// Set new lat/lon position of UAV icon
...
...
@@ -276,6 +274,9 @@ void QGCMapWidget::updateGlobalPosition()
MAV2DIcon
*
newUAV
=
new
MAV2DIcon
(
map
,
this
,
system
);
AddUAV
(
system
->
getUASID
(),
newUAV
);
uav
=
newUAV
;
uav
->
SetTrailTime
(
1
);
uav
->
SetTrailDistance
(
5
);
uav
->
SetTrailType
(
mapcontrol
::
UAVTrailType
::
ByTimeElapsed
);
}
// Set new lat/lon position of UAV icon
...
...
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