fixes for fuchs and started new sequencer module

This commit is contained in:
2021-10-10 09:40:17 +02:00
parent 7c9eaca8ef
commit 3cd730e616
5 changed files with 58 additions and 27 deletions
+8 -2
View File
@@ -244,8 +244,14 @@ class Scan:
self.scan_info["scan_step_info"].append(step_info)
def writeScanInfo(self):
with open(self.scan_info_filename, "w") as f:
json.dump(self.scan_info, f, indent=4, sort_keys=True)
if self.scan_info_filename.exists():
with open(self.scan_info_filename, "w") as f:
json.dump(self.scan_info, f, indent=4, sort_keys=True)
else:
with open(self.scan_info_filename, "r+") as f:
f.seek(0)
json.dump(self.scan_info, f, indent=4, sort_keys=True)
f.truncate()
def scanAll(self, step_info=None):
done = False
+8 -8
View File
@@ -398,13 +398,13 @@ namespace.append_obj(
pvname_zoom="SARES20-MF1:MOT_16",
)
# 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-C2",
lazy=True,
name="samplecam_sideview",
module_name="eco.devices_general.cameras_swissfel",
)
namespace.append_obj(
"CameraBasler",
@@ -599,7 +599,7 @@ except:
#### pgroup specific appending, might be temporary at this location ####
namespace.append_obj('Xom',module_name='xom',name='xom')
namespace.append_obj('Xom',module_name='xom',name='xom',lazy=True)
+16 -16
View File
@@ -101,22 +101,22 @@ class Assembly:
base = self
settings = {}
status_indicators = {}
for ts in self.settings:
if (not (ts is self)) and hasattr(ts, "get_status"):
tstat = ts.get_status(base=base)
settings.update(tstat["settings"])
status_indicators.update(tstat["status_indicators"])
else:
settings[ts.alias.get_full_name(base=base)] = ts.get_current_value()
for ts in self.status_indicators:
if (not (ts is self)) and hasattr(ts, "get_status"):
tstat = ts.get_status(base=base)
status_indicators.update(tstat["settings"])
status_indicators.update(tstat["status_indicators"])
else:
status_indicators[
ts.alias.get_full_name(base=base)
] = ts.get_current_value()
for ts in self.settings_collection.get_list():
# if (not (ts is self)) and hasattr(ts, "get_status"):
# tstat = ts.get_status(base=base)
# settings.update(tstat["settings"])
# status_indicators.update(tstat["status_indicators"])
# else:
settings[ts.alias.get_full_name(base=base)] = ts.get_current_value()
for ts in self.status_indicators_collection.get_list():
# if (not (ts is self)) and hasattr(ts, "get_status"):
# tstat = ts.get_status(base=base)
# status_indicators.update(tstat["settings"])
# status_indicators.update(tstat["status_indicators"])
# else:
status_indicators[
ts.alias.get_full_name(base=base)
] = ts.get_current_value()
return {"settings": settings, "status_indicators": status_indicators}
def status(self, get_string=False):
+18
View File
@@ -0,0 +1,18 @@
from ..epics import AdjustablePv
from ..elements import Assembly
class CtaSequencer(Assembly):
def __init__(self,pvname, sequence_number, name=None):
super().__init__(name=name)
self.pvname = pvname
self.sequence_number = sequence_number
self._append(AdjustablePv,self._pvstr('Crtl-Length-I'),name='length',is_setting=True)
self._append(AdjustablePv,self._pvstr('Crtl-Cycles-I'),name='length',is_setting=True)
def _pvstr(self,suffix=''):
return f'{self.pvname}:seq{self.sequence_number:d}{suffix}'
+8 -1
View File
@@ -72,6 +72,13 @@ class Target_xyz(Assembly):
name="z",
is_setting=True,
)
# temporarily remove the offsets for the limit switch homed stages
ix = self.settings_collection._list.index(self.x.offset)
self.settings_collection._list.pop(ix)
ix = self.settings_collection._list.index(self.y.offset)
self.settings_collection._list.pop(ix)
ix = self.settings_collection._list.index(self.z.offset)
self.settings_collection._list.pop(ix)
class ProfKbBernina(Assembly):
@@ -83,7 +90,7 @@ class ProfKbBernina(Assembly):
pvname_mirror="SARES23-LIC9",
mirror_in=15,
mirror_out=-5,
pvname_zoom="SARES20-MF1:MOT_8",
pvname_zoom="SARES20-MF2:MOT_4",
pvname_camera="SARES20-PROF141-M1",
name=None,
):