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
65ec484a
Commit
65ec484a
authored
Apr 30, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Different visuals for Planne Home in Plan View
parent
1dcbcf61
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
12 deletions
+18
-12
MissionController.cc
src/MissionManager/MissionController.cc
+3
-3
MissionSettingsItem.cc
src/MissionManager/MissionSettingsItem.cc
+7
-1
MissionSettingsItem.h
src/MissionManager/MissionSettingsItem.h
+5
-5
MissionSettingsTest.cc
src/MissionManager/MissionSettingsTest.cc
+1
-1
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+1
-1
MissionItemIndexLabel.qml
src/QmlControls/MissionItemIndexLabel.qml
+1
-1
No files found.
src/MissionManager/MissionController.cc
View file @
65ec484a
...
...
@@ -640,7 +640,7 @@ bool MissionController::_loadJsonMissionFileV2(const QJsonObject& json, QmlObjec
if
(
!
JsonHelper
::
loadGeoCoordinate
(
json
[
_jsonPlannedHomePositionKey
],
true
/* altitudeRequired */
,
homeCoordinate
,
errorString
))
{
return
false
;
}
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
visualItems
);
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
_editMode
,
visualItems
);
settingsItem
->
setCoordinate
(
homeCoordinate
);
visualItems
->
insert
(
0
,
settingsItem
);
qCDebug
(
MissionControllerLog
)
<<
"plannedHomePosition"
<<
homeCoordinate
;
...
...
@@ -724,7 +724,7 @@ bool MissionController::_loadJsonMissionFileV2(const QJsonObject& json, QmlObjec
visualItems
->
append
(
corridorItem
);
}
else
if
(
complexItemType
==
MissionSettingsItem
::
jsonComplexItemTypeValue
)
{
qCDebug
(
MissionControllerLog
)
<<
"Loading Mission Settings: nextSequenceNumber"
<<
nextSequenceNumber
;
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
visualItems
);
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
_editMode
,
visualItems
);
if
(
!
settingsItem
->
load
(
itemObject
,
nextSequenceNumber
++
,
errorString
))
{
return
false
;
}
...
...
@@ -1717,7 +1717,7 @@ double MissionController::_normalizeLon(double lon)
/// Add the Mission Settings complex item to the front of the items
void
MissionController
::
_addMissionSettings
(
QmlObjectListModel
*
visualItems
,
bool
addToCenter
)
{
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
visualItems
);
MissionSettingsItem
*
settingsItem
=
new
MissionSettingsItem
(
_controllerVehicle
,
_editMode
,
visualItems
);
qCDebug
(
MissionControllerLog
)
<<
"_addMissionSettings addToCenter"
<<
addToCenter
;
...
...
src/MissionManager/MissionSettingsItem.cc
View file @
65ec484a
...
...
@@ -27,8 +27,9 @@ const char* MissionSettingsItem::_plannedHomePositionAltitudeName = "PlannedHome
QMap
<
QString
,
FactMetaData
*>
MissionSettingsItem
::
_metaDataMap
;
MissionSettingsItem
::
MissionSettingsItem
(
Vehicle
*
vehicle
,
QObject
*
parent
)
MissionSettingsItem
::
MissionSettingsItem
(
Vehicle
*
vehicle
,
bool
planView
,
QObject
*
parent
)
:
ComplexMissionItem
(
vehicle
,
parent
)
,
_planView
(
planView
)
,
_plannedHomePositionAltitudeFact
(
0
,
_plannedHomePositionAltitudeName
,
FactMetaData
::
valueTypeDouble
)
,
_plannedHomePositionFromVehicle
(
false
)
,
_missionEndRTL
(
false
)
...
...
@@ -299,3 +300,8 @@ void MissionSettingsItem::_setHomeAltFromTerrain(double terrainAltitude)
_plannedHomePositionAltitudeFact
.
setRawValue
(
terrainAltitude
);
}
}
QString
MissionSettingsItem
::
abbreviation
(
void
)
const
{
return
_planView
?
tr
(
"Planned Home"
)
:
tr
(
"H"
);
}
src/MissionManager/MissionSettingsItem.h
View file @
65ec484a
...
...
@@ -24,7 +24,7 @@ class MissionSettingsItem : public ComplexMissionItem
Q_OBJECT
public:
MissionSettingsItem
(
Vehicle
*
vehicle
,
QObject
*
parent
=
NULL
);
MissionSettingsItem
(
Vehicle
*
vehicle
,
bool
planView
,
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
Fact
*
plannedHomePositionAltitude
READ
plannedHomePositionAltitude
CONSTANT
)
Q_PROPERTY
(
bool
missionEndRTL
READ
missionEndRTL
WRITE
setMissionEndRTL
NOTIFY
missionEndRTLChanged
)
...
...
@@ -68,7 +68,7 @@ public:
bool
specifiesAltitudeOnly
(
void
)
const
final
{
return
false
;
}
QString
commandDescription
(
void
)
const
final
{
return
"Mission Start"
;
}
QString
commandName
(
void
)
const
final
{
return
"Mission Start"
;
}
QString
abbreviation
(
void
)
const
final
{
return
"H"
;
}
QString
abbreviation
(
void
)
const
final
;
QGeoCoordinate
coordinate
(
void
)
const
final
{
return
_plannedHomePositionCoordinate
;
}
QGeoCoordinate
exitCoordinate
(
void
)
const
final
{
return
_plannedHomePositionCoordinate
;
}
int
sequenceNumber
(
void
)
const
final
{
return
_sequenceNumber
;
}
...
...
@@ -101,15 +101,15 @@ private slots:
void
_setHomeAltFromTerrain
(
double
terrainAltitude
);
private:
bool
_planView
;
QGeoCoordinate
_plannedHomePositionCoordinate
;
// Does not include altitude
Fact
_plannedHomePositionAltitudeFact
;
bool
_plannedHomePositionFromVehicle
;
bool
_missionEndRTL
;
CameraSection
_cameraSection
;
SpeedSection
_speedSection
;
int
_sequenceNumber
;
bool
_dirty
;
int
_sequenceNumber
;
bool
_dirty
;
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
...
...
src/MissionManager/MissionSettingsTest.cc
View file @
65ec484a
...
...
@@ -22,7 +22,7 @@ void MissionSettingsTest::init(void)
{
VisualMissionItemTest
::
init
();
_settingsItem
=
new
MissionSettingsItem
(
_offlineVehicle
,
this
);
_settingsItem
=
new
MissionSettingsItem
(
_offlineVehicle
,
t
rue
/* planView */
,
t
his
);
}
void
MissionSettingsTest
::
cleanup
(
void
)
...
...
src/PlanView/MissionItemEditor.qml
View file @
65ec484a
...
...
@@ -76,7 +76,7 @@ Rectangle {
anchors.verticalCenter
:
commandPicker
.
verticalCenter
anchors.leftMargin
:
_margin
anchors.left
:
parent
.
left
text
:
missionItem
.
homePosition
?
"
H
"
:
missionItem
.
sequenceNumber
text
:
missionItem
.
homePosition
?
"
P
"
:
missionItem
.
sequenceNumber
color
:
_outerTextColor
}
...
...
src/QmlControls/MissionItemIndexLabel.qml
View file @
65ec484a
...
...
@@ -33,7 +33,7 @@ Canvas {
property
real
_gimbalRadians
:
degreesToRadians
(
vehicleYaw
+
gimbalYaw
-
90
)
property
real
_labelMargin
:
2
property
real
_labelRadius
:
_indicatorRadius
+
_labelMargin
property
string
_label
:
index
===
0
?
""
:
label
property
string
_label
:
label
.
length
>
1
?
label
:
""
property
string
_index
:
index
===
0
||
index
===
-
1
?
label
.
charAt
(
0
)
:
index
onColorChanged
:
requestPaint
()
...
...
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