CorridorScanComplexItemTest.h 2.24 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9 10 11
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#pragma once

12
#include "TransectStyleComplexItemTestBase.h"
13 14 15
#include "TCPLink.h"
#include "MultiSignalSpy.h"
#include "CorridorScanComplexItem.h"
16
#include "PlanMasterController.h"
17 18 19

#include <QGeoCoordinate>

20
class CorridorScanComplexItemTest : public TransectStyleComplexItemTestBase
21 22 23 24 25 26 27
{
    Q_OBJECT
    
public:
    CorridorScanComplexItemTest(void);

protected:
28
    void init   (void) final;
29 30
    void cleanup(void) final;
    
31
#if 1
32
private slots:
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
    void _testDirty         (void);
    void _testCameraTrigger (void);
    void _testPathChanges   (void);
    void _testItemGeneration(void);
    void _testItemCount     (void);
#else
    // Used to debug a single test
private slots:
    void _testItemGeneration(void);
private:
    void _testDirty         (void);
    void _testCameraTrigger (void);
    void _testPathChanges   (void);
    void _testItemCount     (void);
#endif
48 49

private:
50 51 52
    void            _waitForReadyForSave(void);
    QList<MAV_CMD>  _createExpectedCommands(bool hasTurnaround, bool useConditionGate);
    void            _testItemGenerationWorker(bool imagesInTurnaround, bool hasTurnaround, bool useConditionGate, const QList<MAV_CMD>& expectedCommands);
53 54 55 56 57 58 59 60 61 62 63 64 65

    enum {
        corridorPolygonPathChangedIndex = 0,
        maxCorridorPolygonSignalIndex
    };

    enum {
        corridorPolygonPathChangedMask = 1 << corridorPolygonPathChangedIndex,
    };

    static const size_t _cCorridorPolygonSignals = maxCorridorPolygonSignalIndex;
    const char*         _rgCorridorPolygonSignals[_cCorridorPolygonSignals];

66 67
    MultiSignalSpy*             _multiSpyCorridorPolygon =  nullptr;
    CorridorScanComplexItem*    _corridorItem =             nullptr;
68 69 70 71 72
    QList<QGeoCoordinate>       _polyLineVertices;

    static constexpr int    _expectedTransectCount =        2;
    static constexpr double _corridorLineSegmentDistance =  200.0;
    static constexpr double _corridorWidth =                50.0;
73
};