Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions slac_devices/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,27 @@ def x(self):
"""Get TMIT value"""
return self.controls_information.PVs.x.get()

def x_buffer(self, buffer: Buffer):
"""Retrieve X position data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:X")
def x_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve X signal data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:X", **kwargs)

@property
def y(self):
"""Get TMIT value"""
return self.controls_information.PVs.y.get()

def y_buffer(self, buffer: Buffer):
"""Retrieve Y position data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:Y")
def y_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve Y signal data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:Y", **kwargs)

@property
def tmit(self):
"""Get TMIT value"""
return self.controls_information.PVs.tmit.get()

def tmit_buffer(self, buffer: Buffer):
def tmit_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve TMIT signal data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:TMIT")
return buffer.get(f"{self.controls_information.control_name}:TMIT", **kwargs)


class BPMCollection(BaseModel):
Expand All @@ -94,13 +94,14 @@ def validate_bpms(cls, v) -> Dict[str, BPM]:
return v

def get_buffer_data(
self, buffer, suffix: str = "TMIT"
self, buffer, suffix: str = "TMIT", **kwargs
) -> Dict[str, Optional[list]]:
"""Retrieve buffer data for all BPMs in the collection.

Args:
buffer: An edef EventDefinition or BSABuffer object.
suffix: PV suffix to read (e.g. "TMIT", "X", "Y").
**kwargs: Passed to buffer.get() (e.g. pad, retries).

Returns:
Dict mapping BPM name to data array, or None for unreachable BPMs.
Expand All @@ -110,7 +111,7 @@ def _yield_buffer_data():
for name, bpm in self.bpms.items():
address = f"{bpm.controls_information.control_name}:{suffix}"
try:
data = buffer.get(address)
data = buffer.get(address, **kwargs)
except (TypeError, BufferError):
data = None
yield name, data
Comment thread
kabanaty marked this conversation as resolved.
Expand Down
12 changes: 6 additions & 6 deletions slac_devices/lblm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class LBLM(Device):
def __init__(self, **kwargs):
super().__init__(**kwargs)

def fast_buffer(self, buffer: Buffer):
def fast_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve fast signal data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:FAST")
return buffer.get(f"{self.controls_information.control_name}:FAST", **kwargs)

@property
def i0_loss(self):
Expand Down Expand Up @@ -106,13 +106,13 @@ def bypass(self, val: bool) -> None:
except ValidationError as e:
print("Bypass must be a boolean:", e)

def i0_loss_buffer(self, buffer: Buffer):
def i0_loss_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve I0 Loss data from timing buffer"""
return buffer.get(self.controls_information.PVs.i0_loss.pvname)
return buffer.get(self.controls_information.PVs.i0_loss.pvname, **kwargs)

def gated_integral_buffer(self, buffer: Buffer):
def gated_integral_buffer(self, buffer: Buffer, **kwargs):
"""Get Gated Integral data from timing buffer"""
return buffer.get(self.controls_information.PVs.gated_integral.pvname)
return buffer.get(self.controls_information.PVs.gated_integral.pvname, **kwargs)


class LBLMCollection(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions slac_devices/pmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class PMT(Device):
def __init__(self, **kwargs):
super().__init__(**kwargs)

def qdcraw_buffer(self, buffer: Buffer):
def qdcraw_buffer(self, buffer: Buffer, **kwargs):
"""Retrieve QDCRAW signal data from timing buffer"""
return buffer.get(f"{self.controls_information.control_name}:QDCRAW")
return buffer.get(f"{self.controls_information.control_name}:QDCRAW", **kwargs)

@property
def qdcraw(self):
Expand Down
4 changes: 2 additions & 2 deletions slac_devices/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def on_status(self):
"""Returns the on status of the wire scanner."""
return self.controls_information.PVs.on_status.get()

def position_buffer(self, buffer: Buffer):
return buffer.get(f"{self.controls_information.control_name}:POSN")
def position_buffer(self, buffer: Buffer, **kwargs):
return buffer.get(f"{self.controls_information.control_name}:POSN", **kwargs)

def retract(self):
"""Retracts the wire scanner"""
Expand Down
Loading