Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
9d413108
Commit
9d413108
authored
Dec 29, 2016
by
Gus Grubba
Browse files
Disabling MAVLink 2.0 logging for APM.
parent
671a465f
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Vehicle/MAVLinkLogManager.cc
View file @
9d413108
...
...
@@ -243,7 +243,7 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message,
if
(
!
_gotHeader
)
{
if
(
data
.
size
()
<
16
)
{
//-- Shouldn't happen but if it does, we might as well close shop.
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Corrupt log header. Canceling log download."
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Corrupt log header. Canceling log download."
;
return
false
;
}
//-- Write header
...
...
@@ -327,7 +327,7 @@ MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app)
_logPath
+=
"/MAVLinkLogs"
;
if
(
!
QDir
(
_logPath
).
exists
())
{
if
(
!
QDir
().
mkpath
(
_logPath
))
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Could not create MAVLink log download path:"
<<
_logPath
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Could not create MAVLink log download path:"
<<
_logPath
;
_loggingDisabled
=
true
;
}
}
...
...
@@ -604,7 +604,7 @@ MAVLinkLogManager::cancelUpload()
void
MAVLinkLogManager
::
startLogging
()
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
if
(
_createNewLog
())
{
_vehicle
->
startMavlinkLog
();
_logRunning
=
true
;
...
...
@@ -617,7 +617,7 @@ MAVLinkLogManager::startLogging()
void
MAVLinkLogManager
::
stopLogging
()
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
//-- Tell vehicle to stop sending logs
_vehicle
->
stopMavlinkLog
();
}
...
...
@@ -660,16 +660,16 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
defaultDescription
=
kDefaultDescr
;
}
if
(
_emailAddress
.
isEmpty
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"User email missing."
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"User email missing."
;
return
false
;
}
if
(
_uploadURL
.
isEmpty
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Upload URL missing."
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Upload URL missing."
;
return
false
;
}
QFileInfo
fi
(
logFile
);
if
(
!
fi
.
exists
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Log file missing:"
<<
logFile
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Log file missing:"
<<
logFile
;
return
false
;
}
QFile
*
file
=
new
QFile
(
logFile
);
...
...
@@ -677,7 +677,7 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
if
(
file
)
{
delete
file
;
}
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Could not open log file:"
<<
logFile
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Could not open log file:"
<<
logFile
;
return
false
;
}
if
(
!
_nam
)
{
...
...
@@ -826,7 +826,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
// far, I'm working on the assumption that multiple vehicles is a rare exception.
// For now, we only handle one log download at a time.
// Disconnect the previous one (if any)
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
disconnect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavCommandResult
,
this
,
&
MAVLinkLogManager
::
_mavCommandResult
);
...
...
@@ -836,7 +836,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
emit
canStartLogChanged
();
}
// Connect new system
if
(
vehicle
)
{
if
(
_
vehicle
&&
_vehicle
->
px4Firmware
()
)
{
_vehicle
=
vehicle
;
connect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
connect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
...
...
@@ -851,7 +851,7 @@ MAVLinkLogManager::_mavlinkLogData(Vehicle* /*vehicle*/, uint8_t /*target_system
{
if
(
_logProcessor
&&
_logProcessor
->
valid
())
{
if
(
!
_logProcessor
->
processStreamData
(
sequence
,
first_message
,
data
))
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Error writing MAVLink log file:"
<<
_logProcessor
->
fileName
();
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Error writing MAVLink log file:"
<<
_logProcessor
->
fileName
();
delete
_logProcessor
;
_logProcessor
=
NULL
;
_logRunning
=
false
;
...
...
@@ -916,7 +916,7 @@ MAVLinkLogManager::_createNewLog()
_insertNewLog
(
_logProcessor
->
record
());
emit
logFilesChanged
();
}
else
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Could not create MAVLink log file:"
<<
_logProcessor
->
fileName
();
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Could not create MAVLink log file:"
<<
_logProcessor
->
fileName
();
delete
_logProcessor
;
_logProcessor
=
NULL
;
}
...
...
@@ -927,7 +927,7 @@ MAVLinkLogManager::_createNewLog()
void
MAVLinkLogManager
::
_armedChanged
(
bool
armed
)
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
if
(
armed
)
{
if
(
_enableAutoStart
)
{
startLogging
();
...
...
src/ui/preferences/MavlinkSettings.qml
View file @
9d413108
...
...
@@ -160,7 +160,7 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
id
:
mavlogLabel
text
:
qsTr
(
"
Vehicle
MAVLink Logging
"
)
text
:
qsTr
(
"
MAVLink
2.0
Logging
(PX4 Firmware Only)
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
...
...
@@ -220,7 +220,7 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
id
:
logLabel
text
:
qsTr
(
"
MAVLink Log Uploads
"
)
text
:
qsTr
(
"
MAVLink
2.0
Log Uploads
(PX4 Firmware Only)
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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