eds: Add first-class support for CiA 306 ObjFlags and Denotation#654
Open
bizfsc wants to merge 1 commit intocanopen-python:masterfrom
Open
eds: Add first-class support for CiA 306 ObjFlags and Denotation#654bizfsc wants to merge 1 commit intocanopen-python:masterfrom
bizfsc wants to merge 1 commit intocanopen-python:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
5dff918 to
90dbe07
Compare
ObjFlags (UNSIGNED32 bitfield) and Denotation (DCF-only string) are
standard CiA 306 fields that are now parsed and exported explicitly.
Changes:
* ODVariable, ODRecord and ODArray gain an obj_flags: int = 0 attribute.
* ODVariable gains a denotation: str = '' attribute.
* _get_obj_flags() helper reads and validates the ObjFlags integer value.
* ObjFlags is parsed for VAR/DOMAIN (via build_variable), ARRAY and RECORD.
* ObjFlags is exported whenever non-zero.
* Denotation is read in build_variable() and written only in DCF mode
(device_commisioning=True), matching the CiA 306 specification.
* Adds test object 0x3060 (ObjFlags=0x1) to sample.eds and four new tests
covering read, round-trip and DCF export for both fields.
Co-authored-by: FedericoSpada <FedericoSpada@users.noreply.github.com>
90dbe07 to
bccbd5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ObjFlags(UNSIGNED32 bitfield) andDenotation(DCF-only string) are standard CiA 306 fields that were previously silently dropped. This PR adds first-class support for both.Changes
ODVariable,ODRecordandODArraygain anobj_flags: int = 0attribute.ODVariablegains adenotation: str = ""attribute._get_obj_flags(eds, section)helper reads and validates theObjFlagsinteger value.ObjFlagsis parsed for VAR/DOMAIN (viabuild_variable()), ARRAY and RECORD top-level objects.ObjFlagsis exported whenever non-zero.Denotationis read inbuild_variable()and written only in DCF mode (device_commisioning=True), matching the CiA 306 specification.Tests
test_reading_obj_flags— VAR withObjFlags=0x1reads back correctlytest_reading_obj_flags_default— standard objects default to0test_roundtrip_obj_flags— full EDS export/import cycle preservesobj_flagstest_denotation_roundtrip_dcf—denotationsurvives a DCF round-triptest_denotation_not_exported_in_eds_mode—denotationis absent in plain EDS export