NetAnim: Prevent closing the routing trace when splitting files
authorJohn Abraham<john.abraham.in@gmail.com>
Sun, 27 Jan 2013 15:56:34 -0800
changeset 9228 5fb8a7e8db69
parent 9227 cca3ebe36928
child 9229 466f83ec435d
NetAnim: Prevent closing the routing trace when splitting files
src/netanim/model/animation-interface.cc
src/netanim/model/animation-interface.h
--- a/src/netanim/model/animation-interface.cc	Mon Jan 21 17:19:00 2013 +0400
+++ b/src/netanim/model/animation-interface.cc	Sun Jan 27 15:56:34 2013 -0800
@@ -157,7 +157,7 @@
     {
       return;
     }
-  StopAnimation ();
+  StopAnimation (true);
   m_outputFileName = m_originalFileName + "-" + oss.str ();
   StartAnimation (true);
   ++i;
@@ -673,7 +673,7 @@
 }
 
 
-void AnimationInterface::StopAnimation ()
+void AnimationInterface::StopAnimation (bool onlyAnimation)
 {
   m_started = false;
   NS_LOG_INFO ("Stopping Animation");
@@ -687,6 +687,10 @@
       std::fclose (m_f);
     }
     m_outputFileSet = false;
+  if (onlyAnimation)
+    {
+      return;
+    }
   if (m_routingF)
     {
       WriteN (GetXMLClose ("anim"), m_routingF);
--- a/src/netanim/model/animation-interface.h	Mon Jan 21 17:19:00 2013 +0400
+++ b/src/netanim/model/animation-interface.h	Sun Jan 27 15:56:34 2013 -0800
@@ -455,7 +455,7 @@
    * \brief Closes the interface to the animator.
    *
    */
-  void StopAnimation ();
+  void StopAnimation (bool onlyAnimation = false);
 
   void DevTxTrace (std::string context,
                    Ptr<const Packet> p,