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
42e630eb
Commit
42e630eb
authored
Apr 18, 2013
by
Lorenz Meier
Browse files
Fixed up logplayer button
parent
69ef65c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
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