Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
8cc8c70
Auto-autoproc initial implementation
vshekar Mar 6, 2025
5063fde
Auto-autoproc set beamline id in fastdph5.py
vshekar Mar 6, 2025
f18c176
Added autoproc blacklist and running after fastdp
vshekar Jul 14, 2025
d808c10
Updated runFastDP to handle failure in fastdp execution
vshekar Jan 12, 2026
bd93dab
Changed LSDC server to use PV callbacks
vshekar Oct 19, 2025
0f1dee7
Added comments and moved code for readability
vshekar Dec 30, 2025
01b2625
Changed the way worker executes
vshekar Dec 30, 2025
1ecc287
Moved daq_main.py to server.py
vshekar Dec 30, 2025
263ad94
Removed NYX related code
vshekar May 23, 2025
80e1c3c
Added Special puck option for FMX
vshekar Oct 19, 2025
c1dc9fc
Moved callback def to after the check
vshekar Jan 12, 2026
fcd6393
Prevent callback from triggering twice
vshekar Jan 12, 2026
bfdfb92
Added CS1000 temp ramping
vshekar Oct 19, 2025
124330a
Apply suggestions from code review
vshekar Jan 5, 2026
7c01e86
Cleanup threads when closing app
vshekar Dec 31, 2025
aff1b12
Small changes to gui
vshekar Dec 31, 2025
f21406f
Removed manual invocations of callbacks
vshekar Dec 31, 2025
5eca237
Updates to loop alignment bluesky plans
vshekar Dec 31, 2025
5c5d91e
Fixes to floco recovery processes
vshekar Oct 8, 2025
dd581a7
Added more commands to update server rather than database from gui
vshekar Dec 30, 2025
0ef0712
imported json and fixed function names
vshekar Dec 30, 2025
46e9724
Changed how check boxes are first intialized
vshekar Dec 30, 2025
d60dab8
Added unmountCold on-off functions
vshekar Dec 31, 2025
a042da4
Using cam url and attaching resolution
vshekar Dec 31, 2025
bd9aed8
Apply suggestion from @Copilot
vshekar Dec 31, 2025
c4c68e6
Apply suggestion from @Copilot
vshekar Dec 31, 2025
5568e28
Apply suggestion from @Copilot
vshekar Dec 31, 2025
aead946
Apply suggestions from code review
vshekar Dec 31, 2025
48b2e74
Added message to gui when unmount cold is toggled
vshekar Dec 31, 2025
f9b4bd1
Made recoverRobot and dryGripper compact
vshekar Dec 31, 2025
d8d6c6b
Add new multicol protocol
vshekar Oct 15, 2025
3dc9cf2
Removed unused functions from daq_macros
vshekar Mar 5, 2025
b485ae4
Removed unused functions from daq_macros
vshekar Feb 11, 2025
e64701e
Remove references to PI scanner
vshekar Feb 6, 2025
2a7196d
Added pixi and related changes to lsdc
vshekar Jan 13, 2026
ae020e2
Fixes to albula interface
vshekar Jan 13, 2026
e51989d
Removed mjpg_url check, assuming it can end with cgi or other urls
vshekar Jan 13, 2026
e9e5042
Fixed log widget error
vshekar Jan 13, 2026
4d4329f
Add current cycle check
vshekar Jan 13, 2026
3d820b0
Changed local variables to instance variables in control_main
vshekar Jan 14, 2026
ac7528c
Add new multicol protocol
vshekar Oct 15, 2025
79b26bf
Fixed camera frame rate for mjpg
vshekar May 13, 2026
96530c7
Delete children of automated collections
vshekar May 13, 2026
ed2c9ee
Add LSDCStui Changes
vshekar May 14, 2026
fff4d7c
Added dose multiplication for FMX in userscreen
vshekar May 14, 2026
1217e8a
Removed custom pv > callback > qtsignal > slot chains
vshekar May 14, 2026
6b9c694
Added ophyd devices instead of using epx.db
vshekar May 15, 2026
bd79dc2
Added Comm and Zebra signals to devices
vshekar May 15, 2026
d3e7abb
Replaced all pyepics pv objects in GUI with ophyd devices
vshekar May 17, 2026
d3a8c02
Added SmartMagnet and force_torque_sensor to AMX+FMX
vshekar May 17, 2026
bcf7da9
Add mini-raster
vshekar May 17, 2026
10d918f
Autosummary table
vshekar May 17, 2026
57aba90
Small misc fixes
vshekar May 17, 2026
d961fdc
Queue and dequeue request without losing priority
vshekar May 17, 2026
1a4b462
Removed prefix widgets from GUI
vshekar May 17, 2026
6219119
Add summarytable to pixi.toml
vshekar May 17, 2026
bd03ef2
Fixed GUI bugs
vshekar May 17, 2026
575825c
Fixed queue pause/resume
vshekar May 17, 2026
283c231
Use refreshTreeThreaded
vshekar May 22, 2026
f244b33
Added 1 second delay to refresh and no "row_clicked" in follow mode
vshekar May 22, 2026
57e891d
Moved xrec raster data fetch to background thread
vshekar Jun 10, 2026
dcf9549
Added timing logs and heartbeat for stuck gui thread
vshekar Jun 11, 2026
6bbf35b
Added UI stall monitor
vshekar Jun 11, 2026
1e4ea7b
Updated pv bridge to emit updates much slower
vshekar Jun 12, 2026
0818301
Added timers to pv updates to see real values
vshekar Jun 12, 2026
6b5b27a
Added safe_get when PVs not available
vshekar Jun 19, 2026
afd1909
Added guards to prevent creating too small of a raster
vshekar Jun 19, 2026
edc2d02
Using requests for getting axis images
vshekar Jun 23, 2026
5d2a30c
Allow VideoThreads to switch between jpg and mjpg streams
vshekar Jun 23, 2026
bcb476b
Add _make_capture to VideoThread
vshekar Jun 23, 2026
fb5c40a
Moving sample cam from mjpg to jpg poll
vshekar Jun 24, 2026
800df81
Added collection metadata into bluesky start document
vshekar Jun 25, 2026
1156e4f
Added sample metadata to loop centering
vshekar Jul 1, 2026
83689b9
Added anomaly detection if image not received from cam
vshekar Jul 4, 2026
b2d0e1c
Changes to raster collection corresponding to new ophyd device
vshekar Jul 8, 2026
3ef32ee
Added collection metadata into bluesky start document
vshekar Jun 25, 2026
6b40bf8
Added detDist to raster definition
vshekar Jul 10, 2026
09529c9
Fixed rasters not getting correct detDist
vshekar Jul 12, 2026
ea7b6de
Update server to prevent functions running while collections run
vshekar Jul 20, 2026
2d30b54
TiledWriter update
vshekar Jul 28, 2026
65b1c4a
Updated bin files for AMX/FMX
vshekar Sep 13, 2026
e2b13d4
Fixed staff screen state check and robot commands to embl server
vshekar Sep 13, 2026
c668a99
Send runDCQueue to second thread in control_main
vshekar Sep 13, 2026
a76c6a4
Allow PYZ homer to initialize in both beamlines
vshekar Sep 13, 2026
f9ef492
Add homePins and pinsHomed Sentinel signals
vshekar Sep 13, 2026
2b91dad
Add correct bluesky metadata for tiled_writer
vshekar Sep 13, 2026
44869da
Validate request model's proposal_id
vshekar Sep 13, 2026
ea4a64e
Update FMX's config params for new detector
vshekar Sep 13, 2026
37ec7a0
Update raddose lib for FMX based on beamsize
vshekar Sep 13, 2026
3822202
Clean up runDCQueue
vshekar Sep 13, 2026
01085b9
Using decorator to mark functions safe to run in parallel
vshekar Jul 20, 2026
63a0024
Added more safe_to_run_in_parallel functions
vshekar Sep 13, 2026
82bf33f
Push raster data fetch to a separate thread
vshekar Sep 14, 2026
554c20d
Optimize data raster data fetch from analysisstore
vshekar Sep 14, 2026
18323a8
Retry wrapper for data services
vshekar Sep 14, 2026
2bf7e2b
defineRectRaster returns uid and request definition
vshekar Sep 14, 2026
9fae957
Code cleanup and small fixes
vshekar Sep 14, 2026
405697f
Update pixi
vshekar Sep 14, 2026
6a2f299
Updates to video displays to prevent GUI freezes
vshekar Sep 14, 2026
a281703
Update start_bs to use tiled and BeamlineDevices class
vshekar Sep 14, 2026
6208487
Updated Eiger detector check
vshekar Sep 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ target/
*#*
*py.*
runEdna_old_21Jan2020.py

.pixi/
60 changes: 0 additions & 60 deletions Gen_Commands.py

This file was deleted.

59 changes: 0 additions & 59 deletions Gen_Traj_Square.py

This file was deleted.

8 changes: 1 addition & 7 deletions beamline_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,8 @@ def read_db():

def init_motors():
global motor_channel_dict
md2_motors = ["omega","sampleX","sampleY","sampleZ", "finex", "finey", "finez"]

for key in list(motor_dict.keys()):
if beamline_designation == "XF:19ID" and key in md2_motors:
from mxbluesky.devices.md2 import MD2Positioner
motor_channel_dict[motor_dict[key]] = MD2Positioner(motor_dict[key],name = key)
else:
motor_channel_dict[motor_dict[key]] = EpicsMotor(motor_dict[key],name = key)
motor_channel_dict[motor_dict[key]] = EpicsMotor(motor_dict[key],name = key)


def initControlPVs():
Expand Down
8 changes: 8 additions & 0 deletions bin/amx_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
export PROJDIR=/nsls2/software/mx/daq/
export CONFIGDIR=${PROJDIR}bnlpx_config/
export LSDCHOME=${PROJDIR}lsdc_amx

export PATH=/usr/local/bin:/usr/bin:/bin
export PYTHONPATH=".:${CONFIGDIR}:/opt/dectris/albula/4.0/python:${LSDCHOME}"
source ${CONFIGDIR}daq_env_amx.txt
8 changes: 8 additions & 0 deletions bin/fmx_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
export PROJDIR=/nsls2/software/mx/daq/
export CONFIGDIR=${PROJDIR}bnlpx_config/
export LSDCHOME=${PROJDIR}lsdc_fmx

export PATH=/usr/local/bin:/usr/bin:/bin
export PYTHONPATH=".:${CONFIGDIR}:/opt/dectris/albula/4.0/python:${LSDCHOME}"
source ${CONFIGDIR}daq_env.txt
2 changes: 1 addition & 1 deletion bin/lsdcGui_amx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export LSDCHOME=${PROJDIR}lsdc_amx
export PATH=/usr/local/bin:/usr/bin:/bin
export PYTHONPATH=".:${CONFIGDIR}:/opt/dectris/albula/4.0/python:${LSDCHOME}"
source ${CONFIGDIR}daq_env_amx.txt
/opt/conda_envs/lsdc-gui-2023-2-latest/bin/python $LSDCHOME/lsdcGui.py&
pixi run --manifest-path $LSDCHOME/pixi.toml amx-gui
2 changes: 1 addition & 1 deletion bin/lsdcGui_fmx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export LSDCHOME=${PROJDIR}lsdc_fmx
export PATH=/usr/local/bin:/usr/bin:/bin
export PYTHONPATH=".:${CONFIGDIR}:/opt/dectris/albula/4.0/python:${LSDCHOME}"
source ${CONFIGDIR}daq_env.txt
/opt/conda_envs/lsdc-gui-2023-2-latest/bin/python $LSDCHOME/lsdcGui.py&
pixi run --manifest-path $LSDCHOME/pixi.toml fmx-gui
10 changes: 0 additions & 10 deletions bin/lsdcGui_nyx

This file was deleted.

6 changes: 3 additions & 3 deletions bin/lsdcRemote_amx.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export matlab_distrib=${PROJDIR}/software/c3d/matlab_distrib
export LD_LIBRARY_PATH=$matlab_distrib/bin/glnx86:$matlab_distrib/toolbox
export PINALIGNDIR=${PROJDIR}pinAlign/pin_align-master/
export MXPROCESSINGSCRIPTSDIR=${PROJDIR}mx-processing/
# below not ideal as environment name also needed by daq_mainAux
conda activate lsdc-server-2023-2-latest
$LSDCHOME/daq_mainAux.py
export REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
export SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worth putting these (and above line) all somewhere, so we can change them simultaneously if needed.

pixi run --manifest-path $LSDCHOME/pixi.toml amx-remote
6 changes: 3 additions & 3 deletions bin/lsdcRemote_fmx.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export matlab_distrib=${PROJDIR}/software/c3d/matlab_distrib
export LD_LIBRARY_PATH=$matlab_distrib/bin/glnx86:$matlab_distrib/toolbox
export PINALIGNDIR=${PROJDIR}pinAlign/pin_align-master/
export MXPROCESSINGSCRIPTSDIR=${PROJDIR}mx-processing/
# below not ideal as environment name also needed by daq_mainAux
conda activate lsdc-server-2023-2-latest
$LSDCHOME/daq_mainAux.py
export REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
export SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt
pixi run --manifest-path $LSDCHOME/pixi.toml fmx-remote
6 changes: 3 additions & 3 deletions bin/lsdcServer_amx.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export matlab_distrib=${PROJDIR}/software/c3d/matlab_distrib
export LD_LIBRARY_PATH=$matlab_distrib/bin/glnx86:$matlab_distrib/toolbox
export PINALIGNDIR=${PROJDIR}pinAlign/pin_align-master/
export MXPROCESSINGSCRIPTSDIR=${PROJDIR}lsdc-processing/
# below not idea as environment name also needed by daq_main2
conda activate lsdc-server-2023-2-latest
$LSDCHOME/lsdcServer
export REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
export SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt
pixi run --manifest-path $LSDCHOME/pixi.toml amx-server
6 changes: 3 additions & 3 deletions bin/lsdcServer_fmx.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export matlab_distrib=${PROJDIR}/software/c3d/matlab_distrib
export LD_LIBRARY_PATH=$matlab_distrib/bin/glnx86:$matlab_distrib/toolbox
export PINALIGNDIR=${PROJDIR}pinAlign/pin_align-master/
export MXPROCESSINGSCRIPTSDIR=${PROJDIR}lsdc-processing/
# below not idea as environment name also needed by daq_main2
conda activate lsdc-server-2023-2-latest
$LSDCHOME/lsdcServer
export REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
export SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt
pixi run --manifest-path $LSDCHOME/pixi.toml fmx-server
14 changes: 0 additions & 14 deletions bin/lsdcServer_nyx.cmd

This file was deleted.

52 changes: 32 additions & 20 deletions config_params.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import grp
import os
from enum import Enum
import requests

# BlConfig parameter variable names

# Eiger detectors
EIGER_DETECTORS = ["EIGER2-9M-XE", "EIGER-16"]

# rastering parameters
RASTER_TUNE_LOW_RES = "rasterTuneLowRes"
RASTER_TUNE_HIGH_RES = "rasterTuneHighRes"
Expand Down Expand Up @@ -65,6 +69,7 @@ class OnMountAvailOptions(Enum):

HUTCH_TIMER_DELAY = 500
SAMPLE_TIMER_DELAY = 40
SAMPLE_CAM_SNAPSHOT_DELAY = 100 # 10 fps for single-image snapshot polling
SERVER_CHECK_DELAY = 2000

FAST_DP_MIN_NODES = 4
Expand All @@ -85,50 +90,60 @@ class OnMountAvailOptions(Enum):
DETECTOR_OBJECT_TYPE_OPHYD = "ophyd" # instantiated in start_bs, using Bluesky scans
DETECTOR_OBJECT_TYPE = "detectorObjectType"

DETECTOR_SAFE_DISTANCE = {"fmx": 200.0, "amx": 180.0, "nyx": 200.0}
DETECTOR_SAFE_DISTANCE = {"fmx": 200.0, "amx": 180.0}
GOVERNOR_TIMEOUT = 120 # seconds for a governor move

DEWAR_SECTORS = {'amx':8, 'fmx':8, 'nyx':8}
PUCKS_PER_DEWAR_SECTOR = {'amx':3, 'fmx':3, 'nyx':3}
DEWAR_SECTORS = {'amx':8, 'fmx':8}
PUCKS_PER_DEWAR_SECTOR = {'amx':3, 'fmx':3}

cryostreamTempPV = {"amx": "XF:17ID1:CS700:TEMP", "fmx": "XF:17ID2:CS700:TEMP", "nyx":"XF:19ID2:CS700:TEMP"}
cryostreamTempPV = {"amx": "XF:17IDB-ES:AMX{CS:1}SAMPLE_TEMP_RBV", "fmx": "XF:17IDC-ES:FMX{CS:1}SAMPLE_TEMP_RBV"}

VALID_EXP_TIMES = {
"amx": {"min": 0.005, "max": 1, "digits": 3},
"fmx": {"min": 0.01, "max": 10, "digits": 3},
"nyx": {"min": 0.002, "max": 10, "digits": 4},
"fmx": {"min": 0.002, "max": 10, "digits": 3},
}
VALID_DET_DIST = {
"amx": {"min": 100, "max": 500, "digits": 3},
"fmx": {"min": 137, "max": 2000, "digits": 2},
"nyx": {"min": 100, "max": 500, "digits": 3},
"fmx": {"min": 100, "max": 2000, "digits": 2},
}
VALID_TOTAL_EXP_TIMES = {
"amx": {"min": 0.005, "max": 300, "digits": 3},
"fmx": {"min": 0.01, "max": 300, "digits": 3},
"nyx": {"min": 0.01, "max": 1000, "digits": 3},
"fmx": {"min": 0.002, "max": 300, "digits": 3},
}
VALID_PREFIX_LENGTH = 25 # TODO centralize with spreadsheet validation?
VALID_PREFIX_NAME = "[0-9a-zA-Z-_]{0,%s}" % VALID_PREFIX_LENGTH
VALID_TRANSMISSION = {
"amx": {"min": 0.001, "max": 1.0, "digits": 3},
"fmx": {"min": 0.001, "max": 1.0, "digits": 3},
"nyx": {"min": 0.001, "max": 0.999, "digits": 3},
}

MINIMUM_RASTER_SIZE = {"amx": 6, "fmx": 6, "nyx": 2}
MINIMUM_RASTER_SIZE = {"amx": 6, "fmx": 6}

LSDC_SERVICE_USERS = ("lsdc-amx", "lsdc-fmx", "lsdc-nyx")
LSDC_SERVICE_USERS = ("lsdc-amx", "lsdc-fmx")
IS_STAFF = (
True
if os.environ.get("STAFF_GROUP") is not None and os.environ["STAFF_GROUP"] in [grp.getgrgid(g).gr_name for g in os.getgroups()]
else False
)

EMBL_SERVER_PV_BASE = {
"amx": "XF:17IDB-ES:AMX{EMBL}",
"fmx": "XF:17IDC-ES:FMX{EMBL}"
}
def get_current_cycle():
try:
cycle_r = requests.get(
f"{os.environ['NSLS2_API_URL']}/v1/facility/nsls2/cycles/current"
)
cycle_r.raise_for_status()
cycle = cycle_r.json().get("cycle")
except requests.exceptions.HTTPError:
return None
except KeyError:
return None
if cycle is None:
return None
return cycle
Comment on lines +129 to +142

CURRENT_CYCLE = get_current_cycle()

EMBL_SERVER_PV_BASE = {"amx": "XF:17IDB-ES:AMX{EMBL}", "fmx": "XF:17IDC-ES:FMX{EMBL}"}

BEAMSIZE_OPTIONS = {
"S": ["V0", "H0"],
Expand All @@ -154,8 +169,6 @@ def get_text(cls, enum_value):
}
return text_values.get(enum_value, "\n(Unknown State)")

OPHYD_COLLECTIONS = {"amx": False, "fmx": False, "nyx": True}

class CollectionProtocols(str, Enum):
STANDARD = "standard"
RASTER = "raster"
Expand All @@ -176,7 +189,6 @@ def get_beamline_options(cls, beamline):
cls.STEP_RASTER, cls.STEP_VECTOR, cls.MULTI_COL, cls.CHARACTERIZE,
cls.EDNA_COL)
beamline_options = {
"nyx": (cls.STANDARD, cls.RASTER, cls.VECTOR),
"amx": all_protocols,
"fmx": all_protocols
}
Expand Down
Loading
Loading