Parts of the Tkenv UI

The Status Bar

The status bar shows the simulation's progress. It contains two rows, the second of which can be hidden using the View|Status Details menu item.

Figure 8.8. The status bar

The status bar

The first row contains the following items:

  1. Ini config name, run number, and the name of the network
  2. The event number of the next simulation event
  3. The simulation time of the next (expected) simulation event.
  4. Message statistics: the number of messages currently scheduled (i.e. in the FES); the number of message objects that currently exists in the simulation; and the number of message objects that have been created this far, including the already deleted ones. Out of the three, probably the middle one is the most useful: if it is steadily growing without apparent reason, the simulation model is probably missing some delete msg statements, and needs to be debugged.

When the simulation is paused or runs with animation, the second row displays the next expected simulation event. Note the word expected: certain schedulers may insert new events before the displayed event in the last moment. Some schedulers that tend to do that are those that accept input from outside sources: real-time scheduler, hybrid or hardware-in-the-loop schedulers, parallel simulation schedulers, etc. Contents of the second row:

  1. Name, C⁠+⁠+ class and ID of the next message (event) object
  2. The module where the next event will occur (i.e. the module where the message will be delivered)
  3. Time of the next event since the last executed event.

When the simulation is running, displaying the next event becomes meaningless, and second row is replaced by the following performance gauges:

Figure 8.9. The status bar during Fast or Express run

The status bar during Fast or Express run

  1. Simulation speed: number of events processed per real second
  2. Relative speed of the simulation (compared to real-time)
  3. Event density: the number of events per simulated seconds

The Timeline

Figure 8.10. The timeline

The timeline

The timeline displays the contents of the Future Events Set on a logarithmic time scale. Each dot represents a message (event).

Clicking an event will focus it in the Object Inspector, and double-clicking will open a floating inspector window. Right-clicking will bring up a context menu with further actions.

The timeline is often crowded, limiting its usefulness. To overcome this, you can hide uninteresting events from the timeline: right-click the event, and choose Exclude Messages Like 'x' from the Animation from the context menu. This will hide events with same name and C⁠+⁠+ class name from the timeline, and also skip the animation when such messages are sent from one module to another. You can view and edit the list of excluded messages on the Filtering page of the Preferences dialog. (Tip: the timeline context menu provides a shortcut to that dialog).

The timeline can be hidden (and revealed again) using the View|Timeline menu item.

The Object Navigator

Figure 8.11. The object tree

The object tree

The Object Navigator displays inspectable objects reachable from two root objects (the network module and the FES) in a tree form.

Clicking an object will focus it in the Object Inspector, and double-clicking will open a floating inspector window. Right-clicking will bring up a context menu with further actions.

The Object Inspector

The Object Inspector is located below the Object Navigator, and lets you examine the contents of objects in detail. The Object Inspector always focuses on the object last clicked (or otherwise selected) on the Tkenv UI. It can be directly navigated as well, via the Back, Forward, and Go to Parent buttons, and also by double-clicking objects shown inside the inspector's area.

Figure 8.12. The object inspector

The object inspector

The inspector features a tabbed interface with two pages: Fields and Contents. The Fields page shows the fields (or data members) of the object, organized in categories. It uses meta-information generated by the message compiler to obtain the list of fields and their values. (This is true even for the built-in classes -- the simulation kernel contains their description of msg format.)

Figure 8.13. The object inspector

The object inspector

The Contents page lists the child objects of the currently inspected object. The child list is obtained via the forEach() method of the object.

The Network Display

The network view provides a graphical view of the network and in general, modules. Graphical representation is based on display strings (@display properties in the NED file). You can go into any compound module by double-clicking its icon.

Message sending, method calls and certain other events are animated in the graphical view. You can customize animation in the Animation page of the Preferences dialog.

Figure 8.14. The network display

The network display

The context menu of submodules makes further actions available (see below).

Figure 8.15. Submodule context menu

Submodule context menu

Figure 8.16. The Utilities submenu

The Utilities submenu

Zooming and Panning

There are several ways for zooming the canvas, both using the mouse and the keyboard:

  • Use Ctrl+M to zoom in, Ctrl+N to zoom out; the same functionality is also available in the canvas toolbar

  • To zoom in around a point, double-click the canvas; use Shift + double-click to zoom out

  • For marquee zoom, drag out a rectangle with the left mouse button while holding down Ctrl; you can cancel the operation with the right mouse button.

  • Panning: moving the mouse while holding down the left mouse button will move the canvas; this is often a more comfortable way to navigate the canvas than using the scroll bars.

The Log Viewer

When you run the simulation, Tkenv will remember the output from logging statements (EV << "Hello World\n";) and the messages sent between modules, and can present it to you in a meaningful manner. Only the output from the last N events is preserved (N being configurable in the Preferences dialog), and only in Step, Run and Fast Run modes. (Express mode can be so fast because such overhead is turned off while it's active.)

The Log Viewer shows log related to one compound module and its subtree. It has two modes: Messages and Log mode, the default being Messages. You can switch between the two modes with tool icons on the inspector's local toolbar.

In Messages mode, the window displays messages sent between the (immediate) submodules of the inspected compound module, and messages sent out of, or into the compound module.

Note

In Messages mode, the Info column can be customized by writing and registering a custom cMessagePrinter class.

Figure 8.17. The log viewer showing message traffic

The log viewer showing message traffic

In Log mode, the window displays log lines that belong to submodules under the inspected compound module (i.e. the whole module subtree.)

Figure 8.18. The log viewer showing module log

The log viewer showing module log

You can filter the content of the window to only include messages from specific modules. Open the log window's context menu and select Filter Window Contents.

Figure 8.19. The log filter dialog

The log filter dialog

General logging behavior can be controlled in the Preferences dialog.

It is also possible to open separate log windows for individual modules. A log window for a compound module displays the log from all of its submodule tree. To open a log window, find the module in the module tree or the network display, right-click it and choose Open Component Log from the context menu.