op_anim_ime_npath_traverse()

Abstract

Depicts the traversal of a model path displayed in a viewer via a moving mark. Examples of paths include network links and node streams.

Syntax

op_anim_ime_npath_traverse (anvid, path_type, path_name, trav_id, trav_options, props, text)
Argument Type Description
anvid Anvid viewer ID
[This value is a numeric identifier which references a viewer. The path traversal will be displayed in the viewer’s window.]
path_type int path object type code
path_name char* path name
trav_id int traversal ID
trav_options int traversal option flags
props int graphical property flags
[This value is the bitwise OR combination of symbolic constant flags listed under “Animation Graphical Property Symbolic Constants—Text Alignment“ on page 3.]
text char* text associated with traversal

Return Type

void

no return value

Example

/* Receive a cell on input stream. */
cell_ptr = op_pk_get (op_intrpt_strm ());

/* Extract ID & address information. */
op_pk_nfd_get (cell_ptr, "cell id",  &cell_id);
op_pk_nfd_get (cell_ptr, "src_addr", &src_addr);
op_pk_nfd_get (cell_ptr, "dst_addr", &dst_addr);

/* Determine next hop of cell and forward. */
out_strm = cell_route_next_hop_port (dst_addr, local_id);
op_pk_send (cell_ptr, out_strm);

/* Animate cell’s transmission to next switch. */
sprintf (cell_data, "cell #%d: s(%d) d(%d)",
		cell_id, src_addr, dst_addr);
op_anim_ime_npath_traverse (vid, OPC_ANIM_OBJTYPE_STREAM, strm_name [out_strm],
	Trav_Id++, OPC_ANIM_TRAV_OPTION_CIRCLE | OPC_ANIM_TRAV_OPTION_FULL |
	OPC_ANIM_TRAV_OPTION_TEXT, OPC_ANIM_COLOR_YELLOW, cell_data);

Details

Path traversals are affected by the color graphical property. The color graphical property of the moving mark can be assigned any of the 64 indexed color values (with the format OPC_ANIM_COLOR_RGB<rgb>) or the 25 named color values (the default color value is black).

The path_type argument should be passed a symbolic constant with the format OPC_ANIM_OBJTYPE_<type>, where possible values of <type> include SIMPLINK, DUPLINK, BUSLINK, and TAPLINK within network model diagrams, or STREAM and STATWIRE within node model diagrams.

There are several options available on path traversals, as specified by the bitwise OR combination of flags passed to the trav_options argument. Option flags have the format OPC_ANIM_TRAV_OPTION_<opt>, where the option values include: mark shape (either CIRCLE or SQUARE), text enabling (TEXT), traversal direction (REVERSE), and traversal scope (FULL—mark traverses complete path from source to destination, SRC_BEGIN—mark traverses from path source to midpoint, DST_END—mark traverses from path midpoint to destination). There are other advanced options that are primarily used by the automatic simulation features of the Simulation Kernel (these appear in Table 46 “Animation Path Traverse Option Symbolic Constants“ on page 9).

The trav_id argument is an integer value which uniquely identifies a specific traversal; this allows destination traversals to refer back to source traversals so that the appropriate marks are moved.

Purpose

Provides a mechanism for depicting movement of information (such as packets) through a network. Typically, this KP is applied to node stream or network link objects to depict messages flowing across such connections.

Errors

  • Program Abort: segmentation violation (due to a badly formed string for the path_name or text arguments)
  • Diagnostic Error: Animation viewer ID (<anvid>) is out-of-range. (due to an invalid value for the anvid argument)
  • Diagnostic Error: Kernel procedure argument (<arg_name>) has out-of-range value (<arg_val>). (due to an invalid value for the path_type or trav_options arguments)
  • Diagnostic Error: Invalid property component (<prop_comp>) for graphical primitive. (due to an inapplicable or invalid value for the props argument)

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com