查看: 7|回复: 7

除了用message机制外,有没有好点的办法让item在暂存区停留一定的时间再走?

[复制链接]

主题

0

回帖

6759

积分

金牌会员

积分
6759
发表于 2021-2-4 09:45:29 | 显示全部楼层 |阅读模式
新人求助

主题

0

回帖

434

积分

中级会员

积分
434
发表于 2021-2-4 11:47:47 | 显示全部楼层
调用PF模块里面的delay不可以吗?

主题

0

回帖

6759

积分

金牌会员

积分
6759
 楼主| 发表于 2021-2-4 15:06:13 | 显示全部楼层
[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid=32795&ptid=11774][color=#999999]clayclay 发表于 2021-2-4 11:47[/color][/url][/size]
调用PF模块里面的delay不可以吗?[/quote]

这个好像可以 不过不喜欢用pf...{:3_41:}

主题

0

回帖

434

积分

中级会员

积分
434
发表于 2021-2-5 09:32:47 | 显示全部楼层
[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid=32796&ptid=11774][color=#999999]liguanyu 发表于 2021-2-4 15:06[/color][/url][/size]
这个好像可以 不过不喜欢用pf...[/quote]

还可以用触发器,进入触发关闭该缓冲区的输出端口一段时间亦可以。

主题

0

回帖

6759

积分

金牌会员

积分
6759
 楼主| 发表于 2021-2-5 10:00:40 | 显示全部楼层
[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid=32802&ptid=11774][color=#999999]clayclay 发表于 2021-2-5 09:32[/color][/url][/size]
还可以用触发器,进入触发关闭该缓冲区的输出端口一段时间亦可以。[/quote]

“关闭输出端口一段时间” 这个时间是调用啥函数实现的呀:$
我现在一个模型里面用了好多senddelayedmessage(),搞得好乱,但是不用我又不知道有什么东西可以再触发这个事件。。

主题

0

回帖

434

积分

中级会员

积分
434
发表于 2021-2-7 14:28:16 | 显示全部楼层
Object.output.close()
最新版应该是调用这个命令。
老版可以用closeoutput()。

主题

0

回帖

434

积分

中级会员

积分
434
发表于 2021-2-7 14:34:59 | 显示全部楼层
[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid=32804&ptid=11774][color=#999999]liguanyu 发表于 2021-2-5 10:00[/color][/url][/size]
“关闭输出端口一段时间” 这个时间是调用啥函数实现的呀
我现在一个模型里面用了好多senddelayedmess ...[/quote]

closeop (obj object, num outputportnum)
Close one output port of object
Description
Close just outputportnum of object. Closing an output port of an object will block the exit from the object through that port. Modelers should only use this command when working with fluid objects because the internal behavior of discrete objects controls the opening and closing of their ports, and therefore this command may be overridden. For discrete objects the modeler is referred to closeoutput() and stopoutput().
Example
closeop(current,1)
参见帮助文件里面,这样调用应该也是可以的,需要自己去试试。

主题

0

回帖

363

积分

注册会员

积分
363
发表于 2021-2-10 08:55:34 | 显示全部楼层
在暂存区触发器中的进入触发,编写以下代码
closeoutput(current);
senddelayedmessage(current,50,current,0,0,0);(其中50为延时时间,可更改到想要的值)
再在暂存区触发器中的消息触发,编写以下代码
openoutput(current);
即可
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|京ICP备14043114号-2

在本版发帖
关注公众号
QQ客服返回顶部