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
e0cf53eb
Commit
e0cf53eb
authored
Aug 20, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Buggy WIP on airframe selection
parent
2d0575fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
16 deletions
+54
-16
style-dark.css
files/styles/style-dark.css
+7
-0
QGCPX4AirframeConfig.cc
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
+45
-15
QGCPX4AirframeConfig.h
src/ui/px4_configuration/QGCPX4AirframeConfig.h
+2
-1
No files found.
files/styles/style-dark.css
View file @
e0cf53eb
...
...
@@ -356,6 +356,13 @@ QPushButton#octoXPushButton, QPushButton#octoPlusPushButton, QPushButton#hPushBu
border
:
3px
solid
#465158
;
}
QPushButton
:checked
#planePushButton
,
QPushButton
:checked
#flyingWingPushButton
,
QPushButton
:checked
#quadXPushButton
,
QPushButton
:checked
#quadPlusPushButton
,
QPushButton
:checked
#hexaXPushButton
,
QPushButton
:checked
#hexaPlusPushButton
,
QPushButton
:checked
#octoXPushButton
,
QPushButton
:checked
#octoPlusPushButton
,
QPushButton
:checked
#hPushButton
{
background-color
:
qlineargradient
(
x1
:
0
,
y1
:
0
,
x2
:
0
,
y2
:
1
,
stop
:
0
#77F
,
stop
:
1
#33A
);
border
:
3px
solid
#4651A8
;
}
QPushButton
#viewModeGeneric
,
QPushButton
#viewModePX4
,
QPushButton
#viewModeAPM
,
QPushButton
#viewModeAR
{
background-color
:
qlineargradient
(
x1
:
0
,
y1
:
0
,
x2
:
0
,
y2
:
1
,
stop
:
0
#73D95D
,
stop
:
1
#18A154
);
border-radius
:
12px
;
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
View file @
e0cf53eb
...
...
@@ -17,13 +17,13 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) :
// Fill the lists here manually in accordance with the list from:
// https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/rcS
ui
->
planeComboBox
->
addItem
(
tr
(
"Multiplex Easystar 1/2"
),
1
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Hobbyking Bixler 1/2"
),
10
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Multiplex Easystar 1/2"
),
1
00
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Hobbyking Bixler 1/2"
),
10
1
);
connect
(
ui
->
planeComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
planeSelected
(
int
)));
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Bormatec Camflyer Q"
),
1
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Phantom FPV"
),
10
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Bormatec Camflyer Q"
),
30
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Phantom FPV"
),
31
);
connect
(
ui
->
flyingWingComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
flyingWingSelected
(
int
)));
...
...
@@ -76,6 +76,7 @@ void QGCPX4AirframeConfig::setActiveUAS(UASInterface* uas)
if
(
mav
)
{
disconnect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
mav
=
NULL
;
}
if
(
!
uas
)
...
...
@@ -84,8 +85,19 @@ void QGCPX4AirframeConfig::setActiveUAS(UASInterface* uas)
mav
=
uas
;
connect
(
mav
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)),
this
,
SLOT
(
parameterChanged
(
int
,
int
,
QString
,
QVariant
)));
}
//connect(uas->getParamManager(), SIGNAL())
void
QGCPX4AirframeConfig
::
uncheckAll
()
{
ui
->
planePushButton
->
setChecked
(
false
);
ui
->
flyingWingPushButton
->
setChecked
(
false
);
ui
->
quadXPushButton
->
setChecked
(
false
);
ui
->
quadPlusPushButton
->
setChecked
(
false
);
ui
->
hexaXPushButton
->
setChecked
(
false
);
ui
->
hexaPlusPushButton
->
setChecked
(
false
);
ui
->
octoXPushButton
->
setChecked
(
false
);
ui
->
octoPlusPushButton
->
setChecked
(
false
);
ui
->
hPushButton
->
setChecked
(
false
);
}
void
QGCPX4AirframeConfig
::
setAirframeID
(
int
id
)
...
...
@@ -93,12 +105,24 @@ 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
);
// XXX too much boilerplate code here - this widget is really just
// a quick hack to get started
uncheckAll
();
if
(
id
>
0
&&
id
<
15
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
}
else
if
(
id
>
10
&&
id
<
20
)
else
if
(
id
>
=
15
&&
id
<
20
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
ui
->
hPushButton
->
setChecked
(
true
);
}
else
if
(
id
>=
30
&&
id
<
50
)
{
ui
->
flyingWingPushButton
->
setChecked
(
true
);
}
else
if
(
id
>=
100
&&
id
<
150
)
{
ui
->
planePushButton
->
setChecked
(
true
);
}
}
...
...
@@ -176,6 +200,7 @@ void QGCPX4AirframeConfig::setAutoConfig(bool enabled)
void
QGCPX4AirframeConfig
::
flyingWingSelected
()
{
uncheckAll
();
ui
->
flyingWingPushButton
->
setChecked
(
true
);
}
...
...
@@ -187,6 +212,7 @@ void QGCPX4AirframeConfig::flyingWingSelected(int index)
void
QGCPX4AirframeConfig
::
planeSelected
()
{
uncheckAll
();
ui
->
planePushButton
->
setChecked
(
true
);
}
...
...
@@ -200,6 +226,7 @@ void QGCPX4AirframeConfig::planeSelected(int index)
void
QGCPX4AirframeConfig
::
quadXSelected
()
{
uncheckAll
();
ui
->
quadXPushButton
->
setChecked
(
true
);
}
...
...
@@ -212,7 +239,8 @@ void QGCPX4AirframeConfig::quadXSelected(int index)
void
QGCPX4AirframeConfig
::
quadPlusSelected
()
{
uncheckAll
();
ui
->
quadPlusPushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
quadPlusSelected
(
int
index
)
...
...
@@ -223,7 +251,8 @@ void QGCPX4AirframeConfig::quadPlusSelected(int index)
void
QGCPX4AirframeConfig
::
hexaXSelected
()
{
uncheckAll
();
ui
->
hexaPlusPushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
hexaXSelected
(
int
index
)
...
...
@@ -234,7 +263,7 @@ void QGCPX4AirframeConfig::hexaXSelected(int index)
void
QGCPX4AirframeConfig
::
hexaPlusSelected
()
{
uncheckAll
();
}
void
QGCPX4AirframeConfig
::
hexaPlusSelected
(
int
index
)
...
...
@@ -245,7 +274,7 @@ void QGCPX4AirframeConfig::hexaPlusSelected(int index)
void
QGCPX4AirframeConfig
::
octoXSelected
()
{
uncheckAll
();
}
void
QGCPX4AirframeConfig
::
octoXSelected
(
int
index
)
...
...
@@ -256,7 +285,7 @@ void QGCPX4AirframeConfig::octoXSelected(int index)
void
QGCPX4AirframeConfig
::
octoPlusSelected
()
{
uncheckAll
();
}
void
QGCPX4AirframeConfig
::
octoPlusSelected
(
int
index
)
...
...
@@ -267,7 +296,8 @@ void QGCPX4AirframeConfig::octoPlusSelected(int index)
void
QGCPX4AirframeConfig
::
hSelected
()
{
uncheckAll
();
ui
->
hPushButton
->
setChecked
(
true
);
}
void
QGCPX4AirframeConfig
::
hSelected
(
int
index
)
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.h
View file @
e0cf53eb
...
...
@@ -81,7 +81,8 @@ protected:
*/
void
setAutoConfig
(
bool
enabled
);
void
uncheckAll
();
private:
UASInterface
*
mav
;
int
selectedId
;
...
...
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