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
e7f9d931
Commit
e7f9d931
authored
Jul 21, 2016
by
Andreas Bircher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding choice for offline mission editing vehicle type and associated cruise and hover speeds
offline mission planning settings
parent
b5164290
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
1 deletion
+110
-1
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+39
-0
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+10
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+61
-1
No files found.
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
e7f9d931
...
...
@@ -19,6 +19,10 @@ static const char* kQmlGlobalKeyName = "QGCQml";
SettingsFact
*
QGroundControlQmlGlobal
::
_offlineEditingFirmwareTypeFact
=
NULL
;
FactMetaData
*
QGroundControlQmlGlobal
::
_offlineEditingFirmwareTypeMetaData
=
NULL
;
SettingsFact
*
QGroundControlQmlGlobal
::
_offlineEditingVehicleTypeFact
=
NULL
;
FactMetaData
*
QGroundControlQmlGlobal
::
_offlineEditingVehicleTypeMetaData
=
NULL
;
SettingsFact
*
QGroundControlQmlGlobal
::
_offlineEditingCruiseSpeedFact
=
NULL
;
SettingsFact
*
QGroundControlQmlGlobal
::
_offlineEditingHoverSpeedFact
=
NULL
;
SettingsFact
*
QGroundControlQmlGlobal
::
_distanceUnitsFact
=
NULL
;
FactMetaData
*
QGroundControlQmlGlobal
::
_distanceUnitsMetaData
=
NULL
;
SettingsFact
*
QGroundControlQmlGlobal
::
_speedUnitsFact
=
NULL
;
...
...
@@ -226,6 +230,41 @@ Fact* QGroundControlQmlGlobal::offlineEditingFirmwareType(void)
return
_offlineEditingFirmwareTypeFact
;
}
Fact
*
QGroundControlQmlGlobal
::
offlineEditingVehicleType
(
void
)
{
if
(
!
_offlineEditingVehicleTypeFact
)
{
QStringList
enumStrings
;
QVariantList
enumValues
;
_offlineEditingVehicleTypeFact
=
new
SettingsFact
(
QString
(),
"OfflineEditingVehicleType"
,
FactMetaData
::
valueTypeUint32
,
(
uint32_t
)
MAV_TYPE_FIXED_WING
);
_offlineEditingVehicleTypeMetaData
=
new
FactMetaData
(
FactMetaData
::
valueTypeUint32
);
enumStrings
<<
"Fixedwing"
<<
"Multicopter"
<<
"VTOL"
;
enumValues
<<
QVariant
::
fromValue
((
uint32_t
)
MAV_TYPE_FIXED_WING
)
<<
QVariant
::
fromValue
((
uint32_t
)
MAV_TYPE_QUADROTOR
)
<<
QVariant
::
fromValue
((
uint32_t
)
MAV_TYPE_VTOL_DUOROTOR
);
_offlineEditingVehicleTypeMetaData
->
setEnumInfo
(
enumStrings
,
enumValues
);
_offlineEditingVehicleTypeFact
->
setMetaData
(
_offlineEditingVehicleTypeMetaData
);
}
return
_offlineEditingVehicleTypeFact
;
}
Fact
*
QGroundControlQmlGlobal
::
offlineEditingCruiseSpeed
(
void
)
{
if
(
!
_offlineEditingCruiseSpeedFact
)
{
_offlineEditingCruiseSpeedFact
=
new
SettingsFact
(
QString
(),
"OfflineEditingCruiseSpeed"
,
FactMetaData
::
valueTypeDouble
,
16.0
);
}
return
_offlineEditingCruiseSpeedFact
;
}
Fact
*
QGroundControlQmlGlobal
::
offlineEditingHoverSpeed
(
void
)
{
if
(
!
_offlineEditingHoverSpeedFact
)
{
_offlineEditingHoverSpeedFact
=
new
SettingsFact
(
QString
(),
"OfflineEditingHoverSpeed"
,
FactMetaData
::
valueTypeDouble
,
4.0
);
}
return
_offlineEditingHoverSpeedFact
;
}
Fact
*
QGroundControlQmlGlobal
::
distanceUnits
(
void
)
{
if
(
!
_distanceUnitsFact
)
{
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
e7f9d931
...
...
@@ -82,6 +82,9 @@ public:
Q_PROPERTY
(
int
mavlinkSystemID
READ
mavlinkSystemID
WRITE
setMavlinkSystemID
NOTIFY
mavlinkSystemIDChanged
)
Q_PROPERTY
(
Fact
*
offlineEditingFirmwareType
READ
offlineEditingFirmwareType
CONSTANT
)
Q_PROPERTY
(
Fact
*
offlineEditingVehicleType
READ
offlineEditingVehicleType
CONSTANT
)
Q_PROPERTY
(
Fact
*
offlineEditingCruiseSpeed
READ
offlineEditingCruiseSpeed
CONSTANT
)
Q_PROPERTY
(
Fact
*
offlineEditingHoverSpeed
READ
offlineEditingHoverSpeed
CONSTANT
)
Q_PROPERTY
(
Fact
*
distanceUnits
READ
distanceUnits
CONSTANT
)
Q_PROPERTY
(
Fact
*
speedUnits
READ
speedUnits
CONSTANT
)
...
...
@@ -158,6 +161,9 @@ public:
QGeoCoordinate
lastKnownHomePosition
()
{
return
qgcApp
()
->
lastKnownHomePosition
();
}
static
Fact
*
offlineEditingFirmwareType
(
void
);
static
Fact
*
offlineEditingVehicleType
(
void
);
static
Fact
*
offlineEditingCruiseSpeed
(
void
);
static
Fact
*
offlineEditingHoverSpeed
(
void
);
static
Fact
*
distanceUnits
(
void
);
static
Fact
*
speedUnits
(
void
);
...
...
@@ -212,6 +218,10 @@ private:
// These are static so they are available to C++ code as well as Qml
static
SettingsFact
*
_offlineEditingFirmwareTypeFact
;
static
FactMetaData
*
_offlineEditingFirmwareTypeMetaData
;
static
SettingsFact
*
_offlineEditingVehicleTypeFact
;
static
FactMetaData
*
_offlineEditingVehicleTypeMetaData
;
static
SettingsFact
*
_offlineEditingCruiseSpeedFact
;
static
SettingsFact
*
_offlineEditingHoverSpeedFact
;
static
SettingsFact
*
_distanceUnitsFact
;
static
FactMetaData
*
_distanceUnitsMetaData
;
static
SettingsFact
*
_speedUnitsFact
;
...
...
src/ui/preferences/GeneralSettings.qml
View file @
e7f9d931
...
...
@@ -378,11 +378,15 @@ QGCView {
//-----------------------------------------------------------------
//-- Offline mission editing settings
QGCLabel
{
text
:
"
Offline mission editing
"
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Offline mission editing:
"
)
text
:
qsTr
(
"
Firmware:
"
)
width
:
hoverSpeedLabel
.
width
anchors.baseline
:
offlineTypeCombo
.
baseline
}
...
...
@@ -394,6 +398,62 @@ QGCView {
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Vehicle:
"
)
width
:
hoverSpeedLabel
.
width
anchors.baseline
:
offlineVehicleCombo
.
baseline
}
FactComboBox
{
id
:
offlineVehicleCombo
width
:
offlineTypeCombo
.
width
fact
:
QGroundControl
.
offlineEditingVehicleType
indexModel
:
false
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
offlineVehicleCombo
.
currentText
!=
"
Multicopter
"
QGCLabel
{
text
:
qsTr
(
"
Cruise speed:
"
)
width
:
hoverSpeedLabel
.
width
anchors.baseline
:
cruiseSpeedField
.
baseline
}
FactTextField
{
id
:
cruiseSpeedField
width
:
offlineTypeCombo
.
width
fact
:
QGroundControl
.
offlineEditingCruiseSpeed
enabled
:
true
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
offlineVehicleCombo
.
currentText
!=
"
Fixedwing
"
QGCLabel
{
id
:
hoverSpeedLabel
text
:
qsTr
(
"
Hover speed:
"
)
width
:
baseFontLabel
.
width
anchors.baseline
:
hoverSpeedField
.
baseline
}
FactTextField
{
id
:
hoverSpeedField
width
:
offlineTypeCombo
.
width
fact
:
QGroundControl
.
offlineEditingHoverSpeed
enabled
:
true
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
...
...
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