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
66c2a33f
Commit
66c2a33f
authored
Aug 14, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap up
parent
2bb5aad4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
21 deletions
+16
-21
CustomFlyView.qml
custom-example/res/CustomFlyView.qml
+1
-2
SafetyComponent.cc
src/AutoPilotPlugins/PX4/SafetyComponent.cc
+1
-1
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+14
-18
No files found.
custom-example/res/CustomFlyView.qml
View file @
66c2a33f
...
...
@@ -605,12 +605,11 @@ Item {
}
//-------------------------------------------------------------------------
//-- Object Avoidance
Rectangle
{
Item
{
visible
:
activeVehicle
&&
activeVehicle
.
objectAvoidance
.
available
&&
activeVehicle
.
objectAvoidance
.
enabled
anchors.centerIn
:
parent
width
:
parent
.
width
*
0.5
height
:
parent
.
height
*
0.5
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
Repeater
{
model
:
activeVehicle
&&
activeVehicle
.
objectAvoidance
.
gridSize
>
0
?
activeVehicle
.
objectAvoidance
.
gridSize
:
[]
Rectangle
{
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.cc
View file @
66c2a33f
...
...
@@ -27,7 +27,7 @@ QString SafetyComponent::name(void) const
QString
SafetyComponent
::
description
(
void
)
const
{
return
tr
(
"Safety Setup is used to setup triggers for Return to Land as well as the settings for Return to Land itself."
);
return
QString
(
);
}
QString
SafetyComponent
::
iconResource
(
void
)
const
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
66c2a33f
...
...
@@ -170,12 +170,11 @@ SetupPage {
enabled
:
_collisionPrevention
Layout.minimumWidth
:
_editFieldWidth
Layout.fillWidth
:
true
Component.onCompleted
:
{
currentIndex
=
_collisionPrevention
?
(
_collisionPrevention
.
value
>
0
?
1
:
0
)
:
0
}
currentIndex
:
_collisionPrevention
?
(
_collisionPrevention
.
rawValue
>
0
?
1
:
0
)
:
0
onActivated
:
{
if
(
_collisionPrevention
)
{
_collisionPrevention
.
value
=
index
>
0
?
5
:
-
1
console
.
log
(
'
Collision prevention enabled:
'
+
_collisionPrevention
.
value
)
}
}
}
...
...
@@ -186,14 +185,10 @@ SetupPage {
}
QGCComboBox
{
model
:
[
qsTr
(
"
Disabled
"
),
qsTr
(
"
Enabled
"
)]
enabled
:
_objectAvoidance
enabled
:
_objectAvoidance
&&
_collisionPrevention
.
rawValue
>
0
Layout.minimumWidth
:
_editFieldWidth
Layout.fillWidth
:
true
Component.onCompleted
:
{
if
(
_objectAvoidance
)
{
currentIndex
=
_objectAvoidance
.
value
===
0
?
0
:
1
}
}
currentIndex
:
_objectAvoidance
?
(
_objectAvoidance
.
value
===
0
?
0
:
1
)
:
0
onActivated
:
{
if
(
_objectAvoidance
)
{
_objectAvoidance
.
value
=
index
>
0
?
1
:
0
...
...
@@ -208,25 +203,26 @@ SetupPage {
}
QGCSlider
{
width
:
_editFieldWidth
enabled
:
_collisionPrevention
enabled
:
_collisionPrevention
&&
_collisionPrevention
.
rawValue
>
0
Layout.minimumWidth
:
_editFieldWidth
Layout.minimumHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2
Layout.fillWidth
:
true
Layout.fillHeight
:
true
maximumValue
:
1
minimumValue
:
15
maximumValue
:
1
5
minimumValue
:
0
stepSize
:
1
displayValue
:
true
updateValueWhileDragging
:
false
Layout.alignment
:
Qt
.
AlignVCenter
Component.onCompleted
:
{
if
(
_collisionPrevention
&&
_collisionPrevention
.
value
>
0
)
{
value
=
_collisionPrevention
.
value
}
}
//-- Looking at raw value on purpose. I don't know how to handle the
// slider range when not using metric system.
value
:
(
_collisionPrevention
&&
_collisionPrevention
.
rawValue
>
0
)
?
_collisionPrevention
.
rawValue
:
0
onValueChanged
:
{
if
(
_collisionPrevention
)
{
_collisionPrevention
.
value
=
value
//-- Negative means disabled
if
(
_collisionPrevention
.
rawValue
>=
0
)
{
_collisionPrevention
.
rawValue
=
value
}
}
}
}
...
...
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