op_ima_traj_info_get()

摘要

返回站点在给定时间所对应的轨迹段中的地面速度和上升速率,以及站点保持这些速度的截止时间。

语法

op_ima_traj_info_get (objid, time, ground_speed_ptr, ascent_rate_ptr, end_time_ptr)
参数 类型 说明
objid Objid 目标站点的对象 ID
time double 目标仿真时间(必须不早于 op_sim_time())
ground_speed_ptr double * 用于填入 time 时刻地面速度的变量
ascent_rate_ptr double * 用于填入 time 时刻上升速率的变量
end_time_ptr double * 用于填入下一个轨迹速度发生变化的仿真时间的变量

返回类型

Compcode

若成功获取轨迹信息,返回 OPC_COMPCODE_SUCCESS;否则返回 OPC_COMPCODE_FAILURE。

示例

/* Display ground speed, ascent rate, and end time for each trajectory segment */
/* of current object’s parent. */
double	    start_time, end_time, ground_speed, ascent_rate;

op_ima_obj_hname_get (op_id_parent (op_id_self ()), name, 256);

start_time = 0;
end_time = OPC_DBL_INFINITY;
do
	{
	retval = op_ima_traj_info_get (op_id_parent (op_id_self ()),
		start_time, &ground_speed, &ascent_rate, &end_time);

	start_time = end_time;

	if (retval == OPC_COMPCODE_SUCCESS)
		printf ("%-40sspd: %g, asc: %g, end: %g\n",
			name, ground_speed, ascent_rate, end_time);
	else
		printf ("%-40s: failed\n", name);
	}
while (end_time != OPC_DBL_INFINITY);

详情

如果指定的站点是固定站点,返回的速度将是其父站点(可能移动)的速度。若移动没有时间限制,则返回的截止时间值为 OPC_DBL_INFINITY。地面速度和上升速率以米/秒为单位。

用途

提供一种方法,用于获取站点在某一特定轨迹段内的地面速度和上升速率信息。

错误

  • 可恢复错误:对象 ID(<objid>)超出范围。
  • 可恢复错误:对象 ID(<objid>)指向受限对象。
  • 可恢复错误:对象(<objid>)类型不正确(<type>);应为节点或天线对象。
  • 可恢复错误:无法为移动子网内的移动站点计算向量移动性
  • 可恢复错误:无法为卫星子网内的移动站点计算向量移动性

参考

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