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
ab294134
Commit
ab294134
authored
Feb 17, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into messageHandler
parents
16e40be2
47c0d51f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
49 deletions
+84
-49
SafetyComponent.cc
src/AutoPilotPlugins/PX4/SafetyComponent.cc
+14
-14
SafetyComponent.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+70
-35
No files found.
src/AutoPilotPlugins/PX4/SafetyComponent.cc
View file @
ab294134
/*=====================================================================
/*=====================================================================
QGroundControl Open Source Ground Control Station
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
======================================================================*/
/// @file
/// @file
...
@@ -67,7 +67,7 @@ bool SafetyComponent::setupComplete(void) const
...
@@ -67,7 +67,7 @@ bool SafetyComponent::setupComplete(void) const
QString
SafetyComponent
::
setupStateDescription
(
void
)
const
QString
SafetyComponent
::
setupStateDescription
(
void
)
const
{
{
const
char
*
stateDescription
;
const
char
*
stateDescription
;
if
(
requiresSetup
())
{
if
(
requiresSetup
())
{
stateDescription
=
"Requires setup"
;
stateDescription
=
"Requires setup"
;
}
else
{
}
else
{
...
@@ -84,7 +84,7 @@ const char** SafetyComponent::setupCompleteChangedTriggerList(void) const
...
@@ -84,7 +84,7 @@ const char** SafetyComponent::setupCompleteChangedTriggerList(void) const
QStringList
SafetyComponent
::
paramFilterList
(
void
)
const
QStringList
SafetyComponent
::
paramFilterList
(
void
)
const
{
{
QStringList
list
;
QStringList
list
;
return
list
;
return
list
;
}
}
...
@@ -92,11 +92,11 @@ QWidget* SafetyComponent::setupWidget(void) const
...
@@ -92,11 +92,11 @@ QWidget* SafetyComponent::setupWidget(void) const
{
{
QGCQmlWidgetHolder
*
holder
=
new
QGCQmlWidgetHolder
();
QGCQmlWidgetHolder
*
holder
=
new
QGCQmlWidgetHolder
();
Q_CHECK_PTR
(
holder
);
Q_CHECK_PTR
(
holder
);
holder
->
setAutoPilot
(
_autopilot
);
holder
->
setAutoPilot
(
_autopilot
);
holder
->
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/SafetyComponent.qml"
));
holder
->
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/SafetyComponent.qml"
));
return
holder
;
return
holder
;
}
}
...
@@ -109,10 +109,10 @@ QString SafetyComponent::prerequisiteSetup(void) const
...
@@ -109,10 +109,10 @@ QString SafetyComponent::prerequisiteSetup(void) const
{
{
PX4AutoPilotPlugin
*
plugin
=
dynamic_cast
<
PX4AutoPilotPlugin
*>
(
_autopilot
);
PX4AutoPilotPlugin
*
plugin
=
dynamic_cast
<
PX4AutoPilotPlugin
*>
(
_autopilot
);
Q_ASSERT
(
plugin
);
Q_ASSERT
(
plugin
);
if
(
!
plugin
->
airframeComponent
()
->
setupComplete
())
{
if
(
!
plugin
->
airframeComponent
()
->
setupComplete
())
{
return
plugin
->
airframeComponent
()
->
name
();
return
plugin
->
airframeComponent
()
->
name
();
}
}
return
QString
();
return
QString
();
}
}
src/AutoPilotPlugins/PX4/SafetyComponent.qml
View file @
ab294134
...
@@ -10,37 +10,76 @@ Rectangle {
...
@@ -10,37 +10,76 @@ Rectangle {
QGCPalette
{
id
:
palette
;
colorGroup
:
QGCPalette
.
Active
}
QGCPalette
{
id
:
palette
;
colorGroup
:
QGCPalette
.
Active
}
width
:
600
width
:
600
height
:
4
00
height
:
6
00
color
:
palette
.
window
color
:
palette
.
window
property
var
leftColWidth
:
350
Column
{
Column
{
anchors.fill
:
parent
anchors.fill
:
parent
spacing
:
20
spacing
:
40
//-----------------------------------------------------------------
//-- Return Home Triggers
Column
{
Column
{
spacing
:
10
spacing
:
18
Label
{
text
:
"
Triggers For Return Home
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Label
{
text
:
"
Return to Land setup
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Row
{
Row
{
Label
{
text
:
"
Climb to minimum altitude of
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
climbField
.
baseline
}
Label
{
FactTextField
{
id
:
climbField
;
fact
:
autopilot
.
parameters
[
"
RTL_RETURN_ALT
"
];
showUnits
:
true
}
width
:
leftColWidth
text
:
"
RC Transmitter Signal Loss - Return Home After
"
color
:
palette
.
windowText
anchors.baseline
:
rcLossField
.
baseline
}
FactTextField
{
id
:
rcLossField
fact
:
autopilot
.
parameters
[
"
COM_RC_LOSS_T
"
]
showUnits
:
true
}
}
}
Row
{
Row
{
Label
{
text
:
"
When Home is reached, descend to altitude of
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
descendField
.
baseline
}
FactCheckBox
{
FactTextField
{
id
:
descendField
;
fact
:
autopilot
.
parameters
[
"
RTL_DESCEND_ALT
"
];
showUnits
:
true
}
id
:
telemetryLossCheckbox
fact
:
autopilot
.
parameters
[
"
COM_DL_LOSS_EN
"
]
width
:
leftColWidth
checkedValue
:
1
uncheckedValue
:
0
text
:
"
Telemetry Signal Timeout - Return Home After
"
anchors.baseline
:
telemetryLossField
.
baseline
}
FactTextField
{
id
:
telemetryLossField
fact
:
autopilot
.
parameters
[
"
COM_DL_LOSS_T
"
];
showUnits
:
true
}
}
}
//-----------------------------------------------------------------
//-- Return Home Options
Column
{
spacing
:
18
Label
{
text
:
"
Return Home Options
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Row
{
Label
{
width
:
leftColWidth
text
:
"
Climb to minimum altitude of
"
color
:
palette
.
windowText
anchors.baseline
:
climbField
.
baseline
}
FactTextField
{
id
:
climbField
fact
:
autopilot
.
parameters
[
"
RTL_RETURN_ALT
"
]
showUnits
:
true
}
}
}
Row
{
Row
{
CheckBox
{
CheckBox
{
id
:
homeLoiterCheckbox
id
:
homeLoiterCheckbox
property
Fact
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
]
property
Fact
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
]
width
:
leftColWidth
checked
:
fact
.
value
>
0
checked
:
fact
.
value
>
0
text
:
"
Loiter at Home altitude for
"
text
:
"
Loiter at Home altitude for
"
onClicked
:
{
onClicked
:
{
fact
.
value
=
checked
?
60
:
-
1
fact
.
value
=
checked
?
60
:
-
1
}
}
style
:
CheckBoxStyle
{
style
:
CheckBoxStyle
{
label
:
Text
{
label
:
Text
{
color
:
palette
.
windowText
color
:
palette
.
windowText
...
@@ -52,47 +91,43 @@ Rectangle {
...
@@ -52,47 +91,43 @@ Rectangle {
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
];
fact
:
autopilot
.
parameters
[
"
RTL_LAND_DELAY
"
];
showUnits
:
true
showUnits
:
true
anchors.baseline
:
homeLoiterCheckbox
.
baseline
anchors.baseline
:
homeLoiterCheckbox
.
baseline
enabled
:
homeLoiterCheckbox
.
checked
==
true
}
}
}
}
}
//-------------------------------------------------------------
//-- Visible only if loiter above is checked
Column
{
// TODO The "enabled" property could be used instead but it
spacing
:
10
// would have to handle a different "disabled" palette.
Label
{
text
:
"
Return to Land Triggers
"
;
color
:
palette
.
windowText
;
font.pointSize
:
20
}
Row
{
Row
{
FactCheckBox
{
Label
{
id
:
telemetryLossCheckbox
width
:
leftColWidth
;
fact
:
autopilot
.
parameters
[
"
COM_DL_LOSS_EN
"
]
text
:
"
When Home is reached, loiter at an altitude of
"
;
checkedValue
:
1
color
:
palette
.
windowText
;
uncheckedValue
:
0
anchors.baseline
:
descendField
.
baseline
text
:
"
Telemetry signal timeout - Return to Land
"
visible
:
homeLoiterCheckbox
.
checked
==
true
anchors.baseline
:
telemetryLossField
.
baseline
}
}
Label
{
text
:
"
after
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
telemetryLossField
.
baseline
}
FactTextField
{
FactTextField
{
id
:
telemetryLossField
id
:
descendField
;
fact
:
autopilot
.
parameters
[
"
NAV_DLL_N
"
];
fact
:
autopilot
.
parameters
[
"
RTL_DESCEND_ALT
"
];
visible
:
homeLoiterCheckbox
.
checked
==
true
showUnits
:
true
showUnits
:
true
}
}
}
}
Row
{
Label
{
text
:
"
RC Transmitter signal loss - Return to Land after
"
;
color
:
palette
.
windowText
;
anchors.baseline
:
rcLossField
.
baseline
}
FactTextField
{
id
:
rcLossField
;
fact
:
autopilot
.
parameters
[
"
COM_RC_LOSS_T
"
];
showUnits
:
true
}
}
}
}
Text
{
Text
{
width
:
parent
.
width
width
:
parent
.
width
font.pointSize
:
14
text
:
"
Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.
"
;
text
:
"
Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.
"
;
visible
:
autopilot
.
parameters
[
"
NAV_RCL_OBC
"
].
value
==
1
visible
:
autopilot
.
parameters
[
"
NAV_RCL_OBC
"
].
value
!=
0
color
:
palette
.
windowText
color
:
palette
.
windowText
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
}
}
Text
{
Text
{
width
:
parent
.
width
width
:
parent
.
width
font.pointSize
:
14
text
:
"
Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.
"
;
text
:
"
Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.
"
;
visible
:
autopilot
.
parameters
[
"
NAV_DLL_OBC
"
].
value
==
1
visible
:
autopilot
.
parameters
[
"
NAV_DLL_OBC
"
].
value
!=
0
color
:
palette
.
windowText
color
:
palette
.
windowText
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
}
}
...
...
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