Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Add logic for making signals on-the-fly, sans p4p -vv call #31

Merged
merged 5 commits into from
Aug 8, 2023

Conversation

rosesyrett
Copy link
Collaborator

@rosesyrett rosesyrett commented Jul 20, 2023

Resolves #25

For this to work, I need to be able to query the epics signal via pv access to get the type of the signal, to be used in the signal_factory (i.e epics_signal_ ... function). Two things need to happen for this to work:

  1. The .db file being used (i.e. the one currently in tests/db/panda.db) needs to have enough information about the signal types,
  2. I need a way of doing 'pvget -vv ${IOC:PV}' via python's p4p library. I am struggling to see how to do that.
    edit: after discussion it seems like we can just use 'None' and the backend will guess.

@rosesyrett rosesyrett self-assigned this Jul 20, 2023
@rosesyrett rosesyrett marked this pull request as draft July 20, 2023 11:08
@rosesyrett
Copy link
Collaborator Author

@coretl this is almost done, except in my tests the db used does not contain an "active" bool signal in the PVI. Could you just modify this MR to include it? Thanks

@rosesyrett rosesyrett marked this pull request as ready for review August 1, 2023 12:43
@rosesyrett rosesyrett requested a review from coretl August 1, 2023 12:43
@coretl
Copy link
Collaborator

coretl commented Aug 2, 2023

Try this:

record(bi, "$(IOC_NAME=PANDAQSRV):PCAP:ACTIVE")
{
    field(ZNAM,  "0")
    field(ONAM,  "1")
    field(PINI, "YES")
    info(Q:group, {
        "$(IOC_NAME=PANDAQSRV):PCAP:PVI": {
            "pvi.active.r": {
                "+channel": "NAME",
                "+type": "plain"
            }
        }
    })
}

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.55% 🎉

Comparison is base (23d4c46) 98.90% compared to head (feb26da) 99.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   98.90%   99.45%   +0.55%     
==========================================
  Files           5        5              
  Lines         364      365       +1     
==========================================
+ Hits          360      363       +3     
+ Misses          4        2       -2     
Files Changed Coverage Δ
src/ophyd_epics_devices/panda.py 99.34% <100.00%> (+1.32%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Looks good - and works with a real PandA too

@rosesyrett rosesyrett merged commit 72b3517 into main Aug 8, 2023
15 checks passed
@rosesyrett rosesyrett deleted the dynamic-panda-signals branch August 8, 2023 12:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change implementation of pcap block for panda ophyd device
3 participants