GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 7de18302 authored by bliss administrator's avatar bliss administrator

Add shopen, shclose, feopen, feclose, update_on, update_off functions

parent da71705b
......@@ -2,11 +2,30 @@ from bliss.setup_globals import *
from bliss.shell.cli.user_dialog import *
from bliss.shell.cli.pt_widgets import BlissDialog
from bliss.config.static import get_config
from bliss.shell.standard import mv as bliss_mv
from bliss.shell.standard import umv as bliss_umv
from bliss.shell.standard import mvr as bliss_mvr
from bliss.shell.standard import umvr as bliss_umvr
from bliss.common.scans.ct import ct as bliss_ct
from bliss.setup_globals import *
from bliss.shell.cli.user_dialog import *
from bliss.shell.cli.pt_widgets import BlissDialog
from bliss.config.static import get_config
TOMO = None
_TOMO = None
def init_tomo(tomo):
global TOMO
TOMO = tomo
global _TOMO
_TOMO = tomo
_UPDATE_ON = False
def update_on():
global _UPDATE_ON
_UPDATE_ON = True
def update_off():
global _UPDATE_ON
_UPDATE_ON = False
def select_tomo():
dlg_tomo = UserInput(label="Enter name of tomo object you want to use (ex: hrtomo)")
......@@ -15,43 +34,44 @@ def select_tomo():
tomo = get_config().get(ret[dlg_tomo])
init_tomo(tomo)
def mvct(*args, exposure_time=None):
mv(*args)
cts(exposure_time)
def umvct(*args, exposure_time=None):
umv(*args)
cts(exposure_time)
def mvrct(*args, exposure_time=None):
mvr(*args)
cts(exposure_time)
def mv(*args):
bliss_mv(*args)
if _UPDATE_ON:
ct()
def mvr(*args):
bliss_mvr(*args)
if _UPDATE_ON:
ct()
def umv(*args):
bliss_umv(*args)
if _UPDATE_ON:
ct()
def umvr(*args):
bliss_umvr(*args)
if _UPDATE_ON:
ct()
def umvrct(*args, exposure_time=None):
umvr(*args)
cts(exposure_time)
def cts(exposure_time=None):
global TOMO
if TOMO is not None:
if TOMO.parameters.exposure_time != 0:
ct(TOMO.parameters.exposure_time)
def ct(exposure_time=None, *args):
if _UPDATE_ON:
global _TOMO
if _TOMO is not None:
if _TOMO.parameters.exposure_time != 0:
bliss_ct(_TOMO.parameters.exposure_time, *args)
else:
print(f"WARNING TOMO.parameters.exposure_time is 0")
else:
print(f"WARNING TOMO.parameters.exposure_time is 0")
print('No tomo exists in the session. Please use select_tomo() to define one')
else:
print('No tomo exists in the session. Please use select_tomo() to define one')
bliss_ct(exposure_time, *args)
def set_accumulation(detector, max_acc_expo_time):
def set_accumulation(detector):
DEFAULT_CHAIN.set_settings(default_acq_chain_acc['chain_config'])
det_def_chain = DEFAULT_CHAIN._settings.get(detector)
if det_def_chain is not None:
acq_settings = det_def_chain.get('acquisition_settings')
acq_settings.update({'acc_max_expo_time':max_acc_expo_time})
detector.acquisition.mode = 'ACCUMULATION'
detector.accumulation.max_expo_time = max_acc_expo_time
else:
if det_def_chain is None:
DEFAULT_CHAIN.set_settings(default_acq_chain['chain_config'])
raise Exception(f'{detector.name} is not configured in default chain for accumulation')
......@@ -59,8 +79,19 @@ def unset_accumulation(detector):
DEFAULT_CHAIN.set_settings(default_acq_chain['chain_config'])
det_def_chain = DEFAULT_CHAIN._settings.get(detector)
detector.acquisition.mode = 'SINGLE'
if det_def_chain is None:
raise Exception(f'{detector.name} is not configured in default chain')
def shopen():
_TOMO.shutter.beam_shutter_open()
def shclose():
_TOMO.shutter.beam_shutter_close()
def feopen():
frontend.open()
def feclose():
frontend.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment