Signal plotten
POST /api/plot
Fügt ein Signal in den ersten Plot des aktiven Tabs ein. Existiert noch kein Tab oder Plot, werden diese automatisch angelegt.
Request
POST /api/plot HTTP/1.1Host: localhost:5678Content-Type: application/jsonBody-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
signal_id | string | Ja | Signal-ID aus POST /api/signals/send oder /api/signals/upload |
{ "signal_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"}Response
Status Code: 200 OK
{ "status": "ok", "result": { "plotted": true, "item_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "signal_name": "Sinus 5Hz", "plot_name": "Plot 1" }}Fehler
| Status | Bedeutung |
|---|---|
400 | signal_id-Feld fehlt |
404 | Signal nicht gefunden |
Beispiel
# Signal senden, signal_id merkenSIGNAL_ID=$(curl -s -X POST http://localhost:5678/api/signals/send \ -H "Content-Type: application/json" \ -d '{"name":"Sinus 5Hz","y":[0,1,0,-1,0],"target_source_id":"<source_id>"}' \ | jq -r '.result.signal_id')
# Signal plottencurl -s -X POST http://localhost:5678/api/plot \ -H "Content-Type: application/json" \ -d "{\"signal_id\":\"$SIGNAL_ID\"}"Tip
Der Python-Client sendet mit scry.plot() das Signal und ruft diesen Endpoint automatisch auf. Mehr dazu auf GitHub.