next some base classed copied and commented to local scripts
This commit is contained in:
@ -154,7 +154,7 @@ print(' 1) phoenix_server = PhoenixBL() ... takes code from server version '
|
|||||||
print('SERBVR VERSION DOES NOT WORK ANYMORE ')
|
print('SERBVR VERSION DOES NOT WORK ANYMORE ')
|
||||||
print('FOLDER SCRUIPT SEEMS TO BE NON_STANDARD!!!!!!! ')
|
print('FOLDER SCRUIPT SEEMS TO BE NON_STANDARD!!!!!!! ')
|
||||||
|
|
||||||
#phoenix_server=PhoenixBL()
|
phoenix_server=PhoenixBL()
|
||||||
|
|
||||||
print(' 2) phoenix=PH.PhoenixBL() ... on inpython shell only! (for debugging)')
|
print(' 2) phoenix=PH.PhoenixBL() ... on inpython shell only! (for debugging)')
|
||||||
|
|
||||||
|
@ -5,9 +5,33 @@
|
|||||||
#
|
#
|
||||||
#####################################################
|
#####################################################
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
#
|
||||||
|
# TRIGGER/Delay
|
||||||
|
#
|
||||||
|
###################
|
||||||
|
|
||||||
|
phoenix_trigger:
|
||||||
|
description: Trigger
|
||||||
|
deviceClass: phoenix_bec.devices.phoenix_trigger.PhoenixTrigger
|
||||||
|
deviceConfig:
|
||||||
|
prefix: 'X07MB-OP2:'
|
||||||
|
deviceTags:
|
||||||
|
- phoenix
|
||||||
|
- trigger
|
||||||
|
- phoenix_devices.yaml
|
||||||
|
onFailure: buffer
|
||||||
|
enabled: true
|
||||||
|
readoutPriority: async
|
||||||
|
softwareTrigger: false
|
||||||
|
|
||||||
|
############################
|
||||||
#
|
#
|
||||||
# MOTORS ES1
|
# MOTORS ES1
|
||||||
#
|
#
|
||||||
|
############################
|
||||||
|
|
||||||
|
|
||||||
ScanX:
|
ScanX:
|
||||||
readoutPriority: baseline
|
readoutPriority: baseline
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
from PhoenixTrigger import PhoenixTrigger
|
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# changes version for PHOENIX WITHOUT HDF5 plugin to be revised/renamed...
|
# changes version for PHOENIX WITHOUT HDF5 plugin to be revised/renamed...
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class FalconHDF5Plugins(Device):
|
|||||||
Base class to map EPICS PVs from HDF5 Plugin to ophyd signals.
|
Base class to map EPICS PVs from HDF5 Plugin to ophyd signals.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
""" ----------------------------------------------------------------------------
|
""" ----------------------------------------------------------------------------
|
||||||
capture = Cpt(EpicsSignalWithRBV, "Capture")
|
capture = Cpt(EpicsSignalWithRBV, "Capture")
|
||||||
enable = Cpt(EpicsSignalWithRBV, "EnableCallbacks", string=True, kind="config")
|
enable = Cpt(EpicsSignalWithRBV, "EnableCallbacks", string=True, kind="config")
|
||||||
xml_file_name = Cpt(EpicsSignalWithRBV, "XMLFileName", string=True, kind="config")
|
xml_file_name = Cpt(EpicsSignalWithRBV, "XMLFileName", string=True, kind="config")
|
||||||
@ -186,7 +186,7 @@ class FalconSetup(CustomDetectorMixin):
|
|||||||
|
|
||||||
def prepare_data_backend(self) -> None:
|
def prepare_data_backend(self) -> None:
|
||||||
"""Prepare data backend for acquisition"""
|
"""Prepare data backend for acquisition"""
|
||||||
w=9
|
w=9
|
||||||
""" --------------------------------------------------------------
|
""" --------------------------------------------------------------
|
||||||
self.parent.filepath.set(
|
self.parent.filepath.set(
|
||||||
self.parent.filewriter.compile_full_filename(f"{self.parent.name}.h5")
|
self.parent.filewriter.compile_full_filename(f"{self.parent.name}.h5")
|
||||||
@ -302,17 +302,8 @@ class FalconSetup(CustomDetectorMixin):
|
|||||||
"""
|
"""
|
||||||
mapping = int(mapping_mode)
|
mapping = int(mapping_mode)
|
||||||
trigger = trigger_source
|
trigger = trigger_source
|
||||||
self.parent.collect_mode.put(mapping)
|
self.parent.collect_mode.put(m
|
||||||
self.parent.pixel_advance_mode.put(trigger)
|
prefix ---- X07MB-ES-MA1:
|
||||||
self.parent.ignore_gate.put(ignore_gate)
|
|
||||||
|
|
||||||
|
|
||||||
class FalconcSAXS(PSIDetectorBase):
|
|
||||||
"""
|
|
||||||
Falcon Sitoro detector for CSAXS
|
|
||||||
|
|
||||||
Parent class: PSIDetectorBase
|
|
||||||
|
|
||||||
class attributes:
|
class attributes:
|
||||||
custom_prepare_cls (FalconSetup) : Custom detector setup class for cSAXS,
|
custom_prepare_cls (FalconSetup) : Custom detector setup class for cSAXS,
|
||||||
inherits from CustomDetectorMixin
|
inherits from CustomDetectorMixin
|
||||||
@ -325,6 +316,7 @@ class FalconcSAXS(PSIDetectorBase):
|
|||||||
|
|
||||||
# Specify which functions are revealed to the user in BEC client
|
# Specify which functions are revealed to the user in BEC client
|
||||||
USER_ACCESS = ["describe"]
|
USER_ACCESS = ["describe"]
|
||||||
|
prefix ---- X07MB-ES-MA1:
|
||||||
|
|
||||||
# specify Setup class
|
# specify Setup class
|
||||||
custom_prepare_cls = FalconSetup
|
custom_prepare_cls = FalconSetup
|
||||||
|
@ -12,8 +12,6 @@ from ophyd_devices.interfaces.base_classes.psi_detector_base import PSIDetectorB
|
|||||||
from bec_lib import bec_logger, messages
|
from bec_lib import bec_logger, messages
|
||||||
from bec_lib.endpoints import MessageEndpoints
|
from bec_lib.endpoints import MessageEndpoints
|
||||||
|
|
||||||
import time
|
|
||||||
|
|
||||||
logger = bec_logger.logger
|
logger = bec_logger.logger
|
||||||
|
|
||||||
DETECTOR_TIMEOUT = 5
|
DETECTOR_TIMEOUT = 5
|
||||||
@ -35,7 +33,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
|
|||||||
super().__init__(*args, parent=parent, **kwargs)
|
super().__init__(*args, parent=parent, **kwargs)
|
||||||
self._counter = 0
|
self._counter = 0
|
||||||
|
|
||||||
WW
|
WW
|
||||||
def on_stage(self):
|
def on_stage(self):
|
||||||
# is this called on each point in scan or just before scan ???
|
# is this called on each point in scan or just before scan ???
|
||||||
print('on stage')
|
print('on stage')
|
||||||
@ -48,13 +46,12 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
|
|||||||
cycles=self.parent.smpl.put(2)
|
cycles=self.parent.smpl.put(2)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
cycles=self.parent.total_cycles.put(cycles)
|
cycles=self.parent.total_cycles.put(cycles)
|
||||||
|
|
||||||
logger.success('PhoenixTrigger on stage')
|
logger.success('PhoenixTrigger on stage')
|
||||||
|
|
||||||
def on_trigger(self):
|
def on_trigger(self):
|
||||||
|
print('on_trigger')
|
||||||
self.parent.start_smpl.put(1)
|
self.parent.start_smpl.put(1)
|
||||||
time.sleep(0.05) # use blocking
|
|
||||||
logger.success('PhoenixTrigger on_trigger')
|
logger.success('PhoenixTrigger on_trigger')
|
||||||
|
|
||||||
return self.wait_with_status(
|
return self.wait_with_status(
|
||||||
@ -62,7 +59,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# logger.success(' PhoenixTrigger on_trigger complete ')
|
# logger.success(' PhoenixTrigger on_trigger complete ')
|
||||||
|
|
||||||
# if success:
|
# if success:
|
||||||
@ -74,7 +71,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
|
|||||||
|
|
||||||
|
|
||||||
def on_complete(self):
|
def on_complete(self):
|
||||||
|
print('on_complete')
|
||||||
timeout =10
|
timeout =10
|
||||||
|
|
||||||
|
|
||||||
@ -99,7 +96,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_stop(self):
|
def on_stop(self):
|
||||||
logger.success(' PhoenixTrigger on_stop ')
|
logger.success(' PhoenixTrigger on_stop ')
|
||||||
|
|
||||||
|
@ -38,35 +38,32 @@ print_dic('instance of device device_ins',device_ins)
|
|||||||
print(' ')
|
print(' ')
|
||||||
print('DEFINE class StageXY... prefix variable not defined ')
|
print('DEFINE class StageXY... prefix variable not defined ')
|
||||||
|
|
||||||
|
|
||||||
class StageXY(Device):
|
class StageXY(Device):
|
||||||
|
# Here the whole namespace and finctionality
|
||||||
print('in StageXY')
|
# of Device(Blueskyinterface,Pphydobject) is inherited
|
||||||
try:
|
# into class StageXY using Device
|
||||||
print('prefix',prefix)
|
# device requires as input parameters the prefix
|
||||||
except:
|
# in the initialization of Cpt there is some magic
|
||||||
print('prefix not defined')
|
# hard to understand, moist likely using calss methods..
|
||||||
|
#
|
||||||
|
|
||||||
x = Cpt(EpicsMotor, 'ScanX')
|
x = Cpt(EpicsMotor, 'ScanX')
|
||||||
y = Cpt(EpicsMotor, 'ScanY')
|
y = Cpt(EpicsMotor, 'ScanY')
|
||||||
|
# end class
|
||||||
|
|
||||||
class StageXY2(Device):
|
|
||||||
#def __init__(self,prefix,name=''):
|
|
||||||
# print('in StageXY')
|
|
||||||
# print(prefix)
|
|
||||||
##print('prefix',prefix)
|
|
||||||
|
|
||||||
x = Cpt(EpicsMotor, 'ScanX')
|
|
||||||
y = Cpt(EpicsMotor, 'ScanY')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print('init xy_stage, use input parameter from Device and prefix is defined')
|
print('init xy_stage, use input parameter from Device and prefix is defined in call ')
|
||||||
xy_stage = StageXY('X07MB-ES-MA1:', name='stage')
|
xy_stage = StageXY('X07MB-ES-MA1:', name='stageXXX')
|
||||||
|
|
||||||
print_dic('class StageXY',StageXY)
|
print_dic('class StageXY',StageXY)
|
||||||
print_dic('instance of StageXY',xy_stage)
|
print_dic('instance of StageXY',xy_stage)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
# This is basic bluesky
|
# This is basic bluesky
|
||||||
# Epics motor def seems to use init params in device, whcih are
|
# Epics motor def seems to use init params in device, whcih are
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
This diretory is for scripts, test etc. which are not loaded into the server.
|
|
||||||
|
|
||||||
Hence no directory should contain a file named
|
|
||||||
__init__.py
|
|
||||||
|
|
||||||
|
|
||||||
For now we keep it in the phoenix_bec structure, but for operation, such files should be located out side of the
|
|
||||||
bec_phoenix plugin.
|
|
@ -39,21 +39,10 @@ class PhoenixBL():
|
|||||||
init PhoenixBL() in phoenix_bec/scripts
|
init PhoenixBL() in phoenix_bec/scripts
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
print('..... init PhoenixBL from phoenix_bec/scripts/phoenix.py')
|
||||||
|
|
||||||
#from ophyd import Device, EpicsMotor, EpicsSignal, EpicsSignalRO
|
|
||||||
#from ophyd import Component as Cpt
|
|
||||||
#self.ScanX = EpicsMotor(name='ScanX',prefix='X07MB-ES-MA1:ScanX')
|
|
||||||
#self.ScanY = EpicsMotor(name='ScanY',prefix='X07MB-ES-MA1:ScanY')
|
|
||||||
#self.DIODE = EpicsSignal(name='SI',read_pv='X07MB-OP2-SAI_07:MEAN')
|
|
||||||
#self.SIG = Cpt(EpicsSignal,name='we',read_pv="X07MB-OP2-SAI_07:MEAN")
|
|
||||||
#self.SMPL = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:SMPL')
|
|
||||||
#self.CYCLES = EpicsSignal(name='SMPL',read_pv='X07MB-OP2:TOTAL-CYCLES',write_pv='X07MB-OP2:TOTAL-CYCLES')
|
|
||||||
|
|
||||||
# load local configuration
|
# load local configuration
|
||||||
|
|
||||||
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
self.path_scripts_local = '/data/test/x07mb-test-bec/bec_deployment/phoenix_bec/phoenix_bec/local_scripts/'
|
||||||
@ -90,3 +79,4 @@ class PhoenixBL():
|
|||||||
def show_phoenix_setup(self):
|
def show_phoenix_setup(self):
|
||||||
print(self.path_phoenix_bec)
|
print(self.path_phoenix_bec)
|
||||||
os.system('cat '+self.path_phoenix_bec+'phoenix_bec/scripts/Current_setup.txt')
|
os.system('cat '+self.path_phoenix_bec+'phoenix_bec/scripts/Current_setup.txt')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user