From eaff8ad1eb1a941bd3d379921f93a71ad667563c Mon Sep 17 00:00:00 2001 From: Shekar V Date: Wed, 17 Apr 2024 16:16:06 -0400 Subject: [PATCH] Added configurable raster size and logging change --- config_params.py | 5 ++++- gui/control_main.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config_params.py b/config_params.py index b94d0425..011d3bf6 100644 --- a/config_params.py +++ b/config_params.py @@ -1,5 +1,6 @@ +import grp +import os from enum import Enum -import os, grp # BlConfig parameter variable names @@ -108,6 +109,8 @@ class RasterStatus(Enum): "nyx": {"min": 0.001, "max": 0.999, "digits": 3}, } +MINIMUM_RASTER_SIZE = {"amx": 6, "fmx": 6, "nyx": 2} + LSDC_SERVICE_USERS = ("lsdc-amx", "lsdc-fmx", "lsdc-nyx") IS_STAFF = ( True diff --git a/gui/control_main.py b/gui/control_main.py index 964cb4de..777bd348 100644 --- a/gui/control_main.py +++ b/gui/control_main.py @@ -36,6 +36,7 @@ VALID_TRANSMISSION, RasterStatus, cryostreamTempPV, + MINIMUM_RASTER_SIZE ) from daq_utils import getBlConfig, setBlConfig from element_info import element_info @@ -2884,8 +2885,8 @@ def drawInteractiveRasterCB(self): # any polygon for now, interactive or from x numsteps_h = raster_h/stepsizeYPix stepsize = float(self.rasterStepEdit.text()) - while (numsteps_w < 6 and numsteps_h < 6): - print(numsteps_h, numsteps_w, stepsize, stepsizeXPix, stepsizeYPix) + while (numsteps_w < MINIMUM_RASTER_SIZE[daq_utils.beamline] and numsteps_h < MINIMUM_RASTER_SIZE[daq_utils.beamline]): + logger.info(f"{numsteps_h=}, {numsteps_w=}, {stepsize=}, {stepsizeXPix=}, {stepsizeYPix=}") if stepsize == 1: logger.error("Cannot add raster request, stepsize must be 1 micron with a minimum width or height of 5 cells") return