2 var SensLabMap = Plugin.extend({
3 init: function(options, element) {
4 this._super(options, element);
6 this.elmt().on('show', this, this.on_show);
8 this.method = query.object;
10 /* Setup query and record handlers */
11 this.listen_query(options.query_uuid);
12 this.listen_query(options.query_all_uuid, 'all');
14 /* GUI setup and event binding */
15 this.initialize_map();
18 initialize_map: function() {
24 console.log("refresh");
28 on_show: function(e) {
32 on_all_new_record: function(n) {
33 // format is : [name, x, y, z, uid, state]
34 // state = "Busy", "Alive" or "Down"
36 node = [this.id, n.x, n.y, n.z, this.id, "Alive"];
37 this.nodes.push(node);
38 console.log("node id " + this.id);
41 on_all_query_done: function() {
47 $.plugin('SensLabMap', SensLabMap);