Commit 35603b4b authored by Don Gagne's avatar Don Gagne

Correct handling of no GeoFence support

parent 944d7224
......@@ -167,6 +167,6 @@
<file alias="PX4MockLink.params">src/comm/PX4MockLink.params</file>
</qresource>
<qresource prefix="/FirmwarePlugin">
<file alias="GeoFenceEditor.qml">src/FirmwarePlugin/GeoFenceEditor.qml</file>
<file alias="NoGeoFenceEditor.qml">src/FirmwarePlugin/NoGeoFenceEditor.qml</file>
</qresource>
</RCC>
......@@ -251,8 +251,9 @@ void APMGeoFenceManager::_parametersReady(void)
if (!_firstParamLoadComplete) {
_firstParamLoadComplete = true;
_fenceSupported = _vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, QStringLiteral("FENCE_ACTION")) &&
!qgcApp()->runningUnitTests();
_fenceSupported = _vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, _fenceTotalParam) &&
_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, _fenceActionParam) &&
!qgcApp()->runningUnitTests();
if (_fenceSupported) {
QStringList paramNames;
......@@ -319,7 +320,11 @@ void APMGeoFenceManager::_circleRadiusRawValueChanged(QVariant value)
QString APMGeoFenceManager::editorQml(void) const
{
return _vehicle->multiRotor() ?
QStringLiteral("qrc:/FirmwarePlugin/APM/CopterGeoFenceEditor.qml") :
QStringLiteral("qrc:/FirmwarePlugin/APM/PlaneGeoFenceEditor.qml");
if (_fenceSupported) {
return _vehicle->multiRotor() ?
QStringLiteral("qrc:/FirmwarePlugin/APM/CopterGeoFenceEditor.qml") :
QStringLiteral("qrc:/FirmwarePlugin/APM/PlaneGeoFenceEditor.qml");
} else {
return QStringLiteral("qrc:/FirmwarePlugin/NoGeoFenceEditor.qml");
}
}
......@@ -49,7 +49,7 @@ public:
virtual QVariantList params (void) const { return QVariantList(); }
virtual QStringList paramLabels (void) const { return QStringList(); }
virtual QString editorQml(void) const { return QStringLiteral("qrc:/FirmwarePlugin/GeoFenceEditor.qml"); }
virtual QString editorQml(void) const { return QStringLiteral("qrc:/FirmwarePlugin/NoGeoFenceEditor.qml"); }
/// Error codes returned in error signal
typedef enum {
......
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