This commit is contained in:
@@ -11,3 +11,15 @@ id_gap:
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
|
||||
smargon:
|
||||
description: REST-based device which connects to Smargopolo
|
||||
deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon
|
||||
deviceConfig: {prefix: 'http://x10sa-smargopolo.psi.ch:3000'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- smargon
|
||||
- motors
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
@@ -56,8 +56,8 @@ class SmargonController(OphydObject):
|
||||
|
||||
def __init__(self, *, prefix, **kwargs):
|
||||
self._prefix = prefix
|
||||
self._readback_endpoint = "/ReadbackSCS"
|
||||
self._target_endpoint = "/TargetSCS"
|
||||
self._readback_endpoint = "/readbackSCS"
|
||||
self._target_endpoint = "/targetSCS"
|
||||
self._targets = {}
|
||||
self._signal_registry: set[str] = set()
|
||||
self._readback_poll_interval: float = _POLL_INTERVAL_SLOW
|
||||
|
||||
@@ -1484,4 +1484,20 @@ def scan_eg(erange, nsteps=50, fit=True):
|
||||
################################################
|
||||
#
|
||||
|
||||
def scan_window(wname="Scan", fit=True):
|
||||
dock_area = bec.gui.new()
|
||||
# Add a new dock with a Waveform to the BECDockArea
|
||||
nam = "waveform_dock_"+wname
|
||||
dock_area.new(name=nam, widget="Waveform")
|
||||
# dock_area.panels
|
||||
# dock_area.panel_list
|
||||
plt1 = dock_area.panels[nam]
|
||||
# Add signals to the WaveformWidget
|
||||
plt1.plot(device_x='id_gap', device_y='bpm')
|
||||
|
||||
dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right")
|
||||
###do stuff
|
||||
|
||||
|
||||
### if done, remove
|
||||
dock2.remove()
|
||||
|
||||
@@ -81,13 +81,13 @@ def validate_axes(axes: Iterable[str] | None) -> list[str]:
|
||||
return list(axes)
|
||||
|
||||
|
||||
@app.get("/ReadbackSCS")
|
||||
@app.get("/readbackSCS")
|
||||
async def readback_scs(axis: list[str] | None = Query(None)):
|
||||
selected_axes = validate_axes(axis)
|
||||
return {ax: motors[ax].position for ax in selected_axes}
|
||||
|
||||
|
||||
@app.put("/TargetSCS")
|
||||
@app.put("/targetSCS")
|
||||
async def target_scs(req: Request):
|
||||
targets = {ax: float(t) for ax, t in req.query_params.items()}
|
||||
if targets is None:
|
||||
|
||||
Reference in New Issue
Block a user