Bug 2060 - add python bindings to netanim module
add python bindings to netanim module
Status: NEW
Product: ns-3
Classification: Unclassified
Component: netanim
pre-release
PC Linux
: P5 enhancement
Assigned To: John Abraham
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-07 13:39 EST by Tom Henderson
Modified: 2015-02-08 11:00 EST (History)
2 users (show)

See Also:


Attachments
possible minimal patch to fix (967 bytes, patch)
2015-02-07 13:39 EST, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2015-02-07 13:39:53 EST
Created attachment 1969 [details]
possible minimal patch to fix

It seems that we could perhaps add python bindings to netanim without much work.  Attached is a patch that worked for me but needs to be more fully tested.
Comment 1 John Abraham 2015-02-08 11:00:51 EST
I tried the patch , and I got

[1507/1795] cxx: build/src/netanim/bindings/ns3module.cc -> build/src/netanim/bindings/ns3module.cc.7.o
In file included from src/netanim/bindings/ns3module.cc:1:0:
src/netanim/bindings/ns3module.h:1273:5: error: ‘TimeChecker’ in namespace ‘ns3’ does not name a type
     ns3::TimeChecker *obj;
     ^
src/netanim/bindings/ns3module.h:1383:5: error: ‘AnimPacketInfo’ in namespace ‘ns3’ does not name a type
     ns3::AnimPacketInfo *obj;
     ^
src/netanim/bindings/ns3module.h:1394:5: error: ‘AnimRxInfo’ in namespace ‘ns3’ does not name a type
     ns3::AnimRxInfo *obj;



john@john-VirtualBox:~/ns3/ns-3-allinone/ns-3-dev$ hg diff 
diff -r 94c2675383e6 src/netanim/model/animation-interface.cc
--- a/src/netanim/model/animation-interface.cc	Fri Feb 06 18:14:38 2015 -0800
+++ b/src/netanim/model/animation-interface.cc	Sun Feb 08 07:57:14 2015 -0800
@@ -33,6 +33,7 @@
 // ns3 includes
 #include "ns3/animation-interface.h"
 #include "ns3/channel.h"
+#include "ns3/nstime.h"
 #include "ns3/config.h"
 #include "ns3/node.h"
 #include "ns3/mobility-model.h"
diff -r 94c2675383e6 src/netanim/model/animation-interface.h
--- a/src/netanim/model/animation-interface.h	Fri Feb 06 18:14:38 2015 -0800
+++ b/src/netanim/model/animation-interface.h	Sun Feb 08 07:57:14 2015 -0800
@@ -29,7 +29,6 @@
 #include "ns3/ptr.h"
 #include "ns3/net-device.h"
 #include "ns3/node-container.h"
-#include "ns3/nstime.h"
 #include "ns3/log.h"
 #include "ns3/node-list.h"
 #include "ns3/random-variable-stream.h"
@@ -51,6 +50,7 @@
 
 
 struct NodeSize;
+class Time;
 
 /**
  * \defgroup netanim Network Animation
diff -r 94c2675383e6 src/netanim/wscript
--- a/src/netanim/wscript	Fri Feb 06 18:14:38 2015 -0800
+++ b/src/netanim/wscript	Sun Feb 08 07:57:14 2015 -0800
@@ -26,3 +26,4 @@
 	if (bld.env['ENABLE_EXAMPLES']) :
 		bld.recurse('examples')
 
+        bld.ns3_python_bindings()


history:

2009  hg clone http://code.nsnam.org/ns-3-allinone
 2010  cd ns-3-allinone/
 2011  ./download.py 
 2014  cd ns-3-dev/
 2018  vim src/netanim/model/animation-interface.h 
 2019  vim src/netanim/model/animation-interface.cc
 2020  vim src/netanim/wscript 
 2023  cd ..
 2024  ./build.py