Commit 2d6e996
authored
Trc file support (#1217)
* Added file for implementation of trc file read and write
* Added trc file header template
* Added link where to lookup the trc file format description
* Add trc reader and writer to backends
* Add example trace file as conversion from asc log
* Add TRCWriter and TRCReader to can package
* Basic header extraction in reader
* Implement read of file version
* Remove useless format string
* Implement basic message parsing
* Move message parsing to separate function
* Implement parse of first message
* Handle none rx messages
* Handle empty files
* Add test method for trc files
* Format code with black
* Implement stop at end of log file
* Implement basic write of header version 2.1
* Add newline after header
* Implement write of messages
* Enable test for trace file writing
* Add test files for different pcan trace file versions
* Use binary mode for write to ensure correct line ending on all platforms
* Add handler for file write
* Move some header lines to specific write function
* Move lines to function
* Move write of file header to class
* Use new function for better code readability
* Add enum for file versions
* Handle text io streams correctly
* send line ending setting to logger
* Add check for file version in writer
* Add TRCFileVersion as export
* Add test for wrong file version
* Add format and header for version 1 trace file format
* Use correct format according to selected version
* Introduce handler method _parse_line
* Skip empty lines
* Add check for type before eval message
* Print info on unsupported types
* Add test for new test data files trc format
* Implement file version reading
* More flexible implementation of line parsing for different versions
* Implement Version 1 trace file parsing
* Add test case for Version 1.0 trc file
* Implement parsing for version 1.1 trace files
* Add test for version 1.1 reading
* Add test case for version 1.0 trace files
* Avoid multi test runs with same input and output by separate generic tests from file version tests
* Correct first timestamp
* Add type information for file attribute
* Add type definitions for init function
* Add type for first_timestamp
* Add info for return types
* Drop type casting for file. Should already be done in init
* Add type info
* Always use text read write
* Update types for initialization
* Use text io mode by default1 parent b0a4400 commit 2d6e996
11 files changed
Lines changed: 637 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
0 commit comments