first try to display dynamic positions, not tested yet
authorAnthony Garcia <anthony.garcia@inria.fr>
Fri, 27 Sep 2013 17:11:24 +0000 (19:11 +0200)
committerAnthony Garcia <anthony.garcia@inria.fr>
Fri, 27 Sep 2013 17:11:24 +0000 (19:11 +0200)
plugins/senslabmap/static/js/senslabmap.js

index 71de05a..ef7007a 100644 (file)
     },
     
     initialize_map: function() {
-      console.log("init toto");
-      // TODO: this is static, retrieve directly nodes
-      nodes = nodes_gre;
-      init();
-      parseNodebox();
+      this.nodes = [];
     },
 
     refresh: function() {
     },
     
     on_show: function(e) {
-      /* GUI setup and event binding */
       e.data.refresh();
     },
     
-    on_all_new_record: function(record) {
-      console.log("All New Record : " + record);
-    },
-    
-    on_new_record: function(record) {
-      console.log("New Record : " + record);
-    },
-
-    on_query_in_progress: function()
-    {
-      console.log('on_query_in_progress');
+    on_all_new_record: function(n) {
+      // format is : [name, x, y, z, uid, state]
+      // state = "Busy", "Alive" or "Down"
+      node = [42, n.x, n.y, n.z, "bb40", "Alive"];
+      this.nodes.push(node);
     },
     
-    on_query_done: function()
-    {
-      console.log('on_query_done');
-    },
-
-    on_all_query_in_progress: function()
-    {
-      console.log('on_all_query_in_progress');
-    },
-    
-    on_all_query_done: function()
-    {
-      console.log('on_all_query_done');
+    on_all_query_done: function() {
+      nodes = this.nodes;
+      init();
+      parseNodebox();
     }
   });
   $.plugin('SensLabMap', SensLabMap);