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
a0bb4bbb
Commit
a0bb4bbb
authored
May 13, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1561 from DonLakeFlyer/AirframeConfig
Airframe Config: No longer tries to reconnect after reboot
parents
bc71d49d
2fa21491
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
48 deletions
+40
-48
AirframeComponent.qml
src/AutoPilotPlugins/PX4/AirframeComponent.qml
+35
-13
AirframeComponentController.cc
src/AutoPilotPlugins/PX4/AirframeComponentController.cc
+5
-3
QGCApplication.cc
src/QGCApplication.cc
+0
-26
QGCApplication.h
src/QGCApplication.h
+0
-6
No files found.
src/AutoPilotPlugins/PX4/AirframeComponent.qml
View file @
a0bb4bbb
...
...
@@ -51,7 +51,7 @@ QGCView {
onCompleted
:
{
if
(
controller
.
showCustomConfigPanel
)
{
panel
.
showDialog
(
customConfigDialog
,
"
Custom Airframe Config
"
,
50
,
StandardButton
.
Reset
)
panel
.
showDialog
(
customConfigDialog
Component
,
"
Custom Airframe Config
"
,
50
,
StandardButton
.
Reset
)
}
}
}
...
...
@@ -62,23 +62,45 @@ QGCView {
}
Component
{
id
:
customConfigDialog
id
:
customConfigDialog
Component
QGCLabel
{
id
:
customConfigPanel
anchors.fill
:
parent
wrapMode
:
Text
.
WordWrap
text
:
"
Your vehicle is using a custom airframe configuration.
"
+
"
This configuration can only be modified through the Parameter Editor.
\n\n
"
+
"
If you want to Reset your airframe configuration and select a standard configuration, click 'Reset' above.
"
signal
hideDialog
QGCViewDialog
{
id
:
customConfigDialog
Fact
{
id
:
sys_autostart
;
name
:
"
SYS_AUTOSTART
"
}
function
accept
()
{
sys_autostart
.
value
=
0
customConfigPanel
.
hideDialog
()
customConfigDialog
.
hideDialog
()
}
QGCLabel
{
anchors.fill
:
parent
wrapMode
:
Text
.
WordWrap
text
:
"
Your vehicle is using a custom airframe configuration.
"
+
"
This configuration can only be modified through the Parameter Editor.
\n\n
"
+
"
If you want to Reset your airframe configuration and select a standard configuration, click 'Reset' above.
"
}
}
}
Component
{
id
:
applyRestartDialogComponent
QGCViewDialog
{
id
:
applyRestartDialog
function
accept
()
{
controller
.
changeAutostart
()
applyRestartDialog
.
hideDialog
()
}
QGCLabel
{
anchors.fill
:
parent
wrapMode
:
Text
.
WordWrap
text
:
"
Clicking Apply will save the changes you have made to your aiframe configuration.
"
+
"
Your vehicle will also be rebooted in order to complete the process.
"
+
"
After your vehicle reboots, you can reconnect it to QGroundControl.
"
}
}
}
...
...
@@ -117,7 +139,7 @@ QGCView {
anchors.right
:
parent
.
right
text
:
"
Apply and Restart
"
onClicked
:
{
controller
.
changeAutostart
()
}
onClicked
:
panel
.
showDialog
(
applyRestartDialogComponent
,
"
Apply and Restart
"
,
50
,
StandardButton
.
Apply
|
StandardButton
.
Cancel
)
}
Item
{
...
...
src/AutoPilotPlugins/PX4/AirframeComponentController.cc
View file @
a0bb4bbb
...
...
@@ -101,24 +101,26 @@ void AirframeComponentController::changeAutostart(void)
return
;
}
qgcApp
()
->
setOverrideCursor
(
Qt
::
WaitCursor
);
_autopilot
->
getParameterFact
(
"SYS_AUTOSTART"
)
->
setValue
(
_autostartId
);
_autopilot
->
getParameterFact
(
"SYS_AUTOCONFIG"
)
->
setValue
(
1
);
qgcApp
()
->
setOverrideCursor
(
Qt
::
WaitCursor
);
// Wait for the parameters to flow through system
qgcApp
()
->
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
QGC
::
SLEEP
::
sleep
(
1
);
qgcApp
()
->
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
// Reboot board
and reconnect
// Reboot board
_uas
->
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
);
qgcApp
()
->
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
QGC
::
SLEEP
::
sleep
(
1
);
qgcApp
()
->
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
LinkManager
::
instance
()
->
disconnectAll
();
qgcApp
()
->
re
connectAfterWait
(
5
);
qgcApp
()
->
re
storeOverrideCursor
(
);
}
AirframeType
::
AirframeType
(
const
QString
&
name
,
const
QString
&
imageResource
,
QObject
*
parent
)
:
...
...
src/QGCApplication.cc
View file @
a0bb4bbb
...
...
@@ -655,32 +655,6 @@ void QGCApplication::_loadCurrentStyle(void)
restoreOverrideCursor
();
}
void
QGCApplication
::
reconnectAfterWait
(
int
waitSeconds
)
{
LinkManager
*
linkManager
=
LinkManager
::
instance
();
Q_ASSERT
(
linkManager
);
Q_ASSERT
(
linkManager
->
getLinks
().
count
()
==
1
);
LinkInterface
*
link
=
linkManager
->
getLinks
()[
0
];
// Save the link configuration so we can restart the link laster
_reconnectLinkConfig
=
LinkConfiguration
::
duplicateSettings
(
linkManager
->
getLinks
()[
0
]
->
getLinkConfiguration
());
// Disconnect and wait
linkManager
->
disconnectLink
(
link
);
QTimer
::
singleShot
(
waitSeconds
*
1000
,
this
,
&
QGCApplication
::
_reconnect
);
}
void
QGCApplication
::
_reconnect
(
void
)
{
Q_ASSERT
(
_reconnectLinkConfig
);
qgcApp
()
->
restoreOverrideCursor
();
LinkManager
::
instance
()
->
createConnectedLink
(
_reconnectLinkConfig
);
_reconnectLinkConfig
=
NULL
;
}
void
QGCApplication
::
reportMissingFact
(
const
QString
&
name
)
{
_missingFacts
+=
name
;
...
...
src/QGCApplication.h
View file @
a0bb4bbb
...
...
@@ -96,9 +96,6 @@ public:
/// Set the current UI style
void
setStyle
(
bool
styleIsDark
);
/// Disconnects the current link and waits for the specified number of seconds before reconnecting.
void
reconnectAfterWait
(
int
waitSeconds
);
/// Used to report a missing Fact. Warning will be displayed to user. Method may be called
/// multiple times.
void
reportMissingFact
(
const
QString
&
name
);
...
...
@@ -143,7 +140,6 @@ public:
static
QGCApplication
*
_app
;
///< Our own singleton. Should be reference directly by qgcApp
private
slots
:
void
_reconnect
(
void
);
void
_missingFactsDisplay
(
void
);
private:
...
...
@@ -167,8 +163,6 @@ private:
static
const
char
*
_lightStyleFile
;
bool
_styleIsDark
;
///< true: dark style, false: light style
LinkConfiguration
*
_reconnectLinkConfig
;
///< Configuration to reconnect for reconnectAfterWait
static
const
int
_missingFactDelayedDisplayTimerTimeout
=
1000
;
///< Timeout to wait for next missing fact to come in before display
QTimer
_missingFactDelayedDisplayTimer
;
///< Timer use to delay missing fact display
QStringList
_missingFacts
;
///< List of missing facts to be displayed
...
...
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