SERVER: connected set_smart_params

This commit is contained in:
2025-10-10 17:19:50 +02:00
parent a15c6c9c47
commit c612eb0966
+7 -1
View File
@@ -8,7 +8,7 @@ import uvicorn
from aaredaqlib.coordinate import SmargonCoordinate, Coordinate
from aaredaqlib.models import SampleShortInfo, DAQStatusModel, BeamlineStateEnum, BeamlineSettingsModel, \
SampleShortInfoList, SessionStatus, SampleCameraSettings, AutofocusSettings, TokenData, \
CryojetSettingsModel
CryojetSettingsModel, SimpleScanParameters
from aaredaqlib.raster_grid import RasterGridRequest, CompletedRasterGrid
from aaredaqlib.rotation_scan import RotationScanRequest, CompletedRotationScan
from aaredaqlib.sample_geometry import SampleGeometryModel
@@ -314,6 +314,12 @@ async def auto(s: SampleShortInfo, token: str = Depends(oauth2_scheme)):
runtime = daq.measure(s)
return f"{runtime:0.3f}"
@app.post("/scan/smart_params")
async def set_smart_params(p: SimpleScanParameters, token: str = Depends(oauth2_scheme)) -> str:
auth.check_jwt_rw(cfg, auth.parse_token(token))
daq.smart_params = p
return "OK"
@app.post("/scan/cancel")
async def cancel(token: str = Depends(oauth2_scheme)):
auth.check_jwt_rw(cfg, auth.parse_token(token))