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
18a9b13a
Unverified
Commit
18a9b13a
authored
Dec 07, 2017
by
Gus Grubba
Committed by
GitHub
Dec 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5867 from gigorvd/slowmap
'manual control lost' when connected joystick with armed UAV
parents
6a75949d
e944d4fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
31 deletions
+27
-31
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+22
-29
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+5
-2
No files found.
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
18a9b13a
...
@@ -24,6 +24,9 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLatitudeSettingsKey =
...
@@ -24,6 +24,9 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLatitudeSettingsKey =
const
char
*
QGroundControlQmlGlobal
::
_flightMapPositionLongitudeSettingsKey
=
"Longitude"
;
const
char
*
QGroundControlQmlGlobal
::
_flightMapPositionLongitudeSettingsKey
=
"Longitude"
;
const
char
*
QGroundControlQmlGlobal
::
_flightMapZoomSettingsKey
=
"FlightMapZoom"
;
const
char
*
QGroundControlQmlGlobal
::
_flightMapZoomSettingsKey
=
"FlightMapZoom"
;
QGeoCoordinate
QGroundControlQmlGlobal
::
_coord
=
QGeoCoordinate
(
0.0
,
0.0
);
double
QGroundControlQmlGlobal
::
_zoom
=
17
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
:
QGCTool
(
app
,
toolbox
)
,
_flightMapInitialZoom
(
17.0
)
,
_flightMapInitialZoom
(
17.0
)
...
@@ -41,11 +44,26 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox
...
@@ -41,11 +44,26 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox
{
{
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
setParent
(
NULL
);
setParent
(
NULL
);
// Load last coordinates and zoom from config file
QSettings
settings
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
_coord
.
setLatitude
(
settings
.
value
(
_flightMapPositionLatitudeSettingsKey
,
0
).
toDouble
());
_coord
.
setLongitude
(
settings
.
value
(
_flightMapPositionLongitudeSettingsKey
,
0
).
toDouble
());
_zoom
=
settings
.
value
(
_flightMapZoomSettingsKey
,
2
).
toDouble
();
//if config file is clear
if
(
_zoom
==
0
)
_zoom
=
17.0
;
}
}
QGroundControlQmlGlobal
::~
QGroundControlQmlGlobal
()
QGroundControlQmlGlobal
::~
QGroundControlQmlGlobal
()
{
{
// Save last coordinates and zoom to config file
QSettings
settings
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
settings
.
setValue
(
_flightMapPositionLatitudeSettingsKey
,
_coord
.
latitude
());
settings
.
setValue
(
_flightMapPositionLongitudeSettingsKey
,
_coord
.
longitude
());
settings
.
setValue
(
_flightMapZoomSettingsKey
,
_zoom
);
}
}
void
QGroundControlQmlGlobal
::
setToolbox
(
QGCToolbox
*
toolbox
)
void
QGroundControlQmlGlobal
::
setToolbox
(
QGCToolbox
*
toolbox
)
...
@@ -198,34 +216,12 @@ void QGroundControlQmlGlobal::setSkipSetupPage(bool skip)
...
@@ -198,34 +216,12 @@ void QGroundControlQmlGlobal::setSkipSetupPage(bool skip)
}
}
}
}
QGeoCoordinate
QGroundControlQmlGlobal
::
flightMapPosition
(
void
)
{
QSettings
settings
;
QGeoCoordinate
coord
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
coord
.
setLatitude
(
settings
.
value
(
_flightMapPositionLatitudeSettingsKey
,
0
).
toDouble
());
coord
.
setLongitude
(
settings
.
value
(
_flightMapPositionLongitudeSettingsKey
,
0
).
toDouble
());
return
coord
;
}
double
QGroundControlQmlGlobal
::
flightMapZoom
(
void
)
{
QSettings
settings
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
return
settings
.
value
(
_flightMapZoomSettingsKey
,
2
).
toDouble
();
}
void
QGroundControlQmlGlobal
::
setFlightMapPosition
(
QGeoCoordinate
&
coordinate
)
void
QGroundControlQmlGlobal
::
setFlightMapPosition
(
QGeoCoordinate
&
coordinate
)
{
{
if
(
coordinate
!=
flightMapPosition
())
{
if
(
coordinate
!=
flightMapPosition
())
{
QSettings
settings
;
_coord
.
setLatitude
(
coordinate
.
latitude
());
_coord
.
setLongitude
(
coordinate
.
longitude
());
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
settings
.
setValue
(
_flightMapPositionLatitudeSettingsKey
,
coordinate
.
latitude
());
settings
.
setValue
(
_flightMapPositionLongitudeSettingsKey
,
coordinate
.
longitude
());
emit
flightMapPositionChanged
(
coordinate
);
emit
flightMapPositionChanged
(
coordinate
);
}
}
}
}
...
@@ -233,10 +229,7 @@ void QGroundControlQmlGlobal::setFlightMapPosition(QGeoCoordinate& coordinate)
...
@@ -233,10 +229,7 @@ void QGroundControlQmlGlobal::setFlightMapPosition(QGeoCoordinate& coordinate)
void
QGroundControlQmlGlobal
::
setFlightMapZoom
(
double
zoom
)
void
QGroundControlQmlGlobal
::
setFlightMapZoom
(
double
zoom
)
{
{
if
(
zoom
!=
flightMapZoom
())
{
if
(
zoom
!=
flightMapZoom
())
{
QSettings
settings
;
_zoom
=
zoom
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
settings
.
setValue
(
_flightMapZoomSettingsKey
,
zoom
);
emit
flightMapZoomChanged
(
zoom
);
emit
flightMapZoomChanged
(
zoom
);
}
}
}
}
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
18a9b13a
...
@@ -142,8 +142,8 @@ public:
...
@@ -142,8 +142,8 @@ public:
QGCCorePlugin
*
corePlugin
()
{
return
_corePlugin
;
}
QGCCorePlugin
*
corePlugin
()
{
return
_corePlugin
;
}
SettingsManager
*
settingsManager
()
{
return
_settingsManager
;
}
SettingsManager
*
settingsManager
()
{
return
_settingsManager
;
}
FactGroup
*
gpsRtkFactGroup
()
{
return
&
_gpsRtkFactGroup
;
}
FactGroup
*
gpsRtkFactGroup
()
{
return
&
_gpsRtkFactGroup
;
}
static
QGeoCoordinate
flightMapPosition
()
;
static
QGeoCoordinate
flightMapPosition
()
{
return
_coord
;
}
static
double
flightMapZoom
()
;
static
double
flightMapZoom
()
{
return
_zoom
;
}
qreal
zOrderTopMost
()
{
return
1000
;
}
qreal
zOrderTopMost
()
{
return
1000
;
}
qreal
zOrderWidgets
()
{
return
100
;
}
qreal
zOrderWidgets
()
{
return
100
;
}
...
@@ -209,6 +209,9 @@ private:
...
@@ -209,6 +209,9 @@ private:
static
const
char
*
_flightMapPositionLatitudeSettingsKey
;
static
const
char
*
_flightMapPositionLatitudeSettingsKey
;
static
const
char
*
_flightMapPositionLongitudeSettingsKey
;
static
const
char
*
_flightMapPositionLongitudeSettingsKey
;
static
const
char
*
_flightMapZoomSettingsKey
;
static
const
char
*
_flightMapZoomSettingsKey
;
static
QGeoCoordinate
_coord
;
static
double
_zoom
;
};
};
#endif
#endif
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