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
efb95d00
Commit
efb95d00
authored
Jan 09, 2012
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed log buttons, replay pausing does not work yet properly, but issue / solution is now known
parent
c31ba506
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
53 deletions
+120
-53
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+91
-41
MAVLinkSettingsWidget.cc
src/ui/MAVLinkSettingsWidget.cc
+17
-8
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+9
-2
QGCMAVLinkLogPlayer.h
src/ui/QGCMAVLinkLogPlayer.h
+1
-0
QGCToolBar.cc
src/ui/QGCToolBar.cc
+2
-2
No files found.
src/comm/MAVLinkProtocol.cc
View file @
efb95d00
This diff is collapsed.
Click to expand it.
src/ui/MAVLinkSettingsWidget.cc
View file @
efb95d00
...
...
@@ -161,12 +161,14 @@ void MAVLinkSettingsWidget::chooseLogfileName()
{
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify MAVLink log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"MAVLink Logfile (*.mavlink);;"
));
if
(
!
fileName
.
endsWith
(
".mavlink"
))
{
if
(
!
fileName
.
endsWith
(
".mavlink"
))
{
fileName
.
append
(
".mavlink"
);
}
QFileInfo
file
(
fileName
);
if
(
file
.
exists
()
&&
!
file
.
isWritable
())
{
if
(
file
.
exists
()
&&
!
file
.
isWritable
())
{
QMessageBox
msgBox
;
msgBox
.
setIcon
(
QMessageBox
::
Critical
);
msgBox
.
setText
(
tr
(
"The selected logfile is not writable"
));
...
...
@@ -174,7 +176,9 @@ void MAVLinkSettingsWidget::chooseLogfileName()
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
}
else
{
}
else
{
updateLogfileName
(
fileName
);
protocol
->
setLogfileName
(
fileName
);
}
...
...
@@ -189,12 +193,15 @@ void MAVLinkSettingsWidget::enableDroneOS(bool enable)
// Delete from all lists first
UDPLink
*
firstUdp
=
NULL
;
QList
<
LinkInterface
*>
links
=
LinkManager
::
instance
()
->
getLinksForProtocol
(
protocol
);
foreach
(
LinkInterface
*
link
,
links
)
{
foreach
(
LinkInterface
*
link
,
links
)
{
UDPLink
*
udp
=
dynamic_cast
<
UDPLink
*>
(
link
);
if
(
udp
)
{
if
(
udp
)
{
if
(
!
firstUdp
)
firstUdp
=
udp
;
// Remove current hosts
for
(
int
i
=
0
;
i
<
m_ui
->
droneOSComboBox
->
count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
m_ui
->
droneOSComboBox
->
count
();
++
i
)
{
QString
oldHostString
=
m_ui
->
droneOSComboBox
->
itemText
(
i
);
oldHostString
=
hostString
.
split
(
":"
).
first
();
udp
->
removeHost
(
oldHostString
);
...
...
@@ -203,8 +210,10 @@ void MAVLinkSettingsWidget::enableDroneOS(bool enable)
}
// Re-add if enabled
if
(
enable
)
{
if
(
firstUdp
)
{
if
(
enable
)
{
if
(
firstUdp
)
{
firstUdp
->
addHost
(
hostString
);
}
// Set key
...
...
src/ui/QGCMAVLinkLogPlayer.cc
View file @
efb95d00
...
...
@@ -21,6 +21,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
mavlinkLogFormat
(
true
),
binaryBaudRate
(
57600
),
isPlaying
(
false
),
currPacketCount
(
0
),
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
{
ui
->
setupUi
(
this
);
...
...
@@ -102,6 +103,7 @@ void QGCMAVLinkLogPlayer::play()
loopTimer
.
start
(
interval
*
accelerationFactor
);
}
isPlaying
=
true
;
ui
->
logStatsLabel
->
setText
(
tr
(
"Started playing.."
));
ui
->
playButton
->
setIcon
(
QIcon
(
":images/actions/media-playback-pause.svg"
));
}
else
...
...
@@ -272,7 +274,8 @@ bool QGCMAVLinkLogPlayer::loadLogFile(const QString& file)
minutes
-=
60
*
hours
;
QString
timelabel
=
tr
(
"%1h:%2m:%3s"
).
arg
(
hours
,
2
).
arg
(
minutes
,
2
).
arg
(
seconds
,
2
);
ui
->
logStatsLabel
->
setText
(
tr
(
"%2 MB, %3 packets, %4"
).
arg
(
logFileInfo
.
size
()
/
1000000.0
f
,
0
,
'f'
,
2
).
arg
(
logFileInfo
.
size
()
/
(
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
))).
arg
(
timelabel
));
currPacketCount
=
logFileInfo
.
size
()
/
(
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
));
ui
->
logStatsLabel
->
setText
(
tr
(
"%2 MB, %3 packets, %4"
).
arg
(
logFileInfo
.
size
()
/
1000000.0
f
,
0
,
'f'
,
2
).
arg
(
currPacketCount
).
arg
(
timelabel
));
}
else
{
...
...
@@ -302,6 +305,10 @@ bool QGCMAVLinkLogPlayer::loadLogFile(const QString& file)
QString
timelabel
=
tr
(
"%1h:%2m:%3s"
).
arg
(
hours
,
2
).
arg
(
minutes
,
2
).
arg
(
seconds
,
2
);
ui
->
logStatsLabel
->
setText
(
tr
(
"%2 MB, %4 at %5 KB/s"
).
arg
(
logFileInfo
.
size
()
/
1000000.0
f
,
0
,
'f'
,
2
).
arg
(
timelabel
).
arg
(
binaryBaudRate
/
10.0
f
/
1024.0
f
,
0
,
'f'
,
2
));
}
// Reset current state
reset
(
0
);
return
true
;
}
}
...
...
@@ -458,7 +465,7 @@ void QGCMAVLinkLogPlayer::logLoop()
// Update status label
// Update progress bar
if
(
loopCounter
%
40
==
0
)
if
(
loopCounter
%
40
==
0
||
currPacketCount
<
500
)
{
QFileInfo
logFileInfo
(
logFile
);
int
progress
=
(
ui
->
positionSlider
->
maximum
()
-
ui
->
positionSlider
->
minimum
())
*
(
logFile
.
pos
()
/
static_cast
<
float
>
(
logFileInfo
.
size
()));
...
...
src/ui/QGCMAVLinkLogPlayer.h
View file @
efb95d00
...
...
@@ -78,6 +78,7 @@ protected:
bool
mavlinkLogFormat
;
int
binaryBaudRate
;
bool
isPlaying
;
unsigned
int
currPacketCount
;
static
const
int
packetLen
=
MAVLINK_MAX_PACKET_LEN
;
static
const
int
timeLen
=
sizeof
(
quint64
);
void
changeEvent
(
QEvent
*
e
);
...
...
src/ui/QGCToolBar.cc
View file @
efb95d00
...
...
@@ -45,7 +45,7 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
toggleLoggingAction
=
new
QAction
(
QIcon
(
":"
),
"Logging"
,
this
);
toggleLoggingAction
->
setCheckable
(
true
);
logReplayAction
=
new
QAction
(
QIcon
(
":"
),
"Replay"
,
this
);
logReplayAction
->
setCheckable
(
tru
e
);
logReplayAction
->
setCheckable
(
fals
e
);
addAction
(
toggleLoggingAction
);
addAction
(
logReplayAction
);
...
...
@@ -143,7 +143,7 @@ void QGCToolBar::logging(bool enabled)
}
QFileInfo
file
(
fileName
);
if
(
file
.
exists
()
&&
!
file
.
isWritable
(
))
if
(
(
file
.
exists
()
&&
!
file
.
isWritable
()
))
{
QMessageBox
msgBox
;
msgBox
.
setIcon
(
QMessageBox
::
Critical
);
...
...
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