From efc19ab41abc09bf939e50e472bf1dc3fe194499 Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Sat, 23 Jul 2016 16:42:31 -0700 Subject: [PATCH] Disable radio setup page for ArduSub vehicle --- src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc | 8 +++++--- src/Vehicle/Vehicle.cc | 5 +++++ src/Vehicle/Vehicle.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc index 4c4fb6a57..126d96834 100644 --- a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc @@ -63,9 +63,11 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void) _airframeComponent->setupTriggerSignals(); _components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent)); - _radioComponent = new APMRadioComponent(_vehicle, this); - _radioComponent->setupTriggerSignals(); - _components.append(QVariant::fromValue((VehicleComponent*)_radioComponent)); + if ( !_vehicle->sub() ) { + _radioComponent = new APMRadioComponent(_vehicle, this); + _radioComponent->setupTriggerSignals(); + _components.append(QVariant::fromValue((VehicleComponent*)_radioComponent)); + } _flightModesComponent = new APMFlightModesComponent(_vehicle, this); _flightModesComponent->setupTriggerSignals(); diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index dae78daaa..b507c3173 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1474,6 +1474,11 @@ bool Vehicle::rover(void) const return vehicleType() == MAV_TYPE_GROUND_ROVER; } +bool Vehicle::sub(void) const +{ + return vehicleType() == MAV_TYPE_SUBMARINE; +} + bool Vehicle::multiRotor(void) const { switch (vehicleType()) { diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 5803d26e6..06207e20a 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -276,6 +276,7 @@ public: Q_PROPERTY(bool vtol READ vtol CONSTANT) Q_PROPERTY(bool rover READ rover CONSTANT) Q_PROPERTY(bool supportsManualControl READ supportsManualControl CONSTANT) + Q_PROPERTY(bool sub READ sub CONSTANT) Q_PROPERTY(bool autoDisconnect MEMBER _autoDisconnect NOTIFY autoDisconnectChanged) Q_PROPERTY(QString prearmError READ prearmError WRITE setPrearmError NOTIFY prearmErrorChanged) Q_PROPERTY(int motorCount READ motorCount CONSTANT) @@ -466,6 +467,7 @@ public: bool multiRotor(void) const; bool vtol(void) const; bool rover(void) const; + bool sub(void) const; bool supportsManualControl(void) const; -- 2.22.0