Commit 0a97dcf7 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5755 from DonLakeFlyer/StableMerge

Stable merge
parents f08f4770 26f243ee
...@@ -11,8 +11,7 @@ ...@@ -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: ...@@ -79,5 +78,3 @@ private:
static const int _privateStaticVariable; static const int _privateStaticVariable;
}; };
#endif
...@@ -1546,10 +1546,9 @@ void MissionController::_managerVehicleHomePositionChanged(const QGeoCoordinate& ...@@ -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);
}
} }
} }
......
...@@ -116,7 +116,8 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent) ...@@ -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
......
...@@ -678,6 +678,8 @@ void Vehicle::_mavlinkMessageReceived(LinkInterface* link, mavlink_message_t mes ...@@ -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);
......
/****************************************************************************
*
* (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"));
}
/****************************************************************************
*
* (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);
};
...@@ -39,6 +39,11 @@ ...@@ -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) ...@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment