Commit a78ee55b authored by Rustom Jehangir's avatar Rustom Jehangir

Make supportsRadio a plugin option

parent 479ca562
......@@ -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));
......
......@@ -62,3 +62,8 @@ bool ArduSubFirmwarePlugin::supportsManualControl(void)
{
return true;
}
bool ArduSubFirmwarePlugin::supportsRadio(void)
{
return false;
}
......@@ -72,6 +72,8 @@ public:
bool supportsThrottleModeCenterZero(void);
bool supportsManualControl(void);
bool supportsRadio(void);
};
#endif
......@@ -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);
......
......@@ -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.
......
......@@ -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) {
......
......@@ -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);
......
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