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
1c7769f4
Commit
1c7769f4
authored
Mar 22, 2012
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed canceling the Logging function through the button on the main toolbar.
parent
ebfb5edb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
QGCToolBar.cc
src/ui/QGCToolBar.cc
+18
-6
QGCToolBar.h
src/ui/QGCToolBar.h
+2
-2
No files found.
src/ui/QGCToolBar.cc
View file @
1c7769f4
...
@@ -49,7 +49,6 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
...
@@ -49,7 +49,6 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
addAction
(
toggleLoggingAction
);
addAction
(
toggleLoggingAction
);
addAction
(
logReplayAction
);
addAction
(
logReplayAction
);
// addSeparator();
// CREATE TOOLBAR ITEMS
// CREATE TOOLBAR ITEMS
// Add internal actions
// Add internal actions
...
@@ -123,7 +122,7 @@ void QGCToolBar::setLogPlayer(QGCMAVLinkLogPlayer* player)
...
@@ -123,7 +122,7 @@ void QGCToolBar::setLogPlayer(QGCMAVLinkLogPlayer* player)
connect
(
logReplayAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
playLogFile
(
bool
)));
connect
(
logReplayAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
playLogFile
(
bool
)));
}
}
void
QGCToolBar
::
playLogFile
(
bool
enabl
ed
)
void
QGCToolBar
::
playLogFile
(
bool
check
ed
)
{
{
// Check if player exists
// Check if player exists
if
(
player
)
if
(
player
)
...
@@ -133,7 +132,7 @@ void QGCToolBar::playLogFile(bool enabled)
...
@@ -133,7 +132,7 @@ void QGCToolBar::playLogFile(bool enabled)
if
(
player
->
isPlayingLogFile
())
if
(
player
->
isPlayingLogFile
())
{
{
player
->
playPause
(
false
);
player
->
playPause
(
false
);
if
(
enabl
ed
)
if
(
check
ed
)
{
{
if
(
!
player
->
selectLogFile
())
return
;
if
(
!
player
->
selectLogFile
())
return
;
}
}
...
@@ -143,23 +142,35 @@ void QGCToolBar::playLogFile(bool enabled)
...
@@ -143,23 +142,35 @@ void QGCToolBar::playLogFile(bool enabled)
{
{
if
(
!
player
->
selectLogFile
())
return
;
if
(
!
player
->
selectLogFile
())
return
;
}
}
player
->
playPause
(
enabl
ed
);
player
->
playPause
(
check
ed
);
}
}
}
}
void
QGCToolBar
::
logging
(
bool
enabl
ed
)
void
QGCToolBar
::
logging
(
bool
check
ed
)
{
{
// Stop logging in any case
// Stop logging in any case
MainWindow
::
instance
()
->
getMAVLink
()
->
enableLogging
(
false
);
MainWindow
::
instance
()
->
getMAVLink
()
->
enableLogging
(
false
);
if
(
enabled
)
// If the user is enabling logging
if
(
checked
)
{
{
// Prompt the user for a filename/location to save to
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify MAVLink log file to save to"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"MAVLink Logfile (*.mavlink *.log *.bin);;"
));
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify MAVLink log file to save to"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"MAVLink Logfile (*.mavlink *.log *.bin);;"
));
// Check that they didn't cancel out
if
(
fileName
.
isNull
())
{
toggleLoggingAction
->
setChecked
(
false
);
return
;
}
// Make sure the file's named properly
if
(
!
fileName
.
endsWith
(
".mavlink"
))
if
(
!
fileName
.
endsWith
(
".mavlink"
))
{
{
fileName
.
append
(
".mavlink"
);
fileName
.
append
(
".mavlink"
);
}
}
// Check that we can save the logfile
QFileInfo
file
(
fileName
);
QFileInfo
file
(
fileName
);
if
((
file
.
exists
()
&&
!
file
.
isWritable
()))
if
((
file
.
exists
()
&&
!
file
.
isWritable
()))
{
{
...
@@ -171,6 +182,7 @@ void QGCToolBar::logging(bool enabled)
...
@@ -171,6 +182,7 @@ void QGCToolBar::logging(bool enabled)
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
msgBox
.
exec
();
}
}
// Otherwise we're off and logging
else
else
{
{
MainWindow
::
instance
()
->
getMAVLink
()
->
setLogfileName
(
fileName
);
MainWindow
::
instance
()
->
getMAVLink
()
->
setLogfileName
(
fileName
);
...
...
src/ui/QGCToolBar.h
View file @
1c7769f4
...
@@ -55,9 +55,9 @@ public slots:
...
@@ -55,9 +55,9 @@ public slots:
/** @brief Received system text message */
/** @brief Received system text message */
void
receiveTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
void
receiveTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
/** @brief Start / stop logging */
/** @brief Start / stop logging */
void
logging
(
bool
enabl
ed
);
void
logging
(
bool
check
ed
);
/** @brief Start playing logfile */
/** @brief Start playing logfile */
void
playLogFile
(
bool
enabl
ed
);
void
playLogFile
(
bool
check
ed
);
/** @brief Set log playing component */
/** @brief Set log playing component */
void
setLogPlayer
(
QGCMAVLinkLogPlayer
*
player
);
void
setLogPlayer
(
QGCMAVLinkLogPlayer
*
player
);
/** @brief Update battery charge state */
/** @brief Update battery charge state */
...
...
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