Committed by
Gerrit Code Review
Merge "GUI -- Update to memento format."
Showing
4 changed files
with
45 additions
and
5 deletions
1 | +{ | ||
2 | + "event": "addDevice", | ||
3 | + "payload": { | ||
4 | + "id": "of:0000000000000003", | ||
5 | + "type": "switch", | ||
6 | + "online": true, | ||
7 | + "labels": [ | ||
8 | + "of:0000000000000003", | ||
9 | + "3", | ||
10 | + "", | ||
11 | + null | ||
12 | + ], | ||
13 | + "props": { | ||
14 | + "location": { | ||
15 | + "type": "latlng", | ||
16 | + "lat": 123.5, | ||
17 | + "lng": 67.8 | ||
18 | + }, | ||
19 | + "anotherProp": "foobar" | ||
20 | + }, | ||
21 | + "metaUi": { | ||
22 | + "xpc": 57.3, | ||
23 | + "ypc": 24.86, | ||
24 | + "and": "other properties the UI wishes to remember..." | ||
25 | + } | ||
26 | + } | ||
27 | +} |
... | @@ -4,7 +4,11 @@ | ... | @@ -4,7 +4,11 @@ |
4 | "payload": { | 4 | "payload": { |
5 | "id": "62:4F:65:BF:FF:B3/-1", | 5 | "id": "62:4F:65:BF:FF:B3/-1", |
6 | "class": "host", | 6 | "class": "host", |
7 | - "x": 197, | 7 | + "memento": { |
8 | - "y": 177 | 8 | + "xpc": 57.3, |
9 | + "ypc": 24.86, | ||
10 | + "and": "other properties the UI wishes to remember..." | ||
11 | + } | ||
9 | } | 12 | } |
10 | } | 13 | } |
14 | + | ... | ... |
... | @@ -1154,16 +1154,18 @@ | ... | @@ -1154,16 +1154,18 @@ |
1154 | d.fixed = true; | 1154 | d.fixed = true; |
1155 | d3.select(self).classed('fixed', true); | 1155 | d3.select(self).classed('fixed', true); |
1156 | if (config.useLiveData) { | 1156 | if (config.useLiveData) { |
1157 | - tellServerCoords(d); | 1157 | + sendUpdateMeta(d); |
1158 | } | 1158 | } |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | - function tellServerCoords(d) { | 1161 | + function sendUpdateMeta(d) { |
1162 | sendMessage('updateMeta', { | 1162 | sendMessage('updateMeta', { |
1163 | id: d.id, | 1163 | id: d.id, |
1164 | 'class': d.class, | 1164 | 'class': d.class, |
1165 | + 'memento': { | ||
1165 | x: Math.floor(d.x), | 1166 | x: Math.floor(d.x), |
1166 | y: Math.floor(d.y) | 1167 | y: Math.floor(d.y) |
1168 | + } | ||
1167 | }); | 1169 | }); |
1168 | } | 1170 | } |
1169 | 1171 | ... | ... |
-
Please register or login to post a comment