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
ee28a045
Commit
ee28a045
authored
Jul 22, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into display_flt_modes
parents
14efc602
38caf81a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
11 deletions
+64
-11
UAS.h
src/uas/UAS.h
+2
-2
QGCMapToolBar.cc
src/ui/map/QGCMapToolBar.cc
+51
-9
QGCMapToolBar.h
src/ui/map/QGCMapToolBar.h
+4
-0
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+7
-0
No files found.
src/uas/UAS.h
View file @
ee28a045
...
...
@@ -56,8 +56,8 @@ public:
UAS
(
MAVLinkProtocol
*
protocol
,
int
id
=
0
);
~
UAS
();
static
const
in
t
lipoFull
=
4
.
2
f
;
///< 100% charged voltage
static
const
in
t
lipoEmpty
=
3
.
5
f
;
///< Discharged voltage
static
const
floa
t
lipoFull
=
4
.
2
f
;
///< 100% charged voltage
static
const
floa
t
lipoEmpty
=
3
.
5
f
;
///< Discharged voltage
/* MANAGEMENT */
...
...
src/ui/map/QGCMapToolBar.cc
View file @
ee28a045
...
...
@@ -7,8 +7,10 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
ui
(
new
Ui
::
QGCMapToolBar
),
map
(
NULL
),
optionsMenu
(
this
),
mapTypesMenu
(
this
),
trailPlotMenu
(
this
),
updateTimesMenu
(
this
),
mapTypesGroup
(
new
QActionGroup
(
this
)),
trailSettingsGroup
(
new
QActionGroup
(
this
)),
updateTimesGroup
(
new
QActionGroup
(
this
))
{
...
...
@@ -45,21 +47,43 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
// Set exclusive items
trailSettingsGroup
->
setExclusive
(
true
);
updateTimesGroup
->
setExclusive
(
true
);
mapTypesGroup
->
setExclusive
(
true
);
// Build up menu
trailPlotMenu
.
setTitle
(
tr
(
"&Add trail dot every.."
));
updateTimesMenu
.
setTitle
(
tr
(
"&Limit map view update rate to.."
));
mapTypesMenu
.
setTitle
(
tr
(
"&Map type"
));
// FIXME MARK CURRENT VALUES IN MENU
QAction
*
action
=
trailPlotMenu
.
addAction
(
tr
(
"No trail"
),
this
,
SLOT
(
setUAVTrailTime
()));
action
->
setData
(
-
1
);
//setup the mapTypesMenu
QAction
*
action
;
action
=
mapTypesMenu
.
addAction
(
tr
(
"Bing Hybrid"
),
this
,
SLOT
(
setMapType
()));
action
->
setData
(
MapType
::
BingHybrid
);
action
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
action
);
mapTypesGroup
->
addAction
(
action
);
action
=
mapTypesMenu
.
addAction
(
tr
(
"Google Hybrid"
),
this
,
SLOT
(
setMapType
()));
action
->
setData
(
MapType
::
GoogleHybrid
);
action
->
setCheckable
(
true
);
mapTypesGroup
->
addAction
(
action
);
action
=
mapTypesMenu
.
addAction
(
tr
(
"OpenStreetMap"
),
this
,
SLOT
(
setMapType
()));
action
->
setData
(
MapType
::
OpenStreetMap
);
action
->
setCheckable
(
true
);
mapTypesGroup
->
addAction
(
action
);
//TODO check current item
optionsMenu
.
addMenu
(
&
mapTypesMenu
);
// FIXME MARK CURRENT VALUES IN MENU
QAction
*
defaultTrailAction
=
trailPlotMenu
.
addAction
(
tr
(
"No trail"
),
this
,
SLOT
(
setUAVTrailTime
()));
defaultTrailAction
->
setData
(
-
1
);
defaultTrailAction
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
defaultTrailAction
);
for
(
int
i
=
0
;
i
<
uavTrailTimeCount
;
++
i
)
{
QAction
*
action
=
trailPlotMenu
.
addAction
(
tr
(
"%1 second%2"
).
arg
(
uavTrailTimeList
[
i
]).
arg
((
uavTrailTimeList
[
i
]
>
1
)
?
"s"
:
""
),
this
,
SLOT
(
setUAVTrailTime
()));
action
=
trailPlotMenu
.
addAction
(
tr
(
"%1 second%2"
).
arg
(
uavTrailTimeList
[
i
]).
arg
((
uavTrailTimeList
[
i
]
>
1
)
?
"s"
:
""
),
this
,
SLOT
(
setUAVTrailTime
()));
action
->
setData
(
uavTrailTimeList
[
i
]);
action
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
action
);
...
...
@@ -71,7 +95,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
}
for
(
int
i
=
0
;
i
<
uavTrailDistanceCount
;
++
i
)
{
QAction
*
action
=
trailPlotMenu
.
addAction
(
tr
(
"%1 meter%2"
).
arg
(
uavTrailDistanceList
[
i
]).
arg
((
uavTrailDistanceList
[
i
]
>
1
)
?
"s"
:
""
),
this
,
SLOT
(
setUAVTrailDistance
()));
action
=
trailPlotMenu
.
addAction
(
tr
(
"%1 meter%2"
).
arg
(
uavTrailDistanceList
[
i
]).
arg
((
uavTrailDistanceList
[
i
]
>
1
)
?
"s"
:
""
),
this
,
SLOT
(
setUAVTrailDistance
()));
action
->
setData
(
uavTrailDistanceList
[
i
]);
action
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
action
);
...
...
@@ -85,7 +109,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
// Set no trail checked if no action is checked yet
if
(
!
trailSettingsGroup
->
checkedAction
())
{
a
ction
->
setChecked
(
true
);
defaultTrailA
ction
->
setChecked
(
true
);
}
optionsMenu
.
addMenu
(
&
trailPlotMenu
);
...
...
@@ -119,7 +143,6 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
}
optionsMenu
.
addMenu
(
&
updateTimesMenu
);
ui
->
optionsButton
->
setMenu
(
&
optionsMenu
);
}
}
...
...
@@ -175,6 +198,23 @@ void QGCMapToolBar::setUpdateInterval()
}
}
void
QGCMapToolBar
::
setMapType
()
{
QObject
*
sender
=
QObject
::
sender
();
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
);
if
(
action
)
{
bool
ok
;
int
mapType
=
action
->
data
().
toInt
(
&
ok
);
if
(
ok
)
{
map
->
SetMapType
((
MapType
::
Types
)
mapType
);
ui
->
posLabel
->
setText
(
tr
(
"Map type: %1"
).
arg
(
mapType
));
}
}
}
void
QGCMapToolBar
::
tileLoadStart
()
{
ui
->
posLabel
->
setText
(
tr
(
"Starting to load tiles.."
));
...
...
@@ -201,10 +241,12 @@ void QGCMapToolBar::tileLoadProgress(int progress)
}
}
QGCMapToolBar
::~
QGCMapToolBar
()
{
delete
ui
;
delete
trailSettingsGroup
;
delete
updateTimesGroup
;
delete
mapTypesGroup
;
// FIXME Delete all actions
}
src/ui/map/QGCMapToolBar.h
View file @
ee28a045
...
...
@@ -28,6 +28,7 @@ public slots:
void
setUAVTrailTime
();
void
setUAVTrailDistance
();
void
setUpdateInterval
();
void
setMapType
();
private:
Ui
::
QGCMapToolBar
*
ui
;
...
...
@@ -37,8 +38,11 @@ protected:
QMenu
optionsMenu
;
QMenu
trailPlotMenu
;
QMenu
updateTimesMenu
;
QMenu
mapTypesMenu
;
QActionGroup
*
trailSettingsGroup
;
QActionGroup
*
updateTimesGroup
;
QActionGroup
*
mapTypesGroup
;
};
#endif // QGCMAPTOOLBAR_H
src/ui/map/QGCMapWidget.cc
View file @
ee28a045
...
...
@@ -30,6 +30,12 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) :
defaultGuidedAlt
=
-
1
;
loadSettings
(
false
);
//handy for debugging:
//this->SetShowTileGridLines(true);
//default appears to be Google Hybrid, and is broken currently
this
->
SetMapType
(
MapType
::
BingHybrid
);
this
->
setContextMenuPolicy
(
Qt
::
ActionsContextMenu
);
QAction
*
guidedaction
=
new
QAction
(
this
);
...
...
@@ -519,6 +525,7 @@ void QGCMapWidget::updateHomePosition(double latitude, double longitude, double
void
QGCMapWidget
::
goHome
()
{
SetCurrentPosition
(
Home
->
Coord
());
SetZoom
(
18
);
//zoom to "large RC park" size
}
/**
...
...
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