summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-03-29 21:26:29 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-03-30 06:09:25 +0000
commit7a89e11e654598ef7a2d000eac0c125087e88a41 (patch)
treebd30254c17bcad2cd057c7c3619a4d525b69d2d5
parent22cdea85f4b69b4ae07783b26e256891deeaaa57 (diff)
canbusutil: Better output formatting with timestamp and info
Print two spaces after the info to separate the CAN ID, print no space before the info as the timestamp already ends with two spaces. Example output: 1490815444.0159 - - 12345678 [04] 00 11 22 33 1490815444.0171 B - 12345678 [04] 00 11 22 33 1490815444.0186 - E 12345678 [04] 00 11 22 33 1490815444.0200 B E 12345678 [04] 00 11 22 33 This example output was generated with the following small script: for i in 0 1 2 3 do cansend vcan0 12345678##${i}00112233 done Change-Id: I579f72383ebb92a979251bd41fe3a6fa58f33f04 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/tools/canbusutil/readtask.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/canbusutil/readtask.cpp b/src/tools/canbusutil/readtask.cpp
index ae4a9ac..798c080 100644
--- a/src/tools/canbusutil/readtask.cpp
+++ b/src/tools/canbusutil/readtask.cpp
@@ -74,11 +74,11 @@ void ReadTask::checkMessages() {
}
if (m_showFdFlags) {
- QString flags = QLatin1String(" - - ");
+ QString flags = QLatin1String("- - ");
if (frame.hasBitrateSwitch())
- flags[1] = QLatin1Char('B');
+ flags[0] = QLatin1Char('B');
if (frame.hasErrorStateIndicator())
- flags[3] = QLatin1Char('E');
+ flags[2] = QLatin1Char('E');
view += flags;
}