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
b5f21cf4
Unverified
Commit
b5f21cf4
authored
Oct 21, 2019
by
Beat Küng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MotorComponent: use same implementation as for APM
Except for motorIndexToLetter()
parent
d5227b87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
29 deletions
+37
-29
MotorComponent.qml
src/AutoPilotPlugins/Common/MotorComponent.qml
+37
-29
No files found.
src/AutoPilotPlugins/Common/MotorComponent.qml
View file @
b5f21cf4
...
@@ -20,9 +20,10 @@ SetupPage {
...
@@ -20,9 +20,10 @@ SetupPage {
id
:
motorPage
id
:
motorPage
pageComponent
:
pageComponent
pageComponent
:
pageComponent
readonly
property
int
_barHeight
:
10
readonly
property
int
_barHeight
:
10
readonly
property
int
_barWidth
:
5
readonly
property
int
_barWidth
:
5
readonly
property
int
_sliderHeight
:
10
readonly
property
int
_sliderHeight
:
10
readonly
property
int
_motorTimeoutSecs
:
3
FactPanelController
{
FactPanelController
{
id
:
controller
id
:
controller
...
@@ -32,7 +33,13 @@ SetupPage {
...
@@ -32,7 +33,13 @@ SetupPage {
id
:
pageComponent
id
:
pageComponent
Column
{
Column
{
spacing
:
10
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
text
:
qsTr
(
"
Warning: Unable to determine motor count
"
)
color
:
qgcPal
.
warningText
visible
:
controller
.
vehicle
.
motorCount
==
-
1
}
Row
{
Row
{
id
:
motorSliders
id
:
motorSliders
...
@@ -46,20 +53,6 @@ SetupPage {
...
@@ -46,20 +53,6 @@ SetupPage {
Column
{
Column
{
property
alias
motorSlider
:
slider
property
alias
motorSlider
:
slider
Timer
{
interval
:
250
running
:
true
repeat
:
true
property
real
_lastValue
:
0
onTriggered
:
{
if
(
_lastValue
!==
slider
.
value
)
{
controller
.
vehicle
.
motorTest
(
index
+
1
,
slider
.
value
,
1
)
}
}
}
QGCLabel
{
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
index
+
1
text
:
index
+
1
...
@@ -69,8 +62,30 @@ SetupPage {
...
@@ -69,8 +62,30 @@ SetupPage {
id
:
slider
id
:
slider
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
orientation
:
Qt
.
Vertical
orientation
:
Qt
.
Vertical
minimumValue
:
0
maximumValue
:
100
maximumValue
:
100
stepSize
:
1
value
:
0
value
:
0
updateValueWhileDragging
:
false
onValueChanged
:
{
controller
.
vehicle
.
motorTest
(
index
+
1
,
value
,
value
==
0
?
0
:
_motorTimeoutSecs
)
if
(
value
!=
0
)
{
motorTimer
.
restart
()
}
}
Timer
{
id
:
motorTimer
interval
:
_motorTimeoutSecs
*
1000
repeat
:
false
running
:
false
onTriggered
:
{
allSlider
.
value
=
0
slider
.
value
=
0
}
}
}
}
}
// Column
}
// Column
}
// Repeater
}
// Repeater
...
@@ -85,8 +100,11 @@ SetupPage {
...
@@ -85,8 +100,11 @@ SetupPage {
id
:
allSlider
id
:
allSlider
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
orientation
:
Qt
.
Vertical
orientation
:
Qt
.
Vertical
minimumValue
:
0
maximumValue
:
100
maximumValue
:
100
stepSize
:
1
value
:
0
value
:
0
updateValueWhileDragging
:
false
onValueChanged
:
{
onValueChanged
:
{
for
(
var
sliderIndex
=
0
;
sliderIndex
<
sliderRepeater
.
count
;
sliderIndex
++
)
{
for
(
var
sliderIndex
=
0
;
sliderIndex
<
sliderRepeater
.
count
;
sliderIndex
++
)
{
...
@@ -95,16 +113,6 @@ SetupPage {
...
@@ -95,16 +113,6 @@ SetupPage {
}
}
}
}
}
// Column
}
// Column
MultiRotorMotorDisplay
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
height
motorCount
:
controller
.
vehicle
.
motorCount
xConfig
:
controller
.
vehicle
.
xConfigMotors
coaxial
:
controller
.
vehicle
.
coaxialMotors
}
}
// Row
}
// Row
QGCLabel
{
QGCLabel
{
...
@@ -131,7 +139,7 @@ SetupPage {
...
@@ -131,7 +139,7 @@ SetupPage {
QGCLabel
{
QGCLabel
{
color
:
qgcPal
.
warningText
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
Propellers are removed - Enable motor sliders
"
)
text
:
safetySwitch
.
checked
?
qsTr
(
"
Careful: Motor sliders are enabled
"
)
:
qsTr
(
"
Propellers are removed - Enable motor sliders
"
)
}
}
}
// Row
}
// Row
}
// Column
}
// Column
...
...
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