/* Process model C form file: wireless_mrt_rx_point_ref.pr.c */
/* Portions of this file copyright 1992-2002 by OPNET Technologies, Inc. */
/* This variable carries the header into the object file */
static const char wireless_mrt_rx_point_ref_pr_c [] = "MIL_3_Tfile_Hdr_ 90A 30A op_runsim 7 3F8A4BE7 3F8A4BE7 1 TRACY tracy 0 0 none none 0 0 none 0 0 0 0 0 0 ";
#include <string.h>
/* OPNET system definitions */
#include <opnet.h>
#if defined (__cplusplus)
extern "C" {
#endif
FSM_EXT_DECS
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif
#if !defined (VOSD_NO_FIN)
#undef BIN
#undef BOUT
#define BIN FIN_LOCAL_FIELD(last_line_passed) = __LINE__ - _block_origin;
#define BOUT BIN
#define BINIT FIN_LOCAL_FIELD(last_line_passed) = 0; _block_origin = __LINE__;
#else
#define BINIT
#endif /* #if !defined (VOSD_NO_FIN) */
/* State variable definitions */
typedef struct
{
/* Internal state tracking for FSM */
FSM_SYS_STATE
} wireless_mrt_rx_point_ref_state;
#define pr_state_ptr ((wireless_mrt_rx_point_ref_state*) SimI_Mod_State_Ptr)
/* This macro definition will define a local variable called */
/* "op_sv_ptr" in each function containing a FIN statement. */
/* This variable points to the state variable data structure, */
/* and can be used from a C debugger to display their values. */
#undef FIN_PREAMBLE
#define FIN_PREAMBLE wireless_mrt_rx_point_ref_state *op_sv_ptr = pr_state_ptr;
/* No Function Block */
enum { _block_origin = __LINE__ };
/* Undefine optional tracing in FIN/FOUT/FRET */
/* The FSM has its own tracing code and the other */
/* functions should not have any tracing. */
#undef FIN_TRACING
#define FIN_TRACING
#undef FOUTRET_TRACING
#define FOUTRET_TRACING
#if defined (__cplusplus)
extern "C" {
#endif
void wireless_mrt_rx_point_ref (void);
Compcode wireless_mrt_rx_point_ref_init (void **);
void wireless_mrt_rx_point_ref_diag (void);
void wireless_mrt_rx_point_ref_terminate (void);
void wireless_mrt_rx_point_ref_svar (void *, const char *, char **);
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif
/* Process model interrupt handling procedure */
void
wireless_mrt_rx_point_ref (void)
{
int _block_origin = 0;
FIN (wireless_mrt_rx_point_ref ());
if (1)
{
Objid subnet_id, /* subnetwork object identifier */
tx_node_id, /* transmitter node object identifier */
rx_node_id, /* receiver node object identifier */
rx_ant_id; /* receiver antenna object identifier */
double altitude, /* the altitude of the transmitter node */
latitude, /* the latitude of the transmitter node */
longitude, /* the longitude of the transmitter node */
x_pos, /* the subnetwork x position of the transmitter node */
y_pos, /* the subnetwork y position of the transmitter node */
z_pos; /* the subnetwork z position of the transmitter node */
Compcode comp_code; /* the completion code for Ima procedures */
FSM_ENTER (wireless_mrt_rx_point_ref)
FSM_BLOCK_SWITCH
{
/*---------------------------------------------------------*/
/** state (point) enter executives **/
FSM_STATE_ENTER_UNFORCED (0, state0_enter_exec, "point", "wireless_mrt_rx_point_ref [point enter execs]")
FSM_PROFILE_SECTION_IN ("wireless_mrt_rx_point_ref [point enter execs]", state0_enter_exec)
{
/* This line assigns the ID of the parent node object (the object */
/* which contains this processor module) to the variable rx_node_id. */
/* op_id_self() determines the object ID of the processor module. */
/* op_topo_parent() uses the processor object ID to determine the */
/* processor's parent object ID. */
rx_node_id = op_topo_parent (op_id_self ());
/* This line determines the ID of the subnet object containing the */
/* node object and stores the value in subnet_id. */
subnet_id = op_topo_parent (rx_node_id);
/* This line assigns the object ID of the transmitter node to the */
/* variable tx_node_id. It uses the name of the transmitter node */
/* (the transmitter node will be named "tx" in the network model) as */
/* an argument to op_id_from_name(), which determines the object's ID */
/* from the provided parameters: parent object ID, object type, and */
/* object name. */
tx_node_id = op_id_from_name (subnet_id, OPC_OBJTYPE_NDFIX, "tx");
/* This line uses op_ima_obj_pos_get() to retrieve the transmitter */
/* node object's global position values. It converts the relative */
/* subnet position values of the transmitter node to geocentric values. */
/* The values of x_pos, y_pos, and z_pos will not be used here, but */
/* the procedure requires their presence as arguments. Most of the */
/* Ima kernel procedures return a completion code which indicates */
/* whether the operation completed successfully. The code is stored */
/* here in the OPNET integer variable comp_code. */
comp_code = op_ima_obj_pos_get (tx_node_id, &latitude, &longitude, &altitude, &x_pos, &y_pos, &z_pos);
/* Comparing the completion code value to the OPNET symbolic */
/* constants OPC_COMPCODE_SUCCESS and OPC_COMPCODE_FAILURE reveals the */
/* success or failure status of the previous operation. This line */
/* tests the completion code, and upon detecting failure, calls */
/* op_sim_end() to immediately end the simulation and print an error */
/* message to the standard output device, and the opnet message area. */
if (comp_code == OPC_COMPCODE_FAILURE)
op_sim_end ("get attributes failed", "", "", "");
/* This line assigns the object ID of the antenna module within the */
/* receiver node to the variable rx_ant_id. It uses the name of the */
/* antenna module (the antenna module will be named ant_rx in the */
/* receiver node model) as an argument to op_id_from_name(). */
rx_ant_id = op_id_from_name (rx_node_id, OPC_OBJTYPE_ANT, "ant_rx");
/* The remaining lines use op_ima_obj_attr_set() to modify the antenna */
/* module's target altitude, target latitude, and target longitude */
/* attributes with values retrieved from the transmitter node. */
/* If the comp_code indicates failure then the simulation is ended */
/* immediately. */
comp_code = op_ima_obj_attr_set (rx_ant_id, "target altitude", altitude);
if (comp_code == OPC_COMPCODE_FAILURE)
op_sim_end ("set target altitude failed", "", "", "");
comp_code = op_ima_obj_attr_set (rx_ant_id, "target latitude", latitude);
if (comp_code == OPC_COMPCODE_FAILURE)
op_sim_end ("set target latitude failed", "", "", "");
comp_code = op_ima_obj_attr_set (rx_ant_id, "target longitude", longitude);
if (comp_code == OPC_COMPCODE_FAILURE)
op_sim_end ("set target longitude failed", "", "", "");
}
FSM_PROFILE_SECTION_OUT ("wireless_mrt_rx_point_ref [point enter execs]", state0_enter_exec)
/** blocking after enter executives of unforced state. **/
FSM_EXIT (1,wireless_mrt_rx_point_ref)
/** state (point) exit executives **/
FSM_STATE_EXIT_UNFORCED (0, "point", "wireless_mrt_rx_point_ref [point exit execs]")
FSM_PROFILE_SECTI
opnet-example.rar_opnet_基于opnet_网络仿真
版权申诉
131 浏览量
2022-09-19
18:42:13
上传
评论
收藏 112KB RAR 举报
小贝德罗
- 粉丝: 69
- 资源: 1万+
最新资源
- 万维考试系统-C语言题库-含题目-程序设计题导出-113道.doc
- Alibaba SpringCloud集成Nacos、openFeign实现负载均衡-源码
- 用户研究系列之Persona介绍(用户画像)
- Image_1715110604427.jpg
- mYzh..trashed-1716951334-.jpg
- Alibaba SpringCloud集成nacos实现配置中心
- 那些好的不像话的心流体验
- 基于pytorch的卷积神经网络识别是否为奥特曼的项目python源码+文档说明+数据集(课程设计)
- 基于卷积神经网络的图像风格迁移python源码+文档说明+界面图片(课程设计)
- 河北地质大学毕业设计-基于卷积神经网络的垃圾分类研究代码python源码+文档说明
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈