minor changes add functions to phoenix.py

This commit is contained in:
gac-x07mb
2024-12-17 16:13:36 +01:00
parent a36a0a9189
commit 3c618b431e
8 changed files with 87 additions and 9 deletions

View File

@ -196,8 +196,11 @@ print("...... %ph_restart_bec_server restarts bec-server in new terminal ")
def ph_restart_bec_server(line):
os.system("bec-server restart")
os.system(
'gnome-terminal --geometry 170X50 -- bash -c "source /data/test/x07mb-test-bec/production/bec_venv/bin/activate ; bec-server attach; exec bash"'
'gnome-terminal --geometry 100X30 -- bash -c "source /data/test/x07mb-test-bec/production/bec_venv/bin/activate ; bec-server attach ; exec bash"'
)
# os.system(
# "gnome-terminal --geometry 170X50 -- bash -c "source / tmux attach -t bec ; exec bash""
# )
# #import phoenix_bec.bec_ipython_client.startup.post_startup

View File

@ -215,9 +215,13 @@ class PhoenixTrigger(PSIDetectorBase):
start_csmpl = Cpt(
EpicsSignal, "START-CSMPL", kind=Kind.config, put_complete=True
) # cont on / off
intr_count = Cpt(
EpicsSignal, "INTR-COUNT", kind=Kind.config, put_complete=True
) # conter run up
# intr_count = Cpt(
# EpicsSignal, "INTR-COUNT", kind=Kind.config, put_complete=True
# ) # conter run up
intr_count = Cpt(EpicsSignal, "INTR-COUNT") # counter run up NEEDS TO BE READ OUT !!!!
total_cycles = Cpt(
EpicsSignal, "TOTAL-CYCLES", kind=Kind.config, put_complete=True
) # cycles set

View File

@ -9,6 +9,9 @@ ph = PhoenixBL()
#
# how do we get this to iphython command line ?
# print('........... falkon.mca1 '
##
ph.list_signals_falcon()
# ph.list_signals_falcon()
# ph.list_signals_xmap()
ph.run_shell("ls")
ph.run_shell(["ls -altr ", "pwd"])

View File

@ -0,0 +1,45 @@
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
BEC_PATH='/data/test/x07mb-test-bec/production'
alias cd_bec='cd '$BEC_PATH
alias bec_env='source 'BEC_PATH'/bec_venv/bin/activate'
alias cd_bec_ph='cd '$BEC_PATH'/phoenix_bec/phoenix_bec'
alias cd_bec_local_scripts='cd '$BEC_PATH'/phoenix_bec/phoenix_bec/local_scripts'
alias cd_bec_devices='cd '$BEC_PATH'/phoenix_bec/phoenix_bec/devices'
alias cd_bec_devices='cd '$BEC_PATH'/phoenix_bec/phoenix_bec/device_configs'
alias cd_bec_device_configs='cd /data/test/x07mb-test-bec/production/phoenix_bec/phoenix_bec/device_configs'
alias cd_bec_scripts='cd /data/test/x07mb-test-bec/production/phoenix_bec/phoenix_bec/scripts'
alias cd_bec_venv_bin='cd /data/test/x07mb-test-bec/production/bec_venv/bin'
#alias activate_bec_venv='source /data/test/x07mb-test-bec/bec_deployment/bec_venv/bin/activate'
#alias activate_bec_venv='source /data/test/x07mb-test-bec/production/bec_venv/bin/activate'
alias bec_env='source /data/test/x07mb-test-bec/production/bec_venv/bin/activate'

View File

@ -37,7 +37,10 @@ print("---------------------------------")
print(" SCAN DO NOT READ DIODE ")
dev.SAI_01_MEAN.readout_priority = "baseline" # do not read detector
ti = tt.time_ns()
s1 = scans.line_scan(dev.MA1_ScanX, 0, 0.002, steps=4, exp_time=0.01, relative=False, delay=2)
phoenix.run_shell("sh monitor.sh > monitor.out & ")
s1 = scans.line_scan(dev.MA1_ScanX, 0, 0.002, steps=4, exp_time=1, relative=False, delay=2)
tf = tt.time_ns()
print("elapsed time", (tf - ti) / 1e9)
@ -46,7 +49,7 @@ print(" SCAN READ DIODE ")
tt.sleep(2)
dev.SAI_01_MEAN.readout_priority = "monitored" # read detector
s2 = scans.line_scan(dev.MA1_ScanX, 0, 0.002, steps=11, exp_time=0.3, relative=False, delay=2)
s2 = scans.line_scan(dev.MA1_ScanX, 0, 0.002, steps=11, exp_time=0.01, relative=False, delay=2)
dev.MA1_ScanX.enabled = False

View File

@ -0,0 +1,2 @@
camonitor X07MB-ES-MA1:ScanX.VAL X07MB-ES-MA1:ScanX.RBV X07MB-OP2:START-CSMPL X07MB-OP2:SMPL X07MB-OP2:INTR-COUNT X07MB-XMAP:StartAll X07MB-XMAP:EraseStart X07MB-XMAP:StopAll
W

View File

@ -205,6 +205,25 @@ class PhoenixBL(Utilities, PhoenixHelp):
# print(self.path_phoenix_bec)
# os.system("cat " + self.path_phoenix_bec + "phoenix_bec/scripts/Current_setup.txt")
def run_shell(self, commands):
cmd = 'gnome-terminal --geometry 100X30 -- bash -c "'
print(cmd)
if type(commands) == list:
for i in commands:
cmd = cmd + i + " ; "
# endfor
else:
cmd = cmd + commands + " ; "
# endelse
cmd = cmd + ' exec bash " '
print(cmd)
os.system(cmd)
# os.system(
# 'gnome-terminal --geometry 100X30 -- bash -c "source /data/test/x07mb-test-bec/production/bec_venv/bin/activate ; bec-server attach ; exec bash"'
# )
@classmethod
def my_log(cls, x):
"""

View File

@ -12,7 +12,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
]
dependencies = []
dependencies = ["pandas"]
[project.optional-dependencies]
dev = [
@ -24,7 +24,6 @@ dev = [
"pytest-random-order",
"ophyd_devices",
"bec_server",
"pandas",
]
[project.entry-points."bec"]