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() {
25 console.log("refresh");
29 on_show: function(e) {
33 on_all_new_record: function(n) {
34 // format is : [name, x, y, z, uid, state]
35 // state = "Busy", "Alive" or "Suspected"
36 if (n.x == null || n.y == null || n.z == null) {
37 console.log("Warning: no coord for " + n.hrn);
41 node = [this.id, n.x, n.y, n.z, this.id, n.boot_state];
42 this.nodes.push(node);
45 on_all_query_done: function() {
46 drawNodes(this.nodes);
50 $.plugin('SensLabMap', SensLabMap);