reorganisation in bernina

This commit is contained in:
2021-01-26 14:19:13 +01:00
parent 008edcb4ac
commit 91c3e63983
2 changed files with 85 additions and 1 deletions
+62 -1
View File
@@ -38,14 +38,75 @@ namespace.append_obj(
name="cam_south",
module_name="eco.devices_general.cameras_ptz",
)
#####################################################################################################
## more temporary devices will be outcoupled to temorary module.
namespace.append_obj(
"AxisPTZ",
"bernina-cam-mobile",
lazy=True,
name="cam_mob",
module_name="eco.devices_general.cameras_ptz",
)
namespace.append_obj(
"BerninaInlineMicroscope",
pvname_camera="SARES20-CAMS142-M3",
lazy=True,
name="inline_microscope",
name="samplecam_inline",
module_name="eco.microscopes",
)
namespace.append_obj(
"CameraBasler",
"SARES20-CAMS142-C2",
lazy=True,
name="samplecam_sideview",
module_name="eco.devices_general.cameras_swissfel",
)
namespace.append_obj(
"CameraBasler",
"SARES20-CAMS142-C3",
lazy=True,
name="samplecam_xrd",
module_name="eco.devices_general.cameras_swissfel",
)
namespace.append_obj(
"PaseShifterAramis",
"SLAAR02-TSPL-EPL",
lazy=True,
name="phase_shifter",
module_name="eco.devices_general.timing",
)
# will be split in permanent and temporary
namespace.append_obj(
"Laser_Exp",
lazy=True,
name="las",
module_name="eco.loptics.bernina_experiment",
Id="SLAAR21-LMOT",
smar_config=config_berninamesp["las_smar_config"],
)
# {
# "args": [],
# "name": "cams_qioptiq",
# "z_und": 142,
# "desc": "Qioptic sample viewer in Bernina hutch",
# "type": "eco.endstations.bernina_cameras:Qioptiq",
# "kwargs": {
# "bshost": "sf-daqsync-01.psi.ch",
# "bsport": 11149,
# "zoomstage_pv": config["cams_qioptiq"]["zoomstage_pv"],
# "camera_pv": config["cams_qioptiq"]["camera_pv"],
# },
# },
# def __getattr__(*args, **kwargs)a
# print("called getattr")
+23
View File
@@ -274,6 +274,29 @@ class Namespace(object):
def all_names(self):
return self.initialized_names | self.lazy_names
def init_all(self, verbose=True, raise_errors=False):
for name in self.all_names:
if verbose:
print(("Configuring %s " % (name)).ljust(25), end="")
sys.stdout.flush()
# if verbose:
# print(("(%s)" % (name)).ljust(25), end="")
# sys.stdout.flush()
try:
dir(self.get_obj(name))
if verbose:
print((_color.GREEN + "OK" + _color.RESET).rjust(5))
sys.stdout.flush()
except Exception as expt:
# tb = traceback.format_exc()
if verbose:
print((_color.RED + "FAILED" + _color.RESET).rjust(5))
# print(sys.exc_info())
if raise_errors:
raise expt
def append_obj(
self, obj_factory, *args, lazy=False, name=None, module_name=None, **kwargs
):