From 00d1d12b4b1ae8762adfd1520be333db6ff8de5f Mon Sep 17 00:00:00 2001 From: gac-x05la Date: Wed, 3 Jul 2024 15:40:52 +0200 Subject: [PATCH] Small changes to get the config running --- .../device_configs/microxas_test_bed.yaml | 40 +++++++++---------- tomcat_bec/devices/gigafrost/gfutils.py | 11 ++--- .../devices/gigafrost/gigafrostclient.py | 11 ++++- .../devices/gigafrost/stddaq_preview.py | 6 +-- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/tomcat_bec/device_configs/microxas_test_bed.yaml b/tomcat_bec/device_configs/microxas_test_bed.yaml index 7470aa7..8b32ecc 100644 --- a/tomcat_bec/device_configs/microxas_test_bed.yaml +++ b/tomcat_bec/device_configs/microxas_test_bed.yaml @@ -47,13 +47,13 @@ femto_mean_curr: enabled: true readOnly: true softwareTrigger: false -es1_roty: - description: 'Test rotation stage' - deviceClass: tomcat_bec.devices.EpicsMotorX - deviceConfig: {prefix: 'X02DA-ES1-SMP1:ROTY'} - onFailure: buffer - enabled: false - readoutPriority: monitored +#es1_roty: +# description: 'Test rotation stage' +# deviceClass: tomcat_bec.devices.EpicsMotorX +# deviceConfig: {prefix: 'X02DA-ES1-SMP1:ROTY'} +# onFailure: buffer +# enabled: false +# readoutPriority: monitored # es1_tasks: # description: 'AA1 task management interface' @@ -79,18 +79,18 @@ es1_roty: # enabled: true # readoutPriority: monitored -camera: - description: Grashopper Camera - deviceClass: tomcat_bec.devices.GrashopperTOMCAT - deviceConfig: - prefix: 'X02DA-PG-USB:' - deviceTags: - - camera - enabled: true - onFailure: buffer - readOnly: false - readoutPriority: monitored - softwareTrigger: true +#camera: +# description: Grashopper Camera +# deviceClass: tomcat_bec.devices.GrashopperTOMCAT +# deviceConfig: +# prefix: 'X02DA-PG-USB:' +# deviceTags: +# - camera +# enabled: true +# onFailure: buffer +# readOnly: false +# readoutPriority: monitored +# softwareTrigger: true gf2: description: GigaFrost camera controls @@ -110,7 +110,7 @@ daq: description: Standard DAQ controls deviceClass: tomcat_bec.devices.gigafrost.stddaq_ws.StdDaqWsClient deviceConfig: - url: 'http://xbl-daq-29:8080' + url: 'ws://xbl-daq-29:8080' deviceTags: - std-daq enabled: true diff --git a/tomcat_bec/devices/gigafrost/gfutils.py b/tomcat_bec/devices/gigafrost/gfutils.py index 2975a59..bffd8a9 100644 --- a/tomcat_bec/devices/gigafrost/gfutils.py +++ b/tomcat_bec/devices/gigafrost/gfutils.py @@ -6,7 +6,8 @@ Created on Thu Jun 27 17:28:43 2024 @author: mohacsi_i """ -import jsonschema +# Not installed on BEC server +#import jsonschema MIN_EXPOSURE_MS = 0.002 MAX_EXPOSURE_MS = 40 @@ -228,8 +229,8 @@ layoutSchema = { def validate_json(json_data): """Silently validate a JSON data according to the predefined schema""" - try: - jsonschema.validate(instance=json_data, schema=layoutSchema) - except jsonschema.exceptions.ValidationError: - return False + #try: + # jsonschema.validate(instance=json_data, schema=layoutSchema) + #except jsonschema.exceptions.ValidationError: + # return False return True diff --git a/tomcat_bec/devices/gigafrost/gigafrostclient.py b/tomcat_bec/devices/gigafrost/gigafrostclient.py index fb97f9c..075e049 100644 --- a/tomcat_bec/devices/gigafrost/gigafrostclient.py +++ b/tomcat_bec/devices/gigafrost/gigafrostclient.py @@ -9,8 +9,15 @@ Created on Thu Jun 27 17:28:43 2024 from ophyd import Device, Component, EpicsSignal, EpicsSignalRO, Kind from ophyd.device import Staged -import gfconstants as const -from gfutils import extend_header_table +try: + import gfconstants as const +except ModuleNotFoundError: + import tomcat_bec.devices.gigafrost.gfconstants as const + +try: + from gfutils import extend_header_table +except ModuleNotFoundError: + from tomcat_bec.devices.gigafrost.gfutils import extend_header_table class GigaFrostClient(Device): diff --git a/tomcat_bec/devices/gigafrost/stddaq_preview.py b/tomcat_bec/devices/gigafrost/stddaq_preview.py index f879cb9..5cdf7c5 100644 --- a/tomcat_bec/devices/gigafrost/stddaq_preview.py +++ b/tomcat_bec/devices/gigafrost/stddaq_preview.py @@ -11,7 +11,7 @@ from time import sleep, time from threading import Thread import numpy as np import zmq -import matplotlib.pyplot as plt +#import matplotlib.pyplot as plt from ophyd import Device, Signal, Component, Kind TOPIC_FILTER = '' @@ -101,8 +101,8 @@ class StdDaqPreview(Device): def plot(self): """Plot the current image""" image = self.image.get() - plt.imshow(np.log10(image+1), vmin=0, vmax=5) - plt.pause(self._throttle) + #plt.imshow(np.log10(image+1), vmin=0, vmax=5) + #plt.pause(self._throttle) def plot_loop(self): """Blocking loop to keep plotting"""