/* Process model C form file: stat_test.pr.c */
/* Portions of this file copyright 1992-2004 by OPNET Technologies, Inc. */
/* This variable carries the header into the object file */
const char stat_test_pr_c [] = "MIL_3_Tfile_Hdr_ 105A 30A op_runsim 7 487195C4 487195C4 1 SNOW Yao.leon 0 0 none none 0 0 none 0 0 0 0 0 0 0 0 a0a 3 ";
#include <string.h>
/* OPNET system definitions */
#include <opnet.h>
#if !defined (VOSD_NO_FIN)
#undef BIN
#undef BOUT
#define BIN FIN_LOCAL_FIELD(_op_last_line_passed) = __LINE__ - _op_block_origin;
#define BOUT BIN
#define BINIT FIN_LOCAL_FIELD(_op_last_line_passed) = 0; _op_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
/* State Variables */
Stathandle count ;
int con ;
} stat_test_state;
#define pr_state_ptr ((stat_test_state*) (OP_SIM_CONTEXT_PTR->mod_state_ptr))
#define count pr_state_ptr->count
#define con pr_state_ptr->con
/* These macro definitions 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_DEC
#undef FIN_PREAMBLE_CODE
#if defined (OPD_PARALLEL)
# define FIN_PREAMBLE_DEC stat_test_state *op_sv_ptr; OpT_Sim_Context * tcontext_ptr;
# define FIN_PREAMBLE_CODE \
if (VosS_Mt_Perform_Lock) \
VOS_THREAD_SPECIFIC_DATA_GET (VosI_Globals.simi_mt_context_data_key, tcontext_ptr, SimT_Context *); \
else \
tcontext_ptr = VosI_Globals.simi_sequential_context_ptr; \
op_sv_ptr = ((stat_test_state *)(tcontext_ptr->mod_state_ptr));
#else
# define FIN_PREAMBLE_DEC stat_test_state *op_sv_ptr;
# define FIN_PREAMBLE_CODE op_sv_ptr = pr_state_ptr;
#endif
/* No Function Block */
#if !defined (VOSD_NO_FIN)
enum { _op_block_origin = __LINE__ };
#endif
/* 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 stat_test (OP_SIM_CONTEXT_ARG_OPT);
VosT_Obtype stat_test_init (int * init_block_ptr);
VosT_Address stat_test_alloc (VOS_THREAD_INDEX_ARG_COMMA VosT_Obtype, int);
void stat_test_diag (OP_SIM_CONTEXT_ARG_OPT);
void stat_test_terminate (OP_SIM_CONTEXT_ARG_OPT);
void stat_test_svar (void *, const char *, void **);
VosT_Obtype Vos_Define_Object_Prstate (const char * _op_name, unsigned int _op_size);
VosT_Address Vos_Alloc_Object_MT (VOS_THREAD_INDEX_ARG_COMMA VosT_Obtype _op_ob_hndl);
VosT_Fun_Status Vos_Poolmem_Dealloc_MT (VOS_THREAD_INDEX_ARG_COMMA VosT_Address _op_ob_ptr);
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif
/* Process model interrupt handling procedure */
void
stat_test (OP_SIM_CONTEXT_ARG_OPT)
{
#if !defined (VOSD_NO_FIN)
int _op_block_origin = 0;
#endif
FIN_MT (stat_test ());
{
FSM_ENTER_NO_VARS ("stat_test")
FSM_BLOCK_SWITCH
{
/*---------------------------------------------------------*/
/** state (init) enter executives **/
FSM_STATE_ENTER_FORCED_NOLABEL (0, "init", "stat_test [init enter execs]")
FSM_PROFILE_SECTION_IN ("stat_test [init enter execs]", state0_enter_exec)
{
count=op_stat_reg("test.Count",OPC_STAT_INDEX_NONE,OPC_STAT_GLOBAL);
con = 0;
}
FSM_PROFILE_SECTION_OUT (state0_enter_exec)
/** state (init) exit executives **/
FSM_STATE_EXIT_FORCED (0, "init", "stat_test [init exit execs]")
/** state (init) transition processing **/
FSM_TRANSIT_FORCE (1, state1_enter_exec, ;, "default", "", "init", "stat")
/*---------------------------------------------------------*/
/** state (stat) enter executives **/
FSM_STATE_ENTER_UNFORCED (1, "stat", state1_enter_exec, "stat_test [stat enter execs]")
/** blocking after enter executives of unforced state. **/
FSM_EXIT (3,"stat_test")
/** state (stat) exit executives **/
FSM_STATE_EXIT_UNFORCED (1, "stat", "stat_test [stat exit execs]")
FSM_PROFILE_SECTION_IN ("stat_test [stat exit execs]", state1_exit_exec)
{
if(op_intrpt_type() == OPC_INTRPT_STRM)
{
Packet * pkptr;
pkptr=op_pk_get(0);
con++;
if(op_sim_time()>=2000)
{con=2000;}
op_stat_write(count,con);
op_pk_destroy(pkptr);
}
}
FSM_PROFILE_SECTION_OUT (state1_exit_exec)
/** state (stat) transition processing **/
FSM_TRANSIT_FORCE (1, state1_enter_exec, ;, "default", "", "stat", "stat")
/*---------------------------------------------------------*/
}
FSM_EXIT (0,"stat_test")
}
}
void
stat_test_diag (OP_SIM_CONTEXT_ARG_OPT)
{
/* No Diagnostic Block */
}
void
stat_test_terminate (OP_SIM_CONTEXT_ARG_OPT)
{
#if !defined (VOSD_NO_FIN)
int _op_block_origin = __LINE__;
#endif
FIN_MT (stat_test_terminate ())
/* No Termination Block */
Vos_Poolmem_Dealloc_MT (OP_SIM_CONTEXT_THREAD_INDEX_COMMA pr_state_ptr);
FOUT
}
/* Undefine shortcuts to state variables to avoid */
/* syntax error in direct access to fields of */
/* local variable prs_ptr in stat_test_svar function. */
#undef count
#undef con
#undef FIN_PREAMBLE_DEC
#undef FIN_PREAMBLE_CODE
#define FIN_PREAMBLE_DEC
#define FIN_PREAMBLE_CODE
VosT_Obtype
stat_test_init (int * init_block_ptr)
{
#if !defined (VOSD_NO_FIN)
int _op_block_origin = 0;
#endif
VosT_Obtype obtype = OPC_NIL;
FIN_MT (stat_test_init (init_block_ptr))
obtype = Vos_Define_Object_Prstate ("proc state vars (stat_test)",
sizeof (stat_test_state));
*init_block_ptr = 0;
FRET (obtype)
}
VosT_Address
stat_test_alloc (VOS_THREAD_INDEX_ARG_COMMA VosT_Obtype obtype, int init_block)
{
#if !defined (VOSD_NO_FIN)
int _op_block_origin = 0;
#endif
stat_test_state * ptr;
FIN_MT (stat_test_alloc (obtype))
ptr = (stat_test_state *)Vos_Alloc_Object_MT (VOS_THREAD_INDEX_COMMA obtype);
if (ptr != OPC_NIL)
ptr->_op_current_block = init_block;
FRET ((VosT_Address)ptr)
}
void
stat_test_svar (void * gen_ptr, const char * var_name, void ** var_p_ptr)
{
stat_test_state *prs_ptr;
FIN_MT (stat_test_svar (gen_ptr, var_name, var_p_ptr))
if (var_name == OPC_NIL)
{
*var_p_ptr = (void *)OPC_NIL;
FOUT
}
prs_ptr = (stat_test_state *)gen_ptr;
if (strcmp ("count" , var_name) == 0)
{
*var_p_ptr = (void *) (&prs_ptr->count);
FOUT
}
if (strcmp ("con" , var_name) == 0)
{
*var_p_ptr = (void *) (&prs_ptr->con);
FOUT
}
*var_p_ptr = (void *)OPC_NIL;
FOUT
}
没有合适的资源?快使用搜索试试~ 我知道了~
stat_test.rar_stat_test
共17个文件
m:4个
obj:2个
cml:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 146 浏览量
2022-09-24
00:00:05
上传
评论
收藏 38KB RAR 举报
温馨提示
基于opnet的自编统计量测试代码,对使用opnet中的API函数的统计量函数
资源推荐
资源详情
资源评论
收起资源包目录
stat_test.rar (17个子文件)
stat_test
stat_test.prj 893B
stat_test-scenario1.ov 57KB
stat_test-scenario1.ef 752B
stat_test.opt32.i0.pr.obj 8KB
stat_test-scenario1.seq 3KB
stat_test-scenario1.cml 105B
stat_test-scenario1.pb.m 1KB
stat_test.dev32.i0.pr.obj 28KB
stat_test.nd.m 1KB
stat_test.pr.c 7KB
stat_test-scenario1.opt32.i0.nt.exp 6KB
stat_test-scenario1.opt32.i0.nt.lib 11KB
stat_test.pr.m 2KB
stat_test-scenario1.nt.log 189B
stat_test-scenario1.nt.m 3KB
stat_test-scenario1.opt32.i0.nt.dll 60KB
www.pudn.com.txt 218B
共 17 条
- 1
资源评论
weixin_42651887
- 粉丝: 76
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- #P0015. 全排列 超级简单
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功