added tweaker

This commit is contained in:
2021-05-25 21:56:03 +02:00
parent cae53d791a
commit eea72f45b4
6 changed files with 47 additions and 12 deletions
+6 -6
View File
@@ -35,7 +35,7 @@ components = [
"args": ["/photonics/home/gac-bernina/eco/configuration/run_table_channels_CA"],
"name": "_env_channels_ca",
"desc": "CA channels added to the run_table",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
@@ -637,35 +637,35 @@ components = [
"args": ["/photonics/home/gac-bernina/eco/configuration/channels_JF"],
"name": "channels_JF",
"desc": "jf detector channels",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
"args": ["/photonics/home/gac-bernina/eco/configuration/channels_BS"],
"name": "channels_BS",
"desc": "jf detector channels",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
"args": ["/photonics/home/gac-bernina/eco/configuration/channels_BSCAM"],
"name": "channels_BSCAM",
"desc": "jf detector channels",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
"args": ["/photonics/home/gac-bernina/eco/configuration/channels_CA"],
"name": "channels_CA",
"desc": "jf detector channels",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
"args": ["/photonics/home/gac-bernina/eco/configuration/channels_CA_epicsdaq"],
"name": "channels_CA_epicsdaq",
"desc": "jf detector channels",
"type": "eco.devices_general.adjustable:AdjustableFS",
"type": "eco.elements.adjustable:AdjustableFS",
"kwargs": {},
},
{
+26 -1
View File
@@ -4,7 +4,10 @@ from ..elements.adjustable import AdjustableVirtual, AdjustableGetSet
from ..epics.adjustable import AdjustablePv, AdjustablePvEnum
from ..elements import Assembly
from .motors import MotorRecord
import sys
from pathlib import Path
sys.path.append('/sf/bernina/config/src/python/sf_databuffer/')
import bufferutils
CAM_CLIENT = None
PIPELINE_CLIENT = None
@@ -53,6 +56,28 @@ class CamserverConfig(Assembly):
alias = self.camserver_alias
self.set_config_fields({"alias": [alias]})
def restart_pipeline(self):
base_directory = "/sf/bernina/config/src/python/sf_databuffer/"
label = self.cam_id
policies = bufferutils.read_files(base_directory / Path("policies"), "policies")
sources = bufferutils.read_files(base_directory / Path("sources"), "sources")
sources_new = sources.copy()
# Only for debugging purposes
labeled_sources = bufferutils.get_labeled_sources(sources_new, label)
for s in labeled_sources:
bufferutils.logging.info(f"Restarting {s['stream']}")
sources_new = bufferutils.remove_labeled_source(sources_new, label)
# Stopping the removed source(s)
bufferutils.update_sources_and_policies(sources_new, policies)
# Starting the source(s) again
bufferutils.update_sources_and_policies(sources, policies)
def stop(self):
self.cc.stop_instance(self.cam_id)
+2 -2
View File
@@ -277,7 +277,7 @@ class RIXS(Assembly):
pos=2,
analyzer="Si533",
hkl=(8, 4, 4),
name="ana_2",
name="ana2",
det=self.__dict__["det"],
pvname=pvname,
)
@@ -286,7 +286,7 @@ class RIXS(Assembly):
pos=2,
analyzer="Si844",
hkl=(8, 4, 4),
name="ana_2_laser",
name="ana2_laser",
det=self.__dict__["det"],
pvname=pvname,
)
+7 -1
View File
@@ -3,7 +3,12 @@ import os
import numpy as np
import time
from ..devices_general.utilities import Changer
from ..elements.adjustable import spec_convenience, AdjustableFS, AdjustableVirtual
from ..elements.adjustable import (
spec_convenience,
AdjustableFS,
AdjustableVirtual,
tweak_option,
)
from ..epics.adjustable import AdjustablePv, AdjustablePvEnum
from ..aliases import append_object_to_object, Alias
from ..elements import Assembly
@@ -86,6 +91,7 @@ class XltEpics:
@spec_convenience
@tweak_option
class XltEpics(Assembly):
def __init__(self, pvname="SLAAR02-LTIM-PDLY", name="lxt_epics"):
super().__init__(name=name)
+2 -1
View File
@@ -5,7 +5,7 @@ from ..devices_general.utilities import Changer
from time import sleep
import numpy as np
from ..aliases import Alias, append_object_to_object
from ..elements.adjustable import spec_convenience, default_representation
from ..elements.adjustable import spec_convenience, default_representation, tweak_option
from ..epics.adjustable import AdjustablePvEnum
from ..devices_general.utilities import Changer
from ..elements.assembly import Assembly
@@ -222,6 +222,7 @@ class Double_Crystal_Mono:
@spec_convenience
@default_representation
@tweak_option
class EcolEnergy_new(Assembly):
def __init__(
self,
+4 -1
View File
@@ -7,7 +7,9 @@ import numpy as np
from ..aliases import Alias, append_object_to_object
from ..elements.adjustable import (
spec_convenience,
update_changes, default_representation,
update_changes,
default_representation,
tweak_option,
)
from ..devices_general.utilities import Changer
from ..elements.assembly import Assembly
@@ -15,6 +17,7 @@ from ..elements.assembly import Assembly
@spec_convenience
@update_changes
@tweak_option
class DoubleCrystalMono(Assembly):
def __init__(
self,