Bug 885 - Error in Ascii tracing in Python examples
authorKim Højgaard-Hansen <kimrhh@gmail.com>
Tue, 20 Apr 2010 14:12:35 -0400
changeset 6256 a02c44146209
parent 6255 ca79ce283a19
child 6257 f2d91c2587ed
Bug 885 - Error in Ascii tracing in Python examples
examples/csma/csma-bridge.py
examples/routing/nms-p2p-nix.cc
examples/wireless/mixed-wireless.py
--- a/examples/csma/csma-bridge.py	Tue Apr 20 12:40:00 2010 -0400
+++ b/examples/csma/csma-bridge.py	Tue Apr 20 14:12:35 2010 -0400
@@ -123,9 +123,8 @@
     # Trace output will be sent to the file "csma-bridge.tr"
     #
     #print "Configure Tracing."
-    #std.ofstream ascii
-    #ascii.open("csma-bridge.tr")
-    #CsmaHelper.EnableAsciiAll(ascii)
+    #ascii = ns3.AsciiTraceHelper();
+    #csma.EnableAsciiAll(ascii.CreateFileStream ("csma-bridge.tr"));
 
     #
     # Also configure some tcpdump traces; each interface will be traced.
--- a/examples/routing/nms-p2p-nix.cc	Tue Apr 20 12:40:00 2010 -0400
+++ b/examples/routing/nms-p2p-nix.cc	Tue Apr 20 14:12:35 2010 -0400
@@ -428,17 +428,6 @@
   TIMER_NOW (routingEnd);
   cout << "Routing tables population took " 
        << TIMER_DIFF (routingEnd, routingStart) << endl;
-#if 0 
-  std::ofstream ascii;
-  ascii.open("nms_p2p_nix.tr");
-  PointToPointHelper::EnableAsciiAll(ascii);
-  CsmaHelper::EnableAsciiAll(ascii);
-#endif
-
-#if 0
-  PointToPointHelper::EnablePcapAll("nms_p2p");
-  CsmaHelper::EnablePcapAll("nms_csma");
-#endif
 
   Simulator::ScheduleNow (Progress);
   cout << "Running simulator..." << endl;
--- a/examples/wireless/mixed-wireless.py	Tue Apr 20 12:40:00 2010 -0400
+++ b/examples/wireless/mixed-wireless.py	Tue Apr 20 14:12:35 2010 -0400
@@ -316,9 +316,10 @@
     #  Let's set up some ns-2-like ascii traces, using another helper class
     # 
     #std.ofstream ascii
-    #ascii.open("mixed-wireless.tr")
-    #WifiHelper.EnableAsciiAll(ascii)
-    #CsmaHelper.EnableAsciiAll(ascii)
+    #ascii = ns3.AsciiTraceHelper();
+    #stream = ascii.CreateFileStream("mixed-wireless.tr");
+    #wifiPhy.EnableAsciiAll(stream);
+    #csma.EnableAsciiAll(stream);
     print "(tracing not done for Python)"
     #  Look at nodes 11, 13 only
     # WifiHelper.EnableAscii(ascii, 11, 0);