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:
...
@@ -56,8 +56,8 @@ public:
UAS
(
MAVLinkProtocol
*
protocol
,
int
id
=
0
);
UAS
(
MAVLinkProtocol
*
protocol
,
int
id
=
0
);
~
UAS
();
~
UAS
();
static
const
in
t
lipoFull
=
4
.
2
f
;
///< 100% charged voltage
static
const
floa
t
lipoFull
=
4
.
2
f
;
///< 100% charged voltage
static
const
in
t
lipoEmpty
=
3
.
5
f
;
///< Discharged voltage
static
const
floa
t
lipoEmpty
=
3
.
5
f
;
///< Discharged voltage
/* MANAGEMENT */
/* MANAGEMENT */
...
...
src/ui/map/QGCMapToolBar.cc
View file @
ee28a045
...
@@ -7,8 +7,10 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
...
@@ -7,8 +7,10 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
ui
(
new
Ui
::
QGCMapToolBar
),
ui
(
new
Ui
::
QGCMapToolBar
),
map
(
NULL
),
map
(
NULL
),
optionsMenu
(
this
),
optionsMenu
(
this
),
mapTypesMenu
(
this
),
trailPlotMenu
(
this
),
trailPlotMenu
(
this
),
updateTimesMenu
(
this
),
updateTimesMenu
(
this
),
mapTypesGroup
(
new
QActionGroup
(
this
)),
trailSettingsGroup
(
new
QActionGroup
(
this
)),
trailSettingsGroup
(
new
QActionGroup
(
this
)),
updateTimesGroup
(
new
QActionGroup
(
this
))
updateTimesGroup
(
new
QActionGroup
(
this
))
{
{
...
@@ -45,21 +47,43 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
...
@@ -45,21 +47,43 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
// Set exclusive items
// Set exclusive items
trailSettingsGroup
->
setExclusive
(
true
);
trailSettingsGroup
->
setExclusive
(
true
);
updateTimesGroup
->
setExclusive
(
true
);
updateTimesGroup
->
setExclusive
(
true
);
mapTypesGroup
->
setExclusive
(
true
);
// Build up menu
// Build up menu
trailPlotMenu
.
setTitle
(
tr
(
"&Add trail dot every.."
));
trailPlotMenu
.
setTitle
(
tr
(
"&Add trail dot every.."
));
updateTimesMenu
.
setTitle
(
tr
(
"&Limit map view update rate to.."
));
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
()));
//setup the mapTypesMenu
action
->
setData
(
-
1
);
QAction
*
action
;
action
=
mapTypesMenu
.
addAction
(
tr
(
"Bing Hybrid"
),
this
,
SLOT
(
setMapType
()));
action
->
setData
(
MapType
::
BingHybrid
);
action
->
setCheckable
(
true
);
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
)
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
->
setData
(
uavTrailTimeList
[
i
]);
action
->
setCheckable
(
true
);
action
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
action
);
trailSettingsGroup
->
addAction
(
action
);
...
@@ -71,7 +95,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
...
@@ -71,7 +95,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
}
}
for
(
int
i
=
0
;
i
<
uavTrailDistanceCount
;
++
i
)
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
->
setData
(
uavTrailDistanceList
[
i
]);
action
->
setCheckable
(
true
);
action
->
setCheckable
(
true
);
trailSettingsGroup
->
addAction
(
action
);
trailSettingsGroup
->
addAction
(
action
);
...
@@ -85,7 +109,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
...
@@ -85,7 +109,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
// Set no trail checked if no action is checked yet
// Set no trail checked if no action is checked yet
if
(
!
trailSettingsGroup
->
checkedAction
())
if
(
!
trailSettingsGroup
->
checkedAction
())
{
{
a
ction
->
setChecked
(
true
);
defaultTrailA
ction
->
setChecked
(
true
);
}
}
optionsMenu
.
addMenu
(
&
trailPlotMenu
);
optionsMenu
.
addMenu
(
&
trailPlotMenu
);
...
@@ -119,7 +143,6 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
...
@@ -119,7 +143,6 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
}
}
optionsMenu
.
addMenu
(
&
updateTimesMenu
);
optionsMenu
.
addMenu
(
&
updateTimesMenu
);
ui
->
optionsButton
->
setMenu
(
&
optionsMenu
);
ui
->
optionsButton
->
setMenu
(
&
optionsMenu
);
}
}
}
}
...
@@ -175,6 +198,23 @@ void QGCMapToolBar::setUpdateInterval()
...
@@ -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
()
void
QGCMapToolBar
::
tileLoadStart
()
{
{
ui
->
posLabel
->
setText
(
tr
(
"Starting to load tiles.."
));
ui
->
posLabel
->
setText
(
tr
(
"Starting to load tiles.."
));
...
@@ -201,10 +241,12 @@ void QGCMapToolBar::tileLoadProgress(int progress)
...
@@ -201,10 +241,12 @@ void QGCMapToolBar::tileLoadProgress(int progress)
}
}
}
}
QGCMapToolBar
::~
QGCMapToolBar
()
QGCMapToolBar
::~
QGCMapToolBar
()
{
{
delete
ui
;
delete
ui
;
delete
trailSettingsGroup
;
delete
trailSettingsGroup
;
delete
updateTimesGroup
;
delete
updateTimesGroup
;
delete
mapTypesGroup
;
// FIXME Delete all actions
// FIXME Delete all actions
}
}
src/ui/map/QGCMapToolBar.h
View file @
ee28a045
...
@@ -28,6 +28,7 @@ public slots:
...
@@ -28,6 +28,7 @@ public slots:
void
setUAVTrailTime
();
void
setUAVTrailTime
();
void
setUAVTrailDistance
();
void
setUAVTrailDistance
();
void
setUpdateInterval
();
void
setUpdateInterval
();
void
setMapType
();
private:
private:
Ui
::
QGCMapToolBar
*
ui
;
Ui
::
QGCMapToolBar
*
ui
;
...
@@ -37,8 +38,11 @@ protected:
...
@@ -37,8 +38,11 @@ protected:
QMenu
optionsMenu
;
QMenu
optionsMenu
;
QMenu
trailPlotMenu
;
QMenu
trailPlotMenu
;
QMenu
updateTimesMenu
;
QMenu
updateTimesMenu
;
QMenu
mapTypesMenu
;
QActionGroup
*
trailSettingsGroup
;
QActionGroup
*
trailSettingsGroup
;
QActionGroup
*
updateTimesGroup
;
QActionGroup
*
updateTimesGroup
;
QActionGroup
*
mapTypesGroup
;
};
};
#endif // QGCMAPTOOLBAR_H
#endif // QGCMAPTOOLBAR_H
src/ui/map/QGCMapWidget.cc
View file @
ee28a045
...
@@ -30,6 +30,12 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) :
...
@@ -30,6 +30,12 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) :
defaultGuidedAlt
=
-
1
;
defaultGuidedAlt
=
-
1
;
loadSettings
(
false
);
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
);
this
->
setContextMenuPolicy
(
Qt
::
ActionsContextMenu
);
QAction
*
guidedaction
=
new
QAction
(
this
);
QAction
*
guidedaction
=
new
QAction
(
this
);
...
@@ -519,6 +525,7 @@ void QGCMapWidget::updateHomePosition(double latitude, double longitude, double
...
@@ -519,6 +525,7 @@ void QGCMapWidget::updateHomePosition(double latitude, double longitude, double
void
QGCMapWidget
::
goHome
()
void
QGCMapWidget
::
goHome
()
{
{
SetCurrentPosition
(
Home
->
Coord
());
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