From 50dce179c65567304c7e2956a802473b22657a25 Mon Sep 17 00:00:00 2001 From: John Abraham Date: Mon, 13 Jan 2014 09:01:22 -0800 Subject: [PATCH] NetAnim: Add sample double counters in the example --- src/netanim/examples/resources_demo.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/netanim/examples/resources_demo.cc b/src/netanim/examples/resources_demo.cc index 61544ecd7..96c5aa633 100644 --- a/src/netanim/examples/resources_demo.cc +++ b/src/netanim/examples/resources_demo.cc @@ -44,7 +44,9 @@ struct rgb colors [] = { uint32_t resourceId1; uint32_t resourceId2; -uint32_t nodeCounterId; +uint32_t nodeCounterIdUint32; +uint32_t nodeCounterIdDouble1; +uint32_t nodeCounterIdDouble2; void modify () { @@ -96,7 +98,9 @@ void modify () // Update Node Counter for node 0, use some random number between 0 to 1000 for value Ptr rv = CreateObject (); - pAnim->UpdateNodeCounter (nodeCounterId, 0, rv->GetValue (0, 1000)); + 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)); if (Simulator::Now ().GetSeconds () < 10) // This is important or the simulation // will run endlessly @@ -180,7 +184,9 @@ int main (int argc, char *argv[]) // Add a node counter - nodeCounterId = pAnim->AddNodeCounter ("Sample Counter", AnimationInterface::UINT32_COUNTER); + nodeCounterIdUint32 = pAnim->AddNodeCounter ("Uint32 Counter", AnimationInterface::UINT32_COUNTER); + nodeCounterIdDouble1 = pAnim->AddNodeCounter ("Double Counter 1", AnimationInterface::DOUBLE_COUNTER); + nodeCounterIdDouble2 = pAnim->AddNodeCounter ("Double Counter 2", AnimationInterface::DOUBLE_COUNTER); Simulator::Schedule (Seconds (0.1), modify);