diff --git a/CodingStyle.h b/CodingStyle.h index ff59d4dc0da90d7c37b7ff2c547ee3833f35c198..2fe6dbb2566e9b4c226844ea215916792fdf3f8c 100644 --- a/CodingStyle.h +++ b/CodingStyle.h @@ -11,8 +11,7 @@ // coding style. In general almost everything in here has some coding style meaning. // Not all style choices are explained. -#ifndef CodingStyle_H -#define CodingStyle_H +#pragma once #include #include @@ -79,5 +78,3 @@ private: static const int _privateStaticVariable; }; - -#endif diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index affa0fa78df13b2ffc9d7375482a5905ac04e592..e510233a37bcd317a795d85c8c6fc7a3bae77569 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -1546,10 +1546,9 @@ void MissionController::_managerVehicleHomePositionChanged(const QGeoCoordinate& } else { qWarning() << "First item is not MissionSettingsItem"; } - if (_visualItems->count() == 1) { - // Don't let this trip the dirty bit - _visualItems->setDirty(false); - } + // Don't let this trip the dirty bit. Otherwise plan will keep getting marked dirty if vehicle home + // changes. + _visualItems->setDirty(false); } } diff --git a/src/MissionManager/SurveyMissionItem.cc b/src/MissionManager/SurveyMissionItem.cc index 94ca5ae298169ffeefb0f5900c79a9abcd3c34ab..367fa865cecb8b644fff7fc028c8c0ac64342cc5 100644 --- a/src/MissionManager/SurveyMissionItem.cc +++ b/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. // NULL check since object creation during unit testing passes NULL for vehicle 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 diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index e0cbe6912969c6586b0a917601a6e6c2d8c74c3c..3ab4b2a8d8d47937925d32e97df67f41f8067512 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -678,6 +678,8 @@ void Vehicle::_mavlinkMessageReceived(LinkInterface* link, mavlink_message_t mes 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); _uas->receiveMessage(message); diff --git a/src/audio/QGCAudioWorkerTest.cc b/src/audio/QGCAudioWorkerTest.cc new file mode 100644 index 0000000000000000000000000000000000000000..3d2e6b0148f2a8b6cb1347964dc8c5262d35332f --- /dev/null +++ b/src/audio/QGCAudioWorkerTest.cc @@ -0,0 +1,32 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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")); +} diff --git a/src/audio/QGCAudioWorkerTest.h b/src/audio/QGCAudioWorkerTest.h new file mode 100644 index 0000000000000000000000000000000000000000..b0432e2e7a0eda70765acda9730f34502824ded5 --- /dev/null +++ b/src/audio/QGCAudioWorkerTest.h @@ -0,0 +1,23 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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); +}; diff --git a/src/qgcunittest/UnitTestList.cc b/src/qgcunittest/UnitTestList.cc index 8e395b980ba756dd115c6f76b89fbe3fe2c382bd..2a4bee03d0a538541823df4f13e190404495dec4 100644 --- a/src/qgcunittest/UnitTestList.cc +++ b/src/qgcunittest/UnitTestList.cc @@ -39,6 +39,11 @@ #include "MissionSettingsTest.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(FactSystemTestPX4) UT_REGISTER_TEST(FileDialogTest) @@ -63,6 +68,10 @@ UT_REGISTER_TEST(SpeedSectionTest) UT_REGISTER_TEST(PlanMasterControllerTest) UT_REGISTER_TEST(MissionSettingsTest) 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. // If disabling a new test, include reason in comment.