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

Commit 78e283e5 authored by bliss administrator's avatar bliss administrator

Corrected some bugs.

Added update_is_on method to know when desactivate/reactivate it inside
tomo
parent f0771b25
......@@ -7,10 +7,10 @@ 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
from bliss import setup_globals
_TOMO = None
def init_tomo(tomo):
......@@ -27,6 +27,10 @@ def update_off():
global _UPDATE_ON
_UPDATE_ON = False
def update_is_on():
global _UPDATE_ON
return _UPDATE_ON == True
def select_tomo():
dlg_tomo = UserInput(label="Enter name of tomo object you want to use (ex: hrtomo)")
ret = BlissDialog( [[dlg_tomo]] , title='Tomo Setup').show()
......@@ -58,27 +62,30 @@ 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)
if exposure_time is not None:
bliss_ct(exposure_time, *args)
else:
print(f"WARNING TOMO.parameters.exposure_time is 0")
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('No tomo exists in the session. Please use select_tomo() to define one')
else:
bliss_ct(exposure_time, *args)
def set_accumulation(detector):
DEFAULT_CHAIN.set_settings(default_acq_chain_acc['chain_config'])
setup_globals.DEFAULT_CHAIN.set_settings(setup_globals.default_acq_chain_acc['chain_config'])
det_def_chain = DEFAULT_CHAIN._settings.get(detector)
det_def_chain = setup_globals.DEFAULT_CHAIN._settings.get(detector)
if det_def_chain is None:
DEFAULT_CHAIN.set_settings(default_acq_chain['chain_config'])
setup_globals.DEFAULT_CHAIN.set_settings(setup_globals.default_acq_chain['chain_config'])
raise Exception(f'{detector.name} is not configured in default chain for accumulation')
def unset_accumulation(detector):
DEFAULT_CHAIN.set_settings(default_acq_chain['chain_config'])
setup_globals.DEFAULT_CHAIN.set_settings(setup_globals.default_acq_chain['chain_config'])
det_def_chain = DEFAULT_CHAIN._settings.get(detector)
det_def_chain = setup_globals.DEFAULT_CHAIN._settings.get(detector)
if det_def_chain is None:
raise Exception(f'{detector.name} is not configured in default chain')
......
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