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
4cfe93cc
Commit
4cfe93cc
authored
Aug 19, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP on airframe config
parent
8917ff17
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1298 additions
and
7 deletions
+1298
-7
QGCPX4VehicleConfig.ui.autosave
src/ui/QGCPX4VehicleConfig.ui.autosave
+1214
-0
QGCPX4AirframeConfig.cc
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
+41
-6
QGCPX4AirframeConfig.h
src/ui/px4_configuration/QGCPX4AirframeConfig.h
+9
-0
QGCPX4AirframeConfig.ui
src/ui/px4_configuration/QGCPX4AirframeConfig.ui
+34
-1
No files found.
src/ui/QGCPX4VehicleConfig.ui.autosave
0 → 100644
View file @
4cfe93cc
This diff is collapsed.
Click to expand it.
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
View file @
4cfe93cc
...
...
@@ -54,27 +54,58 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) :
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
}
void
QGCPX4AirframeConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
component
);
if
(
parameterName
.
contains
(
"SYS_AUTOSTART"
))
{
int
index
=
value
.
toInt
();
if
(
index
>
0
)
{
setAirframeID
(
index
);
ui
->
statusLabel
->
setText
(
tr
(
"Onboard start script ID: #%1"
).
arg
(
index
));
}
else
{
ui
->
statusLabel
->
setText
(
tr
(
"System not configured for autostart."
));
}
}
}
void
QGCPX4AirframeConfig
::
setActiveUAS
(
UASInterface
*
uas
)
{
// if (mav)
if
(
mav
)
{
disconnect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
if
(
!
uas
)
return
;
mav
=
uas
;
connect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
//connect(uas->getParamManager(), SIGNAL())
}
void
QGCPX4AirframeConfig
::
setAirframeID
(
int
id
)
{
selectedId
=
id
;
ui
->
statusLabel
->
setText
(
tr
(
"Ground start script ID: #%1"
).
arg
(
selectedId
));
if
(
id
>
0
&&
id
<
10
)
{
ui
->
planePushButton
->
setChecked
(
true
);
}
else
if
(
id
>
10
&&
id
<
20
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
}
}
void
QGCPX4AirframeConfig
::
applyAndReboot
()
{
// Guard against the case of an edit where we didn't receive all params yet
if
(
selectedId
<
0
)
if
(
selectedId
<
=
0
)
{
QMessageBox
msgBox
;
msgBox
.
setText
(
tr
(
"No airframe selected"
));
...
...
@@ -125,7 +156,9 @@ void QGCPX4AirframeConfig::applyAndReboot()
qDebug
()
<<
"Setting comp"
<<
components
.
first
()
<<
"SYS_AUTOSTART"
<<
(
qint32
)
selectedId
;
mav
->
getParamManager
()
->
setParameter
(
components
.
first
(),
"SYS_AUTOSTART"
,
(
qint32
)
selectedId
);
mav
->
setParameter
(
components
.
first
(),
"SYS_AUTOSTART"
,
(
qint32
)
selectedId
);
//mav->getParamManager()->setParameter(components.first(), "SYS_AUTOSTART", (qint32)selectedId);
// Send pending params
mav
->
getParamManager
()
->
sendPendingParameters
();
...
...
@@ -146,7 +179,7 @@ void QGCPX4AirframeConfig::setAutoConfig(bool enabled)
void
QGCPX4AirframeConfig
::
flyingWingSelected
()
{
ui
->
flyingWingPushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
flyingWingSelected
(
int
index
)
...
...
@@ -157,24 +190,26 @@ void QGCPX4AirframeConfig::flyingWingSelected(int index)
void
QGCPX4AirframeConfig
::
planeSelected
()
{
ui
->
planePushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
planeSelected
(
int
index
)
{
int
system_index
=
ui
->
planeComboBox
->
itemData
(
index
).
toInt
();
planeSelected
();
setAirframeID
(
system_index
);
}
void
QGCPX4AirframeConfig
::
quadXSelected
()
{
ui
->
quadXPushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
quadXSelected
(
int
index
)
{
int
system_index
=
ui
->
quadXComboBox
->
itemData
(
index
).
toInt
();
quadXSelected
();
setAirframeID
(
system_index
);
}
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.h
View file @
4cfe93cc
...
...
@@ -24,6 +24,15 @@ public slots:
*/
void
setActiveUAS
(
UASInterface
*
uas
);
/**
* @brief Handle parameter changes
* @param uas
* @param component
* @param parameterName
* @param value
*/
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
/**
* @brief Quadrotor in X configuration has been selected
*/
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.ui
View file @
4cfe93cc
...
...
@@ -23,7 +23,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<y>
-175
</y>
<width>
762
</width>
<height>
531
</height>
</rect>
...
...
@@ -46,6 +46,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -77,6 +80,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -108,6 +114,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -139,6 +148,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -170,6 +182,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -201,6 +216,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -232,6 +250,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -263,6 +284,9 @@
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
@@ -284,6 +308,15 @@
<property
name=
"text"
>
<string/>
</property>
<property
name=
"iconSize"
>
<size>
<width>
120
</width>
<height>
120
</height>
</size>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
...
...
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