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
703c7d41
Commit
703c7d41
authored
May 14, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alt slider min/max from settings
parent
3217c367
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
7 deletions
+154
-7
Guided.SettingsGroup.json
src/Settings/Guided.SettingsGroup.json
+26
-0
GuidedSettings.cc
src/Settings/GuidedSettings.cc
+67
-0
GuidedSettings.h
src/Settings/GuidedSettings.h
+48
-0
SettingsManager.cc
src/Settings/SettingsManager.cc
+8
-6
SettingsManager.h
src/Settings/SettingsManager.h
+5
-1
No files found.
src/Settings/Guided.SettingsGroup.json
0 → 100644
View file @
703c7d41
[
{
"name"
:
"FixedWingMinimumAltitude"
,
"type"
:
"double"
,
"units"
:
"m"
,
"defaultValue"
:
10
},
{
"name"
:
"FixedWingMaximumAltitude"
,
"type"
:
"double"
,
"units"
:
"m"
,
"defaultValue"
:
121.92
},
{
"name"
:
"VehicleMinimumAltitude"
,
"type"
:
"double"
,
"units"
:
"m"
,
"defaultValue"
:
2
},
{
"name"
:
"VehicleMaximumAltitude"
,
"type"
:
"double"
,
"units"
:
"m"
,
"defaultValue"
:
121.92
}
]
src/Settings/GuidedSettings.cc
0 → 100644
View file @
703c7d41
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "GuidedSettings.h"
#include "QGCPalette.h"
#include "QGCApplication.h"
#include <QQmlEngine>
#include <QtQml>
#include <QStandardPaths>
const
char
*
GuidedSettings
::
guidedSettingsGroupName
=
"Guided"
;
const
char
*
GuidedSettings
::
fixedWingMinimumAltitudeName
=
"FixedWingMinimumAltitude"
;
const
char
*
GuidedSettings
::
fixedWingMaximumAltitudeName
=
"FixedWingMaximumAltitude"
;
const
char
*
GuidedSettings
::
vehicleMinimumAltitudeName
=
"VehicleMinimumAltitude"
;
const
char
*
GuidedSettings
::
vehicleMaximumAltitudeName
=
"VehicleMaximumAltitude"
;
GuidedSettings
::
GuidedSettings
(
QObject
*
parent
)
:
SettingsGroup
(
guidedSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
,
_fixedWingMinimumAltitudeFact
(
NULL
)
,
_fixedWingMaximumAltitudeFact
(
NULL
)
,
_vehicleMinimumAltitudeFact
(
NULL
)
,
_vehicleMaximumAltitudeFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
GuidedSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"GuidedSettings"
,
"Reference only"
);
}
Fact
*
GuidedSettings
::
fixedWingMinimumAltitude
(
void
)
{
if
(
!
_fixedWingMinimumAltitudeFact
)
{
_fixedWingMinimumAltitudeFact
=
_createSettingsFact
(
fixedWingMinimumAltitudeName
);
}
return
_fixedWingMinimumAltitudeFact
;
}
Fact
*
GuidedSettings
::
fixedWingMaximumAltitude
(
void
)
{
if
(
!
_fixedWingMaximumAltitudeFact
)
{
_fixedWingMaximumAltitudeFact
=
_createSettingsFact
(
fixedWingMaximumAltitudeName
);
}
return
_fixedWingMaximumAltitudeFact
;
}
Fact
*
GuidedSettings
::
vehicleMinimumAltitude
(
void
)
{
if
(
!
_vehicleMinimumAltitudeFact
)
{
_vehicleMinimumAltitudeFact
=
_createSettingsFact
(
vehicleMinimumAltitudeName
);
}
return
_vehicleMinimumAltitudeFact
;
}
Fact
*
GuidedSettings
::
vehicleMaximumAltitude
(
void
)
{
if
(
!
_vehicleMaximumAltitudeFact
)
{
_vehicleMaximumAltitudeFact
=
_createSettingsFact
(
vehicleMaximumAltitudeName
);
}
return
_vehicleMaximumAltitudeFact
;
}
src/Settings/GuidedSettings.h
0 → 100644
View file @
703c7d41
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef GuidedSettings_H
#define GuidedSettings_H
#include "SettingsGroup.h"
#include "QGCMAVLink.h"
class
GuidedSettings
:
public
SettingsGroup
{
Q_OBJECT
public:
GuidedSettings
(
QObject
*
parent
=
NULL
);
// These min/max altitudes are used by the guided altitude slider
Q_PROPERTY
(
Fact
*
fixedWingMinimumAltitude
READ
fixedWingMinimumAltitude
CONSTANT
)
Q_PROPERTY
(
Fact
*
fixedWingMaximumAltitude
READ
fixedWingMaximumAltitude
CONSTANT
)
Q_PROPERTY
(
Fact
*
vehicleMinimumAltitude
READ
vehicleMinimumAltitude
CONSTANT
)
Q_PROPERTY
(
Fact
*
vehicleMaximumAltitude
READ
vehicleMaximumAltitude
CONSTANT
)
Fact
*
fixedWingMinimumAltitude
(
void
);
Fact
*
fixedWingMaximumAltitude
(
void
);
Fact
*
vehicleMinimumAltitude
(
void
);
Fact
*
vehicleMaximumAltitude
(
void
);
static
const
char
*
guidedSettingsGroupName
;
static
const
char
*
fixedWingMinimumAltitudeName
;
static
const
char
*
fixedWingMaximumAltitudeName
;
static
const
char
*
vehicleMinimumAltitudeName
;
static
const
char
*
vehicleMaximumAltitudeName
;
private:
SettingsFact
*
_fixedWingMinimumAltitudeFact
;
SettingsFact
*
_fixedWingMaximumAltitudeFact
;
SettingsFact
*
_vehicleMinimumAltitudeFact
;
SettingsFact
*
_vehicleMaximumAltitudeFact
;
};
#endif
src/Settings/SettingsManager.cc
View file @
703c7d41
...
...
@@ -14,12 +14,13 @@
SettingsManager
::
SettingsManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
,
_appSettings
(
NULL
)
,
_unitsSettings
(
NULL
)
,
_autoConnectSettings
(
NULL
)
,
_videoSettings
(
NULL
)
,
_flightMapSettings
(
NULL
)
,
_rtkSettings
(
NULL
)
,
_appSettings
(
NULL
)
,
_unitsSettings
(
NULL
)
,
_autoConnectSettings
(
NULL
)
,
_videoSettings
(
NULL
)
,
_flightMapSettings
(
NULL
)
,
_rtkSettings
(
NULL
)
,
_guidedSettings
(
NULL
)
{
}
...
...
@@ -36,4 +37,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_videoSettings
=
new
VideoSettings
(
this
);
_flightMapSettings
=
new
FlightMapSettings
(
this
);
_rtkSettings
=
new
RTKSettings
(
this
);
_guidedSettings
=
new
GuidedSettings
(
this
);
}
src/Settings/SettingsManager.h
View file @
703c7d41
...
...
@@ -20,6 +20,7 @@
#include "VideoSettings.h"
#include "FlightMapSettings.h"
#include "RTKSettings.h"
#include "GuidedSettings.h"
#include <QVariantList>
...
...
@@ -36,7 +37,8 @@ public:
Q_PROPERTY
(
QObject
*
autoConnectSettings
READ
autoConnectSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
videoSettings
READ
videoSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
rtkSettings
READ
rtkSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
rtkSettings
READ
rtkSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
guidedSettings
READ
guidedSettings
CONSTANT
)
// Override from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
...
@@ -47,6 +49,7 @@ public:
VideoSettings
*
videoSettings
(
void
)
{
return
_videoSettings
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
RTKSettings
*
rtkSettings
(
void
)
{
return
_rtkSettings
;
}
GuidedSettings
*
guidedSettings
(
void
)
{
return
_guidedSettings
;
}
private:
AppSettings
*
_appSettings
;
...
...
@@ -55,6 +58,7 @@ private:
VideoSettings
*
_videoSettings
;
FlightMapSettings
*
_flightMapSettings
;
RTKSettings
*
_rtkSettings
;
GuidedSettings
*
_guidedSettings
;
};
#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