refactor: fixed formatter for aerotech
This commit is contained in:
parent
75360a9636
commit
573da8a20b
@ -40,5 +40,12 @@ from .aerotech.AerotechAutomation1 import (
|
||||
)
|
||||
|
||||
from .SpmBase import SpmBase
|
||||
from .aerotech.AerotechAutomation1 import aa1Controller, aa1Tasks, aa1GlobalVariables, aa1GlobalVariableBindings, aa1AxisPsoDistance, aa1AxisDriveDataCollection, EpicsMotorX
|
||||
|
||||
from .aerotech.AerotechAutomation1 import (
|
||||
aa1Controller,
|
||||
aa1Tasks,
|
||||
aa1GlobalVariables,
|
||||
aa1GlobalVariableBindings,
|
||||
aa1AxisPsoDistance,
|
||||
aa1AxisDriveDataCollection,
|
||||
EpicsMotorX,
|
||||
)
|
||||
|
@ -38,8 +38,7 @@ from collections import OrderedDict
|
||||
|
||||
|
||||
class EpicsMotorX(EpicsMotor):
|
||||
""" Special motor class that provides flyer interface and progress bar.
|
||||
"""
|
||||
"""Special motor class that provides flyer interface and progress bar."""
|
||||
|
||||
SUB_PROGRESS = "progress"
|
||||
|
||||
@ -88,7 +87,10 @@ class EpicsMotorX(EpicsMotor):
|
||||
"""Progress update on the scan"""
|
||||
if (self._startPosition is None) or (self._targetPosition is None) or (not self.moving):
|
||||
self._run_subs(
|
||||
sub_type=self.SUB_PROGRESS, value=1, max_value=1, done=1,
|
||||
sub_type=self.SUB_PROGRESS,
|
||||
value=1,
|
||||
max_value=1,
|
||||
done=1,
|
||||
)
|
||||
return
|
||||
|
||||
@ -105,8 +107,7 @@ class EpicsMotorX(EpicsMotor):
|
||||
|
||||
|
||||
class EpicsPassiveRO(EpicsSignalRO):
|
||||
""" Small helper class to read PVs that need to be processed first.
|
||||
"""
|
||||
"""Small helper class to read PVs that need to be processed first."""
|
||||
|
||||
def __init__(self, read_pv, *, string=False, name=None, **kwargs):
|
||||
super().__init__(read_pv, string=string, name=name, **kwargs)
|
||||
@ -237,7 +238,10 @@ class aa1Tasks(Device):
|
||||
"""Progress update on the scan"""
|
||||
value = self.progress()
|
||||
self._run_subs(
|
||||
sub_type=self.SUB_PROGRESS, value=value, max_value=1, done=1,
|
||||
sub_type=self.SUB_PROGRESS,
|
||||
value=value,
|
||||
max_value=1,
|
||||
done=1,
|
||||
)
|
||||
|
||||
def _progress(self) -> None:
|
||||
@ -288,8 +292,7 @@ class aa1Tasks(Device):
|
||||
return raw
|
||||
|
||||
def configure(self, d: dict = {}) -> tuple:
|
||||
""" Configuration interface for flying
|
||||
"""
|
||||
"""Configuration interface for flying"""
|
||||
# Unrolling the configuration dict
|
||||
text = str(d["text"]) if "text" in d else None
|
||||
filename = str(d["filename"]) if "filename" in d else None
|
||||
@ -1028,7 +1031,10 @@ class aa1AxisPsoDistance(aa1AxisPsoBase):
|
||||
if self.dstArrayDepleted.value:
|
||||
print("PSO array depleted")
|
||||
self._run_subs(
|
||||
sub_type=self.SUB_PROGRESS, value=1, max_value=1, done=1,
|
||||
sub_type=self.SUB_PROGRESS,
|
||||
value=1,
|
||||
max_value=1,
|
||||
done=1,
|
||||
)
|
||||
return
|
||||
|
||||
@ -1393,7 +1399,10 @@ class aa1AxisDriveDataCollection(Device):
|
||||
"""Progress update on the scan"""
|
||||
if self.state.value not in (2, "Acquiring"):
|
||||
self._run_subs(
|
||||
sub_type=self.SUB_PROGRESS, value=1, max_value=1, done=1,
|
||||
sub_type=self.SUB_PROGRESS,
|
||||
value=1,
|
||||
max_value=1,
|
||||
done=1,
|
||||
)
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user