Browse Source

Merge pull request #5755 from DonLakeFlyer/StableMerge

Stable merge
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
0a97dcf7bd
  1. 5
      CodingStyle.h
  2. 7
      src/MissionManager/MissionController.cc
  3. 3
      src/MissionManager/SurveyMissionItem.cc
  4. 2
      src/Vehicle/Vehicle.cc
  5. 32
      src/audio/QGCAudioWorkerTest.cc
  6. 23
      src/audio/QGCAudioWorkerTest.h
  7. 9
      src/qgcunittest/UnitTestList.cc

5
CodingStyle.h

@ -11,8 +11,7 @@
// coding style. In general almost everything in here has some coding style meaning. // coding style. In general almost everything in here has some coding style meaning.
// Not all style choices are explained. // Not all style choices are explained.
#ifndef CodingStyle_H #pragma once
#define CodingStyle_H
#include <QObject> #include <QObject>
#include <QMap> #include <QMap>
@ -79,5 +78,3 @@ private:
static const int _privateStaticVariable; static const int _privateStaticVariable;
}; };
#endif

7
src/MissionManager/MissionController.cc

@ -1546,10 +1546,9 @@ void MissionController::_managerVehicleHomePositionChanged(const QGeoCoordinate&
} else { } else {
qWarning() << "First item is not MissionSettingsItem"; qWarning() << "First item is not MissionSettingsItem";
} }
if (_visualItems->count() == 1) { // Don't let this trip the dirty bit. Otherwise plan will keep getting marked dirty if vehicle home
// Don't let this trip the dirty bit // changes.
_visualItems->setDirty(false); _visualItems->setDirty(false);
}
} }
} }

3
src/MissionManager/SurveyMissionItem.cc

@ -116,7 +116,8 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent)
// If the user hasn't changed turnaround from the default (which is a fixed wing default) and we are multi-rotor set the multi-rotor default. // If the user hasn't changed turnaround from the default (which is a fixed wing default) and we are multi-rotor set the multi-rotor default.
// NULL check since object creation during unit testing passes NULL for vehicle // NULL check since object creation during unit testing passes NULL for vehicle
if (_vehicle && _vehicle->multiRotor() && _turnaroundDistFact.rawValue().toDouble() == _turnaroundDistFact.rawDefaultValue().toDouble()) { if (_vehicle && _vehicle->multiRotor() && _turnaroundDistFact.rawValue().toDouble() == _turnaroundDistFact.rawDefaultValue().toDouble()) {
_turnaroundDistFact.setRawValue(5); // Note this is set to 10 meters to work around a problem with PX4 Pro turnaround behavior. Don't change unless firmware gets better as well.
_turnaroundDistFact.setRawValue(10);
} }
// We override the grid altitude to the mission default // We override the grid altitude to the mission default

2
src/Vehicle/Vehicle.cc

@ -678,6 +678,8 @@ void Vehicle::_mavlinkMessageReceived(LinkInterface* link, mavlink_message_t mes
break; break;
} }
// This must be emitted after the vehicle processes the message. This way the vehicle state is up to date when anyone else
// does processing.
emit mavlinkMessageReceived(message); emit mavlinkMessageReceived(message);
_uas->receiveMessage(message); _uas->receiveMessage(message);

32
src/audio/QGCAudioWorkerTest.cc

@ -0,0 +1,32 @@
/****************************************************************************
*
* (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 "QGCAudioWorkerTest.h"
#include "QGCAudioWorker.h"
QGCAudioWorkerTest::QGCAudioWorkerTest(void)
{
}
void QGCAudioWorkerTest::_testSpokenReplacements(void)
{
QString result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-10.5m, -10.5m. -10.5 m"));
QCOMPARE(result, QStringLiteral(" negative 10.5 meters, negative 10.5 meters. negative 10.5 meters"));
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-10m -10 m"));
QCOMPARE(result, QStringLiteral(" negative 10 meters negative 10 meters"));
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("foo -10m -10 m bar"));
QCOMPARE(result, QStringLiteral("foo negative 10 meters negative 10 meters bar"));
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-foom"));
QCOMPARE(result, QStringLiteral("-foom"));
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("10 moo"));
QCOMPARE(result, QStringLiteral("10 moo"));
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("10moo"));
QCOMPARE(result, QStringLiteral("10moo"));
}

23
src/audio/QGCAudioWorkerTest.h

@ -0,0 +1,23 @@
/****************************************************************************
*
* (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"
class QGCAudioWorkerTest : public UnitTest
{
Q_OBJECT
public:
QGCAudioWorkerTest(void);
private slots:
void _testSpokenReplacements(void);
};

9
src/qgcunittest/UnitTestList.cc

@ -39,6 +39,11 @@
#include "MissionSettingsTest.h" #include "MissionSettingsTest.h"
#include "QGCMapPolygonTest.h" #include "QGCMapPolygonTest.h"
#if 0
// Temporarily disabled until I move some stuff from Stable to master
#include "QGCAudioWorkerTest.h"
#endif
UT_REGISTER_TEST(FactSystemTestGeneric) UT_REGISTER_TEST(FactSystemTestGeneric)
UT_REGISTER_TEST(FactSystemTestPX4) UT_REGISTER_TEST(FactSystemTestPX4)
UT_REGISTER_TEST(FileDialogTest) UT_REGISTER_TEST(FileDialogTest)
@ -63,6 +68,10 @@ UT_REGISTER_TEST(SpeedSectionTest)
UT_REGISTER_TEST(PlanMasterControllerTest) UT_REGISTER_TEST(PlanMasterControllerTest)
UT_REGISTER_TEST(MissionSettingsTest) UT_REGISTER_TEST(MissionSettingsTest)
UT_REGISTER_TEST(QGCMapPolygonTest) UT_REGISTER_TEST(QGCMapPolygonTest)
#if 0
// Temporarily disabled until I move some stuff from Stable to master
UT_REGISTER_TEST(QGCAudioWorkerTest)
#endif
// List of unit test which are currently disabled. // List of unit test which are currently disabled.
// If disabling a new test, include reason in comment. // If disabling a new test, include reason in comment.

Loading…
Cancel
Save