Skip to content

Commit

Permalink
Merge pull request #387 from vshekar/change-beamsize-parameters
Browse files Browse the repository at this point in the history
Changing 4 beamsize options to 2
  • Loading branch information
vshekar authored Jun 11, 2024
2 parents c765a38 + f113e07 commit d824163
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 5 additions & 0 deletions config_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,9 @@ class OnMountAvailOptions(Enum):
EMBL_SERVER_PV_BASE = {
"amx": "XF:17IDB-ES:AMX{EMBL}",
"fmx": "XF:17IDC-ES:FMX{EMBL}"
}

BEAMSIZE_OPTIONS = {
"S": ["V0", "H0"],
"L": ["V1", "H1"]
}
15 changes: 4 additions & 11 deletions daq_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import bluesky.plans as bp
from bluesky.preprocessors import finalize_wrapper, finalize_decorator
from fmx_annealer import govStatusGet, govStateSet, fmxAnnealer, amxAnnealer # for using annealer specific to FMX and AMX
from config_params import ON_MOUNT_OPTION, OnMountAvailOptions
from config_params import ON_MOUNT_OPTION, OnMountAvailOptions, BEAMSIZE_OPTIONS
from mxbluesky.plans import detect_loop, topview_optimized

if daq_utils.beamline == 'fmx':
Expand Down Expand Up @@ -4081,16 +4081,9 @@ def set_beamsize(sizeV, sizeH):
setPvDesc("CRL_H1B_IN",1)
else:
logger.error("Error: Horizontal size argument has to be \'H0\' or \'H1\'")
if (sizeV == 'V0' and sizeH == 'H0'):
daq_lib.set_field("size_mode",0)
elif (sizeV == 'V0' and sizeH == 'H1'):
daq_lib.set_field("size_mode",1)
elif (sizeV == 'V1' and sizeH == 'H0'):
daq_lib.set_field("size_mode",2)
elif (sizeV == 'V1' and sizeH == 'H1'):
daq_lib.set_field("size_mode",3)
else:
pass
for index, key in enumerate(BEAMSIZE_OPTIONS.keys()):
if BEAMSIZE_OPTIONS[key] == [sizeV, sizeH]:
daq_lib.set_field("size_mode", index)



Expand Down
9 changes: 5 additions & 4 deletions gui/control_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import db_lib
import lsdcOlog
from config_params import (
BEAMSIZE_OPTIONS,
CRYOSTREAM_ONLINE,
HUTCH_TIMER_DELAY,
MINIMUM_RASTER_SIZE,
RASTER_GUI_XREC_FILL_DELAY,
SAMPLE_TIMER_DELAY,
SERVER_CHECK_DELAY,
Expand All @@ -37,7 +39,6 @@
VALID_TRANSMISSION,
RasterStatus,
cryostreamTempPV,
MINIMUM_RASTER_SIZE
)
from daq_utils import getBlConfig, setBlConfig
from element_info import element_info
Expand Down Expand Up @@ -544,9 +545,8 @@ def createSampleTab(self):
setTransButton = QtWidgets.QPushButton("Set Trans")
setTransButton.clicked.connect(self.setTransCB)
beamsizeLabel = QtWidgets.QLabel("BeamSize:")
beamSizeOptionList = ["V0H0", "V0H1", "V1H0", "V1H1"]
self.beamsizeComboBox = QtWidgets.QComboBox(self)
self.beamsizeComboBox.addItems(beamSizeOptionList)
self.beamsizeComboBox.addItems(BEAMSIZE_OPTIONS.keys())
self.beamsizeComboBox.setCurrentIndex(int(self.beamSize_pv.get()))
self.beamsizeComboBox.activated[str].connect(self.beamsizeComboActivatedCB)
if daq_utils.beamline == "amx" or self.energy_pv.get() < 9000:
Expand Down Expand Up @@ -2518,7 +2518,8 @@ def protoRadioToggledCB(self, text):
pass

def beamsizeComboActivatedCB(self, text):
self.send_to_server("set_beamsize", [text[0:2], text[2:4]])
self.send_to_server("set_beamsize", BEAMSIZE_OPTIONS[text])


def protoComboActivatedCB(self, text):
self.showProtParams()
Expand Down

0 comments on commit d824163

Please sign in to comment.