File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1659,13 +1659,28 @@ def setupLogMessages(self, log_file):
1659
1659
for msg in self .txMsgs :
1660
1660
tx_dict [msg .message .frame_id ] = msg
1661
1661
with open (log_file ) as f :
1662
+ timestamp = None
1663
+ firstMsg = None
1664
+ for msg in pycan .CanutilsLogReader (f ):
1665
+ if msg is not None :
1666
+ firstMsg = msg
1667
+ break
1668
+
1669
+ if firstMsg is not None and firstMsg .timestamp < 1e9 :
1670
+ timestamp = 0
1671
+
1662
1672
for msg in pycan .CanutilsLogReader (f ):
1663
1673
if msg .is_rx :
1664
1674
key = rx_dict .get (msg .arbitration_id )
1665
1675
else :
1666
1676
key = tx_dict .get (msg .arbitration_id )
1667
1677
if key :
1668
- key .timestamps .append (msg .timestamp )
1678
+ if timestamp is not None :
1679
+ timestamp += msg .timestamp
1680
+ key .timestamps .append (timestamp )
1681
+ else :
1682
+ key .timestamps .append (msg .timestamp )
1683
+
1669
1684
signalValues = key .message .decode (msg .data )
1670
1685
for sig in key .signals :
1671
1686
value = signalValues .get (sig .signal .name )
You can’t perform that action at this time.
0 commit comments