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
9d413108
Commit
9d413108
authored
Dec 29, 2016
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabling MAVLink 2.0 logging for APM.
parent
671a465f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
MAVLinkLogManager.cc
src/Vehicle/MAVLinkLogManager.cc
+13
-13
MavlinkSettings.qml
src/ui/preferences/MavlinkSettings.qml
+2
-2
No files found.
src/Vehicle/MAVLinkLogManager.cc
View file @
9d413108
...
@@ -243,7 +243,7 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message,
...
@@ -243,7 +243,7 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message,
if
(
!
_gotHeader
)
{
if
(
!
_gotHeader
)
{
if
(
data
.
size
()
<
16
)
{
if
(
data
.
size
()
<
16
)
{
//-- Shouldn't happen but if it does, we might as well close shop.
//-- 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
;
return
false
;
}
}
//-- Write header
//-- Write header
...
@@ -327,7 +327,7 @@ MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app)
...
@@ -327,7 +327,7 @@ MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app)
_logPath
+=
"/MAVLinkLogs"
;
_logPath
+=
"/MAVLinkLogs"
;
if
(
!
QDir
(
_logPath
).
exists
())
{
if
(
!
QDir
(
_logPath
).
exists
())
{
if
(
!
QDir
().
mkpath
(
_logPath
))
{
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
;
_loggingDisabled
=
true
;
}
}
}
}
...
@@ -604,7 +604,7 @@ MAVLinkLogManager::cancelUpload()
...
@@ -604,7 +604,7 @@ MAVLinkLogManager::cancelUpload()
void
void
MAVLinkLogManager
::
startLogging
()
MAVLinkLogManager
::
startLogging
()
{
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
if
(
_createNewLog
())
{
if
(
_createNewLog
())
{
_vehicle
->
startMavlinkLog
();
_vehicle
->
startMavlinkLog
();
_logRunning
=
true
;
_logRunning
=
true
;
...
@@ -617,7 +617,7 @@ MAVLinkLogManager::startLogging()
...
@@ -617,7 +617,7 @@ MAVLinkLogManager::startLogging()
void
void
MAVLinkLogManager
::
stopLogging
()
MAVLinkLogManager
::
stopLogging
()
{
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
//-- Tell vehicle to stop sending logs
//-- Tell vehicle to stop sending logs
_vehicle
->
stopMavlinkLog
();
_vehicle
->
stopMavlinkLog
();
}
}
...
@@ -660,16 +660,16 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
...
@@ -660,16 +660,16 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
defaultDescription
=
kDefaultDescr
;
defaultDescription
=
kDefaultDescr
;
}
}
if
(
_emailAddress
.
isEmpty
())
{
if
(
_emailAddress
.
isEmpty
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"User email missing."
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"User email missing."
;
return
false
;
return
false
;
}
}
if
(
_uploadURL
.
isEmpty
())
{
if
(
_uploadURL
.
isEmpty
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Upload URL missing."
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Upload URL missing."
;
return
false
;
return
false
;
}
}
QFileInfo
fi
(
logFile
);
QFileInfo
fi
(
logFile
);
if
(
!
fi
.
exists
())
{
if
(
!
fi
.
exists
())
{
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Log file missing:"
<<
logFile
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Log file missing:"
<<
logFile
;
return
false
;
return
false
;
}
}
QFile
*
file
=
new
QFile
(
logFile
);
QFile
*
file
=
new
QFile
(
logFile
);
...
@@ -677,7 +677,7 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
...
@@ -677,7 +677,7 @@ MAVLinkLogManager::_sendLog(const QString& logFile)
if
(
file
)
{
if
(
file
)
{
delete
file
;
delete
file
;
}
}
qC
Critical
(
MAVLinkLogManagerLog
)
<<
"Could not open log file:"
<<
logFile
;
qC
Warning
(
MAVLinkLogManagerLog
)
<<
"Could not open log file:"
<<
logFile
;
return
false
;
return
false
;
}
}
if
(
!
_nam
)
{
if
(
!
_nam
)
{
...
@@ -826,7 +826,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
...
@@ -826,7 +826,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
// far, I'm working on the assumption that multiple vehicles is a rare exception.
// 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.
// For now, we only handle one log download at a time.
// Disconnect the previous one (if any)
// Disconnect the previous one (if any)
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
disconnect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
disconnect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavCommandResult
,
this
,
&
MAVLinkLogManager
::
_mavCommandResult
);
disconnect
(
_vehicle
,
&
Vehicle
::
mavCommandResult
,
this
,
&
MAVLinkLogManager
::
_mavCommandResult
);
...
@@ -836,7 +836,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
...
@@ -836,7 +836,7 @@ MAVLinkLogManager::_activeVehicleChanged(Vehicle* vehicle)
emit
canStartLogChanged
();
emit
canStartLogChanged
();
}
}
// Connect new system
// Connect new system
if
(
vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
_vehicle
=
vehicle
;
_vehicle
=
vehicle
;
connect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
connect
(
_vehicle
,
&
Vehicle
::
armedChanged
,
this
,
&
MAVLinkLogManager
::
_armedChanged
);
connect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
connect
(
_vehicle
,
&
Vehicle
::
mavlinkLogData
,
this
,
&
MAVLinkLogManager
::
_mavlinkLogData
);
...
@@ -851,7 +851,7 @@ MAVLinkLogManager::_mavlinkLogData(Vehicle* /*vehicle*/, uint8_t /*target_system
...
@@ -851,7 +851,7 @@ MAVLinkLogManager::_mavlinkLogData(Vehicle* /*vehicle*/, uint8_t /*target_system
{
{
if
(
_logProcessor
&&
_logProcessor
->
valid
())
{
if
(
_logProcessor
&&
_logProcessor
->
valid
())
{
if
(
!
_logProcessor
->
processStreamData
(
sequence
,
first_message
,
data
))
{
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
;
delete
_logProcessor
;
_logProcessor
=
NULL
;
_logProcessor
=
NULL
;
_logRunning
=
false
;
_logRunning
=
false
;
...
@@ -916,7 +916,7 @@ MAVLinkLogManager::_createNewLog()
...
@@ -916,7 +916,7 @@ MAVLinkLogManager::_createNewLog()
_insertNewLog
(
_logProcessor
->
record
());
_insertNewLog
(
_logProcessor
->
record
());
emit
logFilesChanged
();
emit
logFilesChanged
();
}
else
{
}
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
;
delete
_logProcessor
;
_logProcessor
=
NULL
;
_logProcessor
=
NULL
;
}
}
...
@@ -927,7 +927,7 @@ MAVLinkLogManager::_createNewLog()
...
@@ -927,7 +927,7 @@ MAVLinkLogManager::_createNewLog()
void
void
MAVLinkLogManager
::
_armedChanged
(
bool
armed
)
MAVLinkLogManager
::
_armedChanged
(
bool
armed
)
{
{
if
(
_vehicle
)
{
if
(
_vehicle
&&
_vehicle
->
px4Firmware
()
)
{
if
(
armed
)
{
if
(
armed
)
{
if
(
_enableAutoStart
)
{
if
(
_enableAutoStart
)
{
startLogging
();
startLogging
();
...
...
src/ui/preferences/MavlinkSettings.qml
View file @
9d413108
...
@@ -160,7 +160,7 @@ Rectangle {
...
@@ -160,7 +160,7 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
QGCLabel
{
id
:
mavlogLabel
id
:
mavlogLabel
text
:
qsTr
(
"
Vehicle MAVLink Logging
"
)
text
:
qsTr
(
"
MAVLink 2.0 Logging (PX4 Firmware Only)
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
}
}
...
@@ -220,7 +220,7 @@ Rectangle {
...
@@ -220,7 +220,7 @@ Rectangle {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
QGCLabel
{
id
:
logLabel
id
:
logLabel
text
:
qsTr
(
"
MAVLink
Log Uploads
"
)
text
:
qsTr
(
"
MAVLink
2.0 Log Uploads (PX4 Firmware Only)
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
}
}
...
...
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