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
e4c1f3ad
Commit
e4c1f3ad
authored
Jul 19, 2012
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #131 from jjhall89/airframe_unittest_fix
Airframe unit test fix
parents
dcdf3701
70c7c99e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
15 deletions
+30
-15
UASUnitTest.cc
qgcunittest/UASUnitTest.cc
+16
-7
UASUnitTest.h
qgcunittest/UASUnitTest.h
+1
-0
UAS.cc
src/uas/UAS.cc
+4
-4
UAS.h
src/uas/UAS.h
+7
-3
UASInterface.h
src/uas/UASInterface.h
+2
-1
No files found.
qgcunittest/UASUnitTest.cc
View file @
e4c1f3ad
...
...
@@ -163,10 +163,7 @@ void UASUnitTest::getYaw_test()
void
UASUnitTest
::
getSelected_test
()
{
bool
test
=
uas
->
getSelected
();
if
(
test
!=
NULL
){
QCOMPARE
(
test
,
false
);
}
QCOMPARE
(
uas
->
getSelected
(),
false
);
}
void
UASUnitTest
::
getSystemType_test
()
...
...
@@ -176,12 +173,24 @@ void UASUnitTest::getSystemType_test()
void
UASUnitTest
::
getAirframe_test
()
{
//when uas is constructed, airframe is set to QGC_AIRFRAME_GENERIC which is 0
QCOMPARE
(
uas
->
getAirframe
(),
0
);
uas
->
setAirframe
(
25
);
QVERIFY
(
uas
->
getAirframe
()
==
25
);
}
void
UASUnitTest
::
setAirframe_test
()
{
//check at construction, that airframe=0 (GENERIC)
QVERIFY
(
uas
->
getAirframe
()
==
0
);
//check that set airframe works
uas
->
setAirframe
(
11
);
QVERIFY
(
uas
->
getAirframe
()
==
11
);
//check that setAirframe will not assign a number to airframe, that is
//not defined in the enum
uas
->
setAirframe
(
12
);
QVERIFY
(
uas
->
getAirframe
()
==
11
);
}
void
UASUnitTest
::
getWaypointList_test
()
{
QVector
<
Waypoint
*>
kk
=
uas
->
getWaypointManager
()
->
getWaypointEditableList
();
...
...
qgcunittest/UASUnitTest.h
View file @
e4c1f3ad
...
...
@@ -49,6 +49,7 @@ private slots:
void
getSelected_test
();
void
getSystemType_test
();
void
getAirframe_test
();
void
setAirframe_test
();
void
getWaypointList_test
();
void
signalWayPoint_test
();
void
getWaypoint_test
();
...
...
src/uas/UAS.cc
View file @
e4c1f3ad
...
...
@@ -86,7 +86,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
receivedRGBDImageTimestamp
(
0.0
),
#endif
paramsOnceRequested
(
false
),
airframe
(
QGC_AIRFRAME_
EASYSTAR
),
airframe
(
QGC_AIRFRAME_
GENERIC
),
attitudeKnown
(
false
),
paramManager
(
NULL
),
attitudeStamped
(
false
),
...
...
@@ -104,7 +104,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
componentID
[
i
]
=
-
1
;
componentMulti
[
i
]
=
false
;
}
color
=
UASInterface
::
getNextColor
();
setBatterySpecs
(
QString
(
"9V,9.5V,12.6V"
));
...
...
@@ -152,9 +152,9 @@ void UAS::readSettings()
void
UAS
::
deleteSettings
()
{
this
->
name
=
""
;
this
->
airframe
=
QGC_AIRFRAME_
EASYSTAR
;
this
->
airframe
=
QGC_AIRFRAME_
GENERIC
;
this
->
autopilot
=
-
1
;
setBatterySpecs
(
QString
(
"9V,9.5V,12.6V"
));
setBatterySpecs
(
QString
(
"9V,9.5V,12.6V"
));
}
int
UAS
::
getUASID
()
const
...
...
src/uas/UAS.h
View file @
e4c1f3ad
...
...
@@ -483,15 +483,19 @@ public slots:
void
setAutopilotType
(
int
apType
)
{
autopilot
=
apType
;
//
emit systemSpecsChanged(uasId);
emit
systemSpecsChanged
(
uasId
);
}
/** @brief Set the type of airframe */
void
setSystemType
(
int
systemType
);
/** @brief Set the specific airframe type */
void
setAirframe
(
int
airframe
)
{
this
->
airframe
=
airframe
;
emit
systemSpecsChanged
(
uasId
);
if
((
airframe
>=
0
)
&&
(
airframe
<
12
))
{
this
->
airframe
=
airframe
;
emit
systemSpecsChanged
(
uasId
);
}
}
/** @brief Set a new name **/
void
setUASName
(
const
QString
&
name
);
...
...
src/uas/UASInterface.h
View file @
e4c1f3ad
...
...
@@ -149,7 +149,8 @@ public:
QGC_AIRFRAME_COAXIAL
,
QGC_AIRFRAME_PTERYX
,
QGC_AIRFRAME_TRICOPTER
,
QGC_AIRFRAME_HEXCOPTER
QGC_AIRFRAME_HEXCOPTER
,
QGC_AIRFRAME_END_OF_ENUM
};
/**
...
...
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