Initial commit

This commit is contained in:
l_samenv
2020-12-04 09:05:06 +01:00
parent 172042e731
commit 9e1d3b4e07
54 changed files with 47695 additions and 0 deletions

BIN
doc/Screen Shot sea.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

1
doc/blocks.tsv Normal file
View File

@ -0,0 +1 @@
1 2 3 4
Can't render this file because it contains an unexpected character in line 1 and column 36.

35
doc/graphics_todo.txt Normal file
View File

@ -0,0 +1,35 @@
Grafik:
- Einbindung in slider
ok, aber Responsivity fehlt noch
- updates funktionieren manchmal nicht (könnte auch am Server liegen)
- marker linie nicht genau synchronisiert
- Zoom-Rechteck funktioniert teilweise
- Zoom selbst muss noch implementiert werden
- Im Moment wird die Zeitachse erst gezeichnet, wenn der erste Update kommt
dies muss noch überdacht werden.
Zeitachse muss an zwei stellen im Code erzeugt werden (in Funktion auslagern).
- die Variable begin bedeutet aktuell:
a) die erste Zeitspanne (zurück)
b) der freie Platz (Zukunft)
dies muss in 2 Variablen aufgeteilt werden
(b eher als absolute Zeit)
- MAXBLOCKGRAPHICS (sowie auch MAXBLOCK) wieder einführen
höhen müssen noch berechnet werden (aktuell fix im css)
- im Moment sind Grafikslider auf (MAXBLOCKGRAPHICS = 1) gesetzt,
sollte aber mit mehreren funktionieren.
- y-domain: statt min/max quantile(?) verwenden
- D3: müssen kurven neu gezeichnet werden, oder kann man auch ansetzen?

41
doc/message_chain.txt Normal file
View File

@ -0,0 +1,41 @@
U id : if showMain : CHAIN getblock/main (accept-block, draw, redraw)
R draw: if main: if showConsole: CHAIN console (accept-console)
else: update slides in all swiper instances
R accept-console: if showGraphics: CHAIN gettime (time)
elif showOverviews: CHAIN getblock FINI
else FINI
R time: CHAIN getvars (var_list)
R var_list: CHAIN graph (graph-draw)
R graph-draw: FINI CHAIN updategraph
R accept-graph: pass
U redraw: CHAIN getblock (accept-block)
U update: updateValues
U graph: createCharts
U graph-update: updateCharts
U command: add to history / add to console
U reply: add to console
R accept-block: pass
R error: ERROR
1. getblock/main
2. console
3. gettime
console "/console?"
graph "/gettime?time=-10,0&"
overview "/getblock?path=_overview&"

201
doc/protocol.txt Normal file
View File

@ -0,0 +1,201 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
***** ServerSentEvents *****
The only constantly open connection:
/updates
response: <id-message> <update-message> <redraw-message> <console-update-message> <graph-update-message>
the id-message is got immediately, later a mix of all other types of messages may be received
*********************************************************************************************************************************
<id-message> = {
"type": "id",
"id":<id>,
"title": <title>
}
<update-message> = {
"type": "update",
"updates": [{"name": <name0>, "value": <value0>}, ...]
}
<redraw-message> = {
"type": "redraw",
"path": <path>
}
<console-update-message> = {
"type": "command" | "reply",
"origin": "self" | "other",
"lines": <line>
}
<graph-update-message> = {
"type": "graph-update",
"reduced": true/false,
"time": <server-time>,
"graph": {
"<name1>": [[<time>,<value>],[<time>,<value>]...
"<name2>": [[<time>,<value>],[<time>,<value>]...
...
}
}
<graph-redraw-message> = {
"type": "graph-redraw"
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
***** XMLHttp *****
All other connections are to be closed (getJSON):
*********************************************************************************************************************************
/getblock?path=<path>&id=<id>
response: <draw-message>
<draw-message> = {
"type": "draw",
"path": <path>,
"components": [<component0>, <component1>, ...]
}
*********************************************************************************************************************************
<component> = <input> | <rdonly> | <checkbox> | <radio-group>
<input> = {
"type": "input",
"name": <variable name>,
"title": <title>
<optional-attributes>
}
<rdonly> = {
"type": "rdonly",
"name": <variable name>,
"title": <title>
<optional-attributes>
}
<checkbox> = {
"type": "checkbox",
"name": <variable name>,
"title": <title>
<optional-attributes>
}
<radio-group> = {
"type": "radio",
"name": <variable name>,
"title": <title>,
"buttons": [{"value": <value0>, "title": <title0>} , ...],
<optional-attributes>
}
<optional-attributes> =
["info": <tool-tip-text> ,]
*********************************************************************************************************************************
/updateblock?path=<path>&id=<id>
response: <accept-block-message> (and from now on, update-messages (incl. initial updates) are sent)
<accept-block-message> = {
"type": "accept-block",
}
*********************************************************************************************************************************
/sendcommand?command=<command>&id=<id>
response: <accept-command-message>
<accept-command-message> = {
"type": "accept-command",
}
*********************************************************************************************************************************
/gettime?time=<start>,<end>&id=<id>
response: <time-message>
<time-message> = {
"type":"time",
"time": [<start>, <end>]
}
*********************************************************************************************************************************
/getvars?time=<time>&id=<id>
response: <varlist-message>
<varlist-message> = {
"type":"var_list",
"blocks": [
{
"tag":"K_2",
"unit": "K",
"curves": [
{
"name":<name1>,
"label":<label1>,
"color":<color1>
},
{
"name":<name2>,
...
} ...
]
},
{
"tag":"mbar",
"unit": "mbar",
"curves": ...
},
...
]
}
*********************************************************************************************************************************
/updategraph?id=<id>
response: <accept-graph-message>
<accept-graph-message> = = {
"type": "accept-graph"
}
*********************************************************************************************************************************
/graph?time=<start>,<end>&variables=<variable list>&id=<id>
response: <graph-draw-message>
<graph-draw-message> = = {
"type": "graph-draw",
"reduced": true/false,
"graph": {
"<name1>": [[<time>,<value>],[<time>,<value>]...
"<name2>": [[<time>,<value>],[<time>,<value>]...
...
}
*********************************************************************************************************************************
/console?id=<id>
response: <accept-console-message> (and from now on, console-updates-messages (incl. history) are sent)
<accept-console-message> = {
"type": "accept-console",
}

17
doc/urls for graphics.txt Normal file
View File

@ -0,0 +1,17 @@
user serverside events for all updates, from the first message
the client id can be retrieved
localhost:8000/update
get the actual data for the chart:
localhost:8000/graph?variables=tt,treg.set.reg&time=-1800,0&id=<client-id>
activate updates for chart:
localhost:8000/graphupdate?id=<client-id>
Start without main and blocks:
localhost:8000/?sg=1&sm=0&sc=0