最近看《NS与网络模拟》教材,经常要查看NS2的源代码,可NS2太过复杂,通过XP的资源管理器看了几天,发现太累!Google了以下,发现有个软件在XP下结合Cygwin的NS2平台,可以很方便地查看源代码,尤其是NS2繁杂的各种类与成员!
 
此链接有如何使用Source-insight软件的详细介绍,但不知何故,其中部分链接地址有问题,特更正如下以备不时只需:
Download Source Insight
(http://www.sourceinsight.com) 此软件的官网
Introduction: http://www.sourceinsight.com/prodinfo.html软件介绍
Trial Version: http://www.sourceinsight.com/eval.html 可下载使用版本
User Manual: http://www.sourceinsight.com/docsv3.html使用手册,界面很友好,对于NS2代码的查看而言,不需要!
 
Adding support for .cc file:    添加对.cc文件格式的支持
1.  Click “Options” Menu --> “Document Options” Dialog
2.  In “Document Options” Dialog:
Select "C++ Source File" in " Document Type" Droplist --> Add “;*.cc” in “File filter” --> Click “Close” Button
 
Adding support for .tcl file: 添加对.tcl文件格式的支持
1.  Download tcl language file from:
2. Click “Options” Menu --> “Preferences” Dialog --> “Languages” Tab
3. In “Languages” Tab:
Click “import” Button --> Select “TCL.CLF” to import the tcl language file --> Select “TCL” in “Language” --> Click “Doc Types…” Button in “Languages” Tab --> “Document Options” Dialog
4.  In “Document Options” Dialog:
Click “Add Type…” Button --> Type “tcl” as Document Type Name --> Type “*.tcl” in “File filter” --> Select “TCL” in “Language” Droplist --> Select "Include when adding to projects" Checkbox --> Click “Close” Button
 
Import NS2 Source code  导入NS2的源代码,以便查看!
1.  Click "Project" Menu --> New Project --> Type “NS2” as the project name --> Click “OK” Button --> Click “OK” Button in “New Project Setting” Dialog --> “Add and Remove Project Files” Dialog
2. In “Add and Remove Project Files” Dialog:
    Select the NS2 source code file folder --> Click “Add All” Button --> Select “Recursively add lower sub-directories” --> Click “OK” Button --> Click “OK” for importing source code --> Click “Close” Button in “Add and Remove Project Files” Dialog