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
82446241
Commit
82446241
authored
Oct 26, 2016
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Objectify log processor.
parent
95f0259e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
239 additions
and
85 deletions
+239
-85
MavlinkLogManager.cc
src/Vehicle/MavlinkLogManager.cc
+209
-63
MavlinkLogManager.h
src/Vehicle/MavlinkLogManager.h
+25
-19
Vehicle.cc
src/Vehicle/Vehicle.cc
+4
-2
Vehicle.h
src/Vehicle/Vehicle.h
+1
-1
No files found.
src/Vehicle/MavlinkLogManager.cc
View file @
82446241
This diff is collapsed.
Click to expand it.
src/Vehicle/MavlinkLogManager.h
View file @
82446241
...
...
@@ -73,24 +73,31 @@ private:
};
//-----------------------------------------------------------------------------
class
CurrentRunningLog
class
MavlinkLogProcessor
{
public:
CurrentRunningLog
()
:
fd
(
NULL
)
,
record
(
NULL
)
,
written
(
0
)
{
}
~
CurrentRunningLog
()
{
close
();
}
void
close
();
FILE
*
fd
;
QString
fileName
;
MavlinkLogFiles
*
record
;
quint32
written
;
MavlinkLogProcessor
();
~
MavlinkLogProcessor
();
void
close
();
bool
valid
();
bool
create
(
MavlinkLogManager
*
manager
,
const
QString
path
,
uint8_t
id
);
MavlinkLogFiles
*
record
()
{
return
_record
;
}
QString
fileName
()
{
return
_fileName
;
}
bool
processStreamData
(
uint16_t
_sequence
,
uint8_t
first_message
,
QByteArray
data
);
private:
bool
_checkSequence
(
uint16_t
seq
,
int
&
num_drops
);
QByteArray
_writeUlogMessage
(
QByteArray
&
data
);
void
_writeData
(
void
*
data
,
int
len
);
private:
FILE
*
_fd
;
quint32
_written
;
int
_sequence
;
int
_numDrops
;
bool
_gotHeader
;
bool
_error
;
QByteArray
_ulogMessage
;
QString
_fileName
;
MavlinkLogFiles
*
_record
;
};
//-----------------------------------------------------------------------------
...
...
@@ -163,7 +170,7 @@ private slots:
void
_dataAvailable
();
void
_uploadProgress
(
qint64
bytesSent
,
qint64
bytesTotal
);
void
_activeVehicleChanged
(
Vehicle
*
vehicle
);
void
_mavlinkLogData
(
Vehicle
*
vehicle
,
uint8_t
target_system
,
uint8_t
target_component
,
uint16_t
sequence
,
uint8_t
length
,
uint8_t
first_message
,
const
uint8_t
*
data
,
bool
acked
);
void
_mavlinkLogData
(
Vehicle
*
vehicle
,
uint8_t
target_system
,
uint8_t
target_component
,
uint16_t
sequence
,
uint8_t
first_message
,
QByteArray
data
,
bool
acked
);
void
_armedChanged
(
bool
armed
);
void
_commandLongAck
(
uint8_t
compID
,
uint16_t
command
,
uint8_t
result
);
void
_processCmdAck
();
...
...
@@ -191,8 +198,7 @@ private:
Vehicle
*
_vehicle
;
bool
_logRunning
;
bool
_loggingDisabled
;
CurrentRunningLog
*
_currentSavingFile
;
uint16_t
_sequence
;
MavlinkLogProcessor
*
_logProcessor
;
bool
_deleteAfterUpload
;
int
_loggingCmdTryCount
;
QTimer
_ackTimer
;
...
...
src/Vehicle/Vehicle.cc
View file @
82446241
...
...
@@ -2015,7 +2015,8 @@ Vehicle::_handleMavlinkLoggingData(mavlink_message_t& message)
{
mavlink_logging_data_t
log
;
mavlink_msg_logging_data_decode
(
&
message
,
&
log
);
emit
mavlinkLogData
(
this
,
log
.
target_system
,
log
.
target_component
,
log
.
sequence
,
log
.
length
,
log
.
first_message_offset
,
log
.
data
,
false
);
emit
mavlinkLogData
(
this
,
log
.
target_system
,
log
.
target_component
,
log
.
sequence
,
log
.
first_message_offset
,
QByteArray
((
const
char
*
)
log
.
data
,
log
.
length
),
false
);
}
//-----------------------------------------------------------------------------
...
...
@@ -2025,7 +2026,8 @@ Vehicle::_handleMavlinkLoggingDataAcked(mavlink_message_t& message)
mavlink_logging_data_t
log
;
mavlink_msg_logging_data_decode
(
&
message
,
&
log
);
_ackMavlinkLogData
(
log
.
sequence
);
emit
mavlinkLogData
(
this
,
log
.
target_system
,
log
.
target_component
,
log
.
sequence
,
log
.
length
,
log
.
first_message_offset
,
log
.
data
,
true
);
emit
mavlinkLogData
(
this
,
log
.
target_system
,
log
.
target_component
,
log
.
sequence
,
log
.
first_message_offset
,
QByteArray
((
const
char
*
)
log
.
data
,
log
.
length
),
true
);
}
//-----------------------------------------------------------------------------
...
...
src/Vehicle/Vehicle.h
View file @
82446241
...
...
@@ -643,7 +643,7 @@ signals:
void
mavlinkScaledImu3
(
mavlink_message_t
message
);
// Mavlink Log Download
void
mavlinkLogData
(
Vehicle
*
vehicle
,
uint8_t
target_system
,
uint8_t
target_component
,
uint16_t
sequence
,
uint8_t
length
,
uint8_t
first_message
,
const
uint8_t
*
data
,
bool
acked
);
void
mavlinkLogData
(
Vehicle
*
vehicle
,
uint8_t
target_system
,
uint8_t
target_component
,
uint16_t
sequence
,
uint8_t
first_message
,
QByteArray
data
,
bool
acked
);
private
slots
:
void
_mavlinkMessageReceived
(
LinkInterface
*
link
,
mavlink_message_t
message
);
...
...
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