Skip to content

Commit

Permalink
put period duration in demo plan, fix bools
Browse files Browse the repository at this point in the history
  • Loading branch information
rerpha committed Aug 15, 2024
1 parent c479ec7 commit a9e2beb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ibex_bluesky_core/demo_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_demo_plan() -> None:
dae = Dae(prefix)
RE(
demo_plan(block, dae),
LiveTable(["mot", "DAE-good_uah", "DAE-run_state", "DAE-rb_number"], default_prec=10),
LiveTable(["mot", "DAE-good_uah", "DAE-run_state", "DAE-rb_number", "DAE-period-run_duration"], default_prec=10),
)
# RE(demo_plan(block, dae), print)

Expand Down
16 changes: 11 additions & 5 deletions src/ibex_bluesky_core/devices/dae.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from bluesky.protocols import Triggerable
from ophyd_async.core import AsyncStatus, ConfigSignal, SignalR, SignalRW, StandardReadable
from ophyd_async.epics.signal import epics_signal_r
from ophyd_async.epics.signal import epics_signal_r, epics_signal_rw

from ibex_bluesky_core.devices.dae_controls import DaeControls
from ibex_bluesky_core.devices.dae_event_mode import DaeEventMode
Expand Down Expand Up @@ -35,6 +35,13 @@ class RunstateEnum(str, Enum):
def __str__(self):
return str(self.value)

class YesNoEnum(str, Enum):
No = "No"
Yes = "Yes"

def __str__(self):
return str(self.value)


class Dae(StandardReadable, Triggerable):
"""Device representing the ISIS data acquisition electronics."""
Expand All @@ -46,7 +53,7 @@ def __init__(self, prefix: str, name: str = "DAE") -> None:
self.good_uah: SignalR[float] = epics_signal_r(float, f"{dae_prefix}GOODUAH")
self.count_rate: SignalR[float] = epics_signal_r(float, f"{dae_prefix}COUNTRATE")
self.m_events: SignalR[float] = epics_signal_r(float, f"{dae_prefix}MEVENTS")
self.sim_mode: SignalR[bool] = epics_signal_r(bool, f"{dae_prefix}SIM_MODE")
self.sim_mode: SignalR[YesNoEnum] = epics_signal_r(YesNoEnum, f"{dae_prefix}SIM_MODE")
self.neutron_proton_ratio: SignalR[float] = epics_signal_r(
float, f"{dae_prefix}NPRATIO"
)
Expand Down Expand Up @@ -77,9 +84,8 @@ def __init__(self, prefix: str, name: str = "DAE") -> None:
RunstateEnum, f"{dae_prefix}RUNSTATE"
)
self.title: SignalRW = isis_epics_signal_rw(str, f"{dae_prefix}TITLE")
self.show_title_and_users: SignalRW = isis_epics_signal_rw(
bool, f"{dae_prefix}TITLE:DISPLAY"
)
self.show_title_and_users: SignalRW = epics_signal_rw(YesNoEnum, f"{dae_prefix}TITLE:DISPLAY", f"{dae_prefix}TITLE:DISPLAY")

self.users: SignalRW = isis_epics_signal_rw(str, f"{dae_prefix}_USERNAME")
self.rb_number: SignalRW = isis_epics_signal_rw(str, f"{dae_prefix}_RBNUMBER")

Expand Down

0 comments on commit a9e2beb

Please sign in to comment.