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
b168706b
Commit
b168706b
authored
Aug 17, 2017
by
Don Gagne
Committed by
GitHub
Aug 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5529 from bluerobotics/pr-vehicle-setup-armed-transition-jacob
Rework disabling of setup pages
parents
d0946f6b
732cfc1a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
406 additions
and
379 deletions
+406
-379
APMSafetyComponentSub.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
+1
-0
SetupPage.qml
src/AutoPilotPlugins/Common/SetupPage.qml
+43
-1
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+348
-350
SetupView.qml
src/VehicleSetup/SetupView.qml
+14
-28
No files found.
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
View file @
b168706b
...
...
@@ -22,6 +22,7 @@ import QGroundControl.ScreenTools 1.0
SetupPage
{
id
:
safetyPage
pageComponent
:
safetyPageComponent
visibleWhileArmed
:
true
Component
{
id
:
safetyPageComponent
...
...
src/AutoPilotPlugins/Common/SetupPage.qml
View file @
b168706b
...
...
@@ -32,8 +32,51 @@ QGCView {
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
visibleWhileArmed
:
false
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
...
...
@@ -68,7 +111,6 @@ QGCView {
id
:
pageLoader
anchors.topMargin
:
_margins
anchors.top
:
headingColumn
.
bottom
}
}
}
...
...
src/VehicleSetup/FirmwareUpgrade.qml
View file @
b168706b
This diff is collapsed.
Click to expand it.
src/VehicleSetup/SetupView.qml
View file @
b168706b
...
...
@@ -56,23 +56,13 @@ Rectangle {
function
showFirmwarePanel
()
{
if
(
!
ScreenTools
.
isMobile
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
&&
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
)
{
_messagePanelText
=
_armedVehicleText
panelLoader
.
setSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
setSource
(
"
FirmwareUpgrade.qml
"
)
}
panelLoader
.
setSource
(
"
FirmwareUpgrade.qml
"
)
}
}
function
showJoystickPanel
()
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
&&
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
)
{
_messagePanelText
=
_armedVehicleText
panelLoader
.
setSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
setSource
(
"
JoystickConfig.qml
"
)
}
panelLoader
.
setSource
(
"
JoystickConfig.qml
"
)
}
function
showParametersPanel
()
...
...
@@ -87,24 +77,19 @@ Rectangle {
function
showVehicleComponentPanel
(
vehicleComponent
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
&&
!
vehicleComponent
.
allowSetupWhileArmed
)
{
_messagePanelText
=
_armedVehicleText
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.
"
panelLoader
.
setSourceComponent
(
messagePanelComponent
)
}
else
{
var
autopilotPlugin
=
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
var
prereq
=
autopilotPlugin
.
prerequisiteSetup
(
vehicleComponent
)
if
(
prereq
!==
""
)
{
//-- TODO: This cannot be trasnlated when built this way.
_messagePanelText
=
prereq
+
"
setup must be completed prior to
"
+
vehicleComponent
.
name
+
"
setup.
"
panelLoader
.
setSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
setSource
(
vehicleComponent
.
setupSource
,
vehicleComponent
)
for
(
var
i
=
0
;
i
<
componentRepeater
.
count
;
i
++
)
{
var
obj
=
componentRepeater
.
itemAt
(
i
);
if
(
obj
.
text
===
vehicleComponent
.
name
)
{
obj
.
checked
=
true
;
break
;
}
panelLoader
.
setSource
(
vehicleComponent
.
setupSource
,
vehicleComponent
)
for
(
var
i
=
0
;
i
<
componentRepeater
.
count
;
i
++
)
{
var
obj
=
componentRepeater
.
itemAt
(
i
);
if
(
obj
.
text
===
vehicleComponent
.
name
)
{
obj
.
checked
=
true
;
break
;
}
}
}
...
...
@@ -170,6 +155,7 @@ Rectangle {
}
}
}
Component
{
id
:
missingParametersVehicleSummaryComponent
...
...
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