diff --git a/eco/acquisition/scan.py b/eco/acquisition/scan.py index d8e241b..ec79514 100755 --- a/eco/acquisition/scan.py +++ b/eco/acquisition/scan.py @@ -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 diff --git a/eco/bernina/bernina.py b/eco/bernina/bernina.py index d7e0100..9eb844c 100644 --- a/eco/bernina/bernina.py +++ b/eco/bernina/bernina.py @@ -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) diff --git a/eco/elements/assembly.py b/eco/elements/assembly.py index 1d11b60..8ab4f67 100644 --- a/eco/elements/assembly.py +++ b/eco/elements/assembly.py @@ -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): diff --git a/eco/timing/sequencer.py b/eco/timing/sequencer.py new file mode 100644 index 0000000..5d6fbad --- /dev/null +++ b/eco/timing/sequencer.py @@ -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}' + + + + + diff --git a/eco/xdiagnostics/profile_monitors.py b/eco/xdiagnostics/profile_monitors.py index 2cf41dc..a6d3af8 100755 --- a/eco/xdiagnostics/profile_monitors.py +++ b/eco/xdiagnostics/profile_monitors.py @@ -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, ):