8 changed files with 226 additions and 2 deletions
@ -0,0 +1,52 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#include "PlanMasterControllerTest.h" |
||||||
|
#include "LinkManager.h" |
||||||
|
#include "MultiVehicleManager.h" |
||||||
|
#include "SimpleMissionItem.h" |
||||||
|
#include "MissionSettingsItem.h" |
||||||
|
#include "QGCApplication.h" |
||||||
|
#include "SettingsManager.h" |
||||||
|
#include "AppSettings.h" |
||||||
|
|
||||||
|
PlanMasterControllerTest::PlanMasterControllerTest(void) |
||||||
|
: _masterController(NULL) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void PlanMasterControllerTest::init(void) |
||||||
|
{ |
||||||
|
UnitTest::init(); |
||||||
|
|
||||||
|
_masterController = new PlanMasterController(this); |
||||||
|
_masterController->start(true /* editMode */); |
||||||
|
} |
||||||
|
|
||||||
|
void PlanMasterControllerTest::cleanup(void) |
||||||
|
{ |
||||||
|
delete _masterController; |
||||||
|
_masterController = NULL; |
||||||
|
|
||||||
|
UnitTest::cleanup(); |
||||||
|
} |
||||||
|
|
||||||
|
void PlanMasterControllerTest::_testMissionFileLoad(void) |
||||||
|
{ |
||||||
|
_masterController->loadFromFile(":/json/unittest/OldFileFormat.mission"); |
||||||
|
QCOMPARE(_masterController->missionController()->visualItems()->count(), 7); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void PlanMasterControllerTest::_testMissionPlannerFileLoad(void) |
||||||
|
{ |
||||||
|
_masterController->loadFromFile(":/json/unittest/MissionPlanner.waypoints"); |
||||||
|
QCOMPARE(_masterController->missionController()->visualItems()->count(), 6); |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "UnitTest.h" |
||||||
|
#include "MockLink.h" |
||||||
|
#include "MissionManager.h" |
||||||
|
#include "MultiSignalSpy.h" |
||||||
|
#include "MissionControllerManagerTest.h" |
||||||
|
#include "PlanMasterController.h" |
||||||
|
#include "MissionController.h" |
||||||
|
#include "SimpleMissionItem.h" |
||||||
|
|
||||||
|
#include <QGeoCoordinate> |
||||||
|
|
||||||
|
class PlanMasterControllerTest : public UnitTest |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
PlanMasterControllerTest(void); |
||||||
|
|
||||||
|
private slots: |
||||||
|
void init(void) final; |
||||||
|
void cleanup(void) final; |
||||||
|
|
||||||
|
void _testMissionFileLoad(void); |
||||||
|
void _testMissionPlannerFileLoad(void); |
||||||
|
|
||||||
|
private: |
||||||
|
PlanMasterController* _masterController; |
||||||
|
}; |
@ -0,0 +1,7 @@ |
|||||||
|
QGC WPL 110 |
||||||
|
0 1 0 16 0 0 0 0 47.660459 -122.103167 5.210000 1 |
||||||
|
1 0 3 16 0.000000 0.000000 0.000000 0.000000 47.661298 -122.103274 100.000000 1 |
||||||
|
2 0 3 16 0.000000 0.000000 0.000000 0.000000 47.661030 -122.101858 100.000000 1 |
||||||
|
3 0 3 16 0.000000 0.000000 0.000000 0.000000 47.659961 -122.101525 100.000000 1 |
||||||
|
4 0 3 16 0.000000 0.000000 0.000000 0.000000 47.659195 -122.103370 100.000000 1 |
||||||
|
5 0 3 16 0.000000 0.000000 0.000000 0.000000 47.660459 -122.105538 100.000000 1 |
@ -0,0 +1,120 @@ |
|||||||
|
{ |
||||||
|
"firmwareType": 3, |
||||||
|
"groundStation": "QGroundControl", |
||||||
|
"items": [ |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 22, |
||||||
|
"coordinate": [ |
||||||
|
47.660137763851573, |
||||||
|
-122.29411931627152, |
||||||
|
50 |
||||||
|
], |
||||||
|
"doJumpId": 1, |
||||||
|
"frame": 2, |
||||||
|
"params": [ |
||||||
|
0, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 18, |
||||||
|
"coordinate": [ |
||||||
|
47.660316610000002, |
||||||
|
-122.29423867, |
||||||
|
10 |
||||||
|
], |
||||||
|
"doJumpId": 2, |
||||||
|
"frame": 3, |
||||||
|
"params": [ |
||||||
|
1, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 18, |
||||||
|
"coordinate": [ |
||||||
|
47.660299945473923, |
||||||
|
-122.29402946102036, |
||||||
|
20 |
||||||
|
], |
||||||
|
"doJumpId": 3, |
||||||
|
"frame": 3, |
||||||
|
"params": [ |
||||||
|
3, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 16, |
||||||
|
"coordinate": [ |
||||||
|
47.660239429999997, |
||||||
|
-122.29371564, |
||||||
|
5 |
||||||
|
], |
||||||
|
"doJumpId": 4, |
||||||
|
"frame": 3, |
||||||
|
"params": [ |
||||||
|
0, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 16, |
||||||
|
"coordinate": [ |
||||||
|
47.660368599999998, |
||||||
|
-122.29426013, |
||||||
|
5 |
||||||
|
], |
||||||
|
"doJumpId": 5, |
||||||
|
"frame": 3, |
||||||
|
"params": [ |
||||||
|
0, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"autoContinue": true, |
||||||
|
"command": 21, |
||||||
|
"coordinate": [ |
||||||
|
47.660153620000003, |
||||||
|
-122.29410455999999, |
||||||
|
3 |
||||||
|
], |
||||||
|
"doJumpId": 6, |
||||||
|
"frame": 3, |
||||||
|
"params": [ |
||||||
|
0, |
||||||
|
0, |
||||||
|
0, |
||||||
|
0 |
||||||
|
], |
||||||
|
"type": "SimpleItem" |
||||||
|
} |
||||||
|
], |
||||||
|
"plannedHomePosition": [ |
||||||
|
47.660137763851573, |
||||||
|
-122.29411931627152, |
||||||
|
0 |
||||||
|
], |
||||||
|
"version": 2 |
||||||
|
} |
Loading…
Reference in new issue