next some base classed copied and commented to local scripts

This commit is contained in:
gac-x07mb
2024-08-21 17:54:57 +02:00
parent 20aaa069de
commit 943aa44abe
8 changed files with 52 additions and 59 deletions

View File

@ -154,7 +154,7 @@ print(' 1) phoenix_server = PhoenixBL() ... takes code from server version '
print('SERBVR VERSION DOES NOT WORK ANYMORE ')
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)')

View File

@ -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
#
############################
ScanX:
readoutPriority: baseline

View File

@ -0,0 +1 @@
from PhoenixTrigger import PhoenixTrigger

View File

@ -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.
"""
""" ----------------------------------------------------------------------------
""" ----------------------------------------------------------------------------
capture = Cpt(EpicsSignalWithRBV, "Capture")
enable = Cpt(EpicsSignalWithRBV, "EnableCallbacks", 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:
"""Prepare data backend for acquisition"""
w=9
w=9
""" --------------------------------------------------------------
self.parent.filepath.set(
self.parent.filewriter.compile_full_filename(f"{self.parent.name}.h5")
@ -302,17 +302,8 @@ class FalconSetup(CustomDetectorMixin):
"""
mapping = int(mapping_mode)
trigger = trigger_source
self.parent.collect_mode.put(mapping)
self.parent.pixel_advance_mode.put(trigger)
self.parent.ignore_gate.put(ignore_gate)
class FalconcSAXS(PSIDetectorBase):
"""
Falcon Sitoro detector for CSAXS
Parent class: PSIDetectorBase
self.parent.collect_mode.put(m
prefix ---- X07MB-ES-MA1:
class attributes:
custom_prepare_cls (FalconSetup) : Custom detector setup class for cSAXS,
inherits from CustomDetectorMixin
@ -325,6 +316,7 @@ class FalconcSAXS(PSIDetectorBase):
# Specify which functions are revealed to the user in BEC client
USER_ACCESS = ["describe"]
prefix ---- X07MB-ES-MA1:
# specify Setup class
custom_prepare_cls = FalconSetup

View File

@ -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.endpoints import MessageEndpoints
import time
logger = bec_logger.logger
DETECTOR_TIMEOUT = 5
@ -35,7 +33,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
super().__init__(*args, parent=parent, **kwargs)
self._counter = 0
WW
WW
def on_stage(self):
# is this called on each point in scan or just before scan ???
print('on stage')
@ -48,13 +46,12 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
cycles=self.parent.smpl.put(2)
time.sleep(0.5)
cycles=self.parent.total_cycles.put(cycles)
logger.success('PhoenixTrigger on stage')
def on_trigger(self):
print('on_trigger')
self.parent.start_smpl.put(1)
time.sleep(0.05) # use blocking
logger.success('PhoenixTrigger on_trigger')
return self.wait_with_status(
@ -62,7 +59,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
# logger.success(' PhoenixTrigger on_trigger complete ')
# if success:
@ -74,7 +71,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
def on_complete(self):
print('on_complete')
timeout =10
@ -99,7 +96,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin):
def on_stop(self):
logger.success(' PhoenixTrigger on_stop ')

View File

@ -38,35 +38,32 @@ print_dic('instance of device device_ins',device_ins)
print(' ')
print('DEFINE class StageXY... prefix variable not defined ')
class StageXY(Device):
print('in StageXY')
try:
print('prefix',prefix)
except:
print('prefix not defined')
# Here the whole namespace and finctionality
# of Device(Blueskyinterface,Pphydobject) is inherited
# into class StageXY using Device
# device requires as input parameters the prefix
# in the initialization of Cpt there is some magic
# hard to understand, moist likely using calss methods..
#
x = Cpt(EpicsMotor, 'ScanX')
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('init xy_stage, use input parameter from Device and prefix is defined')
xy_stage = StageXY('X07MB-ES-MA1:', name='stage')
print('init xy_stage, use input parameter from Device and prefix is defined in call ')
xy_stage = StageXY('X07MB-ES-MA1:', name='stageXXX')
print_dic('class StageXY',StageXY)
print_dic('instance of StageXY',xy_stage)
#############################################
# This is basic bluesky
# Epics motor def seems to use init params in device, whcih are

View File

@ -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.

View File

@ -39,21 +39,10 @@ class PhoenixBL():
init PhoenixBL() in phoenix_bec/scripts
"""
import os
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
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):
print(self.path_phoenix_bec)
os.system('cat '+self.path_phoenix_bec+'phoenix_bec/scripts/Current_setup.txt')