Browse Source

Make supportsRadio a plugin option

QGC4.4
Rustom Jehangir 9 years ago
parent
commit
a78ee55b13
  1. 2
      src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
  2. 5
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
  3. 2
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
  4. 5
      src/FirmwarePlugin/FirmwarePlugin.cc
  5. 4
      src/FirmwarePlugin/FirmwarePlugin.h
  6. 5
      src/Vehicle/Vehicle.cc
  7. 1
      src/Vehicle/Vehicle.h

2
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc

@ -66,7 +66,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void) @@ -66,7 +66,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_airframeComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent));
if ( !_vehicle->sub() ) {
if ( _vehicle->supportsRadio() ) {
_radioComponent = new APMRadioComponent(_vehicle, this);
_radioComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_radioComponent));

5
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc

@ -62,3 +62,8 @@ bool ArduSubFirmwarePlugin::supportsManualControl(void) @@ -62,3 +62,8 @@ bool ArduSubFirmwarePlugin::supportsManualControl(void)
{
return true;
}
bool ArduSubFirmwarePlugin::supportsRadio(void)
{
return false;
}

2
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h

@ -72,6 +72,8 @@ public: @@ -72,6 +72,8 @@ public:
bool supportsThrottleModeCenterZero(void);
bool supportsManualControl(void);
bool supportsRadio(void);
};
#endif

5
src/FirmwarePlugin/FirmwarePlugin.cc

@ -94,6 +94,11 @@ bool FirmwarePlugin::supportsManualControl(void) @@ -94,6 +94,11 @@ bool FirmwarePlugin::supportsManualControl(void)
return false;
}
bool FirmwarePlugin::supportsRadio(void)
{
return true;
}
bool FirmwarePlugin::adjustIncomingMavlinkMessage(Vehicle* vehicle, mavlink_message_t* message)
{
Q_UNUSED(vehicle);

4
src/FirmwarePlugin/FirmwarePlugin.h

@ -137,6 +137,10 @@ public: @@ -137,6 +137,10 @@ public:
/// By default, this returns false unless overridden in the firmware plugin.
virtual bool supportsManualControl(void);
/// Returns true if the firmware supports the use of the RC radio and requires the RC radio
/// setup page. Returns true by default.
virtual bool supportsRadio(void);
/// Called before any mavlink message is processed by Vehicle such that the firmwre plugin
/// can adjust any message characteristics. This is handy to adjust or differences in mavlink
/// spec implementations such that the base code can remain mavlink generic.

5
src/Vehicle/Vehicle.cc

@ -1525,6 +1525,11 @@ bool Vehicle::supportsThrottleModeCenterZero(void) const @@ -1525,6 +1525,11 @@ bool Vehicle::supportsThrottleModeCenterZero(void) const
return _firmwarePlugin->supportsThrottleModeCenterZero();
}
bool Vehicle::supportsRadio(void) const
{
return _firmwarePlugin->supportsRadio();
}
void Vehicle::_setCoordinateValid(bool coordinateValid)
{
if (coordinateValid != _coordinateValid) {

1
src/Vehicle/Vehicle.h

@ -475,6 +475,7 @@ public: @@ -475,6 +475,7 @@ public:
bool supportsManualControl(void) const;
bool supportsThrottleModeCenterZero(void) const;
bool supportsRadio(void) const;
void setFlying(bool flying);
void setGuidedMode(bool guidedMode);

Loading…
Cancel
Save