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
f4b62d90
Commit
f4b62d90
authored
Aug 18, 2016
by
Don Gagne
Committed by
GitHub
Aug 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3906 from DonLakeFlyer/JoystickConfig
Joystick config: Fix scrolling
parents
3f63baf5
fcf77a69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
560 additions
and
558 deletions
+560
-558
SetupPage.qml
src/AutoPilotPlugins/Common/SetupPage.qml
+4
-2
JoystickConfig.qml
src/VehicleSetup/JoystickConfig.qml
+533
-542
SetupView.qml
src/VehicleSetup/SetupView.qml
+23
-14
No files found.
src/AutoPilotPlugins/Common/SetupPage.qml
View file @
f4b62d90
...
...
@@ -25,6 +25,8 @@ QGCView {
viewPanel
:
setupPanel
property
alias
pageComponent
:
pageLoader
.
sourceComponent
property
string
pageName
:
vehicleComponent
?
vehicleComponent
.
name
:
""
property
string
pageDescription
:
vehicleComponent
?
vehicleComponent
.
description
:
""
property
real
availableWidth
:
width
-
pageLoader
.
x
property
real
availableHeight
:
height
-
pageLoader
.
y
...
...
@@ -49,7 +51,7 @@ QGCView {
QGCLabel
{
font.pointSize
:
ScreenTools
.
largeFontPointSize
text
:
vehicleComponent
.
n
ame
+
"
"
+
qsTr
(
"
Setup
"
)
text
:
pageN
ame
+
"
"
+
qsTr
(
"
Setup
"
)
visible
:
!
ScreenTools
.
isShortScreen
}
...
...
@@ -57,7 +59,7 @@ QGCView {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
vehicleComponent
.
d
escription
text
:
pageD
escription
visible
:
!
ScreenTools
.
isShortScreen
}
}
...
...
src/VehicleSetup/JoystickConfig.qml
View file @
f4b62d90
...
...
@@ -21,23 +21,30 @@ import QGroundControl.FactSystem 1.0
import
QGroundControl
.
FactControls
1.0
/// Joystick Config
QGCView
{
id
:
rootQGCView
viewPanel
:
panel
SetupPage
{
id
:
joystickPage
pageComponent
:
pageComponent
pageName
:
qsTr
(
"
Joystick
"
)
pageDescription
:
qsTr
(
"
Joystick Setup is used to configure a calibrate joysticks.
"
)
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
panel
.
enabled
}
Component
{
id
:
pageComponent
Item
{
width
:
availableWidth
height
:
Math
.
max
(
leftColumn
.
height
,
rightColumn
.
height
)
readonly
property
string
dialogTitle
:
qsTr
(
"
Joystick Config
"
)
readonly
property
real
labelToMonitorMargin
:
defaultTextWidth
*
3
property
bool
controllerCompleted
:
false
property
bool
controllerAndViewReady
:
false
readonly
property
real
labelToMonitorMargin
:
defaultTextWidth
*
3
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeJoystick
:
joystickManager
.
activeJoystick
JoystickConfigController
{
id
:
controller
factPanel
:
p
anel
factPanel
:
joystickPage
.
viewP
anel
statusText
:
statusText
cancelButton
:
cancelButton
nextButton
:
nextButton
...
...
@@ -45,24 +52,20 @@ QGCView {
Component.onCompleted
:
{
controllerCompleted
=
true
if
(
rootQGCView
.
completedSignalled
)
{
if
(
joystickPage
.
completedSignalled
)
{
controllerAndViewReady
=
true
controller
.
start
()
}
}
}
onCompleted
:
{
Component
.
onCompleted
:
{
if
(
controllerCompleted
)
{
controllerAndViewReady
=
true
controller
.
start
()
}
}
QGCViewPanel
{
id
:
panel
anchors.fill
:
parent
// Live axis monitor control component
Component
{
id
:
axisMonitorDisplayComponent
...
...
@@ -123,36 +126,22 @@ QGCView {
duration
:
1500
}
/*
/*
// Axis value debugger
QGCLabel {
anchors.fill: parent
text: axisValue
}
*/
*/
}
}
// Component - axisMonitorDisplayComponent
// Main view Qml starts here
QGCLabel
{
id
:
header
font.pointSize
:
ScreenTools
.
mediumFontPointSize
text
:
qsTr
(
"
JOYSTICK
"
)
}
Item
{
id
:
spacer
anchors.top
:
header
.
bottom
width
:
parent
.
width
height
:
10
}
// Left side column
Column
{
id
:
leftColumn
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.top
:
spacer
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
rightColumn
.
left
spacing
:
10
...
...
@@ -178,11 +167,11 @@ QGCView {
id
:
rollLoader
anchors.left
:
rollLabel
.
right
anchors.right
:
parent
.
right
height
:
rootQGCView
.
defaultText
Height
height
:
ScreenTools
.
defaultFontPixel
Height
width
:
100
sourceComponent
:
axisMonitorDisplayComponent
property
real
defaultTextWidth
:
rootQGCView
.
defaultText
Width
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixel
Width
property
bool
mapped
:
controller
.
rollAxisMapped
property
bool
reversed
:
controller
.
rollAxisReversed
}
...
...
@@ -208,11 +197,11 @@ QGCView {
id
:
pitchLoader
anchors.left
:
pitchLabel
.
right
anchors.right
:
parent
.
right
height
:
rootQGCView
.
defaultText
Height
height
:
ScreenTools
.
defaultFontPixel
Height
width
:
100
sourceComponent
:
axisMonitorDisplayComponent
property
real
defaultTextWidth
:
rootQGCView
.
defaultText
Width
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixel
Width
property
bool
mapped
:
controller
.
pitchAxisMapped
property
bool
reversed
:
controller
.
pitchAxisReversed
}
...
...
@@ -238,11 +227,11 @@ QGCView {
id
:
yawLoader
anchors.left
:
yawLabel
.
right
anchors.right
:
parent
.
right
height
:
rootQGCView
.
defaultText
Height
height
:
ScreenTools
.
defaultFontPixel
Height
width
:
100
sourceComponent
:
axisMonitorDisplayComponent
property
real
defaultTextWidth
:
rootQGCView
.
defaultText
Width
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixel
Width
property
bool
mapped
:
controller
.
yawAxisMapped
property
bool
reversed
:
controller
.
yawAxisReversed
}
...
...
@@ -268,11 +257,11 @@ QGCView {
id
:
throttleLoader
anchors.left
:
throttleLabel
.
right
anchors.right
:
parent
.
right
height
:
rootQGCView
.
defaultText
Height
height
:
ScreenTools
.
defaultFontPixel
Height
width
:
100
sourceComponent
:
axisMonitorDisplayComponent
property
real
defaultTextWidth
:
rootQGCView
.
defaultText
Width
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixel
Width
property
bool
mapped
:
controller
.
throttleAxisMapped
property
bool
reversed
:
controller
.
throttleAxisReversed
}
...
...
@@ -647,11 +636,11 @@ QGCView {
Loader
{
id
:
theLoader
anchors.verticalCenter
:
axisLabel
.
verticalCenter
height
:
rootQGCView
.
defaultText
Height
height
:
ScreenTools
.
defaultFontPixel
Height
width
:
200
sourceComponent
:
axisMonitorDisplayComponent
property
real
defaultTextWidth
:
rootQGCView
.
defaultText
Width
property
real
defaultTextWidth
:
ScreenTools
.
defaultFontPixel
Width
property
bool
mapped
:
true
readonly
property
bool
reversed
:
false
}
...
...
@@ -676,7 +665,8 @@ QGCView {
}
}
Row
{
Flow
{
width
:
parent
.
width
spacing
:
-
1
Repeater
{
...
...
@@ -704,5 +694,6 @@ QGCView {
}
// Row
}
// Column - Axis Monitor
}
// Column - Right Column
}
// QGCViewPanel
}
}
// Item
}
// Component - pageComponent
}
// SetupPage
src/VehicleSetup/SetupView.qml
View file @
f4b62d90
...
...
@@ -45,14 +45,14 @@ Rectangle {
{
if
(
_fullParameterVehicleAvailable
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
.
length
==
0
)
{
panelLoader
.
s
ourceComponent
=
noComponentsVehicleSummaryComponent
panelLoader
.
s
etSourceComponent
(
noComponentsVehicleSummaryComponent
)
}
else
{
panelLoader
.
s
ource
=
"
VehicleSummary.qml
"
;
panelLoader
.
s
etSource
(
"
VehicleSummary.qml
"
)
}
}
else
if
(
QGroundControl
.
multiVehicleManager
.
parameterReadyVehicleAvailable
)
{
panelLoader
.
s
ourceComponent
=
missingParametersVehicleSummaryComponent
panelLoader
.
s
etSourceComponent
(
missingParametersVehicleSummaryComponent
)
}
else
{
panelLoader
.
s
ourceComponent
=
disconnectedVehicleSummaryComponent
panelLoader
.
s
etSourceComponent
(
disconnectedVehicleSummaryComponent
)
}
}
...
...
@@ -61,9 +61,9 @@ Rectangle {
if
(
!
ScreenTools
.
isMobile
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
&&
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
)
{
_messagePanelText
=
_armedVehicleText
panelLoader
.
s
ourceComponent
=
messagePanelComponent
panelLoader
.
s
etSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
s
ource
=
"
FirmwareUpgrade.qml
"
;
panelLoader
.
s
etSource
(
"
FirmwareUpgrade.qml
"
)
}
}
}
...
...
@@ -72,34 +72,33 @@ Rectangle {
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
&&
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
)
{
_messagePanelText
=
_armedVehicleText
panelLoader
.
s
ourceComponent
=
messagePanelComponent
panelLoader
.
s
etSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
s
ource
=
"
JoystickConfig.qml
"
;
panelLoader
.
s
etSource
(
"
JoystickConfig.qml
"
)
}
}
function
showParametersPanel
()
{
panelLoader
.
s
ource
=
"
SetupParameterEditor.qml
"
;
panelLoader
.
s
etSource
(
"
SetupParameterEditor.qml
"
)
}
function
showPX4FlowPanel
()
{
panelLoader
.
s
ource
=
"
PX4FlowSensor.qml
"
;
panelLoader
.
s
etSource
(
"
PX4FlowSensor.qml
"
)
}
function
showVehicleComponentPanel
(
vehicleComponent
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
armed
&&
!
vehicleComponent
.
allowSetupWhileArmed
)
{
_messagePanelText
=
_armedVehicleText
panelLoader
.
s
ourceComponent
=
messagePanelComponent
panelLoader
.
s
etSourceComponent
(
messagePanelComponent
)
}
else
{
if
(
vehicleComponent
.
prerequisiteSetup
!=
""
)
{
_messagePanelText
=
vehicleComponent
.
prerequisiteSetup
+
"
setup must be completed prior to
"
+
vehicleComponent
.
name
+
"
setup.
"
panelLoader
.
s
ourceComponent
=
messagePanelComponent
panelLoader
.
s
etSourceComponent
(
messagePanelComponent
)
}
else
{
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
source
=
vehicleComponent
.
setupSource
panelLoader
.
setSource
(
vehicleComponent
.
setupSource
,
vehicleComponent
)
for
(
var
i
=
0
;
i
<
componentRepeater
.
count
;
i
++
)
{
var
obj
=
componentRepeater
.
itemAt
(
i
);
if
(
obj
.
text
===
vehicleComponent
.
name
)
{
...
...
@@ -350,6 +349,16 @@ Rectangle {
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
function
setSource
(
source
,
vehicleComponent
)
{
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
source
=
source
}
function
setSourceComponent
(
sourceComponent
,
vehicleComponent
)
{
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
sourceComponent
=
sourceComponent
}
property
var
vehicleComponent
}
}
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