refactor(falcon): Migrate falcon to ScanServer ScanInfo model
This commit is contained in:
@@ -19,6 +19,7 @@ from csaxs_bec.devices.epics.falcon_csaxs import (
|
||||
MappingSource,
|
||||
TriggerSource,
|
||||
)
|
||||
from csaxs_bec.devices.utils.utils import fetch_scan_info
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -104,9 +105,9 @@ def test_falcon_on_stage(mock_det: FalconcSAXS):
|
||||
num_points = 10
|
||||
exp_time = 0.2
|
||||
frames_per_trigger = 5
|
||||
falcon.scan_info.msg.num_points = num_points
|
||||
falcon.scan_info.msg.scan_parameters["frames_per_trigger"] = frames_per_trigger
|
||||
falcon.scan_info.msg.scan_parameters["exp_time"] = exp_time
|
||||
falcon.scan_info.msg.info["num_points"] = num_points
|
||||
falcon.scan_info.msg.info["frames_per_trigger"] = frames_per_trigger
|
||||
falcon.scan_info.msg.info["exp_time"] = exp_time
|
||||
falcon.hdf5.array_counter.put(5) # Set to non-zero to check reset
|
||||
|
||||
# I. Normal case
|
||||
@@ -128,7 +129,7 @@ def test_falcon_on_stage(mock_det: FalconcSAXS):
|
||||
# II. Unstage device first
|
||||
falcon.unstage()
|
||||
exp_time = 1e-3 # Smaller than readout time
|
||||
falcon.scan_info.msg.scan_parameters["exp_time"] = exp_time
|
||||
falcon.scan_info.msg.info["exp_time"] = exp_time
|
||||
with pytest.raises(ValueError):
|
||||
falcon.stage()
|
||||
assert falcon.staged is not ophyd.Staged.no
|
||||
@@ -184,8 +185,9 @@ def test_falcon_complete(mock_det: FalconcSAXS):
|
||||
|
||||
num_points = 10
|
||||
frames_per_trigger = 5
|
||||
falcon.scan_info.msg.num_points = num_points
|
||||
falcon.scan_info.msg.scan_parameters["frames_per_trigger"] = frames_per_trigger
|
||||
falcon.scan_info.msg.info["num_points"] = num_points
|
||||
falcon.scan_info.msg.info["frames_per_trigger"] = frames_per_trigger
|
||||
falcon.scan_parameters = fetch_scan_info(falcon.scan_info)
|
||||
|
||||
# I. Test normal case with success
|
||||
falcon.dxp.current_pixel._read_pv.mock_data = num_points * frames_per_trigger - 1
|
||||
|
||||
Reference in New Issue
Block a user