tmm_propagation_spec_calc_pathloss()

注意: 需要地形建模模块(Terrain Modeling Module)功能。

摘要

使用指定的传播规范执行路径损耗计算。

语法

tmm_propagation_spec_calc_pathloss (spec, tda_state_ptr, tx_position_ptr, rx_position_ptr, center_frequency, bandwidth, verbose, status_ptr, message_buffer_v, zone_used)
参数 类型 说明
spec const TmmT_Propagation_Spec * 选择传播模型时使用的传播规范。
tda_state_ptr void * 供管道阶段使用,用于向路径损耗计算函数传递参数。
tx_position_ptr TmmT_Position * 对应发射机位置的路径端点。
rx_position_ptr TmmT_Position * 对应接收机位置的路径端点。
center_frequency double 信号的中心频率,单位为赫兹。
bandwidth double 信号的带宽,单位为赫兹。
verbose int 控制向仿真日志报告路径损耗计算消息的详细程度,取 OPC_TRUE 或 OPC_FALSE。作用与 tmm_verbose_set() 相同。
status_ptr TmmT_Loss_Status * 由路径损耗计算函数填写的区域,用于指示计算状态,取值为 TmmC_Loss_Valid、TmmC_Loss_No_Closure 或 TmmC_Loss_Error 之一。
message_buffer_v char 用于保存路径损耗计算产生的消息的缓冲区(参见详情)。
zone_used TmmT_Propagation_Zone * 用于填写本次计算所用区域的区域。用 tmm_zone_valid() 检验:结果为 false 表示未选择任何区域,为 true 表示该区域被用于路径损耗计算。

返回类型

double

以分贝表示的路径损耗。(检查 status_ptr 以确认该值是否为有效的路径损耗。)

头文件

tmm.h

示例

摘自 dra_closure.ps.c:

TmmT_Propagation_Zone    zone_used;


/** Call the propagation spec's path loss calculation method.        **/
/** The function can report:                                        **/
/**    a signal loss value                                          **/
/**    a error condition (e.g. invalid elevation)                  **/
/**    a lack of link closure - so no communication is             **/
/** possible.                                                      **/
FIN_MT (tmm_spec_closure_calc (pkptr));

/* Get transmission frequency in Hz. */
tx_base_freq = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_FREQ);
tx_bandwidth = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_BW);
tx_center_freq = tx_base_freq + (tx_bandwidth / 2.0);

/* Get transmitter's location. */
tx_position.latitude = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_LAT);
tx_position.longitude = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_LONG);
tx_position.elevation = op_td_get_dbl (pkptr, OPC_TDA_RA_TX_ALT);

/* Get receiver's location. */
rx_position.latitude = op_td_get_dbl (pkptr, OPC_TDA_RA_RX_LAT);
rx_position.longitude = op_td_get_dbl (pkptr, OPC_TDA_RA_RX_LONG);
rx_position.elevation = op_td_get_dbl (pkptr, OPC_TDA_RA_RX_ALT);

/* Propagation models shipped by Riverbed don't use any extra state  */
/* so just for clarity set the local state pointer to null.       */
/* User created propagation models can pass any value they wish.  */
pipeline_invocation_state_ptr = OPC_NIL;

/* Determine if TMM verbose is requested. */
/* This can be set using the tmm_verbose environment attribute */
trace_active = op_prg_odb_trace_active ()|| op_prg_odb_pktrace_active (pkptr);
verbose_active = tmm_verbose_get ();

/*** Call the propagation spec's path_loss_calc_method. ***/

for (str_index = 0; str_index < TMMC_LOSS_MESSAGE_BUF_NUM_STRS; str_index++)
    tmm_spec_msg_buffer_v [str_index] [0] = '\0';
    tmm_spec_path_loss_dB = 
    tmm_propagation_spec_calc_pathloss (
        DraS_Closure_Prop_Spec_Ptr,
        pipeline_invocation_state_ptr,
        &tx_position,
        &rx_position,
        tx_center_freq,
        tx_bandwidth,
        verbose_active || trace_active,
        &tmm_spec_loss_status,
        tmm_spec_msg_buffer_v,
        &zone_used);

详情

如果传播规范包含多个区域,TMM 会选择频率范围兼容且包含信号路径百分比最大的区域,然后使用该区域指定的传播模型。更多详情参见“Creating a Propagation Specification“ 第 14 页。

message_buffer_v 参数为路径损耗计算提供了报告位置,用于报告计算损耗值过程中出现的任何问题或错误的文本消息。该变量是一个二维数组,由五个 512 字符的缓冲区数组组成。

用途

该函数针对给定的路径、频率和带宽计算路径损耗,所用传播模型从给定的传播规范中选取。

错误

  • 无。

参考

  • 无。

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