设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2798|回复: 1

几个常用函数说明的探讨

[复制链接]
发表于 2008-6-6 11:35:08 | 显示全部楼层 |阅读模式
在Flexsim的触发器等编程中,常见的几个函数(一般在头部)如下:
fsnode* item = parnode(1);
fsnode* current = ownerobject(c);
unsigned int port = parval(2);
关于这几个函数,我这样理解对不对:
(1)parnode(num index)
Description:
For developer use. This command is used inside a function that is called by the nodefunction() command. It returns the parameter passed to nodefunction specified by index as a node (or fsnode*). The first additional parameter passed to nodefunction() is parameter 1, the second is parameter 2, etc. Parameters can also be retrieved using parval() and parstr() for casting them as numbers and strings respectively.
Example:
fsnode* item = parnode(1);
This command sets item so that it references the node that was passed to nodefunction() as parameter 1.
设置实体为相应的树结点指针所指向,且作为以后的该结点函数的第一个参数;
(2)fsnode* current = ownerobject(c);
ownerobject(node thenode)
Description:
For developer use. This command returns the node with object data attached to it that is the start of the sub-tree that thenode is in. In other words, it returns the object node that contains thenode.
Example:
string objname = getname(ownerobject(c));
This sets objname to the name of the object that contains the node referenced by c.  The c usually refers to the node where the code is being written.
设置当前实体对象结点的容器结点(父结点);
(3)unsigned int port = parval(2);
parval(num index)
Description:
For developer use. This command is used inside a function that is called by the nodefunction() command. It returns the parameter passed to nodefunction specified by index as a number. The first additional parameter passed to nodefunction() is parameter 1, the second is parameter 2, etc. Parameters can also be retrieved using parnode() and parstr() for casting them as a fsnode pointer and string respectively.
Example:
float passedval = parval(3);
This sets passedval equal to the number that was passed to nodefunction() as parameter 3.
设置port为结点触发器函数的第2个参数。

是否有问题,请指教
 楼主| 发表于 2008-6-6 11:45:26 | 显示全部楼层
根据一般意义的理解:
current:为当前实体对象;
item为与实体对象触发器操作相关的临时实体;
port为临时实体进出的端口号,
但感觉与后面的函数及Flexsim自带帮助解释不一致。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2024-11-27 11:02 , Processed in 0.017347 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表