Browse Source

Add gotoFlightMode method

QGC4.4
Don Gagne 6 years ago
parent
commit
fb13763f12
  1. 1
      src/FirmwarePlugin/APM/APMFirmwarePlugin.h
  2. 5
      src/FirmwarePlugin/FirmwarePlugin.cc
  3. 3
      src/FirmwarePlugin/FirmwarePlugin.h
  4. 1
      src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h

1
src/FirmwarePlugin/APM/APMFirmwarePlugin.h

@ -84,6 +84,7 @@ public:
QString flightMode (uint8_t base_mode, uint32_t custom_mode) const override; QString flightMode (uint8_t base_mode, uint32_t custom_mode) const override;
bool setFlightMode (const QString& flightMode, uint8_t* base_mode, uint32_t* custom_mode) override; bool setFlightMode (const QString& flightMode, uint8_t* base_mode, uint32_t* custom_mode) override;
bool isGuidedMode (const Vehicle* vehicle) const override; bool isGuidedMode (const Vehicle* vehicle) const override;
QString gotoFlightMode (void) const override { return QStringLiteral("Guided"); }
QString rtlFlightMode (void) const override { return QString("RTL"); } QString rtlFlightMode (void) const override { return QString("RTL"); }
QString missionFlightMode (void) const override { return QString("Auto"); } QString missionFlightMode (void) const override { return QString("Auto"); }
void pauseVehicle (Vehicle* vehicle) override; void pauseVehicle (Vehicle* vehicle) override;

5
src/FirmwarePlugin/FirmwarePlugin.cc

@ -757,3 +757,8 @@ int FirmwarePlugin::versionCompare(Vehicle* vehicle, QString& compare)
int patch = versionNumbers[2].toInt(); int patch = versionNumbers[2].toInt();
return versionCompare(vehicle, major, minor, patch); return versionCompare(vehicle, major, minor, patch);
} }
QString FirmwarePlugin::gotoFlightMode(void) const
{
return QString();
}

3
src/FirmwarePlugin/FirmwarePlugin.h

@ -114,6 +114,9 @@ public:
/// Returns whether the vehicle is in guided mode or not. /// Returns whether the vehicle is in guided mode or not.
virtual bool isGuidedMode(const Vehicle* vehicle) const; virtual bool isGuidedMode(const Vehicle* vehicle) const;
/// Returns the flight mode which the vehicle will be in if it is performing a goto location
virtual QString gotoFlightMode(void) const;
/// Set guided flight mode /// Set guided flight mode
virtual void setGuidedMode(Vehicle* vehicle, bool guidedMode); virtual void setGuidedMode(Vehicle* vehicle, bool guidedMode);

1
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h

@ -42,6 +42,7 @@ public:
QString rtlFlightMode (void) const override { return _rtlFlightMode; } QString rtlFlightMode (void) const override { return _rtlFlightMode; }
QString landFlightMode (void) const override { return _landingFlightMode; } QString landFlightMode (void) const override { return _landingFlightMode; }
QString takeControlFlightMode (void) const override { return _manualFlightMode; } QString takeControlFlightMode (void) const override { return _manualFlightMode; }
QString gotoFlightMode (void) const override { return _holdFlightMode; }
void pauseVehicle (Vehicle* vehicle) override; void pauseVehicle (Vehicle* vehicle) override;
void guidedModeRTL (Vehicle* vehicle) override; void guidedModeRTL (Vehicle* vehicle) override;
void guidedModeLand (Vehicle* vehicle) override; void guidedModeLand (Vehicle* vehicle) override;

Loading…
Cancel
Save