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
fb582986
Commit
fb582986
authored
Nov 06, 2012
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed logging
parent
12cdc471
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
LogCompressor.cc
src/LogCompressor.cc
+6
-3
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+1
-1
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+5
-5
No files found.
src/LogCompressor.cc
View file @
fb582986
...
...
@@ -28,6 +28,8 @@ This file is part of the QGROUNDCONTROL project
*/
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QTemporaryFile>
#include <QTextStream>
#include <QStringList>
...
...
@@ -64,14 +66,15 @@ void LogCompressor::run()
QString
outFileName
;
QStringList
parts
=
QFileInfo
(
infile
.
fileName
()).
absoluteFilePath
().
split
(
"."
,
QString
::
SkipEmptyParts
);
QStringList
parts
=
QFileInfo
(
infile
.
fileName
()).
absoluteFilePath
().
split
(
"."
,
QString
::
SkipEmptyParts
);
parts
.
replace
(
parts
.
size
()
-
2
,
"compressed."
+
parts
.
last
());
parts
.
replace
(
0
,
parts
.
first
()
+
"_compressed"
);
parts
.
replace
(
parts
.
size
()
-
1
,
"txt"
);
outFileName
=
parts
.
join
(
"."
);
// Verify that the output file is useable
QFile
outTmpFile
(
outFileName
);
if
(
!
outTmpFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
if
(
!
outTmpFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
|
QIODevice
::
Truncate
))
{
emit
logProcessingStatusChanged
(
tr
(
"Log Compressor: Cannot start/compress log file, since output file %1 is not writable"
).
arg
(
QFileInfo
(
outTmpFile
.
fileName
()).
absoluteFilePath
()));
return
;
}
...
...
src/ui/linechart/LinechartPlot.cc
View file @
fb582986
...
...
@@ -47,7 +47,7 @@ LinechartPlot::LinechartPlot(QWidget *parent, int plotid, quint64 interval): Qwt
this
->
plotid
=
plotid
;
this
->
plotInterval
=
interval
;
maxValue
=
DBL_MIN
;
maxValue
=
-
DBL_MAX
;
minValue
=
DBL_MAX
;
//lastMaxTimeAdded = QTime();
...
...
src/ui/linechart/LinechartWidget.cc
View file @
fb582986
...
...
@@ -548,13 +548,13 @@ void LinechartWidget::startLogging()
// Let user select the log file name
//QDate date(QDate::currentDate());
// QString("./pixhawk-log-" + date.toString("yyyy-MM-dd") + "-" + QString::number(logindex) + ".log")
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"Logfile (*.
csv *.txt
);;"
));
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"Logfile (*.
log
);;"
));
while
(
!
(
fileName
.
endsWith
(
".
txt"
)
||
fileName
.
endsWith
(
".csv
"
))
&&
!
abort
&&
fileName
!=
""
)
{
while
(
!
(
fileName
.
endsWith
(
".
log
"
))
&&
!
abort
&&
fileName
!=
""
)
{
QMessageBox
msgBox
;
msgBox
.
setIcon
(
QMessageBox
::
Critical
);
msgBox
.
setText
(
"Unsuitable file extension for logfile"
);
msgBox
.
setInformativeText
(
"Please choose .
txt or .csv
as file extension. Click OK to change the file extension, cancel to not start logging."
);
msgBox
.
setInformativeText
(
"Please choose .
log
as file extension. Click OK to change the file extension, cancel to not start logging."
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
|
QMessageBox
::
Cancel
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
if
(
msgBox
.
exec
()
!=
QMessageBox
::
Ok
)
...
...
@@ -562,7 +562,7 @@ void LinechartWidget::startLogging()
abort
=
true
;
break
;
}
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"Logfile (*.
txt *.csv
);;"
));
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"Logfile (*.
log
);;"
));
}
qDebug
()
<<
"SAVE FILE"
<<
fileName
;
...
...
@@ -570,7 +570,7 @@ void LinechartWidget::startLogging()
// Check if the user did not abort the file save dialog
if
(
!
abort
&&
fileName
!=
""
)
{
logFile
=
new
QFile
(
fileName
);
if
(
logFile
->
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
if
(
logFile
->
open
(
QIODevice
::
Truncate
|
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
logging
=
true
;
logStartTime
=
0
;
curvesWidget
->
setEnabled
(
false
);
...
...
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