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
cd907cde
Commit
cd907cde
authored
Aug 20, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit Test for PX4RCCalibration widget
parent
fc8fb2e4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
683 additions
and
0 deletions
+683
-0
PX4RCCalibrationTest.cc
src/qgcunittest/PX4RCCalibrationTest.cc
+581
-0
PX4RCCalibrationTest.h
src/qgcunittest/PX4RCCalibrationTest.h
+102
-0
No files found.
src/qgcunittest/PX4RCCalibrationTest.cc
0 → 100644
View file @
cd907cde
This diff is collapsed.
Click to expand it.
src/qgcunittest/PX4RCCalibrationTest.h
0 → 100644
View file @
cd907cde
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef PX4RCCALIBRATIONTEST_H
#define PX4RCCALIBRATIONTEST_H
#include "AutoTest.h"
#include "MockUASManager.h"
#include "MockUAS.h"
#include "px4_configuration/PX4RCCalibration.h"
/// @file
/// @brief QGCPX4RCCAlibration Widget unit test
///
/// @author Don Gagne <don@thegagnes.com>
class
PX4RCCalibrationTest
:
public
QObject
{
Q_OBJECT
public:
PX4RCCalibrationTest
(
void
);
private
slots
:
void
init
(
void
);
void
cleanup
(
void
);
void
_setUAS_test
(
void
);
void
_minRCChannels_test
(
void
);
//void _liveRC_test(void);
void
_beginState_test
(
void
);
void
_identifyState_test
(
void
);
void
_identifyStateSkipOptional_test
(
void
);
void
_minMaxState_test
(
void
);
void
_centerThrottleState_test
(
void
);
void
_detectInversionState_test
(
void
);
void
_trimsState_test
(
void
);
void
_fullCalibration_test
(
void
);
private:
void
_centerAllChannels
(
void
);
void
_beginState_worker
(
bool
standaloneTest
);
void
_identifyState_worker
(
bool
standaloneTest
,
bool
skipOptional
);
void
_minMaxState_worker
(
bool
standaloneTest
);
void
_centerThrottleState_worker
(
bool
standaloneTest
);
void
_detectInversionState_worker
(
bool
standaloneTest
);
void
_trimsState_worker
(
bool
standaloneTest
);
enum
{
validateMinMaxMask
=
1
<<
0
,
validateTrimsMask
=
1
<<
1
,
validateReversedMask
=
1
<<
2
,
validateMappingMask
=
1
<<
3
,
validateAllMask
=
0xFFFF
};
void
_validateParameters
(
int
validateMask
,
bool
skipOptional
=
false
);
MockUASManager
*
_mockUASManager
;
MockUAS
*
_mockUAS
;
PX4RCCalibration
*
_calWidget
;
enum
{
nextButtonMask
=
1
<<
0
,
cancelButtonMask
=
1
<<
1
,
skipButtonMask
=
1
<<
2
,
tryAgainButtonMask
=
1
<<
3
};
QPushButton
*
_nextButton
;
QPushButton
*
_cancelButton
;
QPushButton
*
_skipButton
;
QPushButton
*
_tryAgainButton
;
QLabel
*
_statusLabel
;
QGCRadioChannelDisplay
*
_rgAttitudeRadioWidget
[
4
];
QGCRadioChannelDisplay
*
_rgRadioWidget
[
PX4RCCalibration
::
_chanMax
];
};
DECLARE_TEST
(
PX4RCCalibrationTest
)
#endif
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