Remove the connection lines in the mobility-fw topology and the characters displayed under the node.

Source: Internet
Author: User

Omnet ++ is an object-oriented discrete event simulation tool. It supports process-based and event-driven simulation, omnet ++ is a common simulation tool in the network. It is especially common in sensor networks, because it is relatively simple and convenient. More importantly, it is an open-source software that does not require money to purchase.
Mobility-fw is a framework developed on the basis of omnet ++. We only need to add things to the defined framework. This further reduces the difficulty of development. However, in the actual development process, some seemingly small problems may occur. For example, the topology is small, the connections are dense, and some characters are displayed under the node. This makes the topology look dark.
How do I remove the connection line?
The method is to modify the connectto function in the channelcontrol. CC file under the mobility-fw/CORE/channelcontrol:
The original function is as follows:
Void channelcontrol: nicentry: connectto (channelcontrol: nicentry & other)
{
// EV <"nicentry: Connecting Nic #" <nicid <"and #" <other. nicid <Endl;
Cgate * localoutgate = requestoutgate ();
Localoutgate-> connectto (other. requestingate ());
Outconns [other. nicid] = localoutgate;
// EV <"/T gate #" <localoutgate-> ID () <"--> #" <localoutgate-> togate ()-> ID () <Endl;
};
The modification is as follows:
Void channelcontrol: nicentry: connectto (channelcontrol: nicentry & other)
{
// EV <"nicentry: Connecting Nic #" <nicid <"and #" <other. nicid <Endl;

Cgate * localoutgate = requestoutgate ();
Localoutgate-> connectto (other. requestingate ());
Localoutgate-> setdisplaystring ("m = m, 50, 50, 50; O = # AAA, 0 ;");
Other. requestingate ()-> setdisplaystring ("m = m, 50, 50, 50; O = # AAA, 0 ;");
Outconns [other. nicid] = localoutgate;
// EV <"/T gate #" <localoutgate-> ID () <"--> #" <localoutgate-> togate ()-> ID () <Endl;
};
Then run nmake-F makefile. VC clean and
Nmake-F makefile. VC
Copy all generated OBJ files to the Lib folder.

How do I remove the characters displayed on the node? (This is troublesome)
Because the source files under the omnet installation directory in windows are incomplete. You must download an installation program in Linux (because it contains all the source code), install the Tcl software before the installation, and set the environment variables (include, Lib, BIN ).
First, modify the modinsp2.tcl file and annotate the 206 and 211 lines, as shown below:
# $ C create text $ X [expr $ y2 + $ width/2 + 3]-text $ name-anchor N-tags "dx"

} Elseif [info exists tags (I)] {

$ C Create Image $ x $ Y-image $ IMG-anchor center-tags "Dx tooltip submod $ submodptr"
# $ C create text $ X [expr $ Y + $ SY/2 + 3]-text $ name-anchor N-tags "dx"

Then, run tcl2c under src/utils using VC or other C ++ tools. file C, generate tcl2c.exe, and copy it to the utils folder. The default value is src/utils/debug,
Then run nmake-F makefile. VC clean and nmake-F makefile. VC, during the running process, you may need to modify some of the source code (because some header file directories cannot be found) (you can also set the environment variables, include, Lib, Bin under the source file directory ), tkenv is generated. lib, copy it to the lib directory of the omnet installation directory.
In this way, the display characters can be removed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.