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
176c2fa0
Commit
176c2fa0
authored
May 27, 2017
by
Jacob Walser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add frame parameter defaults option for Sub
parent
da5d69d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
6 deletions
+73
-6
APMAirframeComponentController.cc
src/AutoPilotPlugins/APM/APMAirframeComponentController.cc
+7
-4
APMSubFrameComponent.qml
src/AutoPilotPlugins/APM/APMSubFrameComponent.qml
+66
-2
No files found.
src/AutoPilotPlugins/APM/APMAirframeComponentController.cc
View file @
176c2fa0
...
...
@@ -40,14 +40,17 @@ APMAirframeComponentController::APMAirframeComponentController(void) :
}
_fillAirFrames
();
Fact
*
frame
;
Fact
*
frame
=
NULL
;
if
(
parameterExists
(
FactSystem
::
defaultComponentId
,
_oldFrameParam
))
{
frame
=
getParameterFact
(
FactSystem
::
defaultComponentId
,
_oldFrameParam
);
}
else
{
}
else
if
(
parameterExists
(
FactSystem
::
defaultComponentId
,
_newFrameParam
))
{
frame
=
getParameterFact
(
FactSystem
::
defaultComponentId
,
_newFrameParam
);
}
connect
(
frame
,
&
Fact
::
rawValueChanged
,
this
,
&
APMAirframeComponentController
::
_factFrameChanged
);
_factFrameChanged
(
frame
->
rawValue
());
if
(
frame
)
{
connect
(
frame
,
&
Fact
::
rawValueChanged
,
this
,
&
APMAirframeComponentController
::
_factFrameChanged
);
_factFrameChanged
(
frame
->
rawValue
());
}
}
APMAirframeComponentController
::~
APMAirframeComponentController
()
...
...
src/AutoPilotPlugins/APM/APMSubFrameComponent.qml
View file @
176c2fa0
...
...
@@ -10,16 +10,26 @@
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controllers
1.0
SetupPage
{
id
:
subFramePage
pageComponent
:
subFramePageComponent
property
var
_flatParamList
:
ListModel
{
ListElement
{
name
:
"
Blue Robotics BlueROV2
"
file
:
"
Sub/bluerov2-3_5.params
"
}
}
APMAirframeComponentController
{
id
:
controller
;
factPanel
:
subFramePage
.
viewPanel
}
Component
{
id
:
subFramePageComponent
...
...
@@ -28,8 +38,6 @@ SetupPage {
id
:
mainColumn
width
:
availableWidth
FactPanelController
{
id
:
controller
;
factPanel
:
subFramePage
.
viewPanel
}
QGCPalette
{
id
:
palette
;
colorGroupEnabled
:
true
}
property
Fact
_frameConfig
:
controller
.
getParameterFact
(
-
1
,
"
FRAME_CONFIG
"
)
...
...
@@ -100,6 +108,19 @@ SetupPage {
}
}
Item
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
defaultsButton
.
height
QGCButton
{
id
:
defaultsButton
anchors.left
:
parent
.
left
text
:
qsTr
(
"
Load Vehicle Default Parameters
"
)
onClicked
:
showDialog
(
selectParamFileDialogComponent
,
qsTr
(
"
Load Vehicle Default Parameters
"
),
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
}
Flow
{
id
:
flowView
width
:
parent
.
width
...
...
@@ -148,4 +169,47 @@ SetupPage {
}
// Flow
}
// Column
}
// Component
Component
{
id
:
selectParamFileDialogComponent
QGCViewDialog
{
QGCLabel
{
id
:
applyParamsText
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.margins
:
_margins
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Select your vehicle to load the default parameters:
"
)
}
Flow
{
anchors.margins
:
_margins
anchors.top
:
applyParamsText
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
spacing
:
_margins
layoutDirection
:
Qt
.
Vertical
;
Repeater
{
id
:
airframePicker
model
:
_flatParamList
delegate
:
QGCButton
{
width
:
parent
.
width
/
2.1
height
:
(
ScreenTools
.
defaultFontPixelHeight
*
14
)
/
5
text
:
name
onClicked
:
{
controller
.
loadParameters
(
file
)
hideDialog
()
}
}
}
}
}
}
}
// SetupPage
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