feat: allow aliased enum PVs to map values to underlying fastcs PVs - #417
feat: allow aliased enum PVs to map values to underlying fastcs PVs#417shihab-dls wants to merge 7 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📝 WalkthroughWalkthroughEPICS CA aliases now support structured enum mappings for read, write, and command PVs. Schemas and options accept the new mapping type. Tests cover conversion, propagation, PVI exposure, and alarms. The demo temperature controller now records successful connections. ChangesEPICS CA enum aliases
Temperature controller connection state
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant EPICS_CA_Client
participant EpicsCAIOC
participant Enum_Attribute
participant ControllerAPI
EPICS_CA_Client->>EpicsCAIOC: Put mapped enum value
EpicsCAIOC->>Enum_Attribute: Convert mapped value
Enum_Attribute->>ControllerAPI: Update attribute or invoke command
ControllerAPI-->>EpicsCAIOC: Return operation result
EpicsCAIOC-->>EPICS_CA_Client: Update PV value and alarm
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
==========================================
+ Coverage 91.44% 91.49% +0.05%
==========================================
Files 72 72
Lines 2944 3034 +90
==========================================
+ Hits 2692 2776 +84
- Misses 252 258 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fastcs/transports/epics/ca/ioc.py`:
- Around line 40-45: Validate structured alias PV values from EnumMapping.pv
against EPICS_MAX_NAME_LENGTH before IOC record creation, just as _add_alias
validates string aliases. Update the record-creation paths around the affected
alias handling so oversized structured aliases are rejected or skipped
consistently before they are used.
- Around line 483-515: Update _add_write_enum_alias so successful writes through
enum_attr also synchronize the alias record created for alias.pv, while
preventing the update from invoking convert_to_value recursively. Ensure the
alias record reflects the underlying enum value after direct writes to the
original PV, and preserve the existing alias-to-underlying conversion and alarm
handling.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8e74ed54-6c70-4cde-879d-a01bb35df28b
📒 Files selected for processing (8)
src/fastcs/demo/controllers.pysrc/fastcs/demo/schema.jsonsrc/fastcs/transports/epics/ca/ioc.pysrc/fastcs/transports/epics/options.pytests/data/schema.jsontests/example_softioc.pytests/transports/epics/ca/test_softioc.pytests/transports/epics/ca/test_softioc_system.py
Summary by CodeRabbit