after removing of trailing spaces
This commit is contained in:
@ -44,6 +44,7 @@ bec._ip.prompts.username = "PHOENIX"
|
|||||||
bec._ip.prompts.status = 1
|
bec._ip.prompts.status = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# make sure that edited modules are reloaded when changed
|
# make sure that edited modules are reloaded when changed
|
||||||
print('post_startup.py : set autoreload of modules')
|
print('post_startup.py : set autoreload of modules')
|
||||||
bec._ip.run_line_magic("reload_ext","autoreload")
|
bec._ip.run_line_magic("reload_ext","autoreload")
|
||||||
@ -70,11 +71,11 @@ print('add ',ophyd_devices_path)
|
|||||||
print('add ',p_path)
|
print('add ',p_path)
|
||||||
|
|
||||||
if ophyd_devices_path not in sys.path:
|
if ophyd_devices_path not in sys.path:
|
||||||
sys.path.insert(1, os.path.expandvars(ophyd_devices_path))
|
sys.path.insert(1, os.path.expandvars(ophyd_devices_path))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if p_path not in sys.path:
|
if p_path not in sys.path:
|
||||||
sys.path.insert(1, os.path.expandvars(p_path))
|
sys.path.insert(1, os.path.expandvars(p_path))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -86,23 +87,24 @@ if p_path not in sys.path:
|
|||||||
|
|
||||||
@register_line_magic
|
@register_line_magic
|
||||||
def ph_reload(line):
|
def ph_reload(line):
|
||||||
##########################################################################
|
##########################################################################
|
||||||
#
|
#
|
||||||
# this reloads certain phoenix related script to the iphython shell.
|
# this reloads certain phoenix related script to the iphython shell.
|
||||||
# useful for debugging/development to be revised for production
|
# useful for debugging/development to be revised for production
|
||||||
# aim of this magic is to quickl reload BL related stuff for debugging
|
# aim of this magic is to quickl reload BL related stuff for debugging
|
||||||
# Most likely there are better ways to do this (possibly bec.reload_user_script()
|
# Most likely there are better ways to do this (possibly bec.reload_user_script()
|
||||||
# but syntax not clear, error messages. Here we know what we do
|
# but syntax not clear, error messages. Here we know what we do
|
||||||
#
|
#
|
||||||
# #######################################################################
|
########################################################################
|
||||||
print('reload phoenix_bec.scripts.phoenix to iphyhton console')
|
|
||||||
print('to update version server restart server ')
|
print('reload phoenix_bec.scripts.phoenix to iphyhton console')
|
||||||
global PH,phoenix
|
print('to update version server restart server ')
|
||||||
print('from phoenix_bec.scripts import phoenix as PH')
|
global PH,phoenix
|
||||||
from phoenix_bec.scripts import phoenix as PH
|
print('from phoenix_bec.scripts import phoenix as PH')
|
||||||
print('phoenix = PH.PhoenixBL()')
|
from phoenix_bec.scripts import phoenix as PH
|
||||||
phoenix = PH.PhoenixBL()
|
print('phoenix = PH.PhoenixBL()')
|
||||||
#ph_config=PH.PhoenixConfighelper()
|
phoenix = PH.PhoenixBL()
|
||||||
|
#ph_config=PH.PhoenixConfighelper()
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
print('register magic')
|
print('register magic')
|
||||||
@ -131,7 +133,6 @@ def ph_load_config(line):
|
|||||||
#enddef
|
#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 ')
|
||||||
|
@ -15,7 +15,6 @@ import sys
|
|||||||
import importlib
|
import importlib
|
||||||
import ophyd
|
import ophyd
|
||||||
|
|
||||||
|
|
||||||
#logger = bec_logger.logger
|
#logger = bec_logger.logger
|
||||||
# load local configuration
|
# load local configuration
|
||||||
#bec.config.load_demo_config()
|
#bec.config.load_demo_config()
|
||||||
|
104
phoenix_bec/local_scripts/TOBEDELETED/phoenix.py_old2
Normal file
104
phoenix_bec/local_scripts/TOBEDELETED/phoenix.py_old2
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
s#from unittest import mock
|
||||||
|
import numpy as np
|
||||||
|
#import pandas
|
||||||
|
#import pytest
|
||||||
|
#from bec_lib import messages
|
||||||
|
#import device_server
|
||||||
|
#from ophyd import Component as Cpt
|
||||||
|
from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||||
|
#from ophyd import FormattedComponent as FCpt
|
||||||
|
#from ophyd import Kind, PVPositioner, Signal
|
||||||
|
#from ophyd.flyers import FlyerInterface
|
||||||
|
#from ophyd.pv_positioner import PVPositionerComparator
|
||||||
|
#from ophyd.status import DeviceStatus, SubscriptionStatus
|
||||||
|
|
||||||
|
from bec_lib.config_helper import ConfigHelper
|
||||||
|
from bec_lib.logger import bec_logger
|
||||||
|
logger = bec_logger.logger
|
||||||
|
|
||||||
|
import time as tt
|
||||||
|
|
||||||
|
#import ophyd
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
#logger = bec_logger.logger
|
||||||
|
# load simulation
|
||||||
|
#bec.config.load_demo_config()
|
||||||
|
|
||||||
|
# .. define base path for directory with scripts
|
||||||
|
|
||||||
|
|
||||||
|
class PhoenixBL():
|
||||||
|
"""
|
||||||
|
|
||||||
|
General class for PHOENIX beamline from phoenix_bec/phoenic_bec/scripts
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
init PhoenixBL() in phoenix_bec/scripts
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
||||||
|
|
||||||
|
#from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||||
|
#from ophyd import Component as Cpt
|
||||||
|
#self.ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
||||||
|
#self.ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
||||||
|
#self.DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
||||||
|
#self.SIG = Cpt(EpicsSignal,name='we',read_pv="X07MB-OP2-SAI_07:MEAN")
|
||||||
|
#self.SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
||||||
|
#self.CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
||||||
|
|
||||||
|
# load local configuration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
||||||
|
self.path_config_local = self.path_scripts_local + 'TEST_ConfigPhoenix/' # base dir for local configurations
|
||||||
|
self.path_devices_local = self.path_config_local + 'Local_device_config/' # local yamal file
|
||||||
|
self.file_devices_file_local = self.path_devices_local + 'phoenix_devices.yaml'
|
||||||
|
|
||||||
|
|
||||||
|
self.path_phoenix_bec ='/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/'
|
||||||
|
self.path_devices = self.path_phoenix_bec + 'phoenix_bec/device_configs/' # local yamal file
|
||||||
|
self.file_devices_file = self.path_phoenix_bec + 'phoenix_bec/device_configs/phoenix_devices.yaml' # local yamal file
|
||||||
|
|
||||||
|
def read_local_phoenix_config(self):
|
||||||
|
print('read file ')
|
||||||
|
print(self.file_phoenix_devices_file)
|
||||||
|
bec.config.update_session_with_file(self.file_devices_file_local)
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
104
phoenix_bec/local_scripts/TOBEDELETED/phoenix.py_old_wrongTAB
Normal file
104
phoenix_bec/local_scripts/TOBEDELETED/phoenix.py_old_wrongTAB
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
#from unittest import mock
|
||||||
|
import numpy as np
|
||||||
|
#import pandas
|
||||||
|
#import pytest
|
||||||
|
#from bec_lib import messages
|
||||||
|
#import device_server
|
||||||
|
#from ophyd import Component as Cpt
|
||||||
|
from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||||
|
#from ophyd import FormattedComponent as FCpt
|
||||||
|
#from ophyd import Kind, PVPositioner, Signal
|
||||||
|
#from ophyd.flyers import FlyerInterface
|
||||||
|
#from ophyd.pv_positioner import PVPositionerComparator
|
||||||
|
#from ophyd.status import DeviceStatus, SubscriptionStatus
|
||||||
|
|
||||||
|
from bec_lib.config_helper import ConfigHelper
|
||||||
|
from bec_lib.logger import bec_logger
|
||||||
|
logger = bec_logger.logger
|
||||||
|
|
||||||
|
import time as tt
|
||||||
|
|
||||||
|
#import ophyd
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
#logger = bec_logger.logger
|
||||||
|
# load simulation
|
||||||
|
#bec.config.load_demo_config()
|
||||||
|
|
||||||
|
# .. define base path for directory with scripts
|
||||||
|
|
||||||
|
|
||||||
|
class PhoenixBL():
|
||||||
|
"""
|
||||||
|
|
||||||
|
General class for PHOENIX beamline from phoenix_bec/phoenic_bec/scripts
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
init PhoenixBL() in phoenix_bec/scripts
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
||||||
|
|
||||||
|
#from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||||
|
#from ophyd import Component as Cpt
|
||||||
|
#self.ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
||||||
|
#self.ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
||||||
|
#self.DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
||||||
|
#self.SIG = Cpt(EpicsSignal,name='we',read_pv="X07MB-OP2-SAI_07:MEAN")
|
||||||
|
#self.SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
||||||
|
#self.CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
||||||
|
|
||||||
|
# load local configuration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
||||||
|
self.path_config_local = self.path_scripts_local + 'TEST_ConfigPhoenix/' # base dir for local configurations
|
||||||
|
self.path_devices_local = self.path_config_local + 'Local_device_config/' # local yamal file
|
||||||
|
self.file_devices_file_local = self.path_devices_local + 'phoenix_devices.yaml'
|
||||||
|
|
||||||
|
|
||||||
|
self.path_phoenix_bec ='/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/'
|
||||||
|
self.path_devices = self.path_phoenix_bec + 'phoenix_bec/device_configs/' # local yamal file
|
||||||
|
self.file_devices_file = self.path_phoenix_bec + 'phoenix_bec/device_configs/phoenix_devices.yaml' # local yamal file
|
||||||
|
|
||||||
|
def read_local_phoenix_config(self):
|
||||||
|
print('read file ')
|
||||||
|
print(self.file_phoenix_devices_file)
|
||||||
|
bec.config.update_session_with_file(self.file_devices_file_local)
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -30,73 +30,72 @@ import sys
|
|||||||
|
|
||||||
|
|
||||||
class PhoenixBL():
|
class PhoenixBL():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
General class for PHOENIX beamline from phoenix_bec/phoenic_bec/scripts
|
General class for PHOENIX beamline from phoenix_bec/phoenic_bec/scripts
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
|
||||||
def __init__(self):
|
"""
|
||||||
|
init PhoenixBL() in phoenix_bec/scripts
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
"""
|
import os
|
||||||
init PhoenixBL() in phoenix_bec/scripts
|
|
||||||
|
|
||||||
"""
|
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
||||||
|
|
||||||
|
#from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
||||||
|
#from ophyd import Component as Cpt
|
||||||
|
#self.ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
||||||
|
#self.ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
||||||
|
#self.DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
||||||
|
#self.SIG = Cpt(EpicsSignal,name='we',read_pv="X07MB-OP2-SAI_07:MEAN")
|
||||||
|
#self.SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
||||||
|
#self.CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
||||||
|
|
||||||
import os
|
# load local configuration
|
||||||
|
|
||||||
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
|
||||||
|
|
||||||
#from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
|
||||||
#from ophyd import Component as Cpt
|
|
||||||
#self.ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
|
||||||
#self.ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
|
||||||
#self.DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
|
||||||
#self.SIG = Cpt(EpicsSignal,name='we',read_pv="X07MB-OP2-SAI_07:MEAN")
|
|
||||||
#self.SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
|
||||||
#self.CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
|
||||||
|
|
||||||
# load local configuration
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
||||||
self.path_config_local = self.path_scripts_local + 'TEST_ConfigPhoenix/' # base dir for local configurations
|
self.path_config_local = self.path_scripts_local + 'TEST_ConfigPhoenix/' # base dir for local configurations
|
||||||
self.path_devices_local = self.path_config_local + 'Local_device_config/' # local yamal file
|
self.path_devices_local = self.path_config_local + 'Local_device_config/' # local yamal file
|
||||||
self.file_devices_file_local = self.path_devices_local + 'phoenix_devices.yaml'
|
self.file_devices_file_local = self.path_devices_local + 'phoenix_devices.yaml'
|
||||||
|
|
||||||
|
|
||||||
self.path_phoenix_bec ='/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/'
|
self.path_phoenix_bec ='/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/'
|
||||||
self.path_devices = self.path_phoenix_bec + 'phoenix_bec/device_configs/' # local yamal file
|
self.path_devices = self.path_phoenix_bec + 'phoenix_bec/device_configs/' # local yamal file
|
||||||
self.file_devices_file = self.path_phoenix_bec + 'phoenix_bec/device_configs/phoenix_devices.yaml' # local yamal file
|
self.file_devices_file = self.path_phoenix_bec + 'phoenix_bec/device_configs/phoenix_devices.yaml' # local yamal file
|
||||||
|
|
||||||
def read_local_phoenix_config(self):
|
def read_local_phoenix_config(self):
|
||||||
print('read file ')
|
print('read file ')
|
||||||
print(self.file_phoenix_devices_file)
|
print(self.file_phoenix_devices_file)
|
||||||
bec.config.update_session_with_file(self.file_devices_file_local)
|
bec.config.update_session_with_file(self.file_devices_file_local)
|
||||||
|
|
||||||
def add_phoenix_config(self):
|
def add_phoenix_config(self):
|
||||||
print('add_phoenix_config ')
|
print('add_phoenix_config ')
|
||||||
print('self.file_devices_file')
|
print('self.file_devices_file')
|
||||||
bec.config.update_session_with_file(self.file_devices_file)
|
bec.config.update_session_with_file(self.file_devices_file)
|
||||||
|
|
||||||
def add_xmap(self):
|
def add_xmap(self):
|
||||||
print('add xmap ')
|
print('add xmap ')
|
||||||
print(self.path_devices+'phoenix_xmap.yaml')
|
print(self.path_devices+'phoenix_xmap.yaml')
|
||||||
bec.config.update_session_with_file(self.path_devices+'phoenix_xmap.yaml',timeout=50)
|
bec.config.update_session_with_file(self.path_devices+'phoenix_xmap.yaml',timeout=50)
|
||||||
|
|
||||||
def add_falcon(self):
|
def add_falcon(self):
|
||||||
print('add_xmap')
|
print('add_xmap')
|
||||||
print(self.path_devices+'/phoenix_falcon.yaml')
|
print(self.path_devices+'/phoenix_falcon.yaml')
|
||||||
bec.config.wait_for_config_reply()
|
bec.config.wait_for_config_reply()
|
||||||
bec.config.update_session_with_file(self.path_devices+'/phoenix_falcon.yaml')
|
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')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user