Unverified Commit 6a3c99c8 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6461 from DonLakeFlyer/DebugGuided

Single bool to debug guided actions
parents b92e685d badf09db
...@@ -112,7 +112,7 @@ Item { ...@@ -112,7 +112,7 @@ Item {
property bool guidedUIVisible: guidedActionConfirm.visible || guidedActionList.visible property bool guidedUIVisible: guidedActionConfirm.visible || guidedActionList.visible
property bool _guidedActionsEnabled: (QGroundControl.corePlugin.options.guidedActionsRequireRCRSSI && _activeVehicle) ? _rcRSSIAvailable : _activeVehicle property bool _guidedActionsEnabled: (!ScreenTools.isDebug && QGroundControl.corePlugin.options.guidedActionsRequireRCRSSI && _activeVehicle) ? _rcRSSIAvailable : _activeVehicle
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property string _flightMode: _activeVehicle ? _activeVehicle.flightMode : "" property string _flightMode: _activeVehicle ? _activeVehicle.flightMode : ""
property bool _missionAvailable: missionController.containsItems property bool _missionAvailable: missionController.containsItems
...@@ -131,45 +131,51 @@ Item { ...@@ -131,45 +131,51 @@ Item {
property bool _vehicleWasFlying: false property bool _vehicleWasFlying: false
property bool _rcRSSIAvailable: _activeVehicle ? _activeVehicle.rcRSSI > 0 && _activeVehicle.rcRSSI < 255 : false property bool _rcRSSIAvailable: _activeVehicle ? _activeVehicle.rcRSSI > 0 && _activeVehicle.rcRSSI < 255 : false
/*
//Handy code for debugging state problems //Handy code for debugging state problems
property bool __guidedModeSupported: _activeVehicle ? _activeVehicle.guidedModeSupported : false property bool __debugGuidedStates: false
property bool __guidedModeSupported: _activeVehicle ? _activeVehicle.guidedModeSupported : false
property bool __pauseVehicleSupported: _activeVehicle ? _activeVehicle.pauseVehicleSupported : false property bool __pauseVehicleSupported: _activeVehicle ? _activeVehicle.pauseVehicleSupported : false
property bool __flightMode: _flightMode property bool __flightMode: _flightMode
function _outputState() { function _outputState() {
//console.log(qsTr("_activeVehicle(%1) _vehicleArmed(%2) guidedModeSupported(%3) _vehicleFlying(%4) _vehicleInRTLMode(%5) pauseVehicleSupported(%6) _vehiclePaused(%7) _flightMode(%8)").arg(_activeVehicle ? 1 : 0).arg(_vehicleArmed ? 1 : 0).arg(__guidedModeSupported ? 1 : 0).arg(_vehicleFlying ? 1 : 0).arg(_vehicleInRTLMode ? 1 : 0).arg(__pauseVehicleSupported ? 1 : 0).arg(_vehiclePaused ? 1 : 0).arg(_flightMode)) if (__debugGuidedStates) {
console.log(qsTr("_activeVehicle(%1) _vehicleArmed(%2) guidedModeSupported(%3) _vehicleFlying(%4) _vehicleInRTLMode(%5) pauseVehicleSupported(%6) _vehiclePaused(%7) _flightMode(%8)").arg(_activeVehicle ? 1 : 0).arg(_vehicleArmed ? 1 : 0).arg(__guidedModeSupported ? 1 : 0).arg(_vehicleFlying ? 1 : 0).arg(_vehicleInRTLMode ? 1 : 0).arg(__pauseVehicleSupported ? 1 : 0).arg(_vehiclePaused ? 1 : 0).arg(_flightMode))
}
} }
Component.onCompleted: _outputState() Component.onCompleted: _outputState()
on_ActiveVehicleChanged: _outputState() on_ActiveVehicleChanged: _outputState()
on_VehicleArmedChanged: _outputState() on_VehicleArmedChanged: _outputState()
on_VehicleInRTLModeChanged: _outputState() on_VehicleInRTLModeChanged: _outputState()
on_VehiclePausedChanged: _outputState() on_VehiclePausedChanged: _outputState()
on__FlightModeChanged: _outputState() on__FlightModeChanged: _outputState()
on__GuidedModeSupportedChanged: _outputState() on__GuidedModeSupportedChanged: _outputState()
on__PauseVehicleSupportedChanged: _outputState() on__PauseVehicleSupportedChanged: _outputState()
on_CurrentMissionIndexChanged: console.log("_currentMissionIndex", _currentMissionIndex) on_CurrentMissionIndexChanged: console.log("_currentMissionIndex", _currentMissionIndex)
on_ResumeMissionIndexChanged: console.log("_resumeMissionIndex", _resumeMissionIndex) on_ResumeMissionIndexChanged: console.log("_resumeMissionIndex", _resumeMissionIndex)
onShowResumeMissionChanged: { onShowResumeMissionChanged: {
console.log("showResumeMission", showResumeMission) if (__debugGuidedStates) {
console.log("showResumeMission", showResumeMission)
}
_outputState() _outputState()
} }
onShowStartMissionChanged: { onShowStartMissionChanged: {
console.log("showStartMission", showStartMission) if (__debugGuidedStates) {
console.log("showStartMission", showStartMission)
}
_outputState() _outputState()
} }
onShowContinueMissionChanged: { onShowContinueMissionChanged: {
console.log("showContinueMission", showContinueMission) if (__debugGuidedStates) {
console.log("showContinueMission", showContinueMission)
}
_outputState() _outputState()
} }
// End of hack // End of hack
*/
on_VehicleFlyingChanged: { on_VehicleFlyingChanged: {
//_outputState() _outputState()
if (!_vehicleFlying) { if (!_vehicleFlying) {
// We use _vehicleWasFLying to help trigger Resume Mission only if the vehicle actually flew and came back down. // We use _vehicleWasFLying to help trigger Resume Mission only if the vehicle actually flew and came back down.
// Otherwise it may trigger during the Start Mission sequence due to signal ordering or armed and resume mission index. // Otherwise it may trigger during the Start Mission sequence due to signal ordering or armed and resume mission index.
......
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