enable adding of configs to existing configs some fixes

This commit is contained in:
gac-x07mb
2024-08-30 17:15:11 +02:00
committed by wakonig_k
parent 08a63c54ce
commit ec61712803
6 changed files with 71 additions and 34 deletions

View File

@ -104,14 +104,12 @@ print("...... %ph_load_xmap ... to reload xmap configuration")
@register_line_magic @register_line_magic
def ph_load_xmap(line): def ph_add_xmap(line):
"""
### magic for loading xmap
# magic for loading xmap """
###
t0 = tt.time() t0 = tt.time()
phoenix_server.add_xmap() phoenix.add_xmap()
print("elapsed time:", tt.time() - t0) print("elapsed time:", tt.time() - t0)
@ -121,28 +119,42 @@ print("...... %ph_load_falcon ... to reload falcon configuration")
@register_line_magic @register_line_magic
def ph_load_falcon(line): def ph_add_falcon(line):
"""
# magic to load falcon magic to add falcon to existing configuration
"""
t0 = tt.time() t0 = tt.time()
phoenix_server.add_falcon() phoenix.add_falcon()
print("elapsed time:", tt.time() - t0) print("elapsed time:", tt.time() - t0)
# enddef ## enddef
@register_line_magic
def ph_load_falcon(line):
"""
magic to load falcon as sole detector
"""
t0 = tt.time()
phoenix.load_falcon()
print("elapsed time:", tt.time() - t0)
print("...... %ph_load_config ... to reload phoenix default configuration") print("...... %ph_load_config ... to reload phoenix default configuration")
@register_line_magic @register_line_magic
def ph_load_config(line): def ph_create_config(line):
"""
load base configuration
"""
t0 = tt.time() t0 = tt.time()
phoenix_server.add_phoenix_config() phoenix.create_base_config()
print("elapsed time:", tt.time() - t0) print("elapsed time:", tt.time() - t0)
# enddef ### enddef
@register_line_magic @register_line_magic
@ -151,6 +163,9 @@ def ph_restart_bec_server(line):
os.system('gnome-terminal --geometry 120X50 -- bash -c "bec-server attach; exec bash"') os.system('gnome-terminal --geometry 120X50 -- bash -c "bec-server attach; exec bash"')
### enddef
##@register_line_magic ##@register_line_magic
# def ph_post_startup(line): # def ph_post_startup(line):
# print('import phoenix_bec.bec_ipython_client.startup.post_startup does not work caused loop ') # print('import phoenix_bec.bec_ipython_client.startup.post_startup does not work caused loop ')

View File

@ -137,3 +137,7 @@ SAI_08_MEAN:
enabled: true enabled: true
readOnly: true readOnly: true
softwareTrigger: false softwareTrigger: false
#
# END OF STANDARD CONFIG
#

View File

@ -1,14 +1,21 @@
#
# falcon without hdf5
#
falcon_nohdf5: falcon_nohdf5:
description: Falcon detector x-ray fluoresence II description: Falcon detector x-ray fluoresence with hdf5 plugin
deviceClass: phoenix_bec.devices.falcon_phoenix_no_hdf5.FalconPhoenix deviceClass: phoenix_bec.devices.falcon_phoenix.FalconPhoenix
deviceConfig: deviceConfig:
prefix: 'X07MB-SITORO:' prefix: 'X07MB-SITORO:'
deviceTags: deviceTags:
- phoenix - phoenix
- falcon - falcon
- no hdf5 - with hdf5
- phoenix_devices.yaml - phoenix_falcon.yaml
onFailure: buffer onFailure: buffer
enabled: true enabled: true
readoutPriority: async readoutPriority: async
softwareTrigger: false softwareTrigger: false
#
# END FALCON with HDF5
#

View File

@ -1,3 +1,7 @@
#
# Configuration XMAP without hdf5
#
xmap_nohdf5: xmap_nohdf5:
description: XMAP detector x-ray fluoresence II description: XMAP detector x-ray fluoresence II
deviceClass: phoenix_bec.devices.xmap_phoenix_no_hdf5.XMAPPhoenix deviceClass: phoenix_bec.devices.xmap_phoenix_no_hdf5.XMAPPhoenix

View File

@ -2,6 +2,7 @@
Directory for general phoenix specific python code Directory for general phoenix specific python code
to autoload register in __init__.py to autoload register in __init__.py

View File

@ -103,13 +103,18 @@ class PhoenixBL:
bec.config.update_session_with_file(self.file_devices_tmp) bec.config.update_session_with_file(self.file_devices_tmp)
def add_falcon(self): def add_falcon(self):
print("add_falcon") print("add_falcon to existing configuration ")
os.system( os.system(
"cat " + self.path_devices + "phoenix_falcon.yaml" + " >> " + self.file_devices_tmp "cat " + self.path_devices + "phoenix_falcon.yaml" + " >> " + self.file_devices_tmp
) )
bec.config.update_session_with_file(self.file_devices_tmp) bec.config.update_session_with_file(self.file_devices_tmp)
def load_falcon(self):
print("load_falcon")
bec.config.update_session_with_file(self.path_devices + "phoenix_falcon.yaml")
def show_phoenix_setup(self): def show_phoenix_setup(self):
print(self.path_phoenix_bec) print(self.path_phoenix_bec)
os.system("cat " + self.path_phoenix_bec + "phoenix_bec/scripts/Current_setup.txt") os.system("cat " + self.path_phoenix_bec + "phoenix_bec/scripts/Current_setup.txt")
@ -153,6 +158,7 @@ class PhGroup:
Further data can be added with new tags by Further data can be added with new tags by
ww.newtag=67 ww.newtag=67
(bec_venv) [gac-x07mb@x07mb-bec-001 phoenix_bec]$
ww.keys() -- list all keys ww.keys() -- list all keys
ww.linescan2group -- converts bec linescan data to group format ww.linescan2group -- converts bec linescan data to group format