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
c7f840ac
Commit
c7f840ac
authored
Dec 12, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
48fa322b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
31 deletions
+24
-31
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+7
-2
SetupView.qml
src/VehicleSetup/SetupView.qml
+17
-29
No files found.
src/QmlControls/SubMenuButton.qml
View file @
c7f840ac
...
@@ -6,6 +6,9 @@ import QtGraphicalEffects 1.0
...
@@ -6,6 +6,9 @@ import QtGraphicalEffects 1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
// Important Note: SubMenuButtons must manage their checked state manually in order to support
// view switch prevention. This means they can't be checkable or autoExclusive.
Button
{
Button
{
id
:
_rootButton
id
:
_rootButton
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
...
@@ -13,12 +16,14 @@ Button {
...
@@ -13,12 +16,14 @@ Button {
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
property
size
sourceSize
:
Qt
.
size
(
ScreenTools
.
defaultFontPixelHeight
*
2
,
ScreenTools
.
defaultFontPixelHeight
*
2
)
property
size
sourceSize
:
Qt
.
size
(
ScreenTools
.
defaultFontPixelHeight
*
2
,
ScreenTools
.
defaultFontPixelHeight
*
2
)
text
:
"
Button
"
///< Pass in your own button text
text
:
"
Button
"
///< Pass in your own button text
activeFocusOnPress
:
true
checkable
:
true
implicitHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3.5
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
implicitHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3.5
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
implicitWidth
:
__panel
.
implicitWidth
implicitWidth
:
__panel
.
implicitWidth
onCheckedChanged
:
checkable
=
false
style
:
ButtonStyle
{
style
:
ButtonStyle
{
id
:
buttonStyle
id
:
buttonStyle
...
...
src/VehicleSetup/SetupView.qml
View file @
c7f840ac
...
@@ -41,6 +41,9 @@ Rectangle {
...
@@ -41,6 +41,9 @@ Rectangle {
function
showSummaryPanel
()
function
showSummaryPanel
()
{
{
if
(
mainWindow
.
preventViewSwitch
)
{
return
}
if
(
_fullParameterVehicleAvailable
)
{
if
(
_fullParameterVehicleAvailable
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
.
length
===
0
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
.
length
===
0
)
{
panelLoader
.
setSourceComponent
(
noComponentsVehicleSummaryComponent
)
panelLoader
.
setSourceComponent
(
noComponentsVehicleSummaryComponent
)
...
@@ -54,30 +57,19 @@ Rectangle {
...
@@ -54,30 +57,19 @@ Rectangle {
}
}
}
}
function
showFirmwarePanel
()
function
showPanel
(
button
,
qmlSource
)
{
{
if
(
mainWindow
.
preventViewSwitch
)
{
if
(
!
ScreenTools
.
isMobile
)
{
return
panelLoader
.
setSource
(
"
FirmwareUpgrade.qml
"
)
}
}
}
button
.
checked
=
true
panelLoader
.
setSource
(
qmlSource
)
function
showJoystickPanel
()
{
panelLoader
.
setSource
(
"
JoystickConfig.qml
"
)
}
function
showParametersPanel
()
{
panelLoader
.
setSource
(
"
SetupParameterEditor.qml
"
)
}
function
showPX4FlowPanel
()
{
panelLoader
.
setSource
(
"
PX4FlowSensor.qml
"
)
}
}
function
showVehicleComponentPanel
(
vehicleComponent
)
function
showVehicleComponentPanel
(
vehicleComponent
)
{
{
if
(
mainWindow
.
preventViewSwitch
)
{
return
}
var
autopilotPlugin
=
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
var
autopilotPlugin
=
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
var
prereq
=
autopilotPlugin
.
prerequisiteSetup
(
vehicleComponent
)
var
prereq
=
autopilotPlugin
.
prerequisiteSetup
(
vehicleComponent
)
if
(
prereq
!==
""
)
{
if
(
prereq
!==
""
)
{
...
@@ -229,7 +221,7 @@ Rectangle {
...
@@ -229,7 +221,7 @@ Rectangle {
exclusiveGroup
:
setupButtonGroup
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
title
text
:
modelData
.
title
visible
:
_corePlugin
&&
_corePlugin
.
options
.
combineSettingsAndSetup
visible
:
_corePlugin
&&
_corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
panelLoader
.
setSource
(
modelData
.
url
)
onClicked
:
showPanel
(
this
,
modelData
.
url
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
}
}
...
@@ -255,7 +247,7 @@ Rectangle {
...
@@ -255,7 +247,7 @@ Rectangle {
text
:
qsTr
(
"
Firmware
"
)
text
:
qsTr
(
"
Firmware
"
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:
show
FirmwarePanel
(
)
onClicked
:
show
Panel
(
this
,
"
FirmwareUpgrade.qml
"
)
}
}
SubMenuButton
{
SubMenuButton
{
...
@@ -265,8 +257,7 @@ Rectangle {
...
@@ -265,8 +257,7 @@ Rectangle {
setupIndicator
:
false
setupIndicator
:
false
text
:
qsTr
(
"
PX4Flow
"
)
text
:
qsTr
(
"
PX4Flow
"
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:
showPX4FlowPanel
(
this
,
"
PX4FlowSensor.qml
"
)
onClicked
:
showPX4FlowPanel
()
}
}
SubMenuButton
{
SubMenuButton
{
...
@@ -277,8 +268,7 @@ Rectangle {
...
@@ -277,8 +268,7 @@ Rectangle {
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!==
0
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!==
0
text
:
qsTr
(
"
Joystick
"
)
text
:
qsTr
(
"
Joystick
"
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:
showJoystickPanel
(
this
,
"
JoystickConfig.qml
"
)
onClicked
:
showJoystickPanel
()
}
}
Repeater
{
Repeater
{
...
@@ -293,8 +283,7 @@ Rectangle {
...
@@ -293,8 +283,7 @@ Rectangle {
text
:
modelData
.
name
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!==
""
visible
:
modelData
.
setupSource
.
toString
()
!==
""
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:
showVehicleComponentPanel
(
modelData
)
onClicked
:
showVehicleComponentPanel
(
modelData
)
}
}
}
}
...
@@ -306,8 +295,7 @@ Rectangle {
...
@@ -306,8 +295,7 @@ Rectangle {
_corePlugin
.
showAdvancedUI
_corePlugin
.
showAdvancedUI
text
:
qsTr
(
"
Parameters
"
)
text
:
qsTr
(
"
Parameters
"
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onClicked
:
showPanel
(
this
,
"
SetupParameterEditor.qml
"
)
onClicked
:
showParametersPanel
()
}
}
}
}
...
...
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