Tests pass in parts due to positionerror
This commit is contained in:
@@ -39,6 +39,7 @@ class AerotechPsoBase(PSIDeviceBase, Device):
|
|||||||
output = Component(EpicsSignalRO, "OUTPUT-RBV", auto_monitor=True, kind=Kind.normal)
|
output = Component(EpicsSignalRO, "OUTPUT-RBV", auto_monitor=True, kind=Kind.normal)
|
||||||
address = Component(EpicsSignalRO, "ARRAY-ADDR", kind=Kind.config)
|
address = Component(EpicsSignalRO, "ARRAY-ADDR", kind=Kind.config)
|
||||||
_eventSingle = Component(EpicsSignal, "EVENT:SINGLE", put_complete=True, kind=Kind.omitted)
|
_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
|
# PSO Distance event module
|
||||||
@@ -138,6 +139,8 @@ class AerotechPsoBase(PSIDeviceBase, Device):
|
|||||||
w_pulse = d.get("pso_w_pulse", 200)
|
w_pulse = d.get("pso_w_pulse", 200)
|
||||||
n_pulse = d.get("pso_n_pulse", 1)
|
n_pulse = d.get("pso_n_pulse", 1)
|
||||||
|
|
||||||
|
self.switch.set("Manual").wait()
|
||||||
|
|
||||||
# Configure the pulsed/toggled waveform
|
# Configure the pulsed/toggled waveform
|
||||||
if wmode in ["toggle", "toggled"]:
|
if wmode in ["toggle", "toggled"]:
|
||||||
# Switching to simple toggle mode
|
# Switching to simple toggle mode
|
||||||
@@ -160,12 +163,6 @@ class AerotechPsoBase(PSIDeviceBase, Device):
|
|||||||
else:
|
else:
|
||||||
raise RuntimeError(f"Unsupported window mode: {wmode}")
|
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):
|
class aa1AxisPsoDistance(AerotechPsoBase):
|
||||||
@@ -226,10 +223,6 @@ class aa1AxisPsoDistance(AerotechPsoBase):
|
|||||||
raise RuntimeError(f"Unsupported distace triggering mode: {pso_wavemode}")
|
raise RuntimeError(f"Unsupported distace triggering mode: {pso_wavemode}")
|
||||||
|
|
||||||
old = self.read_configuration()
|
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)
|
# Configure distance generator (also resets counter to 0)
|
||||||
self._distance_value = pso_distance
|
self._distance_value = pso_distance
|
||||||
@@ -291,29 +284,21 @@ class aa1AxisPsoDistance(AerotechPsoBase):
|
|||||||
return self.fire(settle_time)
|
return self.fire(settle_time)
|
||||||
|
|
||||||
def arm(self) -> None:
|
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
|
# Stage the PSO distance module and zero counter
|
||||||
if isinstance(self._distance_value, (np.ndarray, list, tuple)):
|
if isinstance(self._distance_value, (np.ndarray, list, tuple)):
|
||||||
self.dstArrayRearm.set(1).wait()
|
self.dstArrayRearm.set(1).wait()
|
||||||
# Wait for polling
|
# Set distance and wait for polling
|
||||||
sleep(0.5)
|
self.switch.set("Distance", settle_time=0.2).wait()
|
||||||
# Start monitoring the counters if distance is valid
|
|
||||||
if self.dstDistanceVal.get() > 0:
|
|
||||||
self.dstEventsEna.set("On").wait()
|
|
||||||
self.dstCounterEna.set("On").wait()
|
|
||||||
|
|
||||||
def disarm(self):
|
def disarm(self):
|
||||||
"""Standard bluesky unstage"""
|
"""Standard bluesky unstage"""
|
||||||
# Ensure output is set to low
|
self.switch.set("Manual", settle_time=0.2).wait()
|
||||||
# if self.output.value:
|
|
||||||
# self.toggle()
|
def launch(self):
|
||||||
# Turn off window mode
|
"""Re-set the counters"""
|
||||||
self.winOutput.set("Off").wait()
|
if isinstance(self._distance_value, (np.ndarray, list, tuple)):
|
||||||
self.winEvents.set("Off").wait()
|
self.dstArrayRearm.set(1).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)
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user