Commit 11d87639 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4240 from DonLakeFlyer/RallyPointOptional

RallyPoint support should be optional
parents d1cc23a2 1b29384e
...@@ -31,7 +31,7 @@ APMRallyPointManager::~APMRallyPointManager() ...@@ -31,7 +31,7 @@ APMRallyPointManager::~APMRallyPointManager()
void APMRallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints) void APMRallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints)
{ {
if (_vehicle->isOfflineEditingVehicle()) { if (_vehicle->isOfflineEditingVehicle() || !rallyPointsSupported()) {
return; return;
} }
...@@ -53,7 +53,7 @@ void APMRallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints) ...@@ -53,7 +53,7 @@ void APMRallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints)
void APMRallyPointManager::loadFromVehicle(void) void APMRallyPointManager::loadFromVehicle(void)
{ {
if (_vehicle->isOfflineEditingVehicle() || _readTransactionInProgress) { if (_vehicle->isOfflineEditingVehicle() || !rallyPointsSupported() || _readTransactionInProgress) {
return; return;
} }
...@@ -144,3 +144,8 @@ bool APMRallyPointManager::inProgress(void) const ...@@ -144,3 +144,8 @@ bool APMRallyPointManager::inProgress(void) const
{ {
return _readTransactionInProgress || _writeTransactionInProgress; return _readTransactionInProgress || _writeTransactionInProgress;
} }
bool APMRallyPointManager::rallyPointsSupported(void) const
{
return _vehicle->parameterManager()->parameterExists(_vehicle->defaultComponentId(), _rallyTotalParam);
}
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
bool inProgress (void) const final; bool inProgress (void) const final;
void loadFromVehicle (void) final; void loadFromVehicle (void) final;
void sendToVehicle (const QList<QGeoCoordinate>& rgPoints) final; void sendToVehicle (const QList<QGeoCoordinate>& rgPoints) final;
bool rallyPointsSupported (void) const final { return true; } bool rallyPointsSupported (void) const final;
QString editorQml(void) const final { return QStringLiteral("qrc:/FirmwarePlugin/APM/APMRallyPointEditor.qml"); } QString editorQml(void) const final { return QStringLiteral("qrc:/FirmwarePlugin/APM/APMRallyPointEditor.qml"); }
......
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