fix: new import locations and types for bec macros #172
@@ -18,7 +18,7 @@ class BecMacros(ABC):
|
||||
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def init_beamline_environment() -> tuple[Any, Any]: ...
|
||||
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
|
||||
|
||||
@@ -17,8 +17,8 @@ class SimulatedBecMacros(BecMacros):
|
||||
@staticmethod
|
||||
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
|
||||
@staticmethod
|
||||
def init_beamline_environment() -> tuple[Any, Any]:
|
||||
return (None, None)
|
||||
def init_beamline_environment() -> tuple[Any, Any, Any]:
|
||||
return (None, None, None)
|
||||
|
||||
@staticmethod
|
||||
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
|
||||
|
||||
@@ -41,7 +41,7 @@ class X06daBecMacros(BecMacros):
|
||||
@staticmethod
|
||||
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
|
||||
@staticmethod
|
||||
def init_beamline_environment() -> tuple[Any, Any]: ...
|
||||
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
|
||||
@staticmethod
|
||||
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -12,9 +12,6 @@ class X10SaBecMacros(BecMacros):
|
||||
save_and_reload,
|
||||
save_current_position,
|
||||
)
|
||||
from pxii_bec.macros.init_beamline import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
init_beamline_environment,
|
||||
)
|
||||
from pxii_bec.macros.katscripts import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
auto_exposure,
|
||||
)
|
||||
@@ -23,6 +20,9 @@ class X10SaBecMacros(BecMacros):
|
||||
get_current_energy,
|
||||
mono_pitch_scan,
|
||||
)
|
||||
from pxii_bec.scripts.init_beamline import ( # pyright: ignore[reportMissingImports, reportMissingModuleSource]
|
||||
init_beamline_environment,
|
||||
)
|
||||
|
||||
self.save_and_reload = save_and_reload
|
||||
self.save_current_position = save_current_position
|
||||
@@ -37,7 +37,7 @@ class X10SaBecMacros(BecMacros):
|
||||
@staticmethod
|
||||
def save_current_position(device, position, axis=None, force=False, max_delta=0.5) -> None: ...
|
||||
@staticmethod
|
||||
def init_beamline_environment() -> tuple[Any, Any]: ...
|
||||
def init_beamline_environment() -> tuple[Any, Any, Any]: ...
|
||||
@staticmethod
|
||||
def bl_energy(energy_ev, move_gap=True, mono_scan=True, plot=True): ...
|
||||
@staticmethod
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
import time
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
|
||||
from aarecommon.config.beamline import cfg_get, mx_beamline
|
||||
from aarecommon.config.logger import setup_logger
|
||||
@@ -72,6 +73,7 @@ class BECClientWorker:
|
||||
logger.debug(f"initialising BEC worker for {beamline}")
|
||||
BEAMLINE = beamline.value.lower()
|
||||
self.beamline = beamline
|
||||
self._backlight_brightness: Any
|
||||
if self.beamline is MXBeamline.X06DA:
|
||||
self._beamline_name = "pxiii"
|
||||
elif self.beamline is MXBeamline.X10SA:
|
||||
@@ -112,7 +114,7 @@ class BECClientWorker:
|
||||
|
||||
def _init_beamline_environment(self):
|
||||
try:
|
||||
self.position_devices, self.planner = self.macros.init_beamline_environment()
|
||||
_, self.position_devices, self.planner = self.macros.init_beamline_environment()
|
||||
self._backlight_brightness = self.position_devices["bl_bright"]
|
||||
self._frontlight_brightness = self.position_devices["fl_bright"]
|
||||
self._zoom = self.dev.scam_zoom
|
||||
|
||||
Reference in New Issue
Block a user