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
3deb2c26
Commit
3deb2c26
authored
Apr 18, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mavlink/qgroundcontrol into sensor_hil
parents
2375b7cb
42e630eb
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 @
3deb2c26
...
@@ -22,6 +22,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
...
@@ -22,6 +22,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
binaryBaudRate
(
57600
),
binaryBaudRate
(
57600
),
isPlaying
(
false
),
isPlaying
(
false
),
currPacketCount
(
0
),
currPacketCount
(
0
),
lastLogDirectory
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
)),
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
...
@@ -43,10 +44,12 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
...
@@ -43,10 +44,12 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
setAccelerationFactorInt
(
49
);
setAccelerationFactorInt
(
49
);
ui
->
speedSlider
->
setValue
(
49
);
ui
->
speedSlider
->
setValue
(
49
);
ui
->
positionSlider
->
setValue
(
ui
->
positionSlider
->
minimum
());
ui
->
positionSlider
->
setValue
(
ui
->
positionSlider
->
minimum
());
loadSettings
();
}
}
QGCMAVLinkLogPlayer
::~
QGCMAVLinkLogPlayer
()
QGCMAVLinkLogPlayer
::~
QGCMAVLinkLogPlayer
()
{
{
storeSettings
();
delete
ui
;
delete
ui
;
}
}
...
@@ -167,8 +170,35 @@ bool QGCMAVLinkLogPlayer::reset(int packetIndex)
...
@@ -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
* @param startDirectory Directory where the file dialog will be opened
* @return filename of the logFile
* @return filename of the logFile
*/
*/
...
@@ -182,6 +212,7 @@ bool QGCMAVLinkLogPlayer::selectLogFile(const QString startDirectory)
...
@@ -182,6 +212,7 @@ bool QGCMAVLinkLogPlayer::selectLogFile(const QString startDirectory)
}
}
else
else
{
{
lastLogDirectory
=
fileName
;
return
loadLogFile
(
fileName
);
return
loadLogFile
(
fileName
);
}
}
}
}
...
...
src/ui/QGCMAVLinkLogPlayer.h
View file @
3deb2c26
...
@@ -50,6 +50,8 @@ public slots:
...
@@ -50,6 +50,8 @@ public slots:
bool
reset
(
int
packetIndex
=
0
);
bool
reset
(
int
packetIndex
=
0
);
/** @brief Select logfile */
/** @brief Select logfile */
bool
selectLogFile
(
const
QString
startDirectory
);
bool
selectLogFile
(
const
QString
startDirectory
);
/** @brief Select logfile */
bool
selectLogFile
();
/** @brief Load log file */
/** @brief Load log file */
bool
loadLogFile
(
const
QString
&
file
);
bool
loadLogFile
(
const
QString
&
file
);
/** @brief Jump to a position in the logfile */
/** @brief Jump to a position in the logfile */
...
@@ -81,8 +83,12 @@ protected:
...
@@ -81,8 +83,12 @@ protected:
unsigned
int
currPacketCount
;
unsigned
int
currPacketCount
;
static
const
int
packetLen
=
MAVLINK_MAX_PACKET_LEN
;
static
const
int
packetLen
=
MAVLINK_MAX_PACKET_LEN
;
static
const
int
timeLen
=
sizeof
(
quint64
);
static
const
int
timeLen
=
sizeof
(
quint64
);
QString
lastLogDirectory
;
void
changeEvent
(
QEvent
*
e
);
void
changeEvent
(
QEvent
*
e
);
void
loadSettings
();
void
storeSettings
();
private:
private:
Ui
::
QGCMAVLinkLogPlayer
*
ui
;
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