-
Notifications
You must be signed in to change notification settings - Fork 30
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
Please specify whether it is CANFD in the Message #96
Comments
Hi,
What about all those We could eventually add an extension method for convenience, something like public static string VFrameFormat(this Message message)
{
// Checks for the VFrameFormat property and returns null if no property is found of the value if found
} I would prefer keeping the public enum VFrameFormat
{
NotSet = 0,
Unknown, // Property set but value not recognized
StandardCAN,
ExtendedCAN,
StandardCAN_FD,
ExtendedCAN_FD
} A |
Adding extension methods is fine. |
Hi, the good thing about extension method is that you can write it yourself in your code extending current functionality, at least until we relese the new version. public static VFrameFormat FrameFormat(this Message message)
{
if (message.CustomProperties.TryGetValue("VFrameFormat", out var frameFormat) == false)
return VFrameFormat.NotSet;
switch (frameFormat.StringCustomProperty.Value)
{
case "StandardCAN":
return VFrameFormat.StandardCan;
case "ExtendedCAN" :
return VFrameFormat.ExtendedCan;
case "StandardCAN_FD" :
return VFrameFormat.StandardCanFd;
case "ExtendedCAN_FD":
return VFrameFormat.ExtendedCanFd;
default:
return VFrameFormat.Unknown;
}
}
public enum VFrameFormat
{
NotSet = 0,
Unknown, // Property set but value not recognized
StandardCan,
ExtendedCan,
StandardCanFd,
ExtendedCanFd
} Cheers |
That's awesome, thanks! |
Below is the CANFD dbc generated by CANdb++, with the canfd flag added to the last line
Although custom attributes can be parsed, I need to determine whether it is CANFD. Can the IsExtID field in the Message be changed to an enumeration, or IsCANFD be added?
![image](https://private-user-images.githubusercontent.com/135562884/383791612-02244cd3-3739-4a1c-b6ab-6f829041a28f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Njk1NTYsIm5iZiI6MTczOTY2OTI1NiwicGF0aCI6Ii8xMzU1NjI4ODQvMzgzNzkxNjEyLTAyMjQ0Y2QzLTM3MzktNGExYy1iNmFiLTZmODI5MDQxYTI4Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMTI3MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xNjcxZjM5N2UzYjNmNzc3ZjMwZTkyYzA1MWIwMWMxN2NlNjYxNTBmYTYzMGE4NWY5MjBkZWM3NTU5ZDc5ZDY5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.9kho3gbR0OJCvTwWXHg_eoegm4QEjiBncwwbMjYKKYk)
The text was updated successfully, but these errors were encountered: