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

Add enums for detector motion #57

Open
DominicOram opened this issue May 17, 2023 · 3 comments
Open

Add enums for detector motion #57

DominicOram opened this issue May 17, 2023 · 3 comments
Labels
good first issue Good for newcomers i24 low priority Not needed for production in the near future

Comments

@DominicOram
Copy link
Contributor

DominicOram commented May 17, 2023

A lot of the movements in DetectorMotion are binary setpoints, using 0/1 to mean open/closed. We should refactor these to be enums to be more descriptive

@stan-dot
Copy link
Contributor

from ophyd_async.core import StandardReadable
from ophyd_async.epics.motor import Motor


class DetectorMotion(StandardReadable):
    """Physical motion for detector travel"""

    def __init__(self, prefix: str, name: str = "") -> None:
        self.y = Motor(prefix + "Y")  # Vertical
        self.z = Motor(prefix + "Z")  # Beam

        super().__init__(name)

at the moment the file does not have binary setpoints so either it's the wrong file or it has changed substantially since.

@noemifrisina from git log I infer you might have more context here, what happened here?

@noemifrisina
Copy link
Collaborator

I'm not sure, I think that the original issue may have been referring to this DetectorMotion device ?
The i24 one is separated because it's quite different and is fine as it is at the moment...

@stan-dot
Copy link
Contributor

stan-dot commented Sep 25, 2024

ah I see

       self.shutter_closed_lim = epics_signal_r(
            float, f"{prefix}{device_prefix}CLOSE_LIMIT"
        )  # on limit = 1, off = 0
        self.shutter_open_lim = epics_signal_r(
            float, f"{prefix}{device_prefix}OPEN_LIMIT"
        )  # on limit = 1, off = 0
        self.z_disabled = epics_signal_r(
            float, f"{prefix}{device_prefix}Z:DISABLED"
        )  # robot interlock, 0=ok to move, 1=blocked
        self.crate_power = epics_signal_r(
            float, f"{prefix}{pmac_prefix}CRATE2_HEALTHY"
        )  # returns 0 if no power
        self.in_robot_load_safe_position = epics_signal_r(
            int, f"{prefix}{pmac_prefix}GPIO_INP_BITS.B2"
        )  # returns 1 if safe

@stan-dot stan-dot added the low priority Not needed for production in the near future label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers i24 low priority Not needed for production in the near future
Projects
None yet
Development

No branches or pull requests

3 participants