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
55ed5cb2
Commit
55ed5cb2
authored
Jan 18, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
c440d29b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
26 deletions
+43
-26
FWLandingPattern.FactMetaData.json
src/MissionManager/FWLandingPattern.FactMetaData.json
+7
-1
FWLandingPatternTest.cc
src/MissionManager/FWLandingPatternTest.cc
+15
-15
FixedWingLandingComplexItem.cc
src/MissionManager/FixedWingLandingComplexItem.cc
+13
-4
FixedWingLandingComplexItem.h
src/MissionManager/FixedWingLandingComplexItem.h
+4
-2
FWLandingPatternEditor.qml
src/PlanView/FWLandingPatternEditor.qml
+4
-4
No files found.
src/MissionManager/FWLandingPattern.FactMetaData.json
View file @
55ed5cb2
...
...
@@ -51,7 +51,13 @@
"min"
:
0.1
,
"max"
:
90
,
"decimalPlaces"
:
1
,
"defaultValue"
:
12.0
"defaultValue"
:
6.0
},
{
"name"
:
"ValueSetIsDistance"
,
"shortDescription"
:
"Value controller loiter point is distance"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"StopTakingPhotos"
,
...
...
src/MissionManager/FWLandingPatternTest.cc
View file @
55ed5cb2
...
...
@@ -149,7 +149,8 @@ void FWLandingPatternTest::_testDirty(void)
<<
_fwItem
->
landingDistance
()
<<
_fwItem
->
glideSlope
()
<<
_fwItem
->
stopTakingPhotos
()
<<
_fwItem
->
stopTakingVideo
();
<<
_fwItem
->
stopTakingVideo
()
<<
_fwItem
->
valueSetIsDistance
();
for
(
Fact
*
fact
:
rgFacts
)
{
qDebug
()
<<
fact
->
name
();
QVERIFY
(
!
_fwItem
->
dirty
());
...
...
@@ -167,8 +168,7 @@ void FWLandingPatternTest::_testDirty(void)
// These bool properties should set dirty when changed
QList
<
const
char
*>
rgBoolNames
;
rgBoolNames
<<
"valueSetIsDistance"
<<
"loiterClockwise"
rgBoolNames
<<
"loiterClockwise"
<<
"altitudesAreRelative"
;
const
QMetaObject
*
metaObject
=
_fwItem
->
metaObject
();
for
(
const
char
*
boolName
:
rgBoolNames
)
{
...
...
@@ -223,16 +223,16 @@ void FWLandingPatternTest::_validateItem(FixedWingLandingComplexItem* newItem)
QVERIFY
(
fuzzyCompareLatLon
(
newItem
->
loiterTangentCoordinate
(),
_fwItem
->
loiterTangentCoordinate
()));
QVERIFY
(
fuzzyCompareLatLon
(
newItem
->
landingCoordinate
(),
_fwItem
->
landingCoordinate
()));
QCOMPARE
(
newItem
->
stopTakingPhotos
()
->
rawValue
().
toBool
(),
_fwItem
->
stopTakingPhotos
()
->
rawValue
().
toBool
());
QCOMPARE
(
newItem
->
stopTakingVideo
()
->
rawValue
().
toBool
(),
_fwItem
->
stopTakingVideo
()
->
rawValue
().
toBool
());
QCOMPARE
(
newItem
->
loiterAltitude
()
->
rawValue
().
toInt
(),
_fwItem
->
loiterAltitude
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
loiterRadius
()
->
rawValue
().
toInt
(),
_fwItem
->
loiterRadius
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingAltitude
()
->
rawValue
().
toInt
(),
_fwItem
->
landingAltitude
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingHeading
()
->
rawValue
().
toInt
(),
_fwItem
->
landingHeading
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingDistance
()
->
rawValue
().
toInt
(),
_fwItem
->
landingDistance
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
glideSlope
()
->
rawValue
().
toInt
(),
_fwItem
->
glideSlope
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
_valueSetIsDistance
,
_fwItem
->
_valueSetIsDistance
);
QCOMPARE
(
newItem
->
_loiterClockwise
,
_fwItem
->
_loiterClockwise
);
QCOMPARE
(
newItem
->
_altitudesAreRelative
,
_fwItem
->
_altitudesAreRelative
);
QCOMPARE
(
newItem
->
_landingCoordSet
,
_fwItem
->
_landingCoordSet
);
QCOMPARE
(
newItem
->
stopTakingPhotos
()
->
rawValue
().
toBool
(),
_fwItem
->
stopTakingPhotos
()
->
rawValue
().
toBool
());
QCOMPARE
(
newItem
->
stopTakingVideo
()
->
rawValue
().
toBool
(),
_fwItem
->
stopTakingVideo
()
->
rawValue
().
toBool
());
QCOMPARE
(
newItem
->
loiterAltitude
()
->
rawValue
().
toInt
(),
_fwItem
->
loiterAltitude
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
loiterRadius
()
->
rawValue
().
toInt
(),
_fwItem
->
loiterRadius
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingAltitude
()
->
rawValue
().
toInt
(),
_fwItem
->
landingAltitude
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingHeading
()
->
rawValue
().
toInt
(),
_fwItem
->
landingHeading
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
landingDistance
()
->
rawValue
().
toInt
(),
_fwItem
->
landingDistance
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
glideSlope
()
->
rawValue
().
toInt
(),
_fwItem
->
glideSlope
()
->
rawValue
().
toInt
());
QCOMPARE
(
newItem
->
valueSetIsDistance
()
->
rawValue
().
toBool
(),
_fwItem
->
valueSetIsDistance
()
->
rawValue
().
toBool
()
);
QCOMPARE
(
newItem
->
_loiterClockwise
,
_fwItem
->
_loiterClockwise
);
QCOMPARE
(
newItem
->
_altitudesAreRelative
,
_fwItem
->
_altitudesAreRelative
);
QCOMPARE
(
newItem
->
_landingCoordSet
,
_fwItem
->
_landingCoordSet
);
}
src/MissionManager/FixedWingLandingComplexItem.cc
View file @
55ed5cb2
...
...
@@ -29,6 +29,7 @@ const char* FixedWingLandingComplexItem::landingAltitudeName = "LandingAlti
const
char
*
FixedWingLandingComplexItem
::
glideSlopeName
=
"GlideSlope"
;
const
char
*
FixedWingLandingComplexItem
::
stopTakingPhotosName
=
"StopTakingPhotos"
;
const
char
*
FixedWingLandingComplexItem
::
stopTakingVideoName
=
"StopTakingVideo"
;
const
char
*
FixedWingLandingComplexItem
::
valueSetIsDistanceName
=
"ValueSetIsDistance"
;
const
char
*
FixedWingLandingComplexItem
::
_jsonLoiterCoordinateKey
=
"loiterCoordinate"
;
const
char
*
FixedWingLandingComplexItem
::
_jsonLoiterRadiusKey
=
"loiterRadius"
;
...
...
@@ -59,9 +60,9 @@ FixedWingLandingComplexItem::FixedWingLandingComplexItem(Vehicle* vehicle, bool
,
_glideSlopeFact
(
settingsGroup
,
_metaDataMap
[
glideSlopeName
])
,
_stopTakingPhotosFact
(
settingsGroup
,
_metaDataMap
[
stopTakingPhotosName
])
,
_stopTakingVideoFact
(
settingsGroup
,
_metaDataMap
[
stopTakingVideoName
])
,
_valueSetIsDistanceFact
(
settingsGroup
,
_metaDataMap
[
valueSetIsDistanceName
])
,
_loiterClockwise
(
true
)
,
_altitudesAreRelative
(
true
)
,
_valueSetIsDistance
(
true
)
{
_editorQml
=
"qrc:/qml/FWLandingPatternEditor.qml"
;
...
...
@@ -89,6 +90,7 @@ FixedWingLandingComplexItem::FixedWingLandingComplexItem(Vehicle* vehicle, bool
connect
(
&
_loiterRadiusFact
,
&
Fact
::
valueChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
&
_stopTakingPhotosFact
,
&
Fact
::
valueChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
&
_stopTakingVideoFact
,
&
Fact
::
valueChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
&
_valueSetIsDistanceFact
,
&
Fact
::
valueChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
loiterCoordinateChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
landingCoordinateChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
loiterClockwiseChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
...
...
@@ -97,6 +99,13 @@ FixedWingLandingComplexItem::FixedWingLandingComplexItem(Vehicle* vehicle, bool
connect
(
this
,
&
FixedWingLandingComplexItem
::
altitudesAreRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
coordinateHasRelativeAltitudeChanged
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
altitudesAreRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
exitCoordinateHasRelativeAltitudeChanged
);
if
(
_valueSetIsDistanceFact
.
rawValue
().
toBool
())
{
_recalcFromHeadingAndDistanceChange
();
}
else
{
_glideSlopeChanged
();
}
setDirty
(
false
);
}
int
FixedWingLandingComplexItem
::
lastSequenceNumber
(
void
)
const
...
...
@@ -142,7 +151,7 @@ void FixedWingLandingComplexItem::save(QJsonArray& missionItems)
saveObject
[
_jsonStopTakingVideoKey
]
=
_stopTakingVideoFact
.
rawValue
().
toBool
();
saveObject
[
_jsonLoiterClockwiseKey
]
=
_loiterClockwise
;
saveObject
[
_jsonAltitudesAreRelativeKey
]
=
_altitudesAreRelative
;
saveObject
[
_jsonValueSetIsDistanceKey
]
=
_valueSetIsDistance
;
saveObject
[
_jsonValueSetIsDistanceKey
]
=
_valueSetIsDistance
Fact
.
rawValue
().
toBool
()
;
missionItems
.
append
(
saveObject
);
}
...
...
@@ -204,7 +213,7 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq
}
else
{
_altitudesAreRelative
=
loiterAltitudeRelative
;
}
_valueSetIsDistance
=
true
;
_valueSetIsDistance
Fact
.
setRawValue
(
true
)
;
}
else
if
(
version
==
2
)
{
QList
<
JsonHelper
::
KeyValidateInfo
>
v2KeyInfoList
=
{
{
_jsonAltitudesAreRelativeKey
,
QJsonValue
::
Bool
,
true
},
...
...
@@ -216,7 +225,7 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq
}
_altitudesAreRelative
=
complexObject
[
_jsonAltitudesAreRelativeKey
].
toBool
();
_valueSetIsDistance
=
complexObject
[
_jsonValueSetIsDistanceKey
].
toBool
(
);
_valueSetIsDistance
Fact
.
setRawValue
(
complexObject
[
_jsonValueSetIsDistanceKey
].
toBool
()
);
}
else
{
errorString
=
tr
(
"%1 complex item version %2 not supported"
).
arg
(
jsonComplexItemTypeValue
).
arg
(
version
);
_ignoreRecalcSignals
=
false
;
...
...
src/MissionManager/FixedWingLandingComplexItem.h
View file @
55ed5cb2
...
...
@@ -30,7 +30,7 @@ public:
Q_PROPERTY
(
Fact
*
loiterRadius
READ
loiterRadius
CONSTANT
)
Q_PROPERTY
(
Fact
*
landingAltitude
READ
landingAltitude
CONSTANT
)
Q_PROPERTY
(
Fact
*
landingHeading
READ
landingHeading
CONSTANT
)
Q_PROPERTY
(
bool
valueSetIsDistance
MEMBER
_valueSetIsDistance
NOTIFY
valueSetIsDistanceChanged
)
Q_PROPERTY
(
Fact
*
valueSetIsDistance
READ
valueSetIsDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
landingDistance
READ
landingDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
glideSlope
READ
glideSlope
CONSTANT
)
Q_PROPERTY
(
bool
loiterClockwise
MEMBER
_loiterClockwise
NOTIFY
loiterClockwiseChanged
)
...
...
@@ -50,6 +50,7 @@ public:
Fact
*
glideSlope
(
void
)
{
return
&
_glideSlopeFact
;
}
Fact
*
stopTakingPhotos
(
void
)
{
return
&
_stopTakingPhotosFact
;
}
Fact
*
stopTakingVideo
(
void
)
{
return
&
_stopTakingVideoFact
;
}
Fact
*
valueSetIsDistance
(
void
)
{
return
&
_valueSetIsDistanceFact
;
}
QGeoCoordinate
landingCoordinate
(
void
)
const
{
return
_landingCoordinate
;
}
QGeoCoordinate
loiterCoordinate
(
void
)
const
{
return
_loiterCoordinate
;
}
QGeoCoordinate
loiterTangentCoordinate
(
void
)
const
{
return
_loiterTangentCoordinate
;
}
...
...
@@ -110,6 +111,7 @@ public:
static
const
char
*
glideSlopeName
;
static
const
char
*
stopTakingPhotosName
;
static
const
char
*
stopTakingVideoName
;
static
const
char
*
valueSetIsDistanceName
;
signals:
void
loiterCoordinateChanged
(
QGeoCoordinate
coordinate
);
...
...
@@ -154,10 +156,10 @@ private:
Fact
_glideSlopeFact
;
Fact
_stopTakingPhotosFact
;
Fact
_stopTakingVideoFact
;
Fact
_valueSetIsDistanceFact
;
bool
_loiterClockwise
;
bool
_altitudesAreRelative
;
bool
_valueSetIsDistance
;
static
const
char
*
settingsGroup
;
static
const
char
*
_jsonLoiterCoordinateKey
;
...
...
src/PlanView/FWLandingPatternEditor.qml
View file @
55ed5cb2
...
...
@@ -119,9 +119,9 @@ Rectangle {
QGCRadioButton
{
id
:
specifyLandingDistance
text
:
qsTr
(
"
Landing Dist
"
)
checked
:
missionItem
.
valueSetIsDistance
checked
:
missionItem
.
valueSetIsDistance
.
rawValue
exclusiveGroup
:
distanceGlideGroup
onClicked
:
missionItem
.
valueSetIsDistance
=
checked
onClicked
:
missionItem
.
valueSetIsDistance
.
rawValue
=
checked
Layout.fillWidth
:
true
}
...
...
@@ -134,9 +134,9 @@ Rectangle {
QGCRadioButton
{
id
:
specifyGlideSlope
text
:
qsTr
(
"
Glide Slope
"
)
checked
:
!
missionItem
.
valueSetIsDistance
checked
:
!
missionItem
.
valueSetIsDistance
.
rawValue
exclusiveGroup
:
distanceGlideGroup
onClicked
:
missionItem
.
valueSetIsDistance
=
!
checked
onClicked
:
missionItem
.
valueSetIsDistance
.
rawValue
=
!
checked
Layout.fillWidth
:
true
}
...
...
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