Thomas Vachuska
Committed by Gerrit Code Review

Merge "GUI -- Update to memento format."

......@@ -10,6 +10,13 @@
"",
null
],
"props": {}
"props": {
"location": {
"type": "latlng",
"lat": 123.5,
"lng": 67.8
},
"anotherProp": "foobar"
}
}
}
......
{
"event": "addDevice",
"payload": {
"id": "of:0000000000000003",
"type": "switch",
"online": true,
"labels": [
"of:0000000000000003",
"3",
"",
null
],
"props": {
"location": {
"type": "latlng",
"lat": 123.5,
"lng": 67.8
},
"anotherProp": "foobar"
},
"metaUi": {
"xpc": 57.3,
"ypc": 24.86,
"and": "other properties the UI wishes to remember..."
}
}
}
......@@ -4,7 +4,11 @@
"payload": {
"id": "62:4F:65:BF:FF:B3/-1",
"class": "host",
"x": 197,
"y": 177
"memento": {
"xpc": 57.3,
"ypc": 24.86,
"and": "other properties the UI wishes to remember..."
}
}
}
......
......@@ -1154,16 +1154,18 @@
d.fixed = true;
d3.select(self).classed('fixed', true);
if (config.useLiveData) {
tellServerCoords(d);
sendUpdateMeta(d);
}
}
function tellServerCoords(d) {
function sendUpdateMeta(d) {
sendMessage('updateMeta', {
id: d.id,
'class': d.class,
x: Math.floor(d.x),
y: Math.floor(d.y)
'memento': {
x: Math.floor(d.x),
y: Math.floor(d.y)
}
});
}
......