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
f643bdea
Commit
f643bdea
authored
Aug 21, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed states of airframe UI, not tested with system yet
parent
e0cf53eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
QGCPX4AirframeConfig.cc
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
+17
-17
No files found.
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
View file @
f643bdea
#include <QMessageBox>
#include <QDebug>
#include "QGCPX4AirframeConfig.h"
#include "ui_QGCPX4AirframeConfig.h"
...
...
@@ -20,18 +21,22 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) :
ui
->
planeComboBox
->
addItem
(
tr
(
"Multiplex Easystar 1/2"
),
100
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Hobbyking Bixler 1/2"
),
101
);
connect
(
ui
->
planePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
planeSelected
()));
connect
(
ui
->
planeComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
planeSelected
(
int
)));
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Bormatec Camflyer Q"
),
30
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Phantom FPV"
),
31
);
connect
(
ui
->
flyingWingPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
flyingWingSelected
()));
connect
(
ui
->
flyingWingComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
flyingWingSelected
(
int
)));
ui
->
quadXComboBox
->
addItem
(
tr
(
"Standard 10
\"
Quad"
),
1
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F330 8
\"
Quad"
),
10
);
connect
(
ui
->
quadXPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
quadXSelected
()));
connect
(
ui
->
quadXComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
quadXSelected
(
int
)));
connect
(
ui
->
quadPlusPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
quadPlusSelected
()));
connect
(
ui
->
quadPlusComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
quadPlusSelected
(
int
)));
connect
(
ui
->
hexaXComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
hexaXSelected
(
int
)));
...
...
@@ -103,6 +108,7 @@ void QGCPX4AirframeConfig::uncheckAll()
void
QGCPX4AirframeConfig
::
setAirframeID
(
int
id
)
{
selectedId
=
id
;
qDebug
()
<<
"ID"
<<
id
;
ui
->
statusLabel
->
setText
(
tr
(
"Ground start script ID: #%1"
).
arg
(
selectedId
));
// XXX too much boilerplate code here - this widget is really just
...
...
@@ -119,10 +125,12 @@ void QGCPX4AirframeConfig::setAirframeID(int id)
else
if
(
id
>=
30
&&
id
<
50
)
{
ui
->
flyingWingPushButton
->
setChecked
(
true
);
ui
->
statusLabel
->
setText
(
tr
(
"Selected flying wing (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
100
&&
id
<
150
)
{
ui
->
planePushButton
->
setChecked
(
true
);
ui
->
statusLabel
->
setText
(
tr
(
"Selected plane (ID: #%1)"
).
arg
(
selectedId
));
}
}
...
...
@@ -200,8 +208,7 @@ void QGCPX4AirframeConfig::setAutoConfig(bool enabled)
void
QGCPX4AirframeConfig
::
flyingWingSelected
()
{
uncheckAll
();
ui
->
flyingWingPushButton
->
setChecked
(
true
);
flyingWingSelected
(
ui
->
flyingWingComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
flyingWingSelected
(
int
index
)
...
...
@@ -212,35 +219,30 @@ void QGCPX4AirframeConfig::flyingWingSelected(int index)
void
QGCPX4AirframeConfig
::
planeSelected
()
{
uncheckAll
();
ui
->
planePushButton
->
setChecked
(
true
);
planeSelected
(
ui
->
planeComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
planeSelected
(
int
index
)
{
int
system_index
=
ui
->
planeComboBox
->
itemData
(
index
).
toInt
();
planeSelected
();
setAirframeID
(
system_index
);
}
void
QGCPX4AirframeConfig
::
quadXSelected
()
{
uncheckAll
();
ui
->
quadXPushButton
->
setChecked
(
true
);
quadXSelected
(
ui
->
quadXComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
quadXSelected
(
int
index
)
{
int
system_index
=
ui
->
quadXComboBox
->
itemData
(
index
).
toInt
();
quadXSelected
();
setAirframeID
(
system_index
);
}
void
QGCPX4AirframeConfig
::
quadPlusSelected
()
{
uncheckAll
();
ui
->
quadPlusPushButton
->
setChecked
(
true
);
quadPlusSelected
(
ui
->
quadPlusComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
quadPlusSelected
(
int
index
)
...
...
@@ -251,8 +253,7 @@ void QGCPX4AirframeConfig::quadPlusSelected(int index)
void
QGCPX4AirframeConfig
::
hexaXSelected
()
{
uncheckAll
();
ui
->
hexaPlusPushButton
->
setChecked
(
true
);
hexaXSelected
(
ui
->
hexaXComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
hexaXSelected
(
int
index
)
...
...
@@ -263,7 +264,7 @@ void QGCPX4AirframeConfig::hexaXSelected(int index)
void
QGCPX4AirframeConfig
::
hexaPlusSelected
()
{
uncheckAll
(
);
hexaPlusSelected
(
ui
->
hexaPlusComboBox
->
currentIndex
()
);
}
void
QGCPX4AirframeConfig
::
hexaPlusSelected
(
int
index
)
...
...
@@ -274,7 +275,7 @@ void QGCPX4AirframeConfig::hexaPlusSelected(int index)
void
QGCPX4AirframeConfig
::
octoXSelected
()
{
uncheckAll
(
);
octoXSelected
(
ui
->
octoXComboBox
->
currentIndex
()
);
}
void
QGCPX4AirframeConfig
::
octoXSelected
(
int
index
)
...
...
@@ -285,7 +286,7 @@ void QGCPX4AirframeConfig::octoXSelected(int index)
void
QGCPX4AirframeConfig
::
octoPlusSelected
()
{
uncheckAll
(
);
octoPlusSelected
(
ui
->
octoPlusComboBox
->
currentIndex
()
);
}
void
QGCPX4AirframeConfig
::
octoPlusSelected
(
int
index
)
...
...
@@ -296,8 +297,7 @@ void QGCPX4AirframeConfig::octoPlusSelected(int index)
void
QGCPX4AirframeConfig
::
hSelected
()
{
uncheckAll
();
ui
->
hPushButton
->
setChecked
(
true
);
hSelected
(
ui
->
hComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
hSelected
(
int
index
)
...
...
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