Search code examples
omnet++veins

How to display the therotical transmission range of the vehicle, when it become a cluster head?


I know that in the ned file, the following line can display a circle representing the transmission range of the vehicle.

@display("p=1025,1025;is=s;r=300");

How can I disable/enable this code from the cc file? Or is there another way to do it from the source code?


Solution

  • In C++ code of your module use the following commands:

    • to show a range:

      getDisplayString().setTagArg("r", 0, 300);
      
    • to disable showing a range:

      getDisplayString().removeTag("r");
      

    References:

    1. OMNeT++ Simulation Manual - Changing Display Strings at Runtime
    2. OMNeT++ Simulation Manual - Appendix G: Display String Tags