minor changes
This commit is contained in:
@@ -33,18 +33,24 @@ to setup the prompts.
|
||||
logger.success("cSAXS session loaded.")
|
||||
"""
|
||||
|
||||
from IPython.core.magic import register_line_magic
|
||||
import time as tt
|
||||
|
||||
# pylint: disable=invalid-name, unused-import, import-error, undefined-variable, unused-variable, unused-argument, no-name-in-module
|
||||
import time as tt
|
||||
import sys
|
||||
from IPython.core.magic import register_line_magic
|
||||
|
||||
|
||||
from bec_lib.logger import bec_logger
|
||||
|
||||
logger = bec_logger.logger
|
||||
logger = bec_logger.LOGLEVEL.TRACE
|
||||
|
||||
#pylint: disable=invald-name, unused-import, import-error, undefined-variable, unused-variable, unused-argument, no-name-in-module
|
||||
|
||||
|
||||
# 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')
|
||||
bec._ip.run_line_magic("reload_ext","autoreload")
|
||||
@@ -54,7 +60,8 @@ print('autoreload loaded ')
|
||||
|
||||
###########
|
||||
#
|
||||
# next lines are not ideal and likely need to be removed they are a temporary fix as we had trouble finding certain paths.
|
||||
# next lines are not ideal and likely need to be removed they are a temporary fix as
|
||||
# we had trouble finding certain paths.
|
||||
#
|
||||
# we need to work in server_env, otherwise no server is found
|
||||
# path to ophyd devices is only way to find default ophyd devices
|
||||
@@ -62,6 +69,7 @@ print('autoreload loaded ')
|
||||
#
|
||||
##########
|
||||
|
||||
|
||||
print('post_startup.py : set some paths as temp fix. This needs to be solved ')
|
||||
|
||||
ophyd_devices_path='/data/test/x07mb-test-bec/bec_deployment/ophyd_devices'
|
||||
@@ -87,21 +95,24 @@ if p_path not in sys.path:
|
||||
|
||||
@register_line_magic
|
||||
def ph_reload(line):
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# this reloads certain phoenix related script to the iphython shell.
|
||||
# useful for debugging/development to be revised for production
|
||||
# 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()
|
||||
# but syntax not clear, error messages. Here we know what we do
|
||||
# but syntax not clear, error messages. Here we know what we do.
|
||||
#
|
||||
########################################################################
|
||||
|
||||
from phoenix_bec.scripts import phoenix as PH
|
||||
print('reload phoenix_bec.scripts.phoenix to iphyhton console')
|
||||
print('to update version server restart server ')
|
||||
# need to use global statement here, as I like to reload into space on
|
||||
# iphyton consoel
|
||||
global PH,phoenix
|
||||
print('from phoenix_bec.scripts import phoenix as PH')
|
||||
from phoenix_bec.scripts import phoenix as PH
|
||||
print('phoenix = PH.PhoenixBL()')
|
||||
phoenix = PH.PhoenixBL()
|
||||
#ph_config=PH.PhoenixConfighelper()
|
||||
@@ -111,6 +122,11 @@ print('register magic')
|
||||
print('...... %ph_load_xmap')
|
||||
@register_line_magic
|
||||
def ph_load_xmap(line):
|
||||
|
||||
###
|
||||
#magic for loading xmap
|
||||
###
|
||||
|
||||
t0=tt.time()
|
||||
phoenix_server.add_xmap()
|
||||
print('elapsed time:', tt.time()-t0)
|
||||
@@ -119,6 +135,9 @@ def ph_load_xmap(line):
|
||||
print('...... %ph_load_falcon')
|
||||
@register_line_magic
|
||||
def ph_load_falcon(line):
|
||||
|
||||
# magic to load falcon
|
||||
|
||||
t0=tt.time()
|
||||
phoenix_server.add_falcon()
|
||||
print('elapsed time:', tt.time()-t0)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
from phoenix_bec.scripts.phoenix import PhoenixBL
|
||||
|
||||
phoenix=PhoenixBL()
|
||||
#phoenix.read_phoenix_config()
|
||||
phoenix.show_phoenix_setup()
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#from unittest import mock
|
||||
"""
|
||||
Scritpt to be developed as template for phoenic scritps
|
||||
"""
|
||||
#from unittest import mock
|
||||
import numpy as np
|
||||
#import pandas
|
||||
#import pytest
|
||||
@@ -15,6 +18,7 @@ import sys
|
||||
import importlib
|
||||
import ophyd
|
||||
|
||||
|
||||
#logger = bec_logger.logger
|
||||
# load local configuration
|
||||
#bec.config.load_demo_config()
|
||||
|
||||
@@ -1,73 +1,66 @@
|
||||
#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 unittest import mock
|
||||
import os
|
||||
import sys
|
||||
import time as tt
|
||||
|
||||
from bec_lib.config_helper import ConfigHelper
|
||||
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
|
||||
|
||||
#import ophyd
|
||||
#logger = bec_logger.logger
|
||||
# load simulation
|
||||
#bec.config.load_demo_config()
|
||||
|
||||
class PhoenixBL():
|
||||
# .. define base path for directory with scripts
|
||||
|
||||
class PhoenixBL():
|
||||
"""
|
||||
|
||||
General class for PHOENIX beamline from phoenix_bec/phoenic_bec/scripts
|
||||
|
||||
#
|
||||
# General class for PHOENIX beamline located in phoenix_bec/phoenic_bec/scripts
|
||||
#
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
init PhoenixBL() in phoenix_bec/scripts
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import os
|
||||
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')
|
||||
#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
|
||||
# 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
|
||||
@@ -75,8 +68,8 @@ class PhoenixBL():
|
||||
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)
|
||||
|
||||
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')
|
||||
@@ -96,9 +89,3 @@ class PhoenixBL():
|
||||
def show_phoenix_setup(self):
|
||||
print(self.path_phoenix_bec)
|
||||
os.system('cat '+self.path_phoenix_bec+'phoenix_bec/scripts/Current_setup.txt')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user