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

Commit 1a80708a authored by Emmanuel Papillon's avatar Emmanuel Papillon

put in place config for shutter calibration

3dxrd -> tdxrd migration changes
parent 95a9bb1b
from bliss.config.settings import HashObjSetting
from bliss.controllers.ct2.client import CT2CounterTimer
# from bliss.common.shutter import BaseShutter, BaseShutterState
from bliss import current_session
......@@ -14,6 +14,11 @@ class FastShutter:
self.__settings = HashObjSetting(f"fastshutter:{name}")
self.__time = None
self.__calib = None
calib_config = config.get("calibration", None)
if calib_config is not None:
self.__calib = FastShutterCalibration(self, calib_config)
def name(self):
return self.__name
......@@ -92,3 +97,38 @@ class FastShutter:
def mode(self, value):
self.__shutter_mux.switch("SHUTTER", value.upper())
def calibration(self):
if self.__calib is None:
raise RuntimeError("No shutter calibration available !!")
return self.__calib
def measure(self):
class FastShutterCalibration(object):
def __init__(self, shutter, config):
self.shutter = shutter
self.__musst = config["musst"]
self.__p201 = config["p201_card"]
self.__diode_name = config["p201_diode_name"]
def __check_counters(self):
self.__diode = None
self.__timer = None
for counter in self.__p201.counters:
if == self.__diode_name:
self.__diode = counter
elif isinstance(counter, CT2CounterTimer):
self.__timer = counter
if self.__diode is None:
raise RuntimeError(f"Could find {self.__diode_name} counter on {}")
if self.__timer is None:
raise RuntimeError(f"Could not find timer on {}")
def measure(self):
......@@ -71,6 +71,7 @@ def mot_findref(axis):
ref_pos = axis.home_found_dial()
elif refcfg["search"] == "HOME":
dial_pos = axis.dial
# s6d vs s6u in iceid116... still only if above switch??
if (dial_pos - refcfg["dial"])> 0 and (axis.steps_per_unit > 0):
home_dir = -1
......@@ -5,13 +5,13 @@ from bliss.scanning.chain import ChainPreset
def set_frelon_trigger():
config = get_config()
chaincfg = config.get("chain_3dxrd_trig")
chaincfg = config.get("chain_tdxrd_trig")
def set_frelon_gate():
config = get_config()
chaincfg = config.get("chain_3dxrd_gate")
chaincfg = config.get("chain_tdxrd_gate")
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