Tests pass in parts due to positionerror

This commit is contained in:
gac-x05la
2025-05-14 18:20:31 +02:00
committed by marone
parent 739811959e
commit 06d0b5ae59
2 changed files with 696 additions and 707 deletions

View File

@@ -39,6 +39,7 @@ class AerotechPsoBase(PSIDeviceBase, Device):
output = Component(EpicsSignalRO, "OUTPUT-RBV", auto_monitor=True, kind=Kind.normal)
address = Component(EpicsSignalRO, "ARRAY-ADDR", kind=Kind.config)
_eventSingle = Component(EpicsSignal, "EVENT:SINGLE", put_complete=True, kind=Kind.omitted)
switch = Component(EpicsSignal, "SWITCH", put_complete=True, kind=Kind.omitted)
# ########################################################################
# PSO Distance event module
@@ -138,6 +139,8 @@ class AerotechPsoBase(PSIDeviceBase, Device):
w_pulse = d.get("pso_w_pulse", 200)
n_pulse = d.get("pso_n_pulse", 1)
self.switch.set("Manual").wait()
# Configure the pulsed/toggled waveform
if wmode in ["toggle", "toggled"]:
# Switching to simple toggle mode
@@ -160,12 +163,6 @@ class AerotechPsoBase(PSIDeviceBase, Device):
else:
raise RuntimeError(f"Unsupported window mode: {wmode}")
# Set PSO output data source
# FIXME : This is essentially staging...
if wmode in ["toggle", "toggled", "pulse", "pulsed"]:
self.outSource.set("Waveform").wait()
elif wmode in ["output", "flag"]:
self.outSource.set("Window").wait()
class aa1AxisPsoDistance(AerotechPsoBase):
@@ -226,10 +223,6 @@ class aa1AxisPsoDistance(AerotechPsoBase):
raise RuntimeError(f"Unsupported distace triggering mode: {pso_wavemode}")
old = self.read_configuration()
# Disable everything
self.winEvents.set("Off").wait()
self.dstCounterEna.set("Off").wait()
self.dstEventsEna.set("Off").wait()
# Configure distance generator (also resets counter to 0)
self._distance_value = pso_distance
@@ -291,29 +284,21 @@ class aa1AxisPsoDistance(AerotechPsoBase):
return self.fire(settle_time)
def arm(self) -> None:
"""Bluesky style stage"""
"""Bluesky style stage
It re-arms the distance array and re-sets the distance counter at current position
"""
# Stage the PSO distance module and zero counter
if isinstance(self._distance_value, (np.ndarray, list, tuple)):
self.dstArrayRearm.set(1).wait()
# Wait for polling
sleep(0.5)
# Start monitoring the counters if distance is valid
if self.dstDistanceVal.get() > 0:
self.dstEventsEna.set("On").wait()
self.dstCounterEna.set("On").wait()
# Set distance and wait for polling
self.switch.set("Distance", settle_time=0.2).wait()
def disarm(self):
"""Standard bluesky unstage"""
# Ensure output is set to low
# if self.output.value:
# self.toggle()
# Turn off window mode
self.winOutput.set("Off").wait()
self.winEvents.set("Off").wait()
# Turn off distance mode
self.dstEventsEna.set("Off").wait()
self.dstCounterEna.set("Off").wait()
# Disable output
self.outSource.set("None").wait()
# Sleep for one poll period
sleep(0.2)
self.switch.set("Manual", settle_time=0.2).wait()
def launch(self):
"""Re-set the counters"""
if isinstance(self._distance_value, (np.ndarray, list, tuple)):
self.dstArrayRearm.set(1).wait()

File diff suppressed because it is too large Load Diff