Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed asc log timestamps to 6 decimal places and uses real message …
…timestamp
  • Loading branch information
BOUAN-DU-CHEF-DU-BOS Ludovic committed Oct 30, 2018
commit 66ce24e9f7659dc5974f8bfc58c436878c915158
6 changes: 3 additions & 3 deletions can/io/asc.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ASCWriter(BaseIOHandler, Listener):

FORMAT_MESSAGE = "{channel} {id:<15} Rx {dtype} {data}"
FORMAT_DATE = "%a %b %m %I:%M:%S %p %Y"
FORMAT_EVENT = "{timestamp: 9.4f} {message}\n"
FORMAT_EVENT = "{timestamp: 9.6f} {message}\n"

def __init__(self, file, channel=1):
"""
Expand Down Expand Up @@ -181,8 +181,8 @@ def log_event(self, message, timestamp=None):
self.header_written = True
self.log_event("Start of measurement") # caution: this is a recursive call!

# figure out the correct timestamp
if timestamp is None or timestamp < self.last_timestamp:
# Use last known timestamp if unknown
if timestamp is None:
timestamp = self.last_timestamp

# turn into relative timestamps if necessary
Expand Down