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
5ef3229c
Commit
5ef3229c
authored
May 25, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring up to date with new IMAGE_START_CAPTURE spec
parent
dd4f3e70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
23 deletions
+27
-23
CameraSection.cc
src/MissionManager/CameraSection.cc
+5
-5
CameraSectionTest.cc
src/MissionManager/CameraSectionTest.cc
+4
-4
SectionTest.cc
src/MissionManager/SectionTest.cc
+12
-12
SectionTest.h
src/MissionManager/SectionTest.h
+1
-1
UnitTest.cc
src/qgcunittest/UnitTest.cc
+5
-1
No files found.
src/MissionManager/CameraSection.cc
View file @
5ef3229c
...
...
@@ -138,12 +138,12 @@ void CameraSection::appendSectionItems(QList<MissionItem*>& items, QObject* miss
item
=
new
MissionItem
(
nextSequenceNumber
++
,
MAV_CMD_IMAGE_START_CAPTURE
,
MAV_FRAME_MISSION
,
0
,
// Camera ID, all cameras
_cameraPhotoIntervalTimeFact
.
rawValue
().
toInt
(),
// Interval
0
,
// Unlimited photo count
-
1
,
// Max resolution
0
,
0
,
// param 4-5 not used
0
,
// Camera ID, all cameras
0
,
// param 7 not used
-
1
,
// Max horizontal resolution
-
1
,
// Max vertical resolution
0
,
0
,
// param 6-7 not used
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
...
...
@@ -264,7 +264,7 @@ bool CameraSection::scanForSection(QmlObjectListModel* visualItems, int scanInde
break
;
case
MAV_CMD_IMAGE_START_CAPTURE
:
if
(
!
foundCameraAction
&&
missionItem
.
param1
()
!=
0
&&
missionItem
.
param2
()
==
0
&&
missionItem
.
param3
()
==
-
1
&&
missionItem
.
param4
()
==
0
&&
missionItem
.
param5
()
==
0
&&
missionItem
.
param6
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
if
(
!
foundCameraAction
&&
missionItem
.
param1
()
==
0
&&
missionItem
.
param2
()
>=
1
&&
missionItem
.
param3
()
==
0
&&
missionItem
.
param4
()
==
-
1
&&
missionItem
.
param5
()
==
-
1
&&
missionItem
.
param6
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
foundCameraAction
=
true
;
cameraAction
()
->
setRawValue
(
TakePhotosIntervalTime
);
cameraPhotoIntervalTime
()
->
setRawValue
(
missionItem
.
param1
());
...
...
src/MissionManager/CameraSectionTest.cc
View file @
5ef3229c
...
...
@@ -42,7 +42,7 @@ void CameraSectionTest::init(void)
MissionItem
(
0
,
MAV_CMD_DO_MOUNT_CONTROL
,
MAV_FRAME_MISSION
,
10.1234
,
0
,
20.1234
,
0
,
0
,
0
,
MAV_MOUNT_MODE_MAVLINK_TARGETING
,
true
,
false
),
this
);
_validTimeItem
=
new
SimpleMissionItem
(
_offlineVehicle
,
MissionItem
(
0
,
MAV_CMD_IMAGE_START_CAPTURE
,
MAV_FRAME_MISSION
,
48
,
0
,
-
1
,
0
,
0
,
0
,
0
,
true
,
false
),
MissionItem
(
0
,
MAV_CMD_IMAGE_START_CAPTURE
,
MAV_FRAME_MISSION
,
0
,
48
,
0
,
-
1
,
-
1
,
0
,
0
,
true
,
false
),
this
);
_validDistanceItem
=
new
SimpleMissionItem
(
_offlineVehicle
,
MissionItem
(
0
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
72
,
0
,
0
,
0
,
0
,
0
,
0
,
true
,
false
),
...
...
@@ -442,7 +442,7 @@ void CameraSectionTest::_testAppendSectionItems(void)
// Test camera actions
_cameraSection
->
cameraAction
()
->
setRawValue
(
CameraSection
::
TakePhotosIntervalTime
);
_cameraSection
->
cameraPhotoIntervalTime
()
->
setRawValue
(
_validTimeItem
->
missionItem
().
param
1
());
_cameraSection
->
cameraPhotoIntervalTime
()
->
setRawValue
(
_validTimeItem
->
missionItem
().
param
2
());
_cameraSection
->
appendSectionItems
(
rgMissionItems
,
this
,
seqNum
);
QCOMPARE
(
rgMissionItems
.
count
(),
1
);
QCOMPARE
(
seqNum
,
1
);
...
...
@@ -494,7 +494,7 @@ void CameraSectionTest::_testAppendSectionItems(void)
_cameraSection
->
gimbalPitch
()
->
setRawValue
(
_validGimbalItem
->
missionItem
().
param1
());
_cameraSection
->
gimbalYaw
()
->
setRawValue
(
_validGimbalItem
->
missionItem
().
param3
());
_cameraSection
->
cameraAction
()
->
setRawValue
(
CameraSection
::
TakePhotosIntervalTime
);
_cameraSection
->
cameraPhotoIntervalTime
()
->
setRawValue
(
_validTimeItem
->
missionItem
().
param
1
());
_cameraSection
->
cameraPhotoIntervalTime
()
->
setRawValue
(
_validTimeItem
->
missionItem
().
param
2
());
_cameraSection
->
appendSectionItems
(
rgMissionItems
,
this
,
seqNum
);
QCOMPARE
(
rgMissionItems
.
count
(),
2
);
QCOMPARE
(
seqNum
,
2
);
...
...
@@ -678,7 +678,7 @@ void CameraSectionTest::_testScanForPhotoIntervalTimeSection(void)
// Image start command but incorrect settings
SimpleMissionItem
invalidSimpleItem
(
_offlineVehicle
,
_validTimeItem
->
missionItem
());
invalidSimpleItem
.
missionItem
().
setParam
2
(
10
);
// must be unlimited
invalidSimpleItem
.
missionItem
().
setParam
3
(
10
);
// must be unlimited
visualItems
.
append
(
&
invalidSimpleItem
);
QCOMPARE
(
_cameraSection
->
scanForSection
(
&
visualItems
,
scanIndex
),
false
);
QCOMPARE
(
visualItems
.
count
(),
1
);
...
...
src/MissionManager/SectionTest.cc
View file @
5ef3229c
...
...
@@ -54,19 +54,19 @@ void SectionTest::_createSpy(Section* section, MultiSignalSpy** sectionSpy)
*
sectionSpy
=
spy
;
}
void
SectionTest
::
_missionItemsEqual
(
MissionItem
&
item1
,
MissionItem
&
item2
)
void
SectionTest
::
_missionItemsEqual
(
MissionItem
&
actual
,
MissionItem
&
expected
)
{
QCOMPARE
(
item1
.
command
(),
item2
.
command
());
QCOMPARE
(
item1
.
frame
(),
item2
.
frame
());
QCOMPARE
(
item1
.
autoContinue
(),
item2
.
autoContinue
());
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param1
(),
item2
.
param1
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param2
(),
item2
.
param2
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param3
(),
item2
.
param3
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param4
(),
item2
.
param4
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param5
(),
item2
.
param5
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param6
(),
item2
.
param6
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
item1
.
param7
(),
item2
.
param7
()));
QCOMPARE
(
actual
.
command
(),
expected
.
command
());
QCOMPARE
(
actual
.
frame
(),
expected
.
frame
());
QCOMPARE
(
actual
.
autoContinue
(),
expected
.
autoContinue
());
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param1
(),
expected
.
param1
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param2
(),
expected
.
param2
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param3
(),
expected
.
param3
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param4
(),
expected
.
param4
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param5
(),
expected
.
param5
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param6
(),
expected
.
param6
()));
QVERIFY
(
UnitTest
::
doubleNaNCompare
(
actual
.
param7
(),
expected
.
param7
()));
}
void
SectionTest
::
_commonScanTest
(
Section
*
section
)
...
...
src/MissionManager/SectionTest.h
View file @
5ef3229c
...
...
@@ -25,7 +25,7 @@ public:
protected:
void
_createSpy
(
Section
*
section
,
MultiSignalSpy
**
sectionSpy
);
void
_missionItemsEqual
(
MissionItem
&
item1
,
MissionItem
&
item2
);
void
_missionItemsEqual
(
MissionItem
&
actual
,
MissionItem
&
expected
);
void
_commonScanTest
(
Section
*
section
);
enum
{
...
...
src/qgcunittest/UnitTest.cc
View file @
5ef3229c
...
...
@@ -510,6 +510,10 @@ bool UnitTest::doubleNaNCompare(double value1, double value2)
if
(
qIsNaN
(
value1
)
&&
qIsNaN
(
value2
))
{
return
true
;
}
else
{
return
qFuzzyCompare
(
value1
,
value2
);
bool
ret
=
qFuzzyCompare
(
value1
,
value2
);
if
(
!
ret
)
{
qDebug
()
<<
value1
<<
value2
;
}
return
ret
;
}
}
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