From 68050cb8cf91ca5097d065fa225ebd1b05c13ce0 Mon Sep 17 00:00:00 2001 From: gac-x07mb Date: Thu, 8 Aug 2024 17:12:46 +0200 Subject: [PATCH] revised post_startup script --- .../startup/post_startup.py | 10 ++- .../device_configs/phoenix_devices.yaml_XXX | 88 ------------------- phoenix_bec/scripts/phoenix.py | 31 ++++++- 3 files changed, 33 insertions(+), 96 deletions(-) delete mode 100644 phoenix_bec/device_configs/phoenix_devices.yaml_XXX diff --git a/phoenix_bec/bec_ipython_client/startup/post_startup.py b/phoenix_bec/bec_ipython_client/startup/post_startup.py index a5ab5fe..101719a 100644 --- a/phoenix_bec/bec_ipython_client/startup/post_startup.py +++ b/phoenix_bec/bec_ipython_client/startup/post_startup.py @@ -41,7 +41,7 @@ import sys # SETUP PROMPTS bec._ip.prompts.username = "PHOENIX" bec._ip.prompts.status = 1 -""" + # make sure that edited modules are reloaded when changed print('post_startup.py : set autoreload of modules') @@ -51,8 +51,10 @@ print('post_startup.py : set autoreload of modules') #try: # #load_autoreload() -# bec._ip.run_line_magic("reload_ext","autoreload") +bec._ip.run_line_magic("reload_ext","autoreload") # print('1xn_line_magic("reload_ext","autoreload") + + bec._ip.run_line_magic("autoreload", "2") print('autoreload loaded ') @@ -109,6 +111,7 @@ def ph_reload(line): from phoenix_bec.scripts import phoenix as PH print('phoenix = PH.PhoenixBL()') phoenix = PH.PhoenixBL() + #ph_config=PH.PhoenixConfighelper() #enddef @@ -136,5 +139,4 @@ phoenix = PH.PhoenixBL() #from phoenix_bec.bec_ipython_client.plugins.phoenix import Phoenix -#from phoenix_bec.devices.falcon_phoenix_no_hdf5 import FalconHDF5Plugins -""" \ No newline at end of file +#from phoenix_bec.devices.falcon_phoenix_no_hdf5 import FalconHDF5Plugins \ No newline at end of file diff --git a/phoenix_bec/device_configs/phoenix_devices.yaml_XXX b/phoenix_bec/device_configs/phoenix_devices.yaml_XXX deleted file mode 100644 index 7c277a8..0000000 --- a/phoenix_bec/device_configs/phoenix_devices.yaml_XXX +++ /dev/null @@ -1,88 +0,0 @@ -falcon_nohdf5: - description: Falcon detector x-ray fluoresence II - deviceClass: phoenix_bec.devices.falcon_phoenix_no_hdf5.FalconcSAXS - deviceConfig: - prefix: 'X07MB-SITORO:' - deviceTags: - - phoenix - - falcon - - no hdf5 - - phoenix_devices.yaml - onFailure: buffer - enabled: true - readoutPriority: async - softwareTrigger: false - -xmap_nohdf5: - description: Falcon detector x-ray fluoresence II - deviceClass: phoenix_bec.devices.xmap_phoenix_no_hdf5.XMAPphoenix - deviceConfig: - prefix: 'X07MB-XMAP:' - deviceTags: - - phoenix - - xmap - - no hdf5 - - phoenix_bec/device_configs/phoenix_devices.yaml - onFailure: buffer - enabled: true - readoutPriority: async - softwareTrigger: false - -# -# MOTORS ES1 -# - -ScanXX: - readoutPriority: baseline - description: 'Horizontal sample position' - deviceClass: ophyd.EpicsMotor - deviceConfig: - -ScanY: - readoutPriority: baseline - description: 'Horizontal sample position' - deviceClass: ophyd.EpicsMotor - deviceConfig: - prefix: 'X07MB-ES-MA1:ScanY' - deviceTags: - - ES-MA1 - - phoenix_bec/device_configs/phoenix_devices.yaml - onFailure: retry - enabled: true - readOnly: false - softwareTrigger: false -# -# -# DIODES from ES1 ADC -# -# - -SAI_07_MEAN: - readoutPriority: monitored - description: DIODE - deviceClass: ophyd.EpicsSignalRO - deviceConfig: - auto_monitor: true - read_pv: 'X07MB-OP2-SAI_07:MEAN' a - deviceTags: - - PHOENIX - - phoenix_bec/device_configs/phoenix_devices.yaml - onFailure: buffer - enabled: true - readOnly: true - softwareTrigger: false - -SAI_08_MEAN: - readoutPriority: monitored - description: DIODE - deviceClass: ophyd.EpicsSignalRO - deviceConfig: - auto_monitor: true - read_pv: 'X07MB-OP2-SAI_08:MEAN' - deviceTags: - - PHOENIX - - phoenix_bec/device_configs/phoenix_devices.yaml - onFailure: buffer - enabled: true - readOnly: true - softwareTrigger: false \ No newline at end of file diff --git a/phoenix_bec/scripts/phoenix.py b/phoenix_bec/scripts/phoenix.py index 836a757..6886d4b 100644 --- a/phoenix_bec/scripts/phoenix.py +++ b/phoenix_bec/scripts/phoenix.py @@ -10,7 +10,9 @@ from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO #from ophyd import Kind, PVPositioner, Signal #from ophyd.flyers import FlyerInterface #from ophyd.pv_positioner import PVPositionerComparator -#from ophyd.status import DeviceStatus, SubscriptionStatus +#from ophyd.status import DeviceStatus, SubscriptionStatus + +from bec_lib.config_helper import ConfigHelper from bec_lib.logger import bec_logger logger = bec_logger.logger @@ -38,6 +40,8 @@ class PhoenixBL(): #scan_name = "phoenix_base" def __init__(self): + + """ init PhoenixBL() in phoenix_bec/scripts @@ -76,11 +80,30 @@ class PhoenixBL(): print(self.file_phoenix_devices_file) bec.config.update_session_with_file(self.file_devices_file_local) - def read_phoenix_config(self): - print('read file ') - print(self.file_phoenix_devices_file) + def add_phoenix_config(self): + print('add_phoenix_config ') + print('self.file_devices_file') bec.config.update_session_with_file(self.file_devices_file) + def add_xmap(self): + print('add xmap ') + print(self.path_devices+'phoenix_xmap.yaml') + bec.config.update_session_with_file(self.path_devices+'phoenix_xmap.yaml',timeout=50) + + def add_falcon(self): + print('add_xmap') + print(self.path_devices+'/phoenix_falcon.yaml') + bec.config.wait_for_config_reply() + bec.config.update_session_with_file(self.path_devices+'/phoenix_falcon.yaml') + def show_phoenix_setup(self): print(self.path_phoenix_bec) os.system('cat '+self.path_phoenix_bec+'phoenix_bec/scripts/Current_setup.txt') + + + +#class PhoenixConfigHelper(ConfigHelper):# +# +# def __init__(self): +# super.__init__(PhoenixConfigHelper) +# \ No newline at end of file