Browse Source

Vehicle: remove unused extraJoystickFlightModes

QGC4.4
Beat Küng 2 years ago
parent
commit
09dca9a1bc
  1. 4
      src/FirmwarePlugin/FirmwarePlugin.h
  2. 6
      src/Joystick/Joystick.cc
  3. 5
      src/Vehicle/Vehicle.cc
  4. 2
      src/Vehicle/Vehicle.h

4
src/FirmwarePlugin/FirmwarePlugin.h

@ -88,10 +88,6 @@ public: @@ -88,10 +88,6 @@ public:
/// list available from the firmware. Call will be made again if advanced mode changes.
virtual QStringList flightModes(Vehicle* /*vehicle*/) { return QStringList(); }
/// Returns the list of additional flight modes to add to the list for joystick button actions.
/// Call will be made again if advanced mode changes.
virtual QStringList extraJoystickFlightModes(Vehicle* /*vehicle*/) { return QStringList(); }
/// Returns the name for this flight mode. Flight mode names must be human readable as well as audio speakable.
/// @param base_mode Base mode from mavlink HEARTBEAT message
/// @param custom_mode Custom mode from mavlink HEARTBEAT message

6
src/Joystick/Joystick.cc

@ -1011,7 +1011,7 @@ void Joystick::_executeButtonAction(const QString& action, bool buttonDown) @@ -1011,7 +1011,7 @@ void Joystick::_executeButtonAction(const QString& action, bool buttonDown)
if (buttonDown) emit setVtolInFwdFlight(true);
} else if (action == _buttonActionVTOLMultiRotor) {
if (buttonDown) emit setVtolInFwdFlight(false);
} else if (_activeVehicle->flightModes().contains(action) || _activeVehicle->extraJoystickFlightModes().contains(action)) {
} else if (_activeVehicle->flightModes().contains(action)) {
if (buttonDown) emit setFlightMode(action);
} else if(action == _buttonActionContinuousZoomIn || action == _buttonActionContinuousZoomOut) {
if (buttonDown) {
@ -1128,10 +1128,6 @@ void Joystick::_buildActionList(Vehicle* activeVehicle) @@ -1128,10 +1128,6 @@ void Joystick::_buildActionList(Vehicle* activeVehicle)
foreach(auto mode, list) {
_assignableButtonActions.append(new AssignableButtonAction(this, mode));
}
list = activeVehicle->extraJoystickFlightModes();
foreach(auto mode, list) {
_assignableButtonActions.append(new AssignableButtonAction(this, mode));
}
}
_assignableButtonActions.append(new AssignableButtonAction(this, _buttonActionVTOLFixedWing));
_assignableButtonActions.append(new AssignableButtonAction(this, _buttonActionVTOLMultiRotor));

5
src/Vehicle/Vehicle.cc

@ -2185,11 +2185,6 @@ QStringList Vehicle::flightModes() @@ -2185,11 +2185,6 @@ QStringList Vehicle::flightModes()
return _firmwarePlugin->flightModes(this);
}
QStringList Vehicle::extraJoystickFlightModes()
{
return _firmwarePlugin->extraJoystickFlightModes(this);
}
QString Vehicle::flightMode() const
{
return _firmwarePlugin->flightMode(_base_mode, _custom_mode);

2
src/Vehicle/Vehicle.h

@ -164,7 +164,6 @@ public: @@ -164,7 +164,6 @@ public:
Q_PROPERTY(bool autoDisarm READ autoDisarm NOTIFY autoDisarmChanged)
Q_PROPERTY(bool flightModeSetAvailable READ flightModeSetAvailable CONSTANT)
Q_PROPERTY(QStringList flightModes READ flightModes NOTIFY flightModesChanged)
Q_PROPERTY(QStringList extraJoystickFlightModes READ extraJoystickFlightModes NOTIFY flightModesChanged)
Q_PROPERTY(QString flightMode READ flightMode WRITE setFlightMode NOTIFY flightModeChanged)
Q_PROPERTY(TrajectoryPoints* trajectoryPoints MEMBER _trajectoryPoints CONSTANT)
Q_PROPERTY(QmlObjectListModel* cameraTriggerPoints READ cameraTriggerPoints CONSTANT)
@ -521,7 +520,6 @@ public: @@ -521,7 +520,6 @@ public:
bool flightModeSetAvailable ();
QStringList flightModes ();
QStringList extraJoystickFlightModes ();
QString flightMode () const;
void setFlightMode (const QString& flightMode);

Loading…
Cancel
Save