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
42e630eb
Commit
42e630eb
authored
Apr 18, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed up logplayer button
parent
69ef65c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+32
-1
QGCMAVLinkLogPlayer.h
src/ui/QGCMAVLinkLogPlayer.h
+6
-0
No files found.
src/ui/QGCMAVLinkLogPlayer.cc
View file @
42e630eb
...
...
@@ -22,6 +22,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
binaryBaudRate
(
57600
),
isPlaying
(
false
),
currPacketCount
(
0
),
lastLogDirectory
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
)),
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
{
ui
->
setupUi
(
this
);
...
...
@@ -43,10 +44,12 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
setAccelerationFactorInt
(
49
);
ui
->
speedSlider
->
setValue
(
49
);
ui
->
positionSlider
->
setValue
(
ui
->
positionSlider
->
minimum
());
loadSettings
();
}
QGCMAVLinkLogPlayer
::~
QGCMAVLinkLogPlayer
()
{
storeSettings
();
delete
ui
;
}
...
...
@@ -167,8 +170,35 @@ bool QGCMAVLinkLogPlayer::reset(int packetIndex)
}
}
void
QGCMAVLinkLogPlayer
::
loadSettings
()
{
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAVLINKLOGPLAYER"
);
lastLogDirectory
=
settings
.
value
(
"LAST_LOG_DIRECTORY"
,
lastLogDirectory
).
toString
();
settings
.
endGroup
();
}
void
QGCMAVLinkLogPlayer
::
storeSettings
()
{
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAVLINKLOGPLAYER"
);
settings
.
setValue
(
"LAST_LOG_DIRECTORY"
,
lastLogDirectory
);
settings
.
endGroup
();
settings
.
sync
();
}
/**
* @brief Select a log file
* @param startDirectory Directory where the file dialog will be opened
* @return filename of the logFile
*/
bool
QGCMAVLinkLogPlayer
::
selectLogFile
()
{
return
selectLogFile
(
lastLogDirectory
);
}
/**
* @brief
QGCMAVLinkLogPlayer::selectLogF
ile
* @brief
Select a log f
ile
* @param startDirectory Directory where the file dialog will be opened
* @return filename of the logFile
*/
...
...
@@ -182,6 +212,7 @@ bool QGCMAVLinkLogPlayer::selectLogFile(const QString startDirectory)
}
else
{
lastLogDirectory
=
fileName
;
return
loadLogFile
(
fileName
);
}
}
...
...
src/ui/QGCMAVLinkLogPlayer.h
View file @
42e630eb
...
...
@@ -50,6 +50,8 @@ public slots:
bool
reset
(
int
packetIndex
=
0
);
/** @brief Select logfile */
bool
selectLogFile
(
const
QString
startDirectory
);
/** @brief Select logfile */
bool
selectLogFile
();
/** @brief Load log file */
bool
loadLogFile
(
const
QString
&
file
);
/** @brief Jump to a position in the logfile */
...
...
@@ -81,8 +83,12 @@ protected:
unsigned
int
currPacketCount
;
static
const
int
packetLen
=
MAVLINK_MAX_PACKET_LEN
;
static
const
int
timeLen
=
sizeof
(
quint64
);
QString
lastLogDirectory
;
void
changeEvent
(
QEvent
*
e
);
void
loadSettings
();
void
storeSettings
();
private:
Ui
::
QGCMAVLinkLogPlayer
*
ui
;
};
...
...
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