Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ff622752
Unverified
Commit
ff622752
authored
7 years ago
by
Don Gagne
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6037 from mavlink/handleSettingsWhileArmed
Handle settings when armed
parents
f4cf5aae
f328b2ea
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
67 deletions
+37
-67
APMSafetyComponentSub.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
+0
-1
SetupPage.qml
src/AutoPilotPlugins/Common/SetupPage.qml
+19
-48
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+13
-13
SetupView.qml
src/VehicleSetup/SetupView.qml
+5
-5
No files found.
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
View file @
ff622752
...
...
@@ -22,7 +22,6 @@ import QGroundControl.ScreenTools 1.0
SetupPage
{
id
:
safetyPage
pageComponent
:
safetyPageComponent
visibleWhileArmed
:
true
Component
{
id
:
safetyPageComponent
...
...
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/Common/SetupPage.qml
View file @
ff622752
...
...
@@ -23,6 +23,7 @@ import QGroundControl.Controllers 1.0
QGCView
{
id
:
setupView
viewPanel
:
setupPanel
enabled
:
!
_shouldDisableWhenArmed
property
alias
pageComponent
:
pageLoader
.
sourceComponent
property
string
pageName
:
vehicleComponent
?
vehicleComponent
.
name
:
""
...
...
@@ -30,53 +31,15 @@ QGCView {
property
real
availableWidth
:
width
-
pageLoader
.
x
property
real
availableHeight
:
height
-
pageLoader
.
y
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
_vehicleArmed
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
:
false
property
bool
_shouldDisableWhenArmed
:
_vehicleArmed
?
(
vehicleComponent
?
!
vehicleComponent
.
allowSetupWhileArmed
:
false
)
:
false
property
bool
visibleWhileArmed
:
false
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
property
string
_pageTitle
:
qsTr
(
"
%1 Setup
"
).
arg
(
pageName
)
property
bool
vehicleArmed
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
:
false
onVehicleArmedChanged
:
{
if
(
visibleWhileArmed
)
{
return
}
if
(
vehicleArmed
)
{
disabledWhileArmed
.
visible
=
true
setupView
.
viewPanel
.
enabled
=
false
}
else
{
disabledWhileArmed
.
visible
=
false
setupView
.
viewPanel
.
enabled
=
true
}
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
setupPanel
.
enabled
}
// Overlay to display when vehicle is armed and the setup page needs
// to be disabled
Item
{
id
:
disabledWhileArmed
visible
:
false
z
:
9999
anchors.fill
:
parent
Rectangle
{
anchors.fill
:
parent
color
:
"
black
"
opacity
:
0.5
}
QGCLabel
{
anchors.margins
:
defaultTextWidth
*
2
anchors.fill
:
parent
verticalAlignment
:
Text
.
AlignVCenter
horizontalAlignment
:
Text
.
AlignHCenter
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
largeFontPointSize
color
:
"
red
"
text
:
"
Setup disabled while the vehicle is armed
"
}
}
QGCViewPanel
{
id
:
setupPanel
anchors.fill
:
parent
...
...
@@ -94,7 +57,7 @@ QGCView {
QGCLabel
{
font.pointSize
:
ScreenTools
.
largeFontPointSize
text
:
pageName
+
"
"
+
qsTr
(
"
Setup
"
)
text
:
_shouldDisableWhenArmed
?
_pageTitle
+
"
<font color=
\"
red
\"
>
"
+
qsTr
(
"
(Disabled while the vehicle is armed)
"
)
+
"
</font>
"
:
_pageTitle
visible
:
!
ScreenTools
.
isShortScreen
}
...
...
@@ -112,6 +75,14 @@ QGCView {
anchors.topMargin
:
_margins
anchors.top
:
headingColumn
.
bottom
}
// Overlay to display when vehicle is armed and this setup page needs
// to be disabled
Rectangle
{
visible
:
_shouldDisableWhenArmed
anchors.fill
:
pageLoader
color
:
"
black
"
opacity
:
0.5
}
}
}
}
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
ff622752
...
...
@@ -43,11 +43,6 @@ SetupPage {
readonly
property
string
highlightPrefix
:
"
<font color=
\"
"
+
qgcPal
.
warningText
+
"
\"
>
"
readonly
property
string
highlightSuffix
:
"
</font>
"
ColumnLayout
{
id
:
innerColumn
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelHeight
function
getBatteryImage
()
{
switch
(
battNumCells
.
value
)
{
...
...
@@ -61,6 +56,11 @@ SetupPage {
}
}
ColumnLayout
{
id
:
innerColumn
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelHeight
function
drawArrowhead
(
ctx
,
x
,
y
,
radians
)
{
ctx
.
save
();
...
...
This diff is collapsed.
Click to expand it.
src/VehicleSetup/SetupView.qml
View file @
ff622752
...
...
@@ -34,6 +34,7 @@ Rectangle {
readonly
property
real
_buttonWidth
:
_defaultTextWidth
*
18
readonly
property
string
_armedVehicleText
:
qsTr
(
"
This operation cannot be performed while the vehicle is armed.
"
)
property
bool
_vehicleArmed
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
:
false
property
string
_messagePanelText
:
qsTr
(
"
missing message panel text
"
)
property
bool
_fullParameterVehicleAvailable
:
QGroundControl
.
multiVehicleManager
.
parameterReadyVehicleAvailable
&&
!
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
parameterManager
.
missingParameters
property
var
_corePlugin
:
QGroundControl
.
corePlugin
...
...
@@ -41,7 +42,7 @@ Rectangle {
function
showSummaryPanel
()
{
if
(
_fullParameterVehicleAvailable
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
.
length
==
0
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
.
length
==
=
0
)
{
panelLoader
.
setSourceComponent
(
noComponentsVehicleSummaryComponent
)
}
else
{
panelLoader
.
setSource
(
"
VehicleSummary.qml
"
)
...
...
@@ -80,8 +81,7 @@ Rectangle {
var
autopilotPlugin
=
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
var
prereq
=
autopilotPlugin
.
prerequisiteSetup
(
vehicleComponent
)
if
(
prereq
!==
""
)
{
//-- TODO: This cannot be translated when built this way.
_messagePanelText
=
prereq
+
"
setup must be completed prior to
"
+
vehicleComponent
.
name
+
"
setup.
"
_messagePanelText
=
qsTr
(
"
%1 setup must be completed prior to %2 setup.
"
).
arg
(
prereq
).
arg
(
vehicleComponent
.
name
)
panelLoader
.
setSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
setSource
(
vehicleComponent
.
setupSource
,
vehicleComponent
)
...
...
@@ -272,7 +272,7 @@ Rectangle {
setupIndicator
:
true
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
=
0
text
:
qsTr
(
"
Joystick
"
)
Layout.fillWidth
:
true
...
...
@@ -289,7 +289,7 @@ Rectangle {
setupComplete
:
modelData
.
setupComplete
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
visible
:
modelData
.
setupSource
.
toString
()
!=
=
""
Layout.fillWidth
:
true
onClicked
:
showVehicleComponentPanel
(
modelData
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment