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
6a48cef3
Commit
6a48cef3
authored
Dec 28, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up PX4 autostart, made indices consistent and added new configs
parent
f566744a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
31 deletions
+124
-31
QGCPX4AirframeConfig.cc
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
+91
-26
QGCPX4AirframeConfig.h
src/ui/px4_configuration/QGCPX4AirframeConfig.h
+4
-3
QGCPX4AirframeConfig.ui
src/ui/px4_configuration/QGCPX4AirframeConfig.ui
+29
-2
No files found.
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
View file @
6a48cef3
...
...
@@ -25,51 +25,73 @@ 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"
),
100
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Hobbyking Bixler 1/2"
),
101
);
ui
->
planeComboBox
->
addItem
(
tr
(
"HilStar (SIMULATION)"
),
1000
);
ui
->
simComboBox
->
addItem
(
tr
(
"HilStar (SIMULATION)"
),
1000
);
connect
(
ui
->
simPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
simSelected
()));
connect
(
ui
->
simComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
simSelected
(
int
)));
ui
->
simPushButton
->
setEnabled
(
ui
->
simComboBox
->
count
()
>
0
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Multiplex Easystar 1/2"
),
2100
);
ui
->
planeComboBox
->
addItem
(
tr
(
"Hobbyking Bixler 1/2"
),
2101
);
connect
(
ui
->
planePushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
planeSelected
()));
connect
(
ui
->
planeComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
planeSelected
(
int
)));
ui
->
planePushButton
->
setEnabled
(
ui
->
planeComboBox
->
count
()
>
0
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Bormatec Camflyer Q"
),
30
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Phantom FPV"
),
31
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Bormatec Camflyer Q (800 mm)"
),
3030
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Z-84 Wing Wing (845 mm)"
),
3033
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"FX-61 Phantom FPV (1550 mm)"
),
3031
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"FX-79 Buffalo (2000 mm)"
),
3034
);
ui
->
flyingWingComboBox
->
addItem
(
tr
(
"Skywalker X5 (1180 mm)"
),
3032
);
connect
(
ui
->
flyingWingPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
flyingWingSelected
()));
connect
(
ui
->
flyingWingComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
flyingWingSelected
(
int
)));
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F330 8
\"
Quad"
),
10
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F450 10
\"
Quad"
),
11
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"Turnigy Talon v2 X550 Quad"
),
666
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"AR.Drone Frame Quad"
),
8
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"AR.Drone Quad (w. PX4FLOW)"
),
9
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F330 8
\"
Quad"
),
4010
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F450 10
\"
Quad"
),
4011
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"Turnigy Talon v2 X550 Quad"
),
4012
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"AR.Drone Frame Quad"
),
4008
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"AR.Drone Quad (w. PX4FLOW)"
),
4009
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"DJI F330 with MK BLCTRL"
),
4017
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"Mikrokopter X frame"
),
4019
);
connect
(
ui
->
quadXPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
quadXSelected
()));
connect
(
ui
->
quadXComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
quadXSelected
(
int
)));
ui
->
quadXPushButton
->
setEnabled
(
ui
->
quadXComboBox
->
count
()
>
0
);
ui
->
quadPlusComboBox
->
addItem
(
tr
(
"DJI F330 8
\"
Quad"
),
4010
);
ui
->
quadXComboBox
->
addItem
(
tr
(
"Mikrokopter + frame"
),
5020
);
connect
(
ui
->
quadPlusPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
quadPlusSelected
()));
connect
(
ui
->
quadPlusComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
quadPlusSelected
(
int
)));
ui
->
quadPlusPushButton
->
setEnabled
(
ui
->
quadPlusComboBox
->
count
()
>
0
);
ui
->
hexaPlusComboBox
->
addItem
(
tr
(
"DJI F550 10
\"
Hexa"
),
6012
);
connect
(
ui
->
hexaXPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
hexaXSelected
()));
connect
(
ui
->
hexaXComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
hexaXSelected
(
int
)));
ui
->
hexaXPushButton
->
setEnabled
(
ui
->
hexaXComboBox
->
count
()
>
0
);
ui
->
hexaPlusComboBox
->
addItem
(
tr
(
"DJI F550 10
\"
Hexa"
),
7013
);
connect
(
ui
->
hexaPlusPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
hexaPlusSelected
()));
connect
(
ui
->
hexaPlusComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
hexaPlusSelected
(
int
)));
ui
->
hexaPlusPushButton
->
setEnabled
(
ui
->
hexaPlusComboBox
->
count
()
>
0
);
ui
->
octoXComboBox
->
addItem
(
tr
(
"Standard 10
\"
Octo"
),
8001
);
connect
(
ui
->
octoXPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
octoXSelected
()));
connect
(
ui
->
octoXComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
octoXSelected
(
int
)));
ui
->
octoXPushButton
->
setEnabled
(
ui
->
octoXComboBox
->
count
()
>
0
);
ui
->
octoPlusComboBox
->
addItem
(
tr
(
"Standard 10
\"
Octo"
),
9001
);
connect
(
ui
->
octoPlusPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
octoPlusSelected
()));
connect
(
ui
->
octoPlusComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
octoPlusSelected
(
int
)));
ui
->
octoPlusPushButton
->
setEnabled
(
ui
->
octoPlusComboBox
->
count
()
>
0
);
ui
->
hComboBox
->
addItem
(
tr
(
"3DR Iris"
),
16
);
ui
->
hComboBox
->
addItem
(
tr
(
"TBS Discovery"
),
15
);
ui
->
hComboBox
->
addItem
(
tr
(
"3DR Iris"
),
1
001
6
);
ui
->
hComboBox
->
addItem
(
tr
(
"TBS Discovery"
),
1
001
5
);
connect
(
ui
->
hPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
hSelected
()));
connect
(
ui
->
hComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
hSelected
(
int
)));
...
...
@@ -144,29 +166,62 @@ void QGCPX4AirframeConfig::setAirframeID(int id)
// a quick hack to get started
uncheckAll
();
if
(
id
>
0
&&
id
<
15
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
ui
->
quadXComboBox
->
setCurrentIndex
(
ui
->
quadXComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected quad X (ID: #%1)"
).
arg
(
selectedId
));
if
(
id
>=
1000
&&
id
<
2000
)
{
ui
->
simPushButton
->
setChecked
(
true
);
ui
->
simComboBox
->
setCurrentIndex
(
ui
->
simComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected simulation (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
15
&&
id
<
2
0
)
else
if
(
id
>=
2000
&&
id
<
300
0
)
{
ui
->
h
PushButton
->
setChecked
(
true
);
ui
->
hComboBox
->
setCurrentIndex
(
ui
->
h
ComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected
H Fram
e (ID: #%1)"
).
arg
(
selectedId
));
ui
->
plane
PushButton
->
setChecked
(
true
);
ui
->
planeComboBox
->
setCurrentIndex
(
ui
->
plane
ComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected
plan
e (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
30
&&
id
<
5
0
)
else
if
(
id
>=
30
00
&&
id
<
400
0
)
{
ui
->
flyingWingPushButton
->
setChecked
(
true
);
ui
->
flyingWingComboBox
->
setCurrentIndex
(
ui
->
flyingWingComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected flying wing (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
100
&&
id
<
150
||
id
>=
1000
<=
2000
)
else
if
(
id
>=
4000
&&
id
<
5000
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
ui
->
quadXComboBox
->
setCurrentIndex
(
ui
->
quadXComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected quadrotor in X config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
5000
&&
id
<
6000
)
{
ui
->
quadPlusPushButton
->
setChecked
(
true
);
ui
->
quadPlusComboBox
->
setCurrentIndex
(
ui
->
quadPlusComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected quadrotor in + config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
6000
&&
id
<
7000
)
{
ui
->
hexaXPushButton
->
setChecked
(
true
);
ui
->
hexaXComboBox
->
setCurrentIndex
(
ui
->
hexaXComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected hexarotor in X config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
7000
&&
id
<
8000
)
{
ui
->
hexaPlusPushButton
->
setChecked
(
true
);
ui
->
hexaPlusComboBox
->
setCurrentIndex
(
ui
->
hexaPlusComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected hexarotor in + config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
8000
&&
id
<
9000
)
{
ui
->
octoXPushButton
->
setChecked
(
true
);
ui
->
octoXComboBox
->
setCurrentIndex
(
ui
->
octoXComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected octorotor in X config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
9000
&&
id
<
10000
)
{
ui
->
octoPlusPushButton
->
setChecked
(
true
);
ui
->
octoPlusComboBox
->
setCurrentIndex
(
ui
->
octoPlusComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected octorotor in + config (ID: #%1)"
).
arg
(
selectedId
));
}
else
if
(
id
>=
10000
&&
id
<
11000
)
{
ui
->
plane
PushButton
->
setChecked
(
true
);
ui
->
planeComboBox
->
setCurrentIndex
(
ui
->
plane
ComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected
plane
(ID: #%1)"
).
arg
(
selectedId
));
ui
->
h
PushButton
->
setChecked
(
true
);
ui
->
hComboBox
->
setCurrentIndex
(
ui
->
h
ComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected
H frame multirotor
(ID: #%1)"
).
arg
(
selectedId
));
}
}
void
QGCPX4AirframeConfig
::
applyAndReboot
()
...
...
@@ -363,6 +418,17 @@ void QGCPX4AirframeConfig::setAutoConfig(bool enabled)
paramMgr
->
setPendingParam
(
0
,
"SYS_AUTOCONFIG"
,
(
qint32
)
((
enabled
)
?
1
:
0
));
}
void
QGCPX4AirframeConfig
::
simSelected
()
{
simSelected
(
ui
->
simComboBox
->
currentIndex
());
}
void
QGCPX4AirframeConfig
::
simSelected
(
int
index
)
{
int
system_index
=
ui
->
simComboBox
->
itemData
(
index
).
toInt
();
setAirframeID
(
system_index
);
}
void
QGCPX4AirframeConfig
::
flyingWingSelected
()
{
flyingWingSelected
(
ui
->
flyingWingComboBox
->
currentIndex
());
...
...
@@ -385,7 +451,6 @@ void QGCPX4AirframeConfig::planeSelected(int index)
setAirframeID
(
system_index
);
}
void
QGCPX4AirframeConfig
::
quadXSelected
()
{
quadXSelected
(
ui
->
quadXComboBox
->
currentIndex
());
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.h
View file @
6a48cef3
...
...
@@ -46,11 +46,12 @@ public slots:
*/
void
quadXSelected
(
int
index
);
void
flyingWing
Selected
();
void
flyingWing
Selected
(
int
index
);
void
sim
Selected
();
void
sim
Selected
(
int
index
);
void
planeSelected
();
void
planeSelected
(
int
index
);
void
flyingWingSelected
();
void
flyingWingSelected
(
int
index
);
void
quadPlusSelected
();
void
quadPlusSelected
(
int
index
);
void
hexaXSelected
();
...
...
src/ui/px4_configuration/QGCPX4AirframeConfig.ui
View file @
6a48cef3
...
...
@@ -26,6 +26,12 @@
</item>
<item
row=
"0"
column=
"0"
colspan=
"4"
>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"baseSize"
>
<size>
<width>
0
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
</property>
...
...
@@ -33,9 +39,9 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<y>
-282
</y>
<width>
762
</width>
<height>
6
47
</height>
<height>
6
38
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
...
...
@@ -345,6 +351,27 @@
</item>
</layout>
</item>
<item
row=
"2"
column=
"1"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_10"
>
<item>
<widget
class=
"QPushButton"
name=
"simPushButton"
>
<property
name=
"text"
>
<string>
Simulation Setup
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"simComboBox"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"text"
>
<string>
Simulation / Experimental
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
...
...
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