Ets_Tool_Open()

注意: 需要 OPNET Development Kit

摘要

打开并安装一个编辑器。

语法

Ets_Tool_Open (editor_type_name, model_name)
参数 类型 说明
editor_type_name const char * 要打开的编辑器名称(参见详情)
model_name const char * 有效的模型名称、空字符串,或 OPC_NIL。

返回类型

EtsT_Compcode

如果任一名称无效则返回 EtsC_Compcode_Failure,否则返回 EtsC_Compcode_Success。

头文件

ets_api_tool.h

详情

此函数打开一个编辑器并将其设为当前编辑器(即使该编辑器窗口位于最顶层并处于活动状态)。编辑器以指定名称的模型打开;如果模型名为 OPC_NIL 或为空,则以一个新的未保存模型打开。如果指定的编辑器与模型组合已经打开,则使该编辑器处于活动状态。

如果编辑器或模型名称不存在,则不会打开任何内容,函数返回 EtsC_Compcode_Failure。

editor_type_name 参数必须是 ETS 配置文件(例如 <reldir>\sys\configs\modeler.ets)中定义的编辑器名称之一。有效的编辑器名称包括 "System" 和 "project"。

按如下方式使用时,此函数涵盖了已弃用函数 Ets_Model_New_Tool_Set_By_Name() 的功能:

  1. 以空字符串作为 model_name 参数调用 Ets_Tool_Open()。
  2. 以 file_type EtsC_Pj_Scenario_Component_Network 调用 Ets_Pj_Current_Scenario_Component_Import()。

例如:

/* Open an empty Project Editor */
Ets_Tool_Open ("project", OPC_NIL);

/* Import the desired network model. */
Ets_Pj_Current_Scenario_Component_Import (EtsC_Pj_Scenario_Component_Network,
	<filename>);

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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