MissionControllerTest.h 2.44 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

10 11 12 13 14 15 16 17 18

#ifndef MissionControllerTest_H
#define MissionControllerTest_H

#include "UnitTest.h"
#include "MockLink.h"
#include "MissionManager.h"
#include "MultiSignalSpy.h"
#include "MissionControllerManagerTest.h"
19
#include "PlanMasterController.h"
20
#include "MissionController.h"
21
#include "SimpleMissionItem.h"
22 23 24 25 26 27 28 29 30 31 32 33 34

#include <QGeoCoordinate>

class MissionControllerTest : public MissionControllerManagerTest
{
    Q_OBJECT
    
public:
    MissionControllerTest(void);

private slots:
    void cleanup(void);

35
    void _testGimbalRecalc(void);
36
    void _testLoadJsonSectionAvailable(void);
Don Gagne's avatar
Don Gagne committed
37 38
    void _testEmptyVehicleAPM(void);
    void _testEmptyVehiclePX4(void);
39 40

private:
41
#if 0
Don Gagne's avatar
Don Gagne committed
42 43
    void _testOfflineToOnlineAPM(void);
    void _testOfflineToOnlinePX4(void);
44
#endif
45 46 47 48 49

private:
    void _initForFirmwareType(MAV_AUTOPILOT firmwareType);
    void _testEmptyVehicleWorker(MAV_AUTOPILOT firmwareType);
    void _testAddWaypointWorker(MAV_AUTOPILOT firmwareType);
50
#if 0
Don Gagne's avatar
Don Gagne committed
51
    void _testOfflineToOnlineWorker(MAV_AUTOPILOT firmwareType);
52
#endif
Don Gagne's avatar
Don Gagne committed
53
    void _setupVisualItemSignals(VisualMissionItem* visualItem);
Don Gagne's avatar
Don Gagne committed
54

Don Gagne's avatar
Don Gagne committed
55 56 57 58
    // MissiomItems signals

    enum {
        coordinateChangedSignalIndex = 0,
Don Gagne's avatar
Don Gagne committed
59
        visualItemMaxSignalIndex
Don Gagne's avatar
Don Gagne committed
60 61 62
    };

    enum {
Don Gagne's avatar
Don Gagne committed
63 64
        coordinateChangedSignalMask =   1 << coordinateChangedSignalIndex,
        visualItemMaxSignalMask =       1 << visualItemMaxSignalIndex,
Don Gagne's avatar
Don Gagne committed
65 66 67
    };

    // MissionController signals
68 69

    enum {
70
        visualItemsChangedSignalIndex = 0,
Don Gagne's avatar
Don Gagne committed
71
        missionControllerMaxSignalIndex
72 73 74
    };

    enum {
75
        visualItemsChangedSignalMask =                 1 << visualItemsChangedSignalIndex,
76 77
    };

Don Gagne's avatar
Don Gagne committed
78 79 80 81 82
    MultiSignalSpy*     _multiSpyMissionController;
    static const size_t _cMissionControllerSignals = missionControllerMaxSignalIndex;
    const char*         _rgMissionControllerSignals[_cMissionControllerSignals];

    MultiSignalSpy*     _multiSpyMissionItem;
Don Gagne's avatar
Don Gagne committed
83 84
    static const size_t _cVisualItemSignals = visualItemMaxSignalIndex;
    const char*         _rgVisualItemSignals[_cVisualItemSignals];
85

86 87
    PlanMasterController*   _masterController;
    MissionController*      _missionController;
88 89 90
};

#endif