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
cbd12e14
Commit
cbd12e14
authored
Aug 22, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show message box, handle USB link disconnect for user
parent
c8e46217
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
QGCPX4AirframeConfig.cc
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
+25
-3
No files found.
src/ui/px4_configuration/QGCPX4AirframeConfig.cc
View file @
cbd12e14
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include "ui_QGCPX4AirframeConfig.h"
#include "ui_QGCPX4AirframeConfig.h"
#include "UASManager.h"
#include "UASManager.h"
#include "LinkManager.h"
#include "UAS.h"
#include "UAS.h"
QGCPX4AirframeConfig
::
QGCPX4AirframeConfig
(
QWidget
*
parent
)
:
QGCPX4AirframeConfig
::
QGCPX4AirframeConfig
(
QWidget
*
parent
)
:
...
@@ -111,9 +112,14 @@ void QGCPX4AirframeConfig::uncheckAll()
...
@@ -111,9 +112,14 @@ void QGCPX4AirframeConfig::uncheckAll()
void
QGCPX4AirframeConfig
::
setAirframeID
(
int
id
)
void
QGCPX4AirframeConfig
::
setAirframeID
(
int
id
)
{
{
qDebug
()
<<
"setAirframeID"
<<
id
;
ui
->
statusLabel
->
setText
(
tr
(
"Start script ID: #%1"
).
arg
(
id
));
if
(
selectedId
==
id
)
return
;
selectedId
=
id
;
selectedId
=
id
;
qDebug
()
<<
"setAirframeID"
<<
selectedId
;
ui
->
statusLabel
->
setText
(
tr
(
"Ground start script ID: #%1"
).
arg
(
selectedId
));
// XXX too much boilerplate code here - this widget is really just
// XXX too much boilerplate code here - this widget is really just
// a quick hack to get started
// a quick hack to get started
...
@@ -121,20 +127,25 @@ void QGCPX4AirframeConfig::setAirframeID(int id)
...
@@ -121,20 +127,25 @@ void QGCPX4AirframeConfig::setAirframeID(int id)
if
(
id
>
0
&&
id
<
15
)
{
if
(
id
>
0
&&
id
<
15
)
{
ui
->
quadXPushButton
->
setChecked
(
true
);
ui
->
quadXPushButton
->
setChecked
(
true
);
ui
->
quadXComboBox
->
setCurrentIndex
(
ui
->
quadXComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected quad X (ID: #%1)"
).
arg
(
selectedId
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected quad X (ID: #%1)"
).
arg
(
selectedId
));
}
}
else
if
(
id
>=
15
&&
id
<
20
)
else
if
(
id
>=
15
&&
id
<
20
)
{
{
ui
->
hPushButton
->
setChecked
(
true
);
ui
->
hPushButton
->
setChecked
(
true
);
ui
->
hComboBox
->
setCurrentIndex
(
ui
->
hComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected H Frame (ID: #%1)"
).
arg
(
selectedId
));
}
}
else
if
(
id
>=
30
&&
id
<
50
)
else
if
(
id
>=
30
&&
id
<
50
)
{
{
ui
->
flyingWingPushButton
->
setChecked
(
true
);
ui
->
flyingWingPushButton
->
setChecked
(
true
);
ui
->
flyingWingComboBox
->
setCurrentIndex
(
ui
->
flyingWingComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected flying wing (ID: #%1)"
).
arg
(
selectedId
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected flying wing (ID: #%1)"
).
arg
(
selectedId
));
}
}
else
if
(
id
>=
100
&&
id
<
150
)
else
if
(
id
>=
100
&&
id
<
150
)
{
{
ui
->
planePushButton
->
setChecked
(
true
);
ui
->
planePushButton
->
setChecked
(
true
);
ui
->
planeComboBox
->
setCurrentIndex
(
ui
->
planeComboBox
->
findData
(
id
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected plane (ID: #%1)"
).
arg
(
selectedId
));
ui
->
statusLabel
->
setText
(
tr
(
"Selected plane (ID: #%1)"
).
arg
(
selectedId
));
}
}
}
}
...
@@ -204,8 +215,19 @@ void QGCPX4AirframeConfig::applyAndReboot()
...
@@ -204,8 +215,19 @@ void QGCPX4AirframeConfig::applyAndReboot()
// Reboot
// Reboot
//TODO right now this relies upon the above send & persist finishing before the reboot command is received...
//TODO right now this relies upon the above send & persist finishing before the reboot command is received...
QGC
::
SLEEP
::
sleep
(
5
);
QMessageBox
msgBox
(
this
);
msgBox
.
setText
(
tr
(
"Storing Parameters and Rebooting Autopilot"
));
msgBox
.
setInformativeText
(
tr
(
"Please wait a few seconds for the reboot to complete."
));
msgBox
.
setStandardButtons
(
QMessageBox
::
NoButton
);
msgBox
.
setModal
(
false
);
msgBox
.
show
();
QGC
::
SLEEP
::
sleep
(
2
);
mav
->
executeCommand
(
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
,
1
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0
);
mav
->
executeCommand
(
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
,
1
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
,
0
);
QGC
::
SLEEP
::
msleep
(
200
);
LinkManager
::
instance
()
->
disconnectAll
();
QGC
::
SLEEP
::
sleep
(
8
);
LinkManager
::
instance
()
->
connectAll
();
msgBox
.
close
();
}
}
void
QGCPX4AirframeConfig
::
setAutoConfig
(
bool
enabled
)
void
QGCPX4AirframeConfig
::
setAutoConfig
(
bool
enabled
)
...
...
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