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

#15 User defined attributes support #29

Merged
merged 9 commits into from
Mar 19, 2023

Conversation

Whitehouse112
Copy link
Contributor

No description provided.

- Added support for BA_DEF_DEF_ tag
- Added support for BA_DEF_ tag
- Added support for BA_ tag
Added test for:
- Message custom property
- Signal custom property
- Node custom property

Changed regex parsing string
- HexCustomProperty class merged into IntCustomProperty class
- PropertyLineParser classe splitted into different files
- Different classes for property definition and property assignment
- Improved regex for enum parsing
- Added some tests
Added custom property tests
Copy link
Collaborator

@Adhara3 Adhara3 left a comment

Choose a reason for hiding this comment

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

  1. CustomProperty.CustomPropertyDefinition should be public, should't it? How the user would know the property data type otherwise?
  2. I would not hide the HEX data type. To me it should stay in the enum and map to it's own property both in definition and value. The mapped type should be an integer type (probably unsigned integer)
  3. Same applies to EnumValue, there should be a public CustomPropertyValue<string> EnumCustomProperty { get; set; }. This is not mandatory but it would make things clearer from an API/user pov
  4. EnumCustomProperty.Definition I would probably call it Enumeration or Values instead and the type should be ISet<string> to make sure they are unique non duplicate values
  5. Property CustomProperties for Signal, Node and Message should be a
    IReadonlyDictionary<string, CustomProperty> or eventually a custom type with a simple interface (e.g. bool ContainsProperty(string propertyName), bool TryGetProperty(string name, out CustomProperty property), int Count {get;}. This is similar to what we will do for Dbc class collections)
  6. Make sure writing some tests that the regex also accept floating point numbers in scientific notation (i.e not only 0.01 but also 1e-2)
  7. Split classes into separate files

… some tests. Code refactoring

- Node, Message and Signal classes are now immutable
- Created new mutable classes for Node, Message and Signal
- CustomProperties (BA_) regex now supports scientific notation for double
- Added tests for regex scientific notation support
- Added Enum and Hex properties in CustomProperty and CustomPropertyDefinition classes
- Updated tests to support new classes
- Code refactoring
- Editable classes (Message, Node, Signal) are now internal
- LineParser classes are now internal
- ILineParser and IDbcBuilder interfaces are now internal
- Final immutable objects are now immutable classes (eg: Node -> ImmutableNode)
- Mutable classes are now final objects (eg: MutableNode -> Node)
- Immutable classes are not used anymore (ready to be implemented in the future)
@Adhara3 Adhara3 merged commit 92f0a67 into EFeru:main Mar 19, 2023
@Whitehouse112 Whitehouse112 deleted the user-defined-attributes-support branch September 13, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants