diff --git a/src/mx_bluesky/beamlines/i24/serial/__init__.py b/src/mx_bluesky/beamlines/i24/serial/__init__.py index d3de09a63..96b093c1b 100644 --- a/src/mx_bluesky/beamlines/i24/serial/__init__.py +++ b/src/mx_bluesky/beamlines/i24/serial/__init__.py @@ -1,6 +1,7 @@ -from mx_bluesky.beamlines.i24.serial.plans_for_web_gui import ( +from mx_bluesky.beamlines.i24.serial.web_gui_plans.general_plans import ( gui_gonio_move_on_click, gui_move_detector, + gui_set_parameters, gui_sleep, gui_stage_move_on_click, ) @@ -55,4 +56,5 @@ "gui_gonio_move_on_click", "gui_sleep", "gui_move_detector", + "gui_set_parameters", ] diff --git a/src/mx_bluesky/beamlines/i24/serial/web_gui_plans/__init__.py b/src/mx_bluesky/beamlines/i24/serial/web_gui_plans/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/mx_bluesky/beamlines/i24/serial/plans_for_web_gui.py b/src/mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py similarity index 59% rename from src/mx_bluesky/beamlines/i24/serial/plans_for_web_gui.py rename to src/mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py index 8fef7342b..399cf9585 100644 --- a/src/mx_bluesky/beamlines/i24/serial/plans_for_web_gui.py +++ b/src/mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py @@ -8,9 +8,11 @@ from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_moveonclick import ( _move_on_mouse_click_plan, ) +from mx_bluesky.beamlines.i24.serial.log import _read_visit_directory_from_file from mx_bluesky.beamlines.i24.serial.setup_beamline.pv_abstract import Eiger, Pilatus from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import ( _move_detector_stage, + get_detector_type, ) @@ -47,3 +49,34 @@ def gui_move_detector(det: Literal["eiger", "pilatus"]) -> MsgGenerator: detector_stage = i24.detector_motion() det_y_target = Eiger.det_y_target if det == "eiger" else Pilatus.det_y_target yield from _move_detector_stage(detector_stage, det_y_target) + + +@bpp.run_decorator() +def gui_set_parameters( + sub_dir: str, + chip_name: str, + exp_time: float, + det_dist: float, + transmission: float, + n_shots: int, +): + detector_stage = i24.detector_motion() + det_type = yield from get_detector_type(detector_stage) + params = { + "visit": _read_visit_directory_from_file().as_posix(), # noqa + "directory": sub_dir, + "filename": chip_name, + "exposure_time_s": exp_time, + "detector_distance_mm": det_dist, + "detector_name": str(det_type), + "num_exposures": n_shots, + "transmission": transmission, + } + # At some point it will use FixedTargetParameters to create the parameters model + # For now not doing that because: + # a- not all data in + # b - detectorParams will create a directory and we do not want that unless testing + # on beamline + # FixedTargetParameters(**params) + print(params) + yield from bps.sleep(0.5)