Add option to enable the visualizer to wifi-ap.cc
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 30 Dec 2009 11:31:59 +0000
changeset 5893 0995ffabd1ad
parent 5892 16fd91be1b08
child 5894 fbb6ec4865d0
Add option to enable the visualizer to wifi-ap.cc
examples/wireless/wifi-ap.cc
--- a/examples/wireless/wifi-ap.cc	Tue Dec 29 18:50:33 2009 +0000
+++ b/examples/wireless/wifi-ap.cc	Wed Dec 30 11:31:59 2009 +0000
@@ -27,6 +27,7 @@
 #include "ns3/contrib-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/athstats-helper.h"
+#include "ns3/visualizer.h"
 
 #include <iostream>
 
@@ -118,7 +119,9 @@
 int main (int argc, char *argv[])
 {
   CommandLine cmd;
+  bool viz = false;
   cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
+  cmd.AddValue ("viz", "Enable visualization", viz);
 
   cmd.Parse (argc, argv);
    
@@ -192,8 +195,15 @@
   athstats.EnableAthstats("athstats-sta", stas);
   athstats.EnableAthstats("athstats-ap", ap);
 
-  Simulator::Run ();
-
+  if (viz)
+    {
+      Visualizer::Run ();
+    }
+  else
+    {
+      Simulator::Run ();
+    }
+  
   Simulator::Destroy ();
 
   return 0;