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
f26504f5
Commit
f26504f5
authored
Oct 27, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saving and Restoring "Map Is Main"
parent
8a9f0c1a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
12 deletions
+49
-12
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+3
-1
QGCInstrumentWidget.qml
src/FlightMap/Widgets/QGCInstrumentWidget.qml
+4
-4
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+37
-7
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+5
-0
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
f26504f5
...
...
@@ -56,8 +56,9 @@ Item {
readonly
property
string
_mapName
:
"
FlightDisplayView
"
readonly
property
string
_showMapBackgroundKey
:
"
/showMapBackground
"
readonly
property
string
_mainIsMapKey
:
"
MainFlyWindowIsMap
"
property
bool
_mainIsMap
:
!
_controller
.
hasVideo
property
bool
_mainIsMap
:
QGroundControl
.
loadBoolGlobalSetting
(
_mainIsMapKey
,
true
)
property
real
_roll
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
roll
)
?
_defaultRoll
:
_activeVehicle
.
roll
)
:
_defaultRoll
property
real
_pitch
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
pitch
)
?
_defaultPitch
:
_activeVehicle
.
pitch
)
:
_defaultPitch
...
...
@@ -158,6 +159,7 @@ Item {
_mainIsMap
=
!
_mainIsMap
pip
.
visible
=
false
reloadContents
();
QGroundControl
.
saveBoolGlobalSetting
(
_mainIsMapKey
,
_mainIsMap
)
}
}
}
...
...
src/FlightMap/Widgets/QGCInstrumentWidget.qml
View file @
f26504f5
...
...
@@ -88,7 +88,7 @@ Item {
horizontalAlignment
:
TextEdit
.
AlignHCenter
}
QGCLabel
{
text
:
altitude
text
:
altitude
.
toFixed
(
1
)
font.weight
:
Font
.
DemiBold
color
:
isSatellite
?
"
black
"
:
"
white
"
}
...
...
@@ -110,7 +110,7 @@ Item {
horizontalAlignment
:
TextEdit
.
AlignHCenter
}
QGCLabel
{
text
:
groundSpeed
text
:
groundSpeed
.
toFixed
(
1
)
font.weight
:
Font
.
DemiBold
color
:
isSatellite
?
"
black
"
:
"
white
"
}
...
...
@@ -134,7 +134,7 @@ Item {
horizontalAlignment
:
TextEdit
.
AlignHCenter
}
QGCLabel
{
text
:
airSpeed
text
:
airSpeed
.
toFixed
(
1
)
font.weight
:
Font
.
DemiBold
color
:
isSatellite
?
"
black
"
:
"
white
"
}
...
...
@@ -156,7 +156,7 @@ Item {
horizontalAlignment
:
TextEdit
.
AlignHCenter
}
QGCLabel
{
text
:
climbRate
text
:
climbRate
.
toFixed
(
1
)
font.weight
:
Font
.
DemiBold
color
:
isSatellite
?
"
black
"
:
"
white
"
}
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
f26504f5
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
...
...
@@ -26,6 +26,8 @@
#include "QGroundControlQmlGlobal.h"
static
const
char
*
kQmlGlobalKeyName
=
"QGCQml"
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QObject
*
parent
)
:
QObject
(
parent
)
,
_homePositionManager
(
HomePositionManager
::
instance
())
...
...
@@ -38,3 +40,31 @@ QGroundControlQmlGlobal::~QGroundControlQmlGlobal()
{
}
void
QGroundControlQmlGlobal
::
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
)
{
QSettings
settings
;
settings
.
beginGroup
(
kQmlGlobalKeyName
);
settings
.
setValue
(
key
,
value
);
}
QString
QGroundControlQmlGlobal
::
loadGlobalSetting
(
const
QString
&
key
,
const
QString
&
defaultValue
)
{
QSettings
settings
;
settings
.
beginGroup
(
kQmlGlobalKeyName
);
return
settings
.
value
(
key
,
defaultValue
).
toString
();
}
void
QGroundControlQmlGlobal
::
saveBoolGlobalSetting
(
const
QString
&
key
,
bool
value
)
{
QSettings
settings
;
settings
.
beginGroup
(
kQmlGlobalKeyName
);
settings
.
setValue
(
key
,
value
);
}
bool
QGroundControlQmlGlobal
::
loadBoolGlobalSetting
(
const
QString
&
key
,
bool
defaultValue
)
{
QSettings
settings
;
settings
.
beginGroup
(
kQmlGlobalKeyName
);
return
settings
.
value
(
key
,
defaultValue
).
toBool
();
}
src/QmlControls/QGroundControlQmlGlobal.h
View file @
f26504f5
...
...
@@ -47,6 +47,11 @@ public:
Q_PROPERTY
(
qreal
zOrderWidgets
READ
zOrderWidgets
CONSTANT
)
///< z order value to widgets, for example: zoom controls, hud widgetss
Q_PROPERTY
(
qreal
zOrderMapItems
READ
zOrderMapItems
CONSTANT
)
///< z order value for map items, for example: mission item indicators
Q_INVOKABLE
void
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
QString
loadGlobalSetting
(
const
QString
&
key
,
const
QString
&
defaultValue
);
Q_INVOKABLE
void
saveBoolGlobalSetting
(
const
QString
&
key
,
bool
value
);
Q_INVOKABLE
bool
loadBoolGlobalSetting
(
const
QString
&
key
,
bool
defaultValue
);
// Property accesors
HomePositionManager
*
homePositionManager
()
{
return
_homePositionManager
;
}
...
...
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