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
e7953629
Commit
e7953629
authored
Jan 16, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle settings when armed
parent
10215bbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
68 deletions
+53
-68
APMSafetyComponentSub.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
+0
-1
SetupPage.qml
src/AutoPilotPlugins/Common/SetupPage.qml
+33
-49
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+13
-13
SetupView.qml
src/VehicleSetup/SetupView.qml
+7
-5
No files found.
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
View file @
e7953629
...
...
@@ -22,7 +22,6 @@ import QGroundControl.ScreenTools 1.0
SetupPage
{
id
:
safetyPage
pageComponent
:
safetyPageComponent
visibleWhileArmed
:
true
Component
{
id
:
safetyPageComponent
...
...
src/AutoPilotPlugins/Common/SetupPage.qml
View file @
e7953629
...
...
@@ -21,8 +21,9 @@ import QGroundControl.Controllers 1.0
/// Base view control for all Setup pages
QGCView
{
id
:
setupView
viewPanel
:
setupPanel
id
:
setupView
viewPanel
:
setupPanel
enabled
:
!
_shouldDisableWhenArmed
property
alias
pageComponent
:
pageLoader
.
sourceComponent
property
string
pageName
:
vehicleComponent
?
vehicleComponent
.
name
:
""
...
...
@@ -30,53 +31,13 @@ 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
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
}
}
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
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
...
...
@@ -88,13 +49,13 @@ QGCView {
clip
:
true
Column
{
id
:
headingColumn
width
:
setupPanel
.
width
spacing
:
_margins
id
:
headingColumn
width
:
setupPanel
.
width
spacing
:
_margins
QGCLabel
{
font.pointSize
:
ScreenTools
.
largeFontPointSize
text
:
pageName
+
"
"
+
qsTr
(
"
Setup
"
)
text
:
qsTr
(
"
%1 Setup
"
).
arg
(
pageName
)
visible
:
!
ScreenTools
.
isShortScreen
}
...
...
@@ -114,4 +75,27 @@ QGCView {
}
}
}
// Overlay to display when vehicle is armed and this setup page needs
// to be disabled
Item
{
visible
:
_shouldDisableWhenArmed
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
:
qsTr
(
"
Setup disabled while the vehicle is armed
"
)
}
}
}
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
e7953629
...
...
@@ -43,24 +43,24 @@ SetupPage {
readonly
property
string
highlightPrefix
:
"
<font color=
\"
"
+
qgcPal
.
warningText
+
"
\"
>
"
readonly
property
string
highlightSuffix
:
"
</font>
"
function
getBatteryImage
()
{
switch
(
battNumCells
.
value
)
{
case
1
:
return
"
/qmlimages/PowerComponentBattery_01cell.svg
"
;
case
2
:
return
"
/qmlimages/PowerComponentBattery_02cell.svg
"
case
3
:
return
"
/qmlimages/PowerComponentBattery_03cell.svg
"
case
4
:
return
"
/qmlimages/PowerComponentBattery_04cell.svg
"
case
5
:
return
"
/qmlimages/PowerComponentBattery_05cell.svg
"
case
6
:
return
"
/qmlimages/PowerComponentBattery_06cell.svg
"
default
:
return
"
/qmlimages/PowerComponentBattery_01cell.svg
"
;
}
}
ColumnLayout
{
id
:
innerColumn
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelHeight
function
getBatteryImage
()
{
switch
(
battNumCells
.
value
)
{
case
1
:
return
"
/qmlimages/PowerComponentBattery_01cell.svg
"
;
case
2
:
return
"
/qmlimages/PowerComponentBattery_02cell.svg
"
case
3
:
return
"
/qmlimages/PowerComponentBattery_03cell.svg
"
case
4
:
return
"
/qmlimages/PowerComponentBattery_04cell.svg
"
case
5
:
return
"
/qmlimages/PowerComponentBattery_05cell.svg
"
case
6
:
return
"
/qmlimages/PowerComponentBattery_06cell.svg
"
default
:
return
"
/qmlimages/PowerComponentBattery_01cell.svg
"
;
}
}
function
drawArrowhead
(
ctx
,
x
,
y
,
radians
)
{
ctx
.
save
();
...
...
src/VehicleSetup/SetupView.qml
View file @
e7953629
...
...
@@ -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
)
...
...
@@ -250,6 +250,7 @@ Rectangle {
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
!
ScreenTools
.
isMobile
&&
_corePlugin
.
options
.
showFirmwareUpgrade
enabled
:
!
_vehicleArmed
text
:
qsTr
(
"
Firmware
"
)
Layout.fillWidth
:
true
...
...
@@ -272,7 +273,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 +290,8 @@ Rectangle {
setupComplete
:
modelData
.
setupComplete
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
visible
:
modelData
.
setupSource
.
toString
()
!==
""
enabled
:
_vehicleArmed
?
modelData
.
allowSetupWhileArmed
:
true
Layout.fillWidth
:
true
onClicked
:
showVehicleComponentPanel
(
modelData
)
...
...
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