Skip to content

Fix PDO mapping choices and selection for non-user objects. Fixes #84 - #85

Open
gte1 wants to merge 2 commits into
Laerdal:mainfrom
gte1:main
Open

gte1 wants to merge 2 commits into
Laerdal:mainfrom
gte1:main

Conversation

@gte1

@gte1 gte1 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and fixes related to PDO mapping logic, buffer size handling, and UI stability in the objdictgen package. It also adds comprehensive tests to ensure correct behavior for various mapping scenarios.

PDO mapping and buffer size logic improvements

  • Updated FindMapVariableList in maps.py to use node.IsEntry(index) for more accurate filtering of map entries, improving correctness in variable selection.
  • Refactored buffer size calculation in node.py to handle buffer sizes provided as strings, converting them to integers before use. This prevents type errors and ensures correct calculations.
  • Simplified logic for determining string type buffer sizes in PDO mapping by using GetSubentryInfos for type lookup, ensuring consistent handling for both arrays and records.

UI stability enhancements

  • Improved grid view reset methods in both commondialogs.py and subindextable.py to disable cell edit controls before resetting the grid, preventing UI inconsistencies or errors during updates. [1] [2]

Testing enhancements

  • Added extensive tests in test_node.py to cover various PDO mapping scenarios, including handling of buffer sizes as text, different mapping sources, and struct types, increasing test coverage and reliability.

Fixed #84

This PR is mainly addressing the wx-based editor: the grid refresh/editor handling is wx-specific. The PDO buffer-size fix is in the shared Node model, though, so it also protects non-wx callers that load string buffer sizes.

@gte1
gte1 marked this pull request as ready for review October 12, 2026 13:31
Fix PDO buffer sizing and wx grid refresh handling
Normalize string buffer sizes before numeric comparisons and disable active
grid editors before refreshing tables. Add regression coverage for both fixes.

This branch has not been deployed

No deployments
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.

Some PDO-mappable objects are missing or fail when selected dropsdown for PDO mappings

1 participant