Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply asc format since format v8.1 #1641

Closed
wants to merge 6 commits into from

Conversation

Tian-Jionglu
Copy link

A solution to solve issue #1531.

Mainly include 2 changes in ASCReader class:

  1. extract header when initial ASCReader, to get correct start_time, version, date, etc before iterate the messages. I think this is necessary;
  2. new function _process_fd_can_frame_2 to process CANFD message in ASCFormat since V8.1;

Remaining issue:
some tests can not pass, mainly because after the change, correct absolute timestamp is get when iterate the messages;

@zariiii9003
Copy link
Collaborator

@Tian-Jionglu Are you still working on the tests? I cannot merge if the tests are failing.

can/io/asc.py Outdated
@@ -98,14 +115,26 @@ def _extract_header(self) -> None:
self.timestamps_format = timestamp_format or "absolute"
continue

if version_match:
version = version_match.group("version")
self.version = version
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider parsing the version using our existing dependency packaging.

https://packaging.pypa.io/en/latest/version.html

@Tian-Jionglu
Copy link
Author

Commits to parse the ASC format version using packaging.
Jobs in working: change ASC format test to adjust absolute time.

@zariiii9003
Copy link
Collaborator

The ASC tests are still failing.

@Tian-Jionglu
Copy link
Author

When diving into test example, i found my mistake at the start.
The symbolic name issue is not only related to ASC format version. In fact, SymblicName works for symbolic logging at first place.
I'm still looking for example about symblic logging.

I would close this PR in coming days, and start a new PR to inherit the change to fix absolute time in ASC format.
If there is already support about symbolic logging in python-can, please give me a hint.


break
if trigger_match:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the files can contain multiple triggers. Parsing it as part of the header is probably not sufficient.

@pierreluctg pierreluctg added the file-io about reading & writing to files label Feb 28, 2024
@Tian-Jionglu
Copy link
Author

see PR #1788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-io about reading & writing to files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants