Skip to content

Commit

Permalink
Use SSXType for expt
Browse files Browse the repository at this point in the history
  • Loading branch information
noemifrisina committed Nov 10, 2023
1 parent b8c7d6c commit 284e9ac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DetStage.edl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ major 4
minor 0
release 1
x 3338
y 498
y 572
w 450
h 180
font "arial-medium-r-18.0"
Expand Down Expand Up @@ -107,13 +107,13 @@ w 160
h 42
fgColor index 14
bgColor index 49
topShadowColor index 0
botShadowColor index 14
topShadowColor index 1
botShadowColor index 11
font "arial-medium-r-18.0"
buttonLabel "Move Stage"
numCmds 1
command {
0 "python SCRIPTS_LOCATION/setup_beamline/setup_detector.py extruder"
0 "python SCRIPTS_LOCATION/setup_beamline/setup_detector.py \"Serial Jet\""
}
endObjectProperties

Expand Down
10 changes: 5 additions & 5 deletions src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/DetStage.edl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ beginScreenProperties
major 4
minor 0
release 1
x 2848
y 688
x 3172
y 731
w 450
h 180
font "arial-medium-r-18.0"
Expand Down Expand Up @@ -107,13 +107,13 @@ w 160
h 42
fgColor index 14
bgColor index 49
topShadowColor index 0
botShadowColor index 14
topShadowColor index 1
botShadowColor index 11
font "arial-medium-r-18.0"
buttonLabel "Move Stage"
numCmds 1
command {
0 "python SCRIPTS_LOCATION/setup_beamline/setup_detector.py fixed-target"
0 "python SCRIPTS_LOCATION/setup_beamline/setup_detector.py \"Serial Fixed\""
}
endObjectProperties

Expand Down
5 changes: 3 additions & 2 deletions src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from dodal.devices.i24.I24_detector_motion import DetectorMotion

from mx_bluesky.I24.serial import log
from mx_bluesky.I24.serial.parameters.constants import SSXType
from mx_bluesky.I24.serial.setup_beamline import pv
from mx_bluesky.I24.serial.setup_beamline.ca import caget # , caput
from mx_bluesky.I24.serial.setup_beamline.pv_abstract import (
Expand Down Expand Up @@ -58,7 +59,7 @@ def _move_detector_stage(detector_stage: DetectorMotion, target: float):
def setup_detector_stage(detector_stage: DetectorMotion, expt_type: str):
# Grab the correct PV depending on experiment
# Its value is set with MUX on edm screen
det_type = pv.me14e_gp101 if expt_type == "fixed-target" else pv.ioc12_gp15
det_type = pv.me14e_gp101 if expt_type == SSXType.FIXED.value else pv.ioc12_gp15
requested_detector = caget(det_type)
logger.info(f"Requested detector: {requested_detector}.")
det_y_target = (
Expand All @@ -78,7 +79,7 @@ def setup_detector_stage(detector_stage: DetectorMotion, expt_type: str):
parser.add_argument(

Check warning on line 79 in src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py

View check run for this annotation

Codecov / codecov/patch

src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py#L78-L79

Added lines #L78 - L79 were not covered by tests
"expt",
type=str,
choices=["extruder", "fixed-target"],
choices=["Serial Jet", "Serial Fixed"],
help="Type of serial experiment being run.",
)

Expand Down
3 changes: 2 additions & 1 deletion tests/I24/serial/setup_beamline/test_setup_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dodal.devices.i24.I24_detector_motion import DetectorMotion
from ophyd.status import Status

from mx_bluesky.I24.serial.parameters.constants import SSXType
from mx_bluesky.I24.serial.setup_beamline import Eiger
from mx_bluesky.I24.serial.setup_beamline.setup_detector import (
get_detector_type,
Expand Down Expand Up @@ -48,5 +49,5 @@ def test_setup_detector_stage_for_eiger(fake_caget, fake_detector_motion):
RE = RunEngine()
fake_caget.return_value = "eiger"

RE(setup_detector_stage(fake_detector_motion, "fixed-target"))
RE(setup_detector_stage(fake_detector_motion, SSXType.FIXED.value))
assert fake_detector_motion.y.user_readback.get() == Eiger.det_y_target

0 comments on commit 284e9ac

Please sign in to comment.