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 58930995ffabd1ad
parent 5892 16fd91be1b08
child 5894 fbb6ec4865d0
Add option to enable the visualizer to wifi-ap.cc
examples/wireless/wifi-ap.cc
     1.1 --- a/examples/wireless/wifi-ap.cc	Tue Dec 29 18:50:33 2009 +0000
     1.2 +++ b/examples/wireless/wifi-ap.cc	Wed Dec 30 11:31:59 2009 +0000
     1.3 @@ -27,6 +27,7 @@
     1.4  #include "ns3/contrib-module.h"
     1.5  #include "ns3/wifi-module.h"
     1.6  #include "ns3/athstats-helper.h"
     1.7 +#include "ns3/visualizer.h"
     1.8  
     1.9  #include <iostream>
    1.10  
    1.11 @@ -118,7 +119,9 @@
    1.12  int main (int argc, char *argv[])
    1.13  {
    1.14    CommandLine cmd;
    1.15 +  bool viz = false;
    1.16    cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
    1.17 +  cmd.AddValue ("viz", "Enable visualization", viz);
    1.18  
    1.19    cmd.Parse (argc, argv);
    1.20     
    1.21 @@ -192,8 +195,15 @@
    1.22    athstats.EnableAthstats("athstats-sta", stas);
    1.23    athstats.EnableAthstats("athstats-ap", ap);
    1.24  
    1.25 -  Simulator::Run ();
    1.26 -
    1.27 +  if (viz)
    1.28 +    {
    1.29 +      Visualizer::Run ();
    1.30 +    }
    1.31 +  else
    1.32 +    {
    1.33 +      Simulator::Run ();
    1.34 +    }
    1.35 +  
    1.36    Simulator::Destroy ();
    1.37  
    1.38    return 0;