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

2M & 4M undulators #1002

Merged
merged 9 commits into from
Jul 9, 2024
Merged

2M & 4M undulators #1002

merged 9 commits into from
Jul 9, 2024

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian commented Jul 8, 2024

NOTE: 2M & 4M -- No PV for Done Moving, rely on Busy and set done_value=0 instead.

@cooleyv
@cpchuang

@prjemian prjemian added the task Something to be done. label Jul 8, 2024
@prjemian prjemian added this to the 1.6.20 milestone Jul 8, 2024
@prjemian prjemian requested a review from MDecarabas July 8, 2024 21:51
@prjemian prjemian self-assigned this Jul 8, 2024
@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

Random and unrelated EPICS CA connection timeout problems in testing.

@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

On 3rd (or 4th?) re-run of all tests, they passed. Might adjust master timeout if failures continue:

MASTER_TIMEOUT = 3

Applied here:

EpicsSignalBase.set_defaults(
auto_monitor=True,
timeout=MASTER_TIMEOUT,
write_timeout=MASTER_TIMEOUT,
connection_timeout=MASTER_TIMEOUT,
)

@prjemian prjemian changed the title 2M undulator 2M & 4M undulators Jul 9, 2024
@prjemian prjemian marked this pull request as draft July 9, 2024 15:38
@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

Testing is more stable with the longer master timeout. 3s was borderline to encounter EPICS CA connection timeouts.

@prjemian prjemian marked this pull request as ready for review July 9, 2024 17:41
@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

@MDecarabas Now, this is ready for review.

Copy link
Collaborator

@MDecarabas MDecarabas left a comment

Choose a reason for hiding this comment

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

Small question about if we can just reuse the 2m undulator class for the 4m as well. Might have missed something but it does not look like any of the code is different

Comment on lines 186 to 227
class Undulator2M(ID_Spectrum_Mixin, ID_Controls_Mixin, ID_Misc_Mixin, Device):
"""APS 2M Undulator.

.. index::
Ophyd Device; PlanarUndulator
Ophyd Device; Undulator2M

APS Use: 1ID, downstream.

EXAMPLE::

undulator = Undulator2M("S01ID:DSID:", name="undulator")
"""

# PVs not found
busy = None
magnet = None
version_plc = None
version_hpmu = None

done = Component(EpicsSignalRO, "BusyM.VAL", kind="omitted")
done_value = 0


class Undulator4M(ID_Spectrum_Mixin, ID_Controls_Mixin, ID_Misc_Mixin, Device):
"""APS 4M Undulator.

.. index::
Ophyd Device; PlanarUndulator
Ophyd Device; Undulator4M

APS Use: 11ID, downstream & upstream.

EXAMPLE::

undulator = Undulator4M("S11ID:DSID:", name="undulator")
"""

# PVs not found
busy = None
magnet = None
version_plc = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this the same content with just a different class name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made 4M as a subclass of 2M

@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

Thought about this, too. Similar to the STI_Undulator? Once (or if) we identify differences, then we can break the dependency.

@MDecarabas
Copy link
Collaborator

Thought about this, too. Similar to the STI_Undulator? Once (or if) we identify differences, then we can break the dependency.

Are you saying as the class will grow you expect to see differences?

@prjemian
Copy link
Contributor Author

prjemian commented Jul 9, 2024

I'm saying that as the class is used at the beam lines, we might discover signals needed by one but not the others.

@prjemian prjemian merged commit d423327 into main Jul 9, 2024
13 checks passed
@prjemian prjemian deleted the 975-2M-undulator branch July 9, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Something to be done.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4M insertion device (only 11US and 11DS) 2M insertion device (only 01DS)
2 participants