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
415baa2c
Commit
415baa2c
authored
Feb 11, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finishing refactoring for today, added persistence to map position and zoom level
parent
a7ae20ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
configuration.h
src/configuration.h
+1
-1
UAS.cc
src/uas/UAS.cc
+1
-1
MapWidget.cc
src/ui/MapWidget.cc
+26
-5
No files found.
src/configuration.h
View file @
415baa2c
...
...
@@ -17,7 +17,7 @@
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 0.8.3 (Alpha RC
6
)"
#define QGC_APPLICATION_VERSION "v. 0.8.3 (Alpha RC
7
)"
namespace
QGC
...
...
src/uas/UAS.cc
View file @
415baa2c
...
...
@@ -44,7 +44,7 @@ warnVoltage(9.5f),
warnLevelPercent
(
20.0
f
),
currentVoltage
(
12.0
f
),
lpVoltage
(
12.0
f
),
batteryRemainingEstimateEnabled
(
tru
e
),
batteryRemainingEstimateEnabled
(
fals
e
),
mode
(
MAV_MODE_UNINIT
),
status
(
MAV_STATE_UNINIT
),
onboardTimeOffset
(
0
),
...
...
src/ui/MapWidget.cc
View file @
415baa2c
...
...
@@ -92,11 +92,24 @@ MapWidget::MapWidget(QWidget *parent) :
// Layer* gsatLayer = new Layer("Google Satellite", gsat, Layer::MapLayer);
// mc->addLayer(gsatLayer);
// Zurich, ETH
int
lastZoom
=
16
;
double
lastLat
=
47.376889
;
double
lastLon
=
8.548056
;
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAPWIDGET"
);
lastLat
=
settings
.
value
(
"LAST_LATITUDE"
,
lastLat
).
toDouble
();
lastLon
=
settings
.
value
(
"LAST_LONGITUDE"
,
lastLon
).
toDouble
();
lastZoom
=
settings
.
value
(
"LAST_ZOOM"
,
lastZoom
).
toInt
();
settings
.
endGroup
();
// SET INITIAL POSITION AND ZOOM
// Set default zoom level
mc
->
setZoom
(
16
);
// Zurich, ETH
mc
->
setView
(
QPointF
(
8.548056
,
47.376889
));
mc
->
setZoom
(
lastZoom
);
mc
->
setView
(
QPointF
(
lastLon
,
lastLat
));
// Veracruz Mexico
//mc->setView(QPointF(-96.105208,19.138955));
...
...
@@ -262,7 +275,7 @@ void MapWidget::goTo()
bool
ok
;
QString
text
=
QInputDialog
::
getText
(
this
,
tr
(
"Please enter coordinates"
),
tr
(
"Coordinates (Lat,Lon):"
),
QLineEdit
::
Normal
,
QString
(
"%1,%2"
).
arg
(
mc
->
currentCoordinate
().
x
()).
arg
(
mc
->
currentCoordinate
().
y
()),
&
ok
);
QString
(
"%1,%2"
).
arg
(
mc
->
currentCoordinate
().
y
()).
arg
(
mc
->
currentCoordinate
().
x
()),
&
ok
);
if
(
ok
&&
!
text
.
isEmpty
())
{
QStringList
split
=
text
.
split
(
","
);
...
...
@@ -276,7 +289,7 @@ void MapWidget::goTo()
if
(
ok
)
{
mc
->
setView
(
QPointF
(
l
atitude
,
long
itude
));
mc
->
setView
(
QPointF
(
l
ongitude
,
lat
itude
));
}
}
}
...
...
@@ -990,6 +1003,14 @@ void MapWidget::showEvent(QShowEvent* event)
void
MapWidget
::
hideEvent
(
QHideEvent
*
event
)
{
Q_UNUSED
(
event
);
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAPWIDGET"
);
QPointF
currentPos
=
mc
->
currentCoordinate
();
settings
.
setValue
(
"LAST_LATITUDE"
,
currentPos
.
y
());
settings
.
setValue
(
"LAST_LONGITUDE"
,
currentPos
.
x
());
settings
.
setValue
(
"LAST_ZOOM"
,
mc
->
currentZoom
());
settings
.
endGroup
();
settings
.
sync
();
}
...
...
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