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
ee97864e
Commit
ee97864e
authored
Nov 27, 2016
by
Don Gagne
Committed by
GitHub
Nov 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4258 from DonLakeFlyer/LogSettings
Allow changes of log saving if not armed with reboot
parents
92bf4bd5
5693e862
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
18 deletions
+7
-18
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+6
-10
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+1
-8
No files found.
src/comm/MAVLinkProtocol.cc
View file @
ee97864e
...
...
@@ -57,7 +57,7 @@ MAVLinkProtocol::MAVLinkProtocol(QGCApplication* app)
#ifndef __mobile__
,
_logSuspendError
(
false
)
,
_logSuspendReplay
(
false
)
,
_
logPromptForSave
(
false
)
,
_
vehicleWasArmed
(
false
)
,
_tempLogFile
(
QString
(
"%2.%3"
).
arg
(
_tempLogFileTemplate
).
arg
(
_logFileExtension
))
#endif
,
_linkMgr
(
NULL
)
...
...
@@ -283,11 +283,11 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
}
// Check for the vehicle arming going by. This is used to trigger log save.
if
(
!
_
logPromptForSave
&&
message
.
msgid
==
MAVLINK_MSG_ID_HEARTBEAT
)
{
if
(
!
_
vehicleWasArmed
&&
message
.
msgid
==
MAVLINK_MSG_ID_HEARTBEAT
)
{
mavlink_heartbeat_t
state
;
mavlink_msg_heartbeat_decode
(
&
message
,
&
state
);
if
(
state
.
base_mode
&
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
)
{
_
logPromptForSave
=
true
;
_
vehicleWasArmed
=
true
;
}
}
}
...
...
@@ -429,11 +429,7 @@ void MAVLinkProtocol::_startLogging(void)
return
;
}
if
(
_app
->
promptFlightDataSaveNotArmed
())
{
_logPromptForSave
=
true
;
}
qDebug
()
<<
"Temp log"
<<
_tempLogFile
.
fileName
()
<<
_logPromptForSave
;
qDebug
()
<<
"Temp log"
<<
_tempLogFile
.
fileName
();
_logSuspendError
=
false
;
}
...
...
@@ -444,13 +440,13 @@ void MAVLinkProtocol::_stopLogging(void)
{
if
(
_closeLogFile
())
{
// If the signals are not connected it means we are running a unit test. In that case just delete log files
if
(
_logPromptForSave
&&
_app
->
promptFlightDataSave
())
{
if
(
(
_vehicleWasArmed
||
_app
->
promptFlightDataSaveNotArmed
())
&&
_app
->
promptFlightDataSave
())
{
emit
saveTempFlightDataLog
(
_tempLogFile
.
fileName
());
}
else
{
QFile
::
remove
(
_tempLogFile
.
fileName
());
}
}
_
logPromptForSave
=
false
;
_
vehicleWasArmed
=
false
;
}
/// @brief Checks the temp directory for log files which may have been left there.
...
...
src/comm/MAVLinkProtocol.h
View file @
ee97864e
...
...
@@ -7,13 +7,6 @@
*
****************************************************************************/
/**
* @file
* @brief Definition of class MAVLinkProtocol
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef MAVLINKPROTOCOL_H_
#define MAVLINKPROTOCOL_H_
...
...
@@ -179,7 +172,7 @@ private:
bool
_logSuspendError
;
///< true: Logging suspended due to error
bool
_logSuspendReplay
;
///< true: Logging suspended due to replay
bool
_
logPromptForSave
;
///< true: Prompt for log save when appropriat
e
bool
_
vehicleWasArmed
;
///< true: Vehicle was armed during log sequenc
e
QGCTemporaryFile
_tempLogFile
;
///< File to log to
static
const
char
*
_tempLogFileTemplate
;
///< Template for temporary log file
...
...
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