VisualMissionItemTest.h 4.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/****************************************************************************
 *
 *   (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 "TCPLink.h"
#include "MultiSignalSpy.h"
15
#include "SimpleMissionItem.h"
16 17 18 19 20 21 22

#include <QGeoCoordinate>

/// Unit test for SimpleMissionItem
class VisualMissionItemTest : public UnitTest
{
    Q_OBJECT
23

24 25 26 27 28 29 30
public:
    VisualMissionItemTest(void);

    void init(void) override;
    void cleanup(void) override;

protected:
31 32
    void _createSpy(SimpleMissionItem* simpleItem, MultiSignalSpy** visualSpy);

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
    enum {
        altDifferenceChangedIndex = 0,
        altPercentChangedIndex,
        azimuthChangedIndex,
        commandDescriptionChangedIndex,
        commandNameChangedIndex,
        abbreviationChangedIndex,
        coordinateChangedIndex,
        exitCoordinateChangedIndex,
        dirtyChangedIndex,
        distanceChangedIndex,
        isCurrentItemChangedIndex,
        sequenceNumberChangedIndex,
        isSimpleItemChangedIndex,
        specifiesCoordinateChangedIndex,
        isStandaloneCoordinateChangedIndex,
        specifiesAltitudeOnlyChangedIndex,
        specifiedFlightSpeedChangedIndex,
        specifiedGimbalYawChangedIndex,
        lastSequenceNumberChangedIndex,
        missionGimbalYawChangedIndex,
        missionVehicleYawChangedIndex,
        coordinateHasRelativeAltitudeChangedIndex,
        exitCoordinateHasRelativeAltitudeChangedIndex,
        exitCoordinateSameAsEntryChangedIndex,
        maxSignalIndex,
    };

    enum {
        altDifferenceChangedMask =                      1 << altDifferenceChangedIndex,
        altPercentChangedMask =                         1 << altPercentChangedIndex,
        azimuthChangedMask =                            1 << azimuthChangedIndex,
        commandDescriptionChangedMask =                 1 << commandDescriptionChangedIndex,
        commandNameChangedMask =                        1 << commandNameChangedIndex,
        abbreviationChangedMask =                       1 << abbreviationChangedIndex,
        coordinateChangedMask =                         1 << coordinateChangedIndex,
        exitCoordinateChangedMask =                     1 << exitCoordinateChangedIndex,
        dirtyChangedMask =                              1 << dirtyChangedIndex,
        distanceChangedMask =                           1 << distanceChangedIndex,
        isCurrentItemChangedMask =                      1 << isCurrentItemChangedIndex,
        sequenceNumberChangedMask =                     1 << sequenceNumberChangedIndex,
        isSimpleItemChangedMask =                       1 << isSimpleItemChangedIndex,
        specifiesCoordinateChangedMask =                1 << specifiesCoordinateChangedIndex,
        isStandaloneCoordinateChangedMask =             1 << isStandaloneCoordinateChangedIndex,
        specifiesAltitudeOnlyChangedMask =              1 << specifiesAltitudeOnlyChangedIndex,
        specifiedFlightSpeedChangedMask =               1 << specifiedFlightSpeedChangedIndex,
        specifiedGimbalYawChangedMask =                 1 << specifiedGimbalYawChangedIndex,
        lastSequenceNumberChangedMask =                 1 << lastSequenceNumberChangedIndex,
        missionGimbalYawChangedMask =                   1 << missionGimbalYawChangedIndex,
        missionVehicleYawChangedMask =                  1 << missionVehicleYawChangedIndex,
        coordinateHasRelativeAltitudeChangedMask =      1 << coordinateHasRelativeAltitudeChangedIndex,
        exitCoordinateHasRelativeAltitudeChangedMask =  1 << exitCoordinateHasRelativeAltitudeChangedIndex,
        exitCoordinateSameAsEntryChangedMask =          1 << exitCoordinateSameAsEntryChangedIndex,
    };

    static const size_t cVisualItemSignals = maxSignalIndex;
    const char*         rgVisualItemSignals[cVisualItemSignals];

    Vehicle*        _offlineVehicle;
};