@@ -76,6 +76,8 @@ def _extract_header(self):
76
76
file_version = line .split ("=" )[1 ]
77
77
if file_version == "1.1" :
78
78
self .file_version = TRCFileVersion .V1_1
79
+ elif file_version == "1.3" :
80
+ self .file_version = TRCFileVersion .V1_3
79
81
elif file_version == "2.0" :
80
82
self .file_version = TRCFileVersion .V2_0
81
83
elif file_version == "2.1" :
@@ -121,6 +123,8 @@ def _extract_header(self):
121
123
self ._parse_cols = self ._parse_msg_v1_0
122
124
elif self .file_version == TRCFileVersion .V1_1 :
123
125
self ._parse_cols = self ._parse_cols_v1_1
126
+ elif self .file_version == TRCFileVersion .V1_3 :
127
+ self ._parse_cols = self ._parse_cols_v1_3
124
128
elif self .file_version in [TRCFileVersion .V2_0 , TRCFileVersion .V2_1 ]:
125
129
self ._parse_cols = self ._parse_cols_v2_x
126
130
else :
@@ -161,6 +165,24 @@ def _parse_msg_v1_1(self, cols: List[str]) -> Optional[Message]:
161
165
msg .is_rx = cols [2 ] == "Rx"
162
166
return msg
163
167
168
+ def _parse_msg_v1_3 (self , cols : List [str ]) -> Optional [Message ]:
169
+ arbit_id = cols [4 ]
170
+
171
+ msg = Message ()
172
+ if isinstance (self .start_time , datetime ):
173
+ msg .timestamp = (
174
+ self .start_time + timedelta (milliseconds = float (cols [1 ]))
175
+ ).timestamp ()
176
+ else :
177
+ msg .timestamp = float (cols [1 ]) / 1000
178
+ msg .arbitration_id = int (arbit_id , 16 )
179
+ msg .is_extended_id = len (arbit_id ) > 4
180
+ msg .channel = int (cols [2 ])
181
+ msg .dlc = int (cols [6 ])
182
+ msg .data = bytearray ([int (cols [i + 7 ], 16 ) for i in range (msg .dlc )])
183
+ msg .is_rx = cols [3 ] == "Rx"
184
+ return msg
185
+
164
186
def _parse_msg_v2_x (self , cols : List [str ]) -> Optional [Message ]:
165
187
type_ = cols [self .columns ["T" ]]
166
188
bus = self .columns .get ("B" , None )
@@ -203,6 +225,14 @@ def _parse_cols_v1_1(self, cols: List[str]) -> Optional[Message]:
203
225
logger .info ("TRCReader: Unsupported type '%s'" , dtype )
204
226
return None
205
227
228
+ def _parse_cols_v1_3 (self , cols : List [str ]) -> Optional [Message ]:
229
+ dtype = cols [3 ]
230
+ if dtype in ("Tx" , "Rx" ):
231
+ return self ._parse_msg_v1_3 (cols )
232
+ else :
233
+ logger .info ("TRCReader: Unsupported type '%s'" , dtype )
234
+ return None
235
+
206
236
def _parse_cols_v2_x (self , cols : List [str ]) -> Optional [Message ]:
207
237
dtype = cols [self .columns ["T" ]]
208
238
if dtype in ["DT" , "FD" , "FB" ]:
0 commit comments