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

sscanDevice: add select_channels() method #105

Closed
prjemian opened this issue Mar 7, 2019 · 4 comments
Closed

sscanDevice: add select_channels() method #105

prjemian opened this issue Mar 7, 2019 · 4 comments
Assignees

Comments

@prjemian
Copy link
Contributor

prjemian commented Mar 7, 2019

Add similar to the ophyd.scaler.ScalerCH.select_channels() method.

@prjemian prjemian added this to the milestone-2019-09 milestone Mar 7, 2019
@prjemian prjemian self-assigned this Mar 7, 2019
@prjemian
Copy link
Contributor Author

prjemian commented Mar 7, 2019

positioners

example code to implement for positioners

# scans.scan1.positioners.p1.setpoint_pv.value
# `xxx:m1.VAL`

scan = scans.scan1

positioners = []
for pname in scan.positioners.component_names:
    if len(getattr(scan.positioners, pname).setpoint_pv.value.strip()) > 0:
        positioners.append(pname)
scan.positioners.configuration_attrs = positioners
read_attrs = []
for pname in positioners:
    read_attrs.append(pname)
    for attr in getattr(scan.positioners, pname).component_names:
        # leave array out here (this is for interim reports)
        if attr == "array":
            continue
        read_attrs.append(f"{pname}.{attr}")
scan.positioners.read_attrs = read_attrs

@prjemian
Copy link
Contributor Author

prjemian commented Mar 7, 2019

detectors

detectors = []
for dname in scan.detectors.component_names:
    if len(getattr(scan.detectors, dname).input_pv.value.strip()) > 0:
        detectors.append(dname)
scan.detectors.configuration_attrs = detectors
read_attrs = []
for dname in detectors:
    read_attrs.append(dname)
    for attr in getattr(scan.detectors, dname).component_names:
        # leave array out here (this is for interim reports)
        if attr == "array":
            continue
        read_attrs.append(f"{dname}.{attr}")
scan.detectors.read_attrs = read_attrs

@prjemian
Copy link
Contributor Author

prjemian commented Mar 7, 2019

triggers

triggers = []
for tname in scan.triggers.component_names:
    if len(getattr(scan.triggers, tname).trigger_pv.value.strip()) > 0:
        triggers.append(tname)
scan.triggers.configuration_attrs = triggers
read_attrs = []
for dname in triggers:
    read_attrs.append(tname)
    for attr in getattr(scan.triggers, tname).component_names:
        # leave array out here (this is for interim reports)
        if attr == "array":
            continue
        read_attrs.append(f"{tname}.{attr}")
scan.triggers.read_attrs = read_attrs

@prjemian
Copy link
Contributor Author

prjemian commented Mar 7, 2019

Note that in ScalerCH, kind is also configured:

        self.channels.kind = Kind.normal
        self.channels.read_attrs = list(read_attrs)
        self.channels.configuration_attrs = list(read_attrs)
        for ch in read_attrs[1:]:
            getattr(self.channels, ch).s.kind = Kind.hinted

Q: How does that apply here?

prjemian added a commit that referenced this issue Mar 7, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
prjemian added a commit that referenced this issue Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant