local_contact_panel.py: added config for autoamtion, currently just the sleep between mount and wait.
This commit is contained in:
@@ -35,6 +35,7 @@ from aare.daq import auth
|
||||
from aare.common.beamline import mx_beamline
|
||||
from aare.daq.config import BeamlineConfig
|
||||
from aare.daq.daq import AareDAQ
|
||||
from aare.daq.config_model import LocalContactConfigModel
|
||||
|
||||
from aare.daq.server_exception_handler import register_exception_handlers
|
||||
|
||||
@@ -760,6 +761,29 @@ async def local_contact_resync_detector_metadata(
|
||||
"payload": payload,
|
||||
}
|
||||
|
||||
@app.get("/local_contact/config")
|
||||
async def local_contact_config(token: str = Depends(oauth2_scheme)) -> LocalContactConfigModel:
|
||||
"""
|
||||
Return Local Contact config values. Staff only.
|
||||
"""
|
||||
data = auth.parse_token(token)
|
||||
auth.check_jwt_staff_only(data)
|
||||
return daq.get_local_contact_config()
|
||||
|
||||
|
||||
@app.put("/local_contact/config")
|
||||
async def local_contact_set_config(
|
||||
payload: LocalContactConfigModel,
|
||||
token: str = Depends(oauth2_scheme),
|
||||
) -> LocalContactConfigModel:
|
||||
"""
|
||||
Update Local Contact config values. Staff only.
|
||||
"""
|
||||
data = auth.parse_token(token)
|
||||
auth.check_jwt_staff_only(data)
|
||||
return daq.set_local_contact_config(payload)
|
||||
|
||||
|
||||
@app.post("/beamline/goto_abr_meas_pos")
|
||||
async def goto_abr_meas_pos(token: str = Depends(oauth2_scheme)):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user