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
c3282048
Commit
c3282048
authored
Jan 21, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate settings
All settings wired and persistent Cleanup non Airmap builds
parent
a5e8264b
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
108 additions
and
91 deletions
+108
-91
QGCExternalLibs.pri
QGCExternalLibs.pri
+6
-3
AirMap.SettingsGroup.json
src/Airmap/AirMap.SettingsGroup.json
+24
-0
AirMapSettings.cc
src/Airmap/AirMapSettings.cc
+8
-0
AirMapSettings.h
src/Airmap/AirMapSettings.h
+4
-0
AirmapSettings.qml
src/Airmap/AirmapSettings.qml
+55
-15
QGroundControl.Airmap.qmldir
src/Airmap/QGroundControl.Airmap.qmldir
+1
-3
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+1
-1
PlanView.qml
src/PlanView/PlanView.qml
+1
-1
App.SettingsGroup.json
src/Settings/App.SettingsGroup.json
+0
-7
AppSettings.cc
src/Settings/AppSettings.cc
+0
-11
AppSettings.h
src/Settings/AppSettings.h
+0
-4
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+8
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+0
-46
No files found.
QGCExternalLibs.pri
View file @
c3282048
...
...
@@ -137,13 +137,16 @@ contains (DEFINES, DISABLE_AIRMAP) {
DEFINES -= QGC_AIRMAP_ENABLED
} else {
AIRMAPD_PATH = $$PWD/libs/airmapd
INCLUDEPATH += \
$${AIRMAPD_PATH}/include
MacBuild|iOSBuild {
message("Including support for AirMap")
message("Including support for AirMap
for macOS
")
LIBS += -L$${AIRMAPD_PATH}/macOS/Qt.5.9 -lairmap-qt
DEFINES += QGC_AIRMAP_ENABLED
} else {
message("Skipping support for Airmap (unsupported platform)")
DEFINES -= QGC_AIRMAP_ENABLED
}
contains (DEFINES, QGC_AIRMAP_ENABLED) {
INCLUDEPATH += \
$${AIRMAPD_PATH}/include
}
}
src/Airmap/AirMap.SettingsGroup.json
View file @
c3282048
...
...
@@ -22,5 +22,29 @@
"shortDescription"
:
"AirMap Password"
,
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"enableAirMap"
,
"shortDescription"
:
"Enable AirMap"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"enableTelemetry"
,
"shortDescription"
:
"Enable AirMap Telemetry"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"loginEmail"
,
"shortDescription"
:
"AirMap Login Email"
,
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"loginPassword"
,
"shortDescription"
:
"AirMap Login Password"
,
"type"
:
"string"
,
"defaultValue"
:
""
}
]
src/Airmap/AirMapSettings.cc
View file @
c3282048
...
...
@@ -20,6 +20,10 @@ DECLARE_SETTINGGROUP(AirMap)
INIT_SETTINGFACT
(
clientID
);
INIT_SETTINGFACT
(
userName
);
INIT_SETTINGFACT
(
password
);
INIT_SETTINGFACT
(
enableAirMap
);
INIT_SETTINGFACT
(
enableTelemetry
);
INIT_SETTINGFACT
(
loginEmail
);
INIT_SETTINGFACT
(
loginPassword
);
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
AirMapSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AirMapSettings"
,
"Reference only"
);
}
...
...
@@ -28,3 +32,7 @@ DECLARE_SETTINGSFACT(AirMapSettings, apiKey)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
clientID
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
userName
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
password
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
enableAirMap
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
enableTelemetry
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
loginEmail
)
DECLARE_SETTINGSFACT
(
AirMapSettings
,
loginPassword
)
src/Airmap/AirMapSettings.h
View file @
c3282048
...
...
@@ -24,5 +24,9 @@ public:
DEFINE_SETTINGFACT
(
clientID
)
DEFINE_SETTINGFACT
(
userName
)
DEFINE_SETTINGFACT
(
password
)
DEFINE_SETTINGFACT
(
enableAirMap
)
DEFINE_SETTINGFACT
(
enableTelemetry
)
DEFINE_SETTINGFACT
(
loginEmail
)
DEFINE_SETTINGFACT
(
loginPassword
)
};
src/Airmap/AirmapSettings.qml
View file @
c3282048
...
...
@@ -35,7 +35,7 @@ QGCView {
property
real
_labelWidth
:
ScreenTools
.
defaultFontPixelWidth
*
20
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
real
_panelWidth
:
_qgcView
.
width
*
_internalWidthRatio
property
Fact
_enableAirMapFact
:
QGroundControl
.
settingsManager
.
a
p
pSettings
.
enableAirMap
property
Fact
_enableAirMapFact
:
QGroundControl
.
settingsManager
.
a
irMa
pSettings
.
enableAirMap
property
bool
_airMapEnabled
:
_enableAirMapFact
.
rawValue
readonly
property
real
_internalWidthRatio
:
0.8
...
...
@@ -84,14 +84,12 @@ QGCView {
fact
:
_enableAirMapFact
visible
:
_enableAirMapFact
.
visible
}
QGCCheckBox
{
text
:
qsTr
(
"
Disable Telemetry
"
)
checked
:
false
FactCheckBox
{
text
:
qsTr
(
"
Enable Telemetry
"
)
fact
:
_enableTelemetryFact
visible
:
_enableTelemetryFact
.
visible
enabled
:
_airMapEnabled
onClicked
:
{
}
property
Fact
_enableTelemetryFact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
enableTelemetry
}
}
}
...
...
@@ -102,7 +100,6 @@ QGCView {
height
:
loginLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
appSettings
.
visible
QGCLabel
{
id
:
loginLabel
text
:
qsTr
(
"
Login / Registration
"
)
...
...
@@ -121,14 +118,18 @@ QGCView {
rowSpacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.25
anchors.centerIn
:
parent
QGCLabel
{
text
:
qsTr
(
"
Email:
"
)
}
QGCTextField
{
width
:
_editFieldWidth
enabled
:
_airMapEnabled
FactTextField
{
fact
:
_loginEmailFact
enabled
:
_airMapEnabled
visible
:
_loginEmailFact
.
visible
property
Fact
_loginEmailFact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
loginEmail
}
QGCLabel
{
text
:
qsTr
(
"
Password:
"
)
}
QGCTextField
{
width
:
_editFieldWidth
enabled
:
_airMapEnabled
FactTextField
{
fact
:
_loginPasswordFact
enabled
:
_airMapEnabled
visible
:
_loginPasswordFact
.
visible
property
Fact
_loginPasswordFact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
loginPassword
}
Item
{
width
:
1
...
...
@@ -150,6 +151,9 @@ QGCView {
Layout.alignment
:
Qt
.
AlignHCenter
Layout.columnSpan
:
2
enabled
:
_airMapEnabled
onClicked
:
{
Qt
.
openUrlExternally
(
"
https://www.airmap.com
"
);
}
}
}
}
...
...
@@ -189,6 +193,42 @@ QGCView {
QGCLabel
{
text
:
qsTr
(
"
+1 212 555 1212
"
)
}
}
}
//-----------------------------------------------------------------
//-- License (Will this stay here?)
Item
{
width
:
_panelWidth
height
:
licenseLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
appSettings
.
visible
QGCLabel
{
id
:
licenseLabel
text
:
qsTr
(
"
License
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
Rectangle
{
height
:
licenseGrid
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
_panelWidth
color
:
qgcPal
.
windowShade
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
GridLayout
{
id
:
licenseGrid
columns
:
2
columnSpacing
:
ScreenTools
.
defaultFontPixelHeight
*
2
rowSpacing
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
anchors.centerIn
:
parent
QGCLabel
{
text
:
qsTr
(
"
API Key:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
apiKey
;
}
QGCLabel
{
text
:
qsTr
(
"
Client ID:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
clientID
;
}
QGCLabel
{
text
:
qsTr
(
"
User Name:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
userName
;
}
QGCLabel
{
text
:
qsTr
(
"
Password:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
password
;
echoMode
:
TextInput
.
Password
}
}
}
}
}
}
...
...
src/Airmap/QGroundControl.Airmap.qmldir
View file @
c3282048
Module
QGroundControl.Airmap
Module QGroundControl.Airmap
AirspaceControl 1.0 AirspaceControl.qml
AirspaceRegulation 1.0 AirspaceRegulation.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
c3282048
...
...
@@ -34,7 +34,7 @@ Item {
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
property
bool
_lightWidgetBorders
:
_isSatellite
property
bool
_enableAirMap
:
QGroundControl
.
settingsManager
.
appSettings
.
enableAirMap
.
rawValu
e
property
bool
_enableAirMap
:
QGroundControl
.
airmapSupported
?
QGroundControl
.
settingsManager
.
airMapSettings
.
enableAirMap
.
rawValue
:
fals
e
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
...
...
src/PlanView/PlanView.qml
View file @
c3282048
...
...
@@ -46,7 +46,7 @@ QGCView {
readonly
property
var
_defaultVehicleCoordinate
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
readonly
property
bool
_waypointsOnlyMode
:
QGroundControl
.
corePlugin
.
options
.
missionWaypointsOnly
property
bool
_enableAirMap
:
QGroundControl
.
settingsManager
.
appSettings
.
enableAirMap
.
rawValu
e
property
bool
_enableAirMap
:
QGroundControl
.
airmapSupported
?
QGroundControl
.
settingsManager
.
airMapSettings
.
enableAirMap
.
rawValue
:
fals
e
property
var
_planMasterController
:
masterController
property
var
_missionController
:
_planMasterController
.
missionController
property
var
_geoFenceController
:
_planMasterController
.
geoFenceController
...
...
src/Settings/App.SettingsGroup.json
View file @
c3282048
...
...
@@ -183,12 +183,5 @@
"shortDescription"
:
"Default firmware type for flashing"
,
"type"
:
"uint32"
,
"defaultValue"
:
12
},
{
"name"
:
"EnableAirMap"
,
"shortDescription"
:
"Enable AirMap"
,
"longDescription"
:
"Enable AirMap Services"
,
"type"
:
"bool"
,
"defaultValue"
:
false
}
]
src/Settings/AppSettings.cc
View file @
c3282048
...
...
@@ -37,7 +37,6 @@ const char* AppSettings::mapboxTokenName = "MapboxT
const
char
*
AppSettings
::
esriTokenName
=
"EsriToken"
;
const
char
*
AppSettings
::
defaultFirmwareTypeName
=
"DefaultFirmwareType"
;
const
char
*
AppSettings
::
gstDebugName
=
"GstreamerDebugLevel"
;
const
char
*
AppSettings
::
enableAirMapName
=
"EnableAirMap"
;
const
char
*
AppSettings
::
parameterFileExtension
=
"params"
;
const
char
*
AppSettings
::
planFileExtension
=
"plan"
;
...
...
@@ -78,7 +77,6 @@ AppSettings::AppSettings(QObject* parent)
,
_esriTokenFact
(
NULL
)
,
_defaultFirmwareTypeFact
(
NULL
)
,
_gstDebugFact
(
NULL
)
,
_enableAirMapFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
AppSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AppSettings"
,
"Reference only"
);
...
...
@@ -402,12 +400,3 @@ Fact* AppSettings::defaultFirmwareType(void)
return
_defaultFirmwareTypeFact
;
}
Fact
*
AppSettings
::
enableAirMap
(
void
)
{
if
(
!
_enableAirMapFact
)
{
_enableAirMapFact
=
_createSettingsFact
(
enableAirMapName
);
}
return
_enableAirMapFact
;
}
src/Settings/AppSettings.h
View file @
c3282048
...
...
@@ -41,7 +41,6 @@ public:
Q_PROPERTY
(
Fact
*
esriToken
READ
esriToken
CONSTANT
)
Q_PROPERTY
(
Fact
*
defaultFirmwareType
READ
defaultFirmwareType
CONSTANT
)
Q_PROPERTY
(
Fact
*
gstDebug
READ
gstDebug
CONSTANT
)
Q_PROPERTY
(
Fact
*
enableAirMap
READ
enableAirMap
CONSTANT
)
Q_PROPERTY
(
QString
missionSavePath
READ
missionSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
parameterSavePath
READ
parameterSavePath
NOTIFY
savePathsChanged
)
...
...
@@ -78,7 +77,6 @@ public:
Fact
*
esriToken
(
void
);
Fact
*
defaultFirmwareType
(
void
);
Fact
*
gstDebug
(
void
);
Fact
*
enableAirMap
(
void
);
QString
missionSavePath
(
void
);
QString
parameterSavePath
(
void
);
...
...
@@ -112,7 +110,6 @@ public:
static
const
char
*
esriTokenName
;
static
const
char
*
defaultFirmwareTypeName
;
static
const
char
*
gstDebugName
;
static
const
char
*
enableAirMapName
;
// Application wide file extensions
static
const
char
*
parameterFileExtension
;
...
...
@@ -161,7 +158,6 @@ private:
SettingsFact
*
_esriTokenFact
;
SettingsFact
*
_defaultFirmwareTypeFact
;
SettingsFact
*
_gstDebugFact
;
SettingsFact
*
_enableAirMapFact
;
};
#endif
src/api/QGCCorePlugin.cc
View file @
c3282048
...
...
@@ -30,7 +30,9 @@ public:
:
pGeneral
(
NULL
)
,
pCommLinks
(
NULL
)
,
pOfflineMaps
(
NULL
)
#if defined(QGC_AIRMAP_ENABLED)
,
pAirmap
(
NULL
)
#endif
,
pMAVLink
(
NULL
)
,
pConsole
(
NULL
)
#if defined(QT_DEBUG)
...
...
@@ -54,8 +56,10 @@ public:
delete
pCommLinks
;
if
(
pOfflineMaps
)
delete
pOfflineMaps
;
#if defined(QGC_AIRMAP_ENABLED)
if
(
pAirmap
)
delete
pAirmap
;
#endif
if
(
pMAVLink
)
delete
pMAVLink
;
if
(
pConsole
)
...
...
@@ -73,7 +77,9 @@ public:
QmlComponentInfo
*
pGeneral
;
QmlComponentInfo
*
pCommLinks
;
QmlComponentInfo
*
pOfflineMaps
;
#if defined(QGC_AIRMAP_ENABLED)
QmlComponentInfo
*
pAirmap
;
#endif
QmlComponentInfo
*
pMAVLink
;
QmlComponentInfo
*
pConsole
;
#if defined(QT_DEBUG)
...
...
@@ -131,10 +137,12 @@ QVariantList &QGCCorePlugin::settingsPages()
QUrl
::
fromUserInput
(
"qrc:/qml/OfflineMap.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QmlComponentInfo
*
)
_p
->
pOfflineMaps
));
#if defined(QGC_AIRMAP_ENABLED)
_p
->
pAirmap
=
new
QmlComponentInfo
(
tr
(
"AirMap"
),
QUrl
::
fromUserInput
(
"qrc:/qml/AirmapSettings.qml"
),
QUrl
::
fromUserInput
(
""
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QmlComponentInfo
*
)
_p
->
pAirmap
));
#endif
_p
->
pMAVLink
=
new
QmlComponentInfo
(
tr
(
"MAVLink"
),
QUrl
::
fromUserInput
(
"qrc:/qml/MavlinkSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
...
...
src/ui/preferences/GeneralSettings.qml
View file @
c3282048
...
...
@@ -555,52 +555,6 @@ QGCView {
}
}
//-----------------------------------------------------------------
//-- AirMap
Item
{
width
:
_qgcView
.
width
*
0.8
height
:
unitLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
rtkSettings
.
visible
QGCLabel
{
text
:
qsTr
(
"
AirMap
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
Rectangle
{
height
:
airMapCol
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
_qgcView
.
width
*
0.8
color
:
qgcPal
.
windowShade
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
airMapSettings
.
visible
Column
{
id
:
airMapCol
spacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.centerIn
:
parent
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
API Key:
"
);
width
:
_labelWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
apiKey
;
width
:
_editFieldWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Client ID:
"
);
width
:
_labelWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
clientID
;
width
:
_editFieldWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
User Name:
"
);
width
:
_labelWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
userName
;
width
:
_editFieldWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Password:
"
);
width
:
_labelWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
airMapSettings
.
password
;
width
:
_editFieldWidth
;
anchors.verticalCenter
:
parent
.
verticalCenter
;
echoMode
:
TextInput
.
Password
}
}
}
}
//-----------------------------------------------------------------
//-- Video Source
Item
{
...
...
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