Skip to content

Commit

Permalink
Use enum on aravis driver (#412)
Browse files Browse the repository at this point in the history
* Use enum on aravis driver

* Update src/ophyd_async/epics/areadetector/drivers/aravis_driver.py

Co-authored-by: Tom C (DLS) <101418278+coretl@users.noreply.github.com>

---------

Co-authored-by: Tom C (DLS) <101418278+coretl@users.noreply.github.com>
  • Loading branch information
callumforrester and coretl authored Jun 26, 2024
1 parent 9165c5a commit d739f0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ophyd_async/epics/areadetector/drivers/aravis_driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum
from typing import Literal

from ophyd_async.core import SubsetEnum
from ophyd_async.epics.areadetector.drivers import ADBase
from ophyd_async.epics.signal.signal import epics_signal_rw_rbv

Expand All @@ -19,7 +19,7 @@ class AravisTriggerMode(str, Enum):
To prevent requiring one Enum class per possible configuration, we set as this Enum
but read from the underlying signal as a str.
"""
AravisTriggerSource = Literal["Freerun", "Line1", "Line2", "Line3", "Line4"]
AravisTriggerSource = SubsetEnum["Freerun", "Line1"]


class AravisDriver(ADBase):
Expand All @@ -34,5 +34,7 @@ def __init__(self, prefix: str, name: str = "") -> None:
self.trigger_mode = epics_signal_rw_rbv(
AravisTriggerMode, prefix + "TriggerMode"
)
self.trigger_source = epics_signal_rw_rbv(str, prefix + "TriggerSource")
self.trigger_source = epics_signal_rw_rbv(
AravisTriggerSource, prefix + "TriggerSource"
)
super().__init__(prefix, name=name)

0 comments on commit d739f0f

Please sign in to comment.