WIP
This commit is contained in:
@@ -152,9 +152,8 @@ class aa1AxisDriveDataCollection(PSIDeviceBase, Device):
|
||||
self.configure(d=d)
|
||||
|
||||
# Stage the data collection if not in internally launced mode
|
||||
# NOTE: Scripted scans start acquiring from the scrits
|
||||
if "scan_type" in scan_args and scan_args["scan_type"] in ("scripted", "script"):
|
||||
self.arm()
|
||||
# NOTE: Scripted scans start acquiring from the scrits at kickoff
|
||||
self.arm()
|
||||
# Reset readback
|
||||
self.reset()
|
||||
|
||||
|
||||
@@ -119,7 +119,6 @@ class AerotechPsoBase(PSIDeviceBase, Device):
|
||||
def fire(self, settle_time=0.1) -> None | DeviceStatus:
|
||||
"""Fire a single PSO event (i.e. manual software trigger)"""
|
||||
# Only trigger if distance was set to invalid
|
||||
logger.warning(f"[{self.name}] Triggerin...")
|
||||
self._eventSingle.set(1, settle_time=settle_time).wait()
|
||||
status = DeviceStatus(self)
|
||||
status.set_finished()
|
||||
|
||||
@@ -106,12 +106,8 @@ class aa1Tasks(PSIDeviceBase, Device):
|
||||
self.fileName.set(d["script_file"]).wait()
|
||||
if "script_text" in d:
|
||||
# Compile text for syntax checking
|
||||
# NOTE: This will load to 'script_file'
|
||||
# NOTE: This will overwrite 'script_file'
|
||||
self._fileWrite.set(d["script_text"], settle_time=0.2).wait()
|
||||
self.switch.set("Load").wait()
|
||||
# Check the result of load
|
||||
if self._failure.value:
|
||||
raise RuntimeError("Failed to load script, perhaps a syntax error?")
|
||||
|
||||
new = self.read_configuration()
|
||||
return (old, new)
|
||||
@@ -169,8 +165,21 @@ class aa1Tasks(PSIDeviceBase, Device):
|
||||
"""Bluesky style stage, prepare, but does not execute"""
|
||||
if self.taskIndex.get() in (0, 1, 2):
|
||||
logger.error(f"[{self.name}] Loading AeroScript on system task. Daring today are we?")
|
||||
if len(self.fileName.get())==0:
|
||||
self.fileName.set("bec.ascript", settle_time=0.1).wait()
|
||||
|
||||
|
||||
# NOTE: old_value can either be initialized or set to UNSET_VALUE
|
||||
def wait_until_new(*_, old_value, value, **__):
|
||||
result = str(old_value) not in ("None", "UNSET_VALUE")
|
||||
print(f"FAILURE: {old_value}\t{value}\t{type(old_value)}\t{type(value)}\t{result}")
|
||||
return result
|
||||
|
||||
# Subscribe and wait for update
|
||||
status = SubscriptionStatus(self._failure, wait_until_new, settle_time=0.1)
|
||||
|
||||
# Load and check success
|
||||
status = self.switch.set("Load", settle_time=0.2)
|
||||
self.switch.set("Load", settle_time=0.2).wait()
|
||||
status.wait()
|
||||
if self._failure.value:
|
||||
raise RuntimeError("Failed to load task, please check the Aerotech IOC")
|
||||
@@ -196,6 +205,7 @@ class aa1Tasks(PSIDeviceBase, Device):
|
||||
|
||||
def not_running(*, value, timestamp, **_):
|
||||
nonlocal timestamp_
|
||||
print(value)
|
||||
result = value[task_idx] not in ["Running", 4]
|
||||
timestamp_ = timestamp
|
||||
return result
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user