NetAnim: Update example to track counters for multiple nodes
authorJohn Abraham <john.abraham.in@gmail.com>
Sun, 19 Jan 2014 05:58:53 -0800
changeset 10579 4ec4b3dcb42a
parent 10578 6cdf44cd956e
child 10580 2a29a9bd6fd6
NetAnim: Update example to track counters for multiple nodes
src/netanim/examples/resources_demo.cc
--- a/src/netanim/examples/resources_demo.cc	Sat Jan 18 20:03:20 2014 -0800
+++ b/src/netanim/examples/resources_demo.cc	Sun Jan 19 05:58:53 2014 -0800
@@ -96,11 +96,14 @@
   for (uint32_t nodeId = 4; nodeId < 12; ++nodeId)
     pAnim->UpdateNodeColor (nodeId, color.r, color.g, color.b); 
 
-  // Update Node Counter for node 0, use some random number between 0 to 1000 for value
+  // Update Node Counter for node 0 and node 5, use some random number between 0 to 1000 for value
   Ptr <UniformRandomVariable> rv = CreateObject<UniformRandomVariable> ();
   pAnim->UpdateNodeCounter (nodeCounterIdUint32, 0, rv->GetValue (0, 1000));
   pAnim->UpdateNodeCounter (nodeCounterIdDouble1, 0, rv->GetValue (100.0, 200.0));
   pAnim->UpdateNodeCounter (nodeCounterIdDouble2, 0, rv->GetValue (300.0, 400.0));
+  pAnim->UpdateNodeCounter (nodeCounterIdUint32, 5, rv->GetValue (0, 1000));
+  pAnim->UpdateNodeCounter (nodeCounterIdDouble1, 5, rv->GetValue (100.0, 200.0));
+  pAnim->UpdateNodeCounter (nodeCounterIdDouble2, 5, rv->GetValue (300.0, 400.0));
 
   if (Simulator::Now ().GetSeconds () < 10) // This is important or the simulation
     // will run endlessly