Commit 08f54ff7 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5066 from DonLakeFlyer/Fixes

Various Fixes
parents be117f58 adcc3d0a
...@@ -60,8 +60,12 @@ FlightMap { ...@@ -60,8 +60,12 @@ FlightMap {
// When the user pans the map we stop responding to vehicle coordinate updates until the panRecenterTimer fires // When the user pans the map we stop responding to vehicle coordinate updates until the panRecenterTimer fires
onUserPannedChanged: { onUserPannedChanged: {
_disableVehicleTracking = true if (userPanned) {
panRecenterTimer.start() console.log("user panned")
userPanned = false
_disableVehicleTracking = true
panRecenterTimer.restart()
}
} }
function pointInRect(point, rect) { function pointInRect(point, rect) {
......
...@@ -87,8 +87,8 @@ Item { ...@@ -87,8 +87,8 @@ Item {
property bool showTakeoff: _activeVehicle && _activeVehicle.guidedModeSupported && !_vehicleFlying && !_activeVehicle.fixedWing property bool showTakeoff: _activeVehicle && _activeVehicle.guidedModeSupported && !_vehicleFlying && !_activeVehicle.fixedWing
property bool showLand: _activeVehicle && _activeVehicle.guidedModeSupported && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode property bool showLand: _activeVehicle && _activeVehicle.guidedModeSupported && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode
property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive && !_vehicleFlying property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive && !_vehicleFlying
property bool showContinueMission: _activeVehicle && _missionAvailable && !_missionActive && _vehicleFlying property bool showContinueMission: _activeVehicle && _missionAvailable && !_missionActive && _vehicleFlying && (_currentMissionIndex < missionController.visualItems.count - 1)
property bool showResumeMission: _activeVehicle && !_vehicleFlying && _missionAvailable && _resumeMissionIndex > 0 property bool showResumeMission: _activeVehicle && !_vehicleFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < missionController.visualItems.count - 2)
property bool showPause: _activeVehicle && _vehicleArmed && _activeVehicle.pauseVehicleSupported && _vehicleFlying && !_vehiclePaused property bool showPause: _activeVehicle && _vehicleArmed && _activeVehicle.pauseVehicleSupported && _vehicleFlying && !_vehiclePaused
property bool showChangeAlt: (_activeVehicle && _vehicleFlying) && _activeVehicle.guidedModeSupported && _vehicleArmed && !_missionActive property bool showChangeAlt: (_activeVehicle && _vehicleFlying) && _activeVehicle.guidedModeSupported && _vehicleArmed && !_missionActive
property bool showOrbit: !_hideOrbit && _activeVehicle && _vehicleFlying && _activeVehicle.orbitModeSupported && _vehicleArmed && !_missionActive property bool showOrbit: !_hideOrbit && _activeVehicle && _vehicleFlying && _activeVehicle.orbitModeSupported && _vehicleArmed && !_missionActive
...@@ -105,11 +105,14 @@ Item { ...@@ -105,11 +105,14 @@ Item {
property bool _vehicleInMissionMode: false property bool _vehicleInMissionMode: false
property bool _vehicleInRTLMode: false property bool _vehicleInRTLMode: false
property bool _vehicleInLandMode: false property bool _vehicleInLandMode: false
property int _currentMissionIndex: missionController.currentMissionIndex
property int _resumeMissionIndex: missionController.resumeMissionIndex property int _resumeMissionIndex: missionController.resumeMissionIndex
property bool _hideEmergenyStop: !QGroundControl.corePlugin.options.guidedBarShowEmergencyStop property bool _hideEmergenyStop: !QGroundControl.corePlugin.options.guidedBarShowEmergencyStop
property bool _hideOrbit: !QGroundControl.corePlugin.options.guidedBarShowOrbit property bool _hideOrbit: !QGroundControl.corePlugin.options.guidedBarShowOrbit
property var _actionData property var _actionData
on_CurrentMissionIndexChanged: console.log("_currentMissionIndex", _currentMissionIndex)
on_FlightModeChanged: { on_FlightModeChanged: {
_vehiclePaused = _flightMode === _activeVehicle.pauseFlightMode _vehiclePaused = _flightMode === _activeVehicle.pauseFlightMode
_vehicleInRTLMode = _flightMode === _activeVehicle.rtlFlightMode _vehicleInRTLMode = _flightMode === _activeVehicle.rtlFlightMode
......
...@@ -1528,6 +1528,19 @@ int MissionController::resumeMissionIndex(void) const ...@@ -1528,6 +1528,19 @@ int MissionController::resumeMissionIndex(void) const
return resumeIndex; return resumeIndex;
} }
int MissionController::currentMissionIndex(void) const
{
if (_editMode) {
return -1;
} else {
int currentIndex = _missionManager->currentIndex();
if (!_controllerVehicle->firmwarePlugin()->sendHomePositionToVehicle()) {
currentIndex++;
}
return currentIndex;
}
}
void MissionController::_currentMissionIndexChanged(int sequenceNumber) void MissionController::_currentMissionIndexChanged(int sequenceNumber)
{ {
if (!_editMode) { if (!_editMode) {
...@@ -1539,6 +1552,7 @@ void MissionController::_currentMissionIndexChanged(int sequenceNumber) ...@@ -1539,6 +1552,7 @@ void MissionController::_currentMissionIndexChanged(int sequenceNumber)
VisualMissionItem* item = qobject_cast<VisualMissionItem*>(_visualItems->get(i)); VisualMissionItem* item = qobject_cast<VisualMissionItem*>(_visualItems->get(i));
item->setIsCurrentItem(item->sequenceNumber() == sequenceNumber); item->setIsCurrentItem(item->sequenceNumber() == sequenceNumber);
} }
emit currentMissionIndexChanged(currentMissionIndex());
} }
} }
......
...@@ -70,7 +70,8 @@ public: ...@@ -70,7 +70,8 @@ public:
Q_PROPERTY(double progressPct READ progressPct NOTIFY progressPctChanged) Q_PROPERTY(double progressPct READ progressPct NOTIFY progressPctChanged)
Q_PROPERTY(int resumeMissionIndex READ resumeMissionIndex NOTIFY resumeMissionIndexChanged) Q_PROPERTY(int currentMissionIndex READ currentMissionIndex NOTIFY currentMissionIndexChanged)
Q_PROPERTY(int resumeMissionIndex READ resumeMissionIndex NOTIFY resumeMissionIndexChanged) ///< Returns the item index two which a mission should be resumed. -1 indicates resume mission not available.
Q_PROPERTY(double missionDistance READ missionDistance NOTIFY missionDistanceChanged) Q_PROPERTY(double missionDistance READ missionDistance NOTIFY missionDistanceChanged)
Q_PROPERTY(double missionTime READ missionTime NOTIFY missionTimeChanged) Q_PROPERTY(double missionTime READ missionTime NOTIFY missionTimeChanged)
...@@ -134,7 +135,7 @@ public: ...@@ -134,7 +135,7 @@ public:
QGeoCoordinate plannedHomePosition (void) const; QGeoCoordinate plannedHomePosition (void) const;
double progressPct (void) const { return _progressPct; } double progressPct (void) const { return _progressPct; }
/// Returns the item index two which a mission should be resumed. -1 indicates resume mission not available. int currentMissionIndex(void) const;
int resumeMissionIndex(void) const; int resumeMissionIndex(void) const;
double missionDistance (void) const { return _missionFlightStatus.totalDistance; } double missionDistance (void) const { return _missionFlightStatus.totalDistance; }
...@@ -166,6 +167,7 @@ signals: ...@@ -166,6 +167,7 @@ signals:
void batteriesRequiredChanged(int batteriesRequired); void batteriesRequiredChanged(int batteriesRequired);
void plannedHomePositionChanged(QGeoCoordinate plannedHomePosition); void plannedHomePositionChanged(QGeoCoordinate plannedHomePosition);
void progressPctChanged(double progressPct); void progressPctChanged(double progressPct);
void currentMissionIndexChanged(int currentMissionIndex);
private slots: private slots:
void _newMissionItemsAvailableFromVehicle(bool removeAllRequested); void _newMissionItemsAvailableFromVehicle(bool removeAllRequested);
......
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